|
Post by Dchild on Aug 11, 2018 2:11:59 GMT
Hey guys Could anyone help me design a simple script to set the probability of a note passing. Mono would be great, but poly would be awesome. Thanks
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 11, 2018 8:41:24 GMT
Try this.
IF LOAD # K0 is user settable constant # (could set via MIDI msg?) # probability of note passing # range 0 to 100 (0-64 in hex) ASS K0 = 32
END
IF MT == 90 IF M2 > 0 # we have a note on, # get random number # between 0 and 100 # and compare to K0 # and block if above IF R64 > K0 XX = XX +B END END END
NB - note off events are not affected so for blocked notes you will receive a note off. If this is a problem, then the script has to be more complicated (need to track whether a note was blocked/passed).
Regards, Nic
|
|
|
Post by Dchild on Aug 11, 2018 9:22:37 GMT
Amazing, thanks for the reply
what at would I need to change to set probably to 50%
|
|
|
Post by Dchild on Aug 11, 2018 9:33:33 GMT
Sorted, wow love this
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 11, 2018 9:41:26 GMT
Probability defaulted to 50% in above example (ASS K0 = 32)
|
|
|
Post by carnbot on Aug 12, 2018 19:04:06 GMT
That's great How would we go about controlling the probability amount via midi cc?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 12, 2018 19:33:11 GMT
Hi carnbot , So we increase the range to 0-127 to match a CC and modify the script as follows. You can set the CC you wish to have it react to by adjusting the values in the ASS K0 = IF LOAD # cc/channel we control probability with ASS K0 = B0 27 # L0 is probability of note passing # range 0 to 127 (0-7F in hex) # default to 50% (and preserve) ASS L0 = 40 +P SET LB0 SPRB SET LB1 L0 +D END
IF MT == 90 IF M2 > 0 # we have a note on, # get random number # between 0 and 127 # and compare to L0 # and block if above IF R7F > L0 XX = XX +B END END END
# handle probability set CC IF M0 == K0 K1 ASS L0 = M2 SET LB1 L0 +D END
Regards, Nic.
|
|
|
Post by carnbot on Aug 12, 2018 22:48:37 GMT
Great work, thanks Nic
|
|