|
Post by fefillo on Aug 29, 2023 3:24:12 GMT
Hi, I'm trying to create a simple script so that I can use a CC toggle (B0 39) to change the CC mapping of other buttons (in this case change CC01 to CC03).
This is what I have so far, but I can't seem to make it re-assign the value of L0 depending on the toggle values of B0 39.
Ass L0 = $2
if M0 == B0 39 00 ass L0 = $2 End
if M0 = B0 39 7F ass L0 = $-2 End
while L0 > 0 B0 01 XX = B0 03 XX End
Thanks in advance for any pointers.
|
|
|
Post by redheronmusic on Aug 29, 2023 13:17:11 GMT
Close, just need a few adjustments
If load Ass L0 = 0 End
if M0 == B0 39 ass L0 = M2 End
If L0 > 0 B0 01 = B0 03 End A few things required to function:
- L0 only needs to be initialized on load. Otherwise, every message received resets it to 0, so remapping will never happen
- SB is effectively an unsigned binary format, so the test if L0 > 0 is true when L0 is -2. A more reliable test is for 0 or not 0, or a specific value. You can use negative values, just have to understand limitations on > and <.
Simplifications
- The while loop sets up an infinite loop, since nothing is changing the value of L0 during the loop. But Nic has a get out of jail function at 128 repeats. The code still works. You can leave out the While...End
- Don't need separate tests watching B0 39 - a single test works, then just store the value of the third digit in L0
|
|
|
Post by fefillo on Aug 29, 2023 21:54:53 GMT
Thank you very much!
This did it:
if load Ass L0 = $1 End
if M0 == B0 39 00 ass L0 = $1 End
if M0 == B0 39 7F ass L0 = $-1 End
if L0 != $1 B0 01 XX = B0 03 XX End
|
|
|
Post by fefillo on Aug 29, 2023 22:33:24 GMT
In case it helps anyone else, I'm using this script to toggle CC mapping on a Korg NanoKontrol2 that I use with BiasFx on ipad. With the script I can now get double the assigned CC's. For now (see code below) I'm just using it to remap the sliders and knobs so that I can control more effects settings.  If load Ass L0 = $1 End
if M0 == B0 39 00 ass L0 = $1 End
if M0 == B0 39 7F ass L0 = $-1 End
If L0 != $1 B0 55 XX = B0 6C XX B0 56 XX = B0 6D XX B0 57 XX = B0 6E XX B0 58 XX = B0 6F XX B0 59 XX = B0 70 XX B0 5A XX = B0 71 XX B0 5B XX = B0 72 XX B0 5C XX = B0 73 XX B0 5D XX = B0 74 XX B0 5E XX = B0 75 XX B0 5F XX = B0 76 XX B0 60 XX = B0 77 XX B0 61 XX = B0 78 XX B0 62 XX = B0 79 XX B0 63 XX = B0 7A XX B0 16 XX = B0 7B XX End
|
|