fix: sync notes from st.notes + set isPlaying for playhead + metronome count-in
This commit is contained in:
@@ -4583,6 +4583,7 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot
|
||||
const viewBeats = Math.ceil(viewWidth / pixelsPerBeat) + 4;
|
||||
|
||||
const [notes, setNotes] = React.useState(st.notes || []);
|
||||
React.useEffect(() => { setNotes(st.notes || []); }, [st.notes]);
|
||||
const brushVelocityRef = React.useRef(0.8);
|
||||
const [selectedNoteIds, setSelectedNoteIds] = React.useState([]);
|
||||
|
||||
@@ -9864,7 +9865,7 @@ const App = () => {
|
||||
setRecTempMidiNotes([]);
|
||||
const ctx = getAudioContext();
|
||||
const silentBuf = ctx.createBuffer(1, 128, ctx.sampleRate);
|
||||
setSubTabs(prev => prev.map(s => s.id === tab.id ? { ...s, buffer: silentBuf } : s));
|
||||
setSubTabs(prev => prev.map(s => s.id === tab.id ? { ...s, buffer: silentBuf, isPlaying: true } : s));
|
||||
startSubTabPlayback({ ...tab, buffer: silentBuf }, startTime);
|
||||
startOffsetTimeRef.current = startTime;
|
||||
startAudioTimeRef.current = context.currentTime;
|
||||
|
||||
Reference in New Issue
Block a user