Hello,
I've been using Midi Translator Pro for about a week - so I am relatively new to it. It's really added a lot to my setup already, but now have encountered my first programming issue (I'm not a programmer.)
I am trying to send a midi CC (let's say CC19: B0 13 pp) (pp values 0-100) to a DSI Poly Evolver which is mainly controlled by sysex instructions which contain LS and MS nibbles (in that order), e.g.
Oscillator 1 Fine Tune:
F0 01 20 01 01 01 LS MS F7
where LS cycles through 00 -> 0F and MS counts up from 00 -> 06 (once LS has cycled through 0F it returns to 00 and MS increments by 1.)
Values range from 00 00 to 0A 06 (0-100) (I think this is correct)
The outgoing message will obviously have variables for LS & MS, but I don't know where to start with the rule function to convert a CC message with values 0-100 to 00 00 - 0A 06
Once I get the general idea, I think I will be able to apply the rule to all controls.
I know this can be done - Has anyone succeeded with this kind of translation?
Thanks for your time,
Tom
Steve
2017-03-14 15:56:46
comment
I will be able to help with this later today. Might have a few more questions for you though.
If I understand correctly you want the above Sysex translated to CC value of 0-100. So the main challenge will be to convert MS LS to proper value on output. Just want to verify that is what you are looking for.
Tom
2017-03-14 16:51:39
comment
Hi Steve,
Thanks for replying.
Other way round – so incoming message is CC (values 0-100)
Outgoing message is the sysex message from 00 00 – 0A 06
Steve
2017-03-14 17:43:32
comment
OK however 0A 06 would be 106. Is this what you want?
Steve
2017-03-14 17:52:45
OK to convert CC value to LSB MSB as you describe
Input Controller XX set value to pp
Rules
// set LSB MOD operator
qq=pp%16
// Set HSB Divide operator since BMT uses integers, remainder gets dropped.
rr = pp/16
output message would then be raw midi
F0 01 20 01 01 01 qq rr F7
I only tested on paper. Let me know if it does the trick
This should handle value up to 127 incoming
Tom
2017-03-14 18:00:16
comment
The outgoing messages should go something like this:
0 = 00 00
1 = 01 00
(miss a few)
15 = 0F 00
16 = 00 01 etc…
I will double check – LSB definitely comes before MSB on the Evolver.
Tom
2017-03-14 23:09:30
comment
Thanks for this Steve. I will not be able to test until tomorrow – I will report back with results.
Tom
Tom
2017-03-15 20:39:06
comment
This is it. Thank you.
Of course I meant to put 04 06 instead of 0A 06.
It should now be possible to map all commands to available CC numbers – there is one more problem to overcome which is how to deal with messages which have values above 127 (CC values 0-127 but sysex message value 0-200 for example). I have seen the tutorials on the old forum which show how to scale a control down. I’m guessing the opposite would be true to scale up. Would an extra variable be needed to get to the desired decimal value, and then apply the two operators above?
Thanks again,
Tom
Steve
2017-03-15 20:53:55
comment
So you want to scale down 0-127 to be 0-100 on input to make it 00-00 to 04-06 on output?
You will not be able to get a single controller to output more than 127. You would have to manipulate sysex values above 127 with a separate controller.
Steve
2017-03-15 21:12:28
comment
If you want to scale down the input 0-127 to become 0-100 you would need to put the following rules before the rules I documented earlier.
// First multiply to get better precision
ss=pp*1000
// target output range 0-100
ss=ss*101
// target input range 0-127
ss=ss/128
// divide it back to get to original decimal place (integer)
ss=ss/1000
// alter the input value for future processing (from original rules)
pp=ss
Steve
2017-03-15 21:19:29
comment
Note you can scale up or down for about anything with this method. Just remember if you scale up, you will lose precision.
Steve
2017-03-15 21:20:20
If you want to scale down the input 0-127 to become 0-100 you would need to put the following rules before the rules I documented earlier.
// First multiply to get better precision
ss=pp*1000
// target output range 0-100
ss=ss*101
// target input range 0-127
ss=ss/128
// divide it back to get to original decimal place (integer)
ss=ss/1000
// alter the input value for future processing (from original rules)
pp=ss
Tom
2017-03-15 23:07:01
comment
Thanks for the explanation Steve.
I thought there might be a way to scale up a controller without losing precision. For now I am happy that it is possible to control a sysex parameter including output values above 127 using cc control input. The midi controller I use can restrict input from 0-100, so for a control parameter which has a range of 200 I just multiply the CC variable by 2 first to increment in steps of 2. This should be good enough.
Thanks again,
Tom
Steve
2017-03-15 23:09:35
comment
Good, deal. Glad I could help!