Post by nic on Nov 2, 2019 8:58:53 GMT
This script will hold all played notes until they are released either with the 'Release' button or via a release CC (set using the dropdown).

You can also set a 'note release' option which makes the hold work slightly differently in that notes are held while a finger is on the keyboard. eg. Press and hold a base note, then add more notes by touching them (no need to hold them down). Only when you lift all fingers off the keyboard or use the manual release (GUI button or CC) does the release happen.
The number of held notes is shown in the left block label and the right block label shows if a hold is in effect.
A StreamByter .sbr file is attached.
Regards, Nic.
Here is the code:

You can also set a 'note release' option which makes the hold work slightly differently in that notes are held while a finger is on the keyboard. eg. Press and hold a base note, then add more notes by touching them (no need to hold them down). Only when you lift all fingers off the keyboard or use the manual release (GUI button or CC) does the release happen.
The number of held notes is shown in the left block label and the right block label shows if a hold is in effect.
A StreamByter .sbr file is attached.
Regards, Nic.
Here is the code:
# note holder by audeonic
if load
# plugin name
set name Hold
# controls aliases
alias Q0 release_button
alias Q1 bypass_button
alias Q2 hidden_1
alias Q3 hidden_2
alias Q4 release_cc
alias Q5 note_release_opt
alias Q6 hidden_3
alias Q7 hidden_4
# configure controls
set release_button Release +button
set bypass_button Bypass +toggle
set hidden_1 +hide
set hidden_2 +hide
set release_cc Release_CC +menu
set note_release_opt Note_Release +yesno
set hidden_3 +hide
set hidden_4 +hide
# setup (preserved) defaults
define preserve +P
assign release_cc = $71 preserve
assign bypass_button = 0 preserve
assign note_release_opt = 0 preserve
set sliders 1
# internals
# ctl held note count
ASS L80 = 0
# held channel
ASS L81 = 0
# held notes
ASS L82 = 0
# notes currently held (reset)
ASS I0 = 0
while I0 <= 7F
ASS LI0 = 0
MAT I0 = I0 + 1
END
# end hold subroutine
SUB end_hold
ASS I0 = 0
while I0 <= 7F
IF LI0 == 1
MAT I1 = 80 + L81
SND I1 I0 00
ASS LI0 = 0
END
MAT I0 = I0 + 1
END
ass L82 = 0
set LB0 S--
set LB1 S--
END
end
# handle bypass
if bypass_button == 1
exit
end
# handle release button
if M0 == F0 7D 01 00
send B0 release_cc 7F +inject
end
# handle note on
IF MT == 90
MAT L80 = L80 + 1
MAT L82 = L82 + 1
set LB0 L82 +D
set LB1 SHold
ASS L81 = MC
ASS LM1 = 1
END
# handle note off
IF MT == 80
MAT L80 = L80 - 1
IF L80 == 0
if note_release_opt == 1
end_hold
end
END
block
END
# handle release cc
IF MT == B0
IF M1 == release_cc
IF M2 == 7F
end_hold
end
block
end
END