nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 31, 2018 18:04:47 GMT
Hi carnbot , So, we could do many mappings (8 for each preset): B1 01 = B0 08 B1 02 = B0 09 ... B7 08 = B0 40 or maybe do it a smarter way: # Livid Base Fader Channel Flattener IF M0 >= B0 IF M0 <= B7 IF M1 >= 1 IF M1 <= 8 MAT L0 = M0 - B0 # get channel # SET LB0 L0 +D # show current preset # MAT L0 = L0 * 8 # multiply by 8 MAT M1 = M1 + L0 # add to cc # ASS M0 = B0 # force channel 1 # ASS M0 = 90 # convert to note on END END END ENDWhen you choose second preset, faders should now send CC9 to 16 on channel 1, third preset 17-24 and so on If you want to convert to note ons, you can uncomment that line that is currently commented. Regards, Nic.
|
|
|
Post by carnbot on Jan 31, 2018 21:33:15 GMT
Hi carnbot , So, we could do many mappings (8 for each preset): B1 01 = B0 08 B1 02 = B0 09 ... B7 08 = B0 40 or maybe do it a smarter way: # Livid Base Fader Channel Flattener IF M0 >= B0 IF M0 <= B7 IF M1 >= 1 IF M1 <= 8 MAT L0 = M0 - B0 # get channel # SET LB0 L0 +D # show current preset # MAT L0 = L0 * 8 # multiply by 8 MAT M1 = M1 + L0 # add to cc # ASS M0 = B0 # force channel 1 # ASS M0 = 90 # convert to note on END END END ENDWhen you choose second preset, faders should now send CC9 to 16 on channel 1, third preset 17-24 and so on If you want to convert to note ons, you can uncomment that line that is currently commented. Regards, Nic. That's brilliant thanks Nic! I used the second preset. Works really well for sending out from the Base The only thing that I'm now scratching my head over is how to reverse this for receiving back to the Base from quantum. Currently the first 8 Base faders can also update their positions when I move the midi learned faders on the Quantum gui, as I'm also sending midi out from Quantum to the Base. But the extra CCs we set up can't update the respective faders positions unless I add another stream byter coming from Quantum. Is there a simple way to reverse this Stream byter equation so our extras CCs get reverse mapped back to the original channels and CCs? I guess a longer way would be to individually map each of the incoming CCs back to 1-8 on the different channels 2-7 I tried that but for some reason only the first fader of the 2nd preset responds if I use this mapping: Not sure if I've done it correctly but only works for fader 9 so far B0 09 = B1 01 B0 10 = B1 02 B0 11 = B1 03 B0 12 = B1 04 B0 13 = B1 05 B0 14 = B1 06 B0 15 = B1 07 B0 16 = B1 08 B0 17 = B2 01 B0 18 = B2 02 B0 19 = B2 03 B0 20 = B2 04 B0 21 = B2 05 B0 22 = B2 06 B0 23 = B2 07 B0 24 = B2 08 B0 25 = B3 01 B0 26 = B3 02 B0 27 = B3 03 B0 28 = B3 04 B0 29 = B3 05 B0 30 = B3 06 B0 31 = B3 07 B0 32 = B3 08 B0 33 = B4 01 B0 34 = B4 02 B0 35 = B4 03 B0 36 = B4 04 B0 37 = B4 05 B0 38 = B4 06 B0 39 = B4 07 B0 40 = B4 08 B0 41 = B5 01 B0 42 = B5 02 B0 43 = B5 03 B0 44 = B5 04 B0 45 = B5 05 B0 46 = B5 06 B0 47 = B5 07 B0 48 = B5 08 B0 49 = B6 01 B0 50 = B6 02 B0 51 = B6 03 B0 52 = B6 04 B0 53 = B6 05 B0 54 = B6 06 B0 55 = B6 07 B0 56 = B6 08
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 1, 2018 10:24:32 GMT
Hi carnbot , Yeah, your individual mappings are not taking into account that Stream Byter uses hex and not decimal so to reverse map, say fader 9-16 on channel 1 back to fader 1 on channel 2 would be: B0 09 = B1 01 B0 0A = B1 02 B0 0B = B1 03 B0 0C = B1 04 B0 0D = B1 05 B0 0E = B1 06 B0 0F = B1 07 B0 10 = B1 08But rather than you needing to type in all those individual remaps we should be able to just reverse remap like this: # deflatten for Livid Base IF M0 >= B0 01 IF M0 <= B0 40 MAT L0 = M1 - 1 # do calcs from 0 MAT L1 = L0 % 8 # determine output CC# MAT L0 = L0 / 8 # determine output chan# MAT M1 = L1 + 1 # set correct CC# MAT M0 = M0 + L0 # set correct chan END ENDI haven't tested the above but I think it should work! Regards, Nic.
|
|
|
Post by carnbot on Feb 1, 2018 13:12:25 GMT
Hi carnbot , Yeah, your individual mappings are not taking into account that Stream Byter uses hex and not decimal so to reverse map, say fader 9-16 on channel 1 back to fader 1 on channel 2 would be: B0 09 = B1 01 B0 0A = B1 02 B0 0B = B1 03 B0 0C = B1 04 B0 0D = B1 05 B0 0E = B1 06 B0 0F = B1 07 B0 10 = B1 08But rather than you needing to type in all those individual remaps we should be able to just reverse remap like this: # deflatten for Livid Base IF M0 >= B0 01 IF M0 <= B0 40 MAT L0 = M1 - 1 # do calcs from 0 MAT L1 = L0 % 8 # determine output CC# MAT L0 = L0 / 8 # determine output chan# MAT M1 = L1 + 1 # set correct CC# MAT M0 = M0 + L0 # set correct chan END ENDI haven't tested the above but I think it should work! Regards, Nic. Ahh of course, I missed the Hex. Rookie error That's done the trick though. It's working both ways now, many thanks!
|
|
|
Post by lukesleepwalker on Apr 30, 2018 23:54:43 GMT
Is there a way to quickly map a bunch of notes to MIDI CCs without laboriously typing out each hex value? I'm looking to convert most common notes in the range of a six string guitar (converting the audio signal to MIDI note values using MIDI guitar 2) to CC values to trigger samples.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on May 1, 2018 7:16:03 GMT
Hi lukesleepwalker , Here is how you can map a range of notes to corresponding CCs. ie. When you press note n then you'll get CC n sent with the note's velocity being the source for the CC's value Let's assume your guitar range is E1 to E5: # convert notes E1 to E5 # to corresponding CC 8X 28-58 = 9X XX 00 9X 28-58 = BXWith the above, when you release a note the CC will be sent with a value of 0. If you don't want that to happen, let me know and I'll adjust those rules to suit. Regards, Nic.
|
|
|
Post by lukesleepwalker on May 4, 2018 22:12:57 GMT
Works great. Thanks, Nic!
|
|
|
Post by lukesleepwalker on May 12, 2018 13:32:23 GMT
I've got another question: is there a way to write a conditional statement that goes something like this: if MidiFire receives E2, A3, C#3 simultaneously (Amaj chord), trigger CC80. If receives E2, A3, C3 simultaneously (Amin), trigger CC81.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on May 13, 2018 8:24:14 GMT
Hi lukesleepwalker , Yes, this should be doable. The strategy would be to monitor those 3 notes and issue the CC when the all were down. Something like: IF LOAD # 3 notes to monitor (E2, A3, C#3) ASS K0 = 34 39 3D # note on/off (channel) ASS K3 = 90 80 # cc to send (CH1:80) ASS K5 = B0 50 7F # state of 3 notes ASS L0 = 0 0 0 END
# force note offs 9X XX 00 = 8X
# monitor note ons/offs IF M0 == K3 K0 ASS L0 = 1 END IF M0 == K3 K1 ASS L1 = 1 END IF M0 == K3 K2 ASS L2 = 1 END IF M0 == K4 K0 ASS L0 = 0 END IF M0 == K4 K1 ASS L1 = 0 END IF M0 == K4 K2 ASS L2 = 0 END
# issue CC when all 3 notes down IF M0 == K3 IF L0 == 1 1 1 SND K5 K6 K7 ASS L0 = 0 0 0 END END
As usual, I just typed in the above. Not sure if it has compile/logic errors, but it's the method that counts. ;-) Next version of MidiFire has loops, so all those multiple IF/END's could be simplified. I suggest creating a separate module for each chord you want to monitor and adjust the values at the top (K array). Regards, Nic.
|
|
|
Post by lukesleepwalker on May 16, 2018 1:02:16 GMT
Works like a charm! Thanks again Nic.
|
|
|
Post by lukesleepwalker on May 17, 2018 1:28:29 GMT
Nic, Having so much fun with the chord detector; thanks for your help. In the above example would it be possible to randomize the CC that is generated? That is, instead of generating CC80, possible to randomize between CC80, CC81, CC82, and CC83? Thx!
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on May 17, 2018 7:56:45 GMT
Hi lukesleepwalker , Sure. Change the following: IF L0 == 1 1 1 SND K5 K6 K7 ASS L0 = 0 0 0 ENDTo IF L0 == 1 1 1 MAT L3 = K6 + R3 SND K5 L3 K7 ASS L0 = 0 0 0 END
Regards, Nic.
|
|
|
Post by lukesleepwalker on May 17, 2018 12:50:56 GMT
Oh wow, the MAT opens up many possibilities... So I can understand it better, say I am doing a simple note to CC conversion:
9X 26 01-7F = BX 52
Can I set a MAT to randomize BX 52 through BX 55? I am assuming the R value in the example above controls the range of randomization?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on May 17, 2018 13:19:49 GMT
Hi lukesleepwalker , Yes, the number after the R specifies the maximum random value that will be returned. Be aware that you cannot mix Stream Byter II variables with Stream Byter I rules, so you would have to partially do stuff in SB II: 9X 26 01-7F = BX 52IF M0 >= B0 IF M0 <= BF IF M1 == 52 MAT M1 = M1 + R3 END END ENDRegards, Nic.
|
|
|
Post by lukesleepwalker on May 17, 2018 19:18:42 GMT
This makes me giddy... works well, Nic. I now have “random robin” sampling triggered by chord changes! Fantastic!
|
|