Skip to content

Commit 8a306e9

Browse files
committed
Track: Don't record notes when timeline stopped
1 parent 0b93dd2 commit 8a306e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

isobar/timelines/track.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,9 @@ def _on_note_on(self, note: MidiNote):
892892
#--------------------------------------------------------------------------------
893893
if self._monitor:
894894
self.output_device.note_on(note.pitch, note.velocity, note.channel)
895+
896+
if not self.timeline.is_running:
897+
return
895898

896899
if self._is_recording:
897900
self._recording_notes[note.pitch] = (self.current_time, note.velocity, note.channel)
@@ -903,6 +906,9 @@ def _on_note_off(self, note: MidiNote):
903906
if self._monitor:
904907
self.output_device.note_off(note.pitch, note.channel)
905908

909+
if not self.timeline.is_running:
910+
return
911+
906912
if note.pitch in self._recording_notes:
907913
start_time, velocity, channel = self._recording_notes.pop(note.pitch)
908914
end_time = self.current_time

0 commit comments

Comments
 (0)