jon
Converser
Posts: 10
|
Post by jon on Sept 22, 2020 1:09:32 GMT
# ssuss - aka Sticky Sustain - jon@diercks.net # v1.03
# Double-tap sustain pedal to hold note(s) as drone. # Continue to play other notes over drone, # even with normal sustain pedal activity. # Double-tap pedal again to release, # optionally also setting new drone notes. # Triple-tap to send panic / all notes off.
if load set name ssuss set include factory standard_includes alias $10 dbl_tap_min_ms # min time between double-taps alias $300 dbl_tap_max_ms # max time between double-taps alias 2 panic_mode # 1 = cc123, 2 = brute force, 3 = both alias $64 pedal_cc alias J0 tap_count end
if MT == note_on_msg assign KM1 = 1 # mark note as held (i.e. key is down) end
if MT == note_off_msg assign KM1 = 0 # unmark from held if LM1 == 1 # if marked for sticky sustain block # suppress note-off, keep sounding end end
if MT == controller_msg if M1 == pedal_cc 0 # pedal up/released assign P0 = T0 if P0 <= dbl_tap_min_ms assign P0 = dbl_tap_max_ms end if P0 >= dbl_tap_max_ms assign tap_count = 1 else increment tap_count if tap_count == 2 # double-tap assign I0 = 0 0 while I0 <= 7F if LI0 == 1 # for each current sus note if KI0 == 0 # if not also being newly held again math I1 = note_off_msg + MC send I1 I0 00 # send note off assign LI0 = 0 # clear from sus array end end if KI0 == 1 assign LI0 = 1 # save new held notes to sus end increment I0 end end if tap_count == 3 # triple-tap = panic if panic_mode != 2 # either 1 or 3 math I0 = controller_msg + MC send I0 $123 00 # all notes off end math I1 = note_off_msg + MC assign I0 = 0 while I0 <= 7F assign KI0 = 0 # clear held status assign LI0 = 0 # clear from sus array if panic_mode >= 2 # either 2 or 3 send I1 I0 00 # send note off end increment I0 end end end end end
|
|
jon
Converser
Posts: 10
|
Post by jon on Oct 1, 2020 20:58:16 GMT
edited, updated to v1.03
made some refinements, more consistent behavior when running multiple instances
|
|
|
Post by synthi on Dec 11, 2020 13:57:59 GMT
Awesome! Thanks!!,
|
|