|
Post by gurbz on Jun 26, 2019 10:09:46 GMT
OMG😳 Don't know what to say...
THANKS!
Gonna try this.👍🏻
|
|
|
Post by gurbz on Jul 9, 2019 5:16:41 GMT
Ok, I have reached the point in developing a MDP2 layout where this really could get helpful. I have one question now: HOW do I activate a cloned midi control in MDP2. So if I install the rules how can I select in the MDP2 layout if a midi control message gets cloned or not?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jul 9, 2019 8:43:00 GMT
Hi gurbz , In MDP your control will generate a MIDI message that will be fed into the 'output' StreamByter. All you need to do is write a little if statement to trap that MIDI message. Say you configure a control in MDP as a switch that sends CC 20 on MIDI channel 1 and you want to know when it is switched between ON and OFF, you would do something like: # look for CC20 on channel 1 IF M0 == B0 14
# is the CC value 0? (OFF) IF M2 == 0 # do what needs to be done when CC goes OFF END
# is the CC value 7F? (ON) IF M2 == 7F # do what needs to be done when CC goes ON END ENDRegards, Nic.
|
|
|
Post by gurbz on Jul 12, 2019 20:12:31 GMT
Okay Nic,
Got this code now when I try to change F0 41 00 00 00 00 33 12 60 00 01 70 00 2F F7 ———-> F0 41 00 00 00 00 33 12 60 00 03 7C 00 21 F7 Explained: the katana amp has 2 fx blocks that are almost identical, FX1 and FX2 can be selected separate or at the same time. It makes sense to clone the midi sysex and what is controlled here is the graphic EQ slider, 31hz. What matter is MA and MB in the sysex blocks, 01 70 —-> 03 7C
I brew this code with the help from nic:
IF M0 == F0 41 00 00 # roland sysex IF M7 == 12 60 00 # KATANA IF MA == 01 IF MB == 70 ASS I0 = M8 MAT I0 = I0 + M09 MAT I0 = I0 + M0A MAT I0 = I0 + M0B MAT I0 = I0 + M0C MAT I0 = I0 % 80 MAT I0 = 80 - I0 IF I0 == 80 ASS I0 = 0 END SND M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 03 7C M0C I0 ME END END END END
Output FX1 (cloned) now is like:
Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 14 1B F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 14 1B F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 15 1A F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 15 1A F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 16 19 F7
Questions:
How do I block the original sysex; How do I know if the checksum checks out ok?
I compare it to the FX2 block get this checksum:
Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 14 0D F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 15 0C F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 16 0B F7
Last but not least will be the inclusion of MDP2 FX1–> FX2 switch.
I hope you can help me with this.
Regards,
Gurbz
|
|
|
Post by gurbz on Jul 12, 2019 21:51:21 GMT
Well: the checksum does’t work in the example above.
When I use the code this way:
IF M0 == F0 41 00 00 # roland sysex IF M7 == 12 60 00 # KATANA IF MA == 01 IF MB == 70 SND M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 03 7C M0C I0 ME END END END END
ASS I0 = M8 MAT I0 = I0 + M09 MAT I0 = I0 + M0A MAT I0 = I0 + M0B MAT I0 = I0 + M0C MAT I0 = I0 % 80 MAT I0 = 80 - I0 IF I0 == 80 ASS I0 = 0 END SND M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 03 7C M0C I0 ME
I get these results:
Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 14 1B F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 14 1A F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 14 1B F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 13 1C F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 13 1B F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 13 1C F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 01 70 12 1D F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 12 1C F7 Message Out: Length=15: F0 41 00 00 00 00 33 12 60 00 03 7C 12 1D F7
I have three lines of sysex now, only need one and the checksum isn’t right yet, I think.
|
|
|
Post by gurbz on Jul 13, 2019 6:50:39 GMT
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jul 13, 2019 7:35:11 GMT
Hi gurbz , It looks like the checksum calc is correct, but it is being calculated on the incoming message and it needs to be done against the outgoing message. The log shows it is recalculating the 1B to 1B so I think it is right. Since you you want the original message blocked, we can simplify things a little and just modify the incoming message like so: IF M0 == F0 41 00 00 # roland sysex IF M7 == 12 60 00 # KATANA IF MA == 01 70 # FX1(?)
# rewrite two bytes (FX2?) ASS MA = 03 7C
# calculate checksum ASS I0 = M8 MAT I0 = I0 + M09 MAT I0 = I0 + M0A MAT I0 = I0 + M0B MAT I0 = I0 + M0C MAT I0 = I0 % 80 MAT I0 = 80 - I0 IF I0 == 80 ASS I0 = 0 END
# replace checksum in message ASS M0D = I0 END END END
Regards, Nic.
|
|
|
Post by gurbz on Jul 13, 2019 7:44:28 GMT
Thank you, Yes! Works!
Trying to get the CC20 switch to work now and another question:
Will I be copying the code and modify it for each control? That is possible but will generate a lot of code. Or is it possible to cover ranges?
|
|
|
Post by gurbz on Jul 13, 2019 7:54:39 GMT
Trying to get a fx switch to work but I’m totally messing this up😄
IF M0 == B0 14
# is the CC value 0? (OFF) IF M2 == 0 # do what needs to be done when CC goes OFF END END
IF M0 == B0 14 IF M2 == 7F IF M0 == F0 41 00 00 # roland sysex IF M7 == 12 60 00 # KATANA IF MA == 01 70 # FX1(?)
# rewrite two bytes (FX2?) ASS MA = 03 7C
# calculate checksum ASS I0 = M8 MAT I0 = I0 + M09 MAT I0 = I0 + M0A MAT I0 = I0 + M0B MAT I0 = I0 + M0C MAT I0 = I0 % 80 MAT I0 = 80 - I0 IF I0 == 80 ASS I0 = 0 END
# replace checksum in message ASS M0D = I0 END END END END END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jul 13, 2019 8:48:57 GMT
Hi gurbz , OK, we need to change our approach. Consider this as a template: IF LOAD # katana sysex message template in L00 to L0E # L00 to L09 = fixed, L0A to L0B = param, LC = val # LD = checksum, LE = end of sysex # L0 L1 L2 L3 L4 L5 L6 L7 L8 L9 LA LB LC LD LE ASS L0 = F0 41 00 00 00 00 33 12 60 00 00 00 00 00 F7
# L80 = flag if incoming message match # L81 = flag if to block original event ASS L80 = 0 0 END
# assume no match and no block ASS L80 = 0 0
# handle incoming katana sysex messages IF M0 == L0 L1 L2 L3 # roland sysex IF M6 == L6 L7 L8 # katana
# convert fx1/31hz to fx2 IF MA == 01 70 # flag to send and block ASS L80 = 1 1
# set fixed param (fx2/21hz) ASS LA = 03 7C
# copy value (always use M0C and never MC here) ASS LC = M0C END
# ... do similar katana sysex conversions here. eg: # (see explanatory notes below) # IF MA == 03 70 # ASS L80-81, LA-LC # END END END
# handle other (non katana sysex) incoming events IF M0 == B0 14 # flag to send and pass ASS L80 = 1 0
# set parameter and copy CC value in one go # *** NB '03 7C' needs to be a switch parameter # *** this will map CC to fx2/31hz ASS LA = 03 7C M2 END
# ... more CC events (similar clauses to above)
# post match processing # if L80 == 1 then we matched, so send # correct katana sysex stored in L0 IF L80 == 1 # calculate checksum of L8-LC (into LD) ASS LD = L8 MAT LD = LD + L9 MAT LD = LD + LA MAT LD = LD + LB MAT LD = LD + LC MAT LD = LD % 80 MAT LD = 80 - LD IF LD == 80 ASS LD = 0 END
# send the message SND L0 L1 L2 L3 L4 L5 L6 L7 L8 L9 LA LB LC LD LE END
# if L81 == 1 then block incoming event IF L81 == 1 XX = XX +B END
Explanation: We construct an outgoing katana sysex message using the L array which will be preconfigured as an empty katana message (we re-use this L array to match katana messages too) Then, we have one separate 'major' if clause for incoming katana events and then 'minor' if clauses inside that for each of the katana events we wish to trap and do something with. Then we have a bunch of other clauses for each incoming non katana event we wish to match. Inside of these event matching clauses (katana or not) we need to do the following: - set L80 to 1 to flag that a katana message is to be sent (always) - set L81 to 1 to block the incoming event or 0 to allow the incoming event to pass (your choice) - set LA to the two byte parameter code of the katana parameter to change (from spec.) - set LC to the parameter value (from message or could be fixed/random) Once the event has passed through the match clauses, if we matched an incoming message, the script then calculates the checksum for the message stored in L and sends it. The original event is finally blocked if a match clause set L81 to 1 Regards, Nic.
|
|
|
Post by gurbz on Jul 13, 2019 10:26:42 GMT
😵😵😵😵😵
This is Gurbz wife: he went to the hospital🚑 Information overload!
Just killing. I will take a look at this tonight. Thanks so much! You rock!
|
|
|
Post by gurbz on Jul 13, 2019 21:18:46 GMT
Ok. When pasting this code into stream byter it converts the sysex again nicely. The cc20 switch does not work yet, what can I do to get this working as a start to getting used to this template?
|
|
|
Post by gurbz on Jul 14, 2019 7:35:02 GMT
Question: for the cc20, B0 14, do we need to state its value? 00 or 7F? ( You ‘re talking to a noob, however I’m interested and you can direct me to basic scripting skills, I try to study the streambyter academy stuff)
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jul 14, 2019 8:43:48 GMT
Hi gurbz , In the template, I made an example where CC20 controls FX2/31Khz parameter, so if you were toggling a switch in MDP that was sending CC20 then I would expect the 31Khz slider in FX2 to go fully up and down as the switch is toggled. What do the MIDI event logs tell you is happening? I will explain the CC handling in more detail. Here is the bit of code from the template that handles CC 20 on channel 1, with the things that you need to change/understand bolded: # handle other (non katana sysex) incoming events IF M0 == B0 14 # flag to send and pass ASS L80 = 1 0
# set parameter and copy CC value in one go # *** NB '03 7C' needs to be a switch parameter # *** this will map CC to fx2/31hz ASS LA = 03 7C M2 ENDThe first IF M0 == B0 14 detects whether we see CC20 on channel 1 (any value). Then, once inside the IF clause we need to always set L80 to 1 (always!) and L81 to 0 or 1 (your choice). In this case ASS L80 = 1 1 sets L80 to 1 and L81 to 0 which will cause the original CC20 to be passed as well as the new katana message. The final bit in the clause is where we set the katana parameter and value that we wish to control in the sysex message stored in L0 to LE. Maybe it's not clear, but: ASS LA = 03 7C M2Is a short hand way of saying: ASS LA = 03 ASS LB = 7C ASS LC = M2- The parameter (LA, LB) is two bytes, like your '01 70' (fx1/31khz) and '03 7C' (fx2/31khz) - these are obtained from the sysex spec for the katana. - The value (LC) of the parameter to set is just one byte. In the example, I used 'M2' which is the value of the incoming CC20 (which if a switch will toggle between 0 and 7F) To handle more CC's (or other incoming events) you just add more IF clauses and change what you assign to LA to LC to suit. Regards, Nic.
|
|
|
Post by gurbz on Jul 14, 2019 9:38:39 GMT
About the switch (CC20 toggle): what I want it to do is block the original message and send out the modified message. The original sysex message addresses the FX1/graphic EQ/31hz and the modified Message adresses the FX2/graphic EQ/31hz control. The layout design essence is using 1 same MDP2 slider for 2 FX blocks that can be switched with a toggle button. Of course I can use this then on all layout pages in MDP2 that have corresponding fx. The katana FX1 and fx2 block are almost similar so when creating a toggle button I do not have to double the visual layouts. One small problem would be that I can not use these EQ section simultaneously because it doubles the settings then.
Design options and explanation of choices for the MDP2 layout in progress:
Another possibility would be 8 or 16 control knobs that function as master controls for all the different fx, so control 1 is for example the level control of the flanger, phaser, etc. Control 2 would be the control of the rate or whatever control function, etc. I would have to create 2 pages of knobs in MDP2, one for FX1 and one for FX2. The thing then would be a different text label for each knob when selecting a different fx but that issue could be taken care of with MDP2. It would reduce the number of controls but the visuals would loose character, I like visual stomp boxes and a limited amount of options on the screen so there ‘s more attention for detail.
These are all design choices. I have a primova midx-20 that is a solution for all the issues above (great box) but the midi buffer of the device is sometimes too small and it isn’t wireless so I am reinventing the wheel with mdp2, back to sysex and streambyter. I am using now an Yamaha ud by-01 and results are snappy, fast response.
Conclusion: I’m gonna try a lot off different angles, some issues are technical a la streambyter, some are designesque.
|
|