fix: piano roll spectrogram is not being zoomed correctly; switching from MIDI region to audio region with piano roll open might cause residual notes.

This commit is contained in:
Xiaohan-Tian
2026-05-01 23:56:12 -07:00
parent 811b3a0936
commit 5890a6d0b9
4 changed files with 42 additions and 16 deletions
+3
View File
@@ -32,6 +32,7 @@ interface PianoGridProps {
bpm?: number;
spectrogramThresholdDb?: number;
spectrogramPower?: number;
pianoRollZoom?: number;
mode?: 'midi-edit' | 'spectrogram' | 'hybrid';
}
@@ -60,6 +61,7 @@ const PianoGrid: React.FC<PianoGridProps> = ({
bpm = 120,
spectrogramThresholdDb = -25,
spectrogramPower = 0.5,
pianoRollZoom = 1,
}) => {
const [cursorPosition, setCursorPosition] = useState<CursorPosition | null>(null);
const [isModifierPressed, setIsModifierPressed] = useState(false);
@@ -240,6 +242,7 @@ const PianoGrid: React.FC<PianoGridProps> = ({
bpm={bpm}
thresholdDb={spectrogramThresholdDb}
power={spectrogramPower}
zoom={pianoRollZoom}
/>
)}