Skip to content

Commit

Permalink
TripleOsc delta note start, Fix playback of notes ending and starting…
Browse files Browse the repository at this point in the history
… at the same time
  • Loading branch information
Technohacker committed Sep 18, 2021
1 parent d63ef26 commit 27e4e20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Instruments/TripleOsc/instrument.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func to_hertz(key_no):

func play_note(note: Note):
self.currently_playing[note.instrument_data.key] = note.instrument_data
self.currently_playing[note.instrument_data.key].start_t = note.note_start
self.currently_playing[note.instrument_data.key].end_t = note.note_start + note.duration
self.currently_playing[note.instrument_data.key].end_t = note.duration
.play_note(note)

func stop_note(note: Note):
Expand Down
3 changes: 3 additions & 0 deletions util/Sequencer/Sequencer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func sequence(sequence: SongSequence):
for note in track.notes:
note = note as Note

if song.track_find_key(track_index, current_time, true) != -1:
current_time += 0.001

current_time += note.note_start_delta
song.track_insert_key(track_index, current_time, {
"method": "play_note",
Expand Down

0 comments on commit 27e4e20

Please sign in to comment.