nic
Soapbox Supremo  
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 10, 2020 10:05:20 GMT
This script converts pitchbend from microtonal to chromatic (ie. whole notes in a 12 octave range).
# ChromaBend - convert pitch bend # to +/- 1 octave chromatic if load set name ChromaBend # configure PB Sensitivity ass I0 = B0 while I0 < C0 snd I0 64 00 snd I0 65 00 snd I0 06 0C snd I0 38 04 snd I0 64 7F snd I0 65 7F mat I0 = I0 + 1 end end
# rejig pitchbend to chromatic if MT == E0 # convert 14 bit to P0 calc P0 = M2 * 80 calc P0 = P0 + M1 # magic fudge calc P1 = P0 % $683 calc P0 = P0 / $683 if P1 > $341 calc P0 = P0 + 1 end calc P0 = P0 * $683 # edge case overrides if P0 == $8196 ass P0 = $8192 end if P0 > $16383 ass P0 = $16383 end if P0 < 0 ass P0 = 0 end # convert P0 to 14 bit calc M2 = P0 / 80 calc M1 = P0 & 7F end
|
|