Skip to content

Commit

Permalink
Fixed accumulating of same sustaining notes (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansehv committed May 18, 2021
1 parent 096924d commit 97ecd75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions boot/samplerbox/changelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Feb-May 2021:
- Limited midi-through, see docs (configuration & usage)
- Added support for Pimaroni Audio Pirate HAT w LCD
- Rewritten serial midi logic to comply with MIDI standards (and get proper midi-thru)
- Fixed piling/accumulating of same sustaining notes
- Code cleanups
Sept-Nov 2020:
- Extended midimon.py to support serial midi
Expand Down
6 changes: 5 additions & 1 deletion samplerbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def MidiCallback(mididev, message, time_stamp):
if midinote==m.playingstopnote(): # and has it mirrored stop?
messagetype = 8

if messagetype == 9: # Note on
if messagetype == 9: # Note on
try:
gv.last_midinote=midinote # save original midinote for the webgui
if keyboardarea and not MT_in:
Expand All @@ -972,6 +972,10 @@ def MidiCallback(mididev, message, time_stamp):
playchord=0 # no chords outside keyboardrange / in effects channel.
for n in range (len(gv.chordnote[playchord])):
playnote=midinote+gv.chordnote[playchord][n]
if sustain: # don't pile up sustain
for n in gv.sustainplayingnotes:
if n.playingnote() == playnote:
n.fadeout(True) # gracefully drop it
if gv.triggernotes[playnote]<128 and not MT_in: # cleanup in case of retrigger
if playnote in gv.playingnotes: # occurs in once/loops modes and chords
for m in gv.playingnotes[playnote]:
Expand Down

0 comments on commit 97ecd75

Please sign in to comment.