|
Post by John Haas on Sept 23, 2018 21:12:14 GMT
Hello, this is my first post, but I'm a big fan of StreamByter, and the power of it. I'm currently remapping controls on a Novation LaunchKey 49 to control a Novation Circuit.
Is there an elegant way to limit the range of a CC from 0-4, instead of the usual 0-127?
Here is what I'm trying to do:
# I want to limit the range of incoming CC15 thru CC18 to 0-4 (instead of 0-127)
# Then, assuming that 0-4 value is stored in M2,
# do the following remapping:
IF M0 == B3 15
MAT I0 = M2 + 28
SND B9 08 I0
END
IF M0 == B3 16
MAT I0 = M2 + 2D
SND B9 12 I0
END
IF M0 == B3 17
MAT I0 = M2 + 32
SND B9 2C I0
END
IF M0 == B3 18
MAT I0 = M2 + 37
SND B9 32 I0
END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 23, 2018 21:46:20 GMT
Hi John Haas , This rule will limit those CCs, although maybe you want to scale them? If so, let me know. B3 15-18 05-7F = XX +BRegards, Nic.
|
|
|
Post by John Haas on Sept 24, 2018 1:53:32 GMT
Thanks, yes I would like to scale them. This is what I came up with, and it works, but I assume there's a better solution.
IF M0 >= B3 15
IF M0 <= B3 19
ASS I0 = 4 # Sample number index, from base sample (for that drum)
IF M2 < 7E # 96-124 ASS I0 = 3
END
IF M2 < 60 # 64-95 ASS I0 = 2
END
IF M2 < 40 # 32-63 ASS I0 = 1
END
IF M2 < 20 # 0-31 ASS I0 = 0
END
END
END
IF M0 == B3 15
MAT I0 = I0 + 28
SND B9 08 I0
END
IF M0 == B3 16
MAT I0 = I0 + 2D
SND B9 12 I0
END
IF M0 == B3 17
MAT I0 = I0 + 32
SND B9 2C I0
END
IF M0 == B3 18
MAT I0 = I0 + 37
SND B9 32 I0
END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 24, 2018 8:34:20 GMT
Hi John Haas , Well, your solution is working, so although I subscribe to "don't fix if it ain't broke" here are two other ways: B3 15-18 0-1F = XX XX 00 B3 15-18 20-3F = XX XX 01 B3 15-18 40-5F = XX XX 02 B3 15-18 60-7D = XX XX 03 B3 15-18 7E-7F = XX XX 04which will remap that CC's value on the way in, or IF M0 >= B3 15 IF M0 <= B3 18 MAT I0 = M2 / 16 END ENDThat second way is slightly different from your mapping. It divides the 0-127 range (roughly) by 22 to give 5 intervals. The first way is more like your 'uneven' mapping. Regards, Nic.
|
|
|
Post by John Haas on Sept 24, 2018 12:22:36 GMT
Thanks Nic, both of those solutions make sense, I appreciate your help!
John
|
|