DvlsAdvct wrote:
In the outgoing message, if you select MIDI Message | Raw MIDI / System Exclusive you can type the messages you want to send in hex. You can type as much as you want and they will all trigger as one. Just type them completely. So if you wanted an incoming message to trigger multiple outgoing messages, your outgoing message would simply say
And they will all trigger when the incoming message and rules are processed.
Aaaaah, of course! Thanks!
No. But how many screens are you driving? And how many different commands do you need to drive? How are the sysex commands structured? Maybe we can trim the kinds of messages and how they are structured to free up variables.
If this is not possible, then I think I'll just have to conserve variables. I only need them for this purpose when I send the messages text anyway, which happens in quite isolated cases. I think I can manage through some controlled recycling of variables.
Anyway, the screens have the following structure:
Two rows.
Row 1 is a single section of 55 chars.
Row 2 is split into eight sections with 7 chars each, except for the last one, that has 6.
The format of the sysex message for row 1 is [7 byte header][up to 55 bytes of letters][F7]
or row 2 is [7 byte header][1 byte lower screen section destination][7 bytes of letters][F7]
Right now, I'm for example printing the name of the current scale. Whatever scale I pick, I just assign new letter codes to the 14 global variables I use. If I wanted to use more screens, I'd need up to 55 of them. A theoretical maximum is 110 variables/characters, if I am for some bizarre reason required to fill the entire display with arbitrary letters simultaneously, and I can't just hard-code any of them.
This gets a little more complicated, but is doable also. What I would do, personally, is have a translator record the knob position as a global variable, and then have a different translator for each scale. So, you'd have one global variable reference the key, and a translator for each scale type, with labels for the octave. You could also break this down in different ways based on your needs. But I'd find it more organized this way, personally. Also, for octave you can do a few other clever pieces. So here's an example.
Wouldn't this approach require me to write the code for changing the key and octave separately in every scale translator? If so, would this be preferrable, architecture-wise? This instinctively feels a bit redundant to me, and there'll be a lot of different places to change the code if I need to alter something.
As it stands now, I just pass the variable through three different stages using tags. I have three global variables setting the value for scale, octave and key respectively. In the Note In translator, I first check for scale, then send it to octave, and last, key. So even though the translator is longer, I only have to write the code for octave and key once.
Is this, in your opinion a better or worse approach than what you're proposing? I don't really know which way to go about it. I'm kind of new at BMT, so feel free to educate me.
If there is a way to pass messages through multiple translators, then I imagine this would be optimal. This would allow me to both partition the massive pile of rules that handle scales, so I can have one for each, and I could at the same time keep the code for octave and key DRY.