feat: added track scope mode for sheet music view; adjusted viewport behavior when switching between piano roll view and sheet music view

This commit is contained in:
Xiaohan-Tian
2026-05-10 13:11:10 -07:00
parent d69b3924e5
commit 578be7b726
11 changed files with 850 additions and 135 deletions
@@ -50,6 +50,7 @@ interface PianoRollContentProps {
automationType?: PianoRollAutomationType;
automationRedrawVersion?: number;
sheetMusicViewEnabled?: boolean;
sheetMusicTrackScopeEnabled?: boolean;
sheetQuantization?: SheetQuantization;
sheetKeySignature?: KeySignature;
sheetInstrument?: InstrumentType;
@@ -83,6 +84,7 @@ const PianoRollContent: React.FC<PianoRollContentProps> = ({
automationType = 'pitch-bend',
automationRedrawVersion = 0,
sheetMusicViewEnabled = false,
sheetMusicTrackScopeEnabled = false,
sheetQuantization,
sheetKeySignature = 'C major',
sheetInstrument = 'acoustic_grand_piano',
@@ -340,6 +342,11 @@ const PianoRollContent: React.FC<PianoRollContentProps> = ({
{sheetMusicViewEnabled && activeRegion && sheetQuantization ? (
<SheetMusicView
activeRegion={activeRegion}
midiRegions={tracks.filter(track => track.getId().toString() === activeRegion?.getTrackId()).flatMap(track => (
track.getRegions().filter(region => region instanceof KGMidiRegion)
)) as KGMidiRegion[]}
maxBars={maxBars}
sheetMusicTrackScopeEnabled={sheetMusicTrackScopeEnabled}
timeSignature={timeSignature}
keySignature={sheetKeySignature}
instrument={sheetInstrument}