|
Post by matsou on Nov 26, 2022 15:17:06 GMT
Hello MidiFire folks,
Hoping someone can help me with a bit of hopefully easy StreamByter code. I have a MIDI Wah pedal CC controller that reports a minimum range of 32 rather than 0, and there’s no way to set this on the controller (its range dial is set to max). I want to spread its range (32-127) to output the full 0-127 range. I much appreciate any help writing the StreamByter code to achieve this.
Crossing my fingers,
—Matthew, long time MidiFire user
|
|
abadam
Developer 
Rotten Apple
Posts: 52
|
Post by abadam on Nov 26, 2022 17:54:08 GMT
subtract 32, multiply by 127 and divide by 95. Example for CC #7, channel 1:
if M0 == B0 $07 calc m2 = m2 - $32 calc m2 = m2 * $127 calc m2 = m2 / $95 end
|
|
|
Post by matsou on Nov 27, 2022 5:49:24 GMT
Awesome! Thank you so much.
|
|
|
Post by matsou on Nov 27, 2022 10:11:01 GMT
Unfortunately the code isn’t working.
The first calc works (subtracting the min value) but the multiplication and division lines are not. So I can get 0-95 rather than 32-127 but after one or the other calcs it reports only 0 or 1, not 0-127. Perhaps it won’t accept numbers out of range or fractions? I tried assigning the CC output to local variable, and doing calc on that variable, but can’t figure out a way to set the CC to the variable without an error. Any more help on this is greatly appreciated!
|
|
abadam
Developer 
Rotten Apple
Posts: 52
|
Post by abadam on Nov 27, 2022 10:15:21 GMT
shit. got it wrong with message. all m1 should be m2. edited above
|
|