|
Post by Olav Røssland on Aug 7, 2024 20:21:36 GMT
1) The volume pedal gives midi values from 127 to 98 (B0 07 F7 - B0 07 62) I want to turn these to 98 to 127. 2) Next, I need to convert the values from 98 - 127 to 0 - 127.
Anyone have an easy way to do this?
|
|
|
Post by Olav Røssland on Aug 8, 2024 9:10:19 GMT
1) The volume pedal gives midi values from 127 to 98 (B0 07 F7 - B0 07 62) I want to turn these to 98 to 127. 2) Next, I need to convert the values from 98 - 127 to 0 - 127. Anyone have an easy way to do this? I found a kind of solution, but got a new problem:... MAT L1 = 7F / 1D gives an INTEGER - I should have included DECIMALS (See step 1 and 2 below...) IF M0 == B0 07 IF M2 >= 62 #The volumepedal gives a midi min value of 62 IF M2 <= 7F #The volumepedal gives a midi max value of 7F MAT L2 = 7F - M2 #Converts input scale from [7F - 62] to [0 - 1D] MAT L1 = 7F / 1D #Step 1 to fix correct scale from [0 - 1D] to scale [0 - 7F] MAT L2 = L2 * L1 #Step 2 to fix correct scale from [0 - 1D] to scale [0 - 7F] SND B0 07 L2 #Send a new midi-value (L2) to B0 07... XX = XX +B END END END RESULT: The volume pedal does not go all the way from zero (-inf dB) to 7F (0,0 dB) Suggested solution?
|
|
|
Post by Olav Røssland on Aug 9, 2024 0:51:11 GMT
My final (...) solution was to use a lookup-table:
IF LOAD ASS L00 = 0 5 9 E 12 17 1B 20 24 29 2D 32 36 3B 40 44 ASS L10 = 49 4D 52 56 5B 5F 64 68 6D 71 76 7A 7F END
IF MT == B0 MAT M2 = 7F - M2 ASS M2 = LM2 END
|
|