Mackie C4 layout brainteaser

Hello Midi Translators,

This might be impossible, but MT has managed to achieve midi tricks I thought were impossible before... I have a Mackie C4 which I am using as a simple midi CC controller in conjunction with a midi keyboard controller (Physis K5) to automate various hardware synths. Each synth has its own template set up on the keyboard controller, and also on the C4 (called a 'layout'). To change from one layout to another on the C4, you either have to do this from the C4 panel, or it can be automated to select the next / previous layout by receiving note on messages: next layout: 90 0A 7F previous layout: 90 09 7F

What I would like to do is to send a program change message from the keyboard, which triggers repeated note on messages to select the correct layout on the Mackie. When starting up the Mackie, it always loads the 1st layout. So for example, selecting program change 4 on the keyboard would then trigger a translator to send 3 note on messages to select the 4th layout on the C4. Now what if I want to then select program 6 - how would midi translator know to only send 2 note on messages to get from layout 4 to 6?

Would there be a way using rules to be able to always send the right number of note on messages to the C4 depending on which program change is received?

Hope what I'm asking makes sense... Thanks for looking, Tom

You can do this. Each time you send a note on message, increment a global variable. The global variable can then tell where you are and now you know how many note on messages you need to get where to the layout you want. What you didn’t describe is how many layouts and what you need to see to decrement a layout such as going from layout 4 to layout 3.

You can use a timer with a variable to determine how many times the note-on message will trigger. Your program change would start a timer for input and your timer translator would actually send out the note-on messages the number of times you specifiy when you trigger the timer.

 

Steve

bome@sniz.biz

Independent Bome Programming Specialist

Bome Q&A moderator

 

I guess you DID describe “previous” but still not sure how high you want to go. How many layouts and what you want to do when you get to max.

Something like this should work.

ga = maximum Program change value

gb = current program number

Init translator sets these variables

There are two translators for input but only one fires depending on the value of the program change number (compared to the current program). The one that fires will set a timer. The timers fire the output values the number of times required.

Have fun!

 


Attachments:
1516678290483_Mackie-C4-Layout-2018-01-22.bmtp

Hi Steve,

Thanks for your time on this – excited to try your suggestion later today.
Just to clarify:
Highest layout number = 10 (this could increase, but I guess just change variable ga as necessary).
Minimum layout = 1. C4 always boots into this layout.
Select next layout command = note-on: 90 0A 7F
Select previous layout command = note on: 90 09 7F
So simply send either of these messages to move up or down the layouts.

This would be great if it works, as contained within each layout are ‘pages’ which operate in the same way (page-up / page-down). These could also be automated using different variables.

Thanks so much – I’ll let you know how I get on in a few hours time…

Tom

Yes, except I think I set the minimum to 0 so you may need to adjust that to 1 and then change a rule or two. Also set gb to 1 on startup. I think I have figured a way I could do it with only 2 rules instead of 4 rules but I haven’t gone back to try it yet. Instead of separate up and down translators, we could set a global variable to 0 or 1 for down or up and add a rule to look for the “direction” and have the output send 09 or 0a accordingly on a single timer.
IE
if gc==0 then pp=9
if gc==1 then pp=10
output raw 90 pp 7f

Good news Steve – it’s essentially working! Well, it is working 100% but occasionally (1 in 10 program changes) the Mackie throws in an extra increment / decrement (I can see the translator is sending the right number of note on messages – amazing!)
I should add (in case anyone wants to use this translator) that the full button press commands are:
90 09 7F (button down) 90 09 00 (button release)
90 0A 7F (button down) 90 0A 00 (button release)
I changed the messages to 90 09 7F 90 09 00 and 90 0A 7F 90 0A 00.
Don’t know if this is the best way to input these commands (as one message) and could explain the occasional skips…

Using initial variables of 0 min and 10 max works perfectly – I needed 11 templates… The keyboard just names them P001 – P011
I haven’t investigated the single translator version yet – might look at this now…

Thanks so much for solving this – I’m running out of challenges to overcome with this setup and might have to start writing some music with all this gear instead, but I have a few ideas…

Yeah about the extra clicks, there might be a math error in one of the rules somewhere. I threw this together rather fast.

As far as button down, button up, you only need to monitor for one and simply ignore the other. Depends on when you want to program to change, upon pressing, or releasing.

This is probably a cleaner simpler version.

 


Attachments:
1516749805195_Mackie-C4-Layout-2018-01-23.bmtp

Hi Steve,

Not having so much luck with the new version of this translator. I didn’t have much time to play with it yesterday, so it could have been the way I had it set up. I’ll have a bit more time later today.
The translator seems to be outputting the correct template values, but it is not sending the correct number of note on messages to the midi output port (sometimes none at all.) I’ll have to double check that everything is set up correctly and nothing is interfering with the output messages…

Thanks,
Tom

If you have integrated it with something else, be aware that I added another global variable.
ga – Max number
gb – Current number
gc – Target Number (New)

I calculate the number of inc/dec message by subtracting target from current and the direction of movement based on whether the result is positive or negative.

I’m pretty sure I tested it and had it working.

Not sure what I’m doing wrong then – here’s the log window:
This is from the project file you kindly attached with just 1 input & output port open.
I am sending the program changes on channel 16.
Press escape to reset variables > send program changes from 0 – 3, and 0 again.
Only the change from 3 to 0 initiates a midi out event.
1: IN 0.1 Physical Keys: Esc
2: OUT 0.1 One-shot timer “Init”: 0 ms delay
3: IN 0.2 On timer “Init”
4: RULE 0.2 assignment: (ga=10) = 10
5: RULE 0.2 assignment: (gb=0) = 0
6: RULE 0.2 assignment: (gc=0) = 0
7: MIDI IN [Physis Piano]: CF 00
8: IN 1.0 Program Change on ch. 16 set ‘oo’ to program=0
9: RULE 1.0 expression: (pp=gb-oo) = 0
10: RULE 1.0 assignment: (gc=oo) = 0
11: OUT 1.0 Timer pp times “Change”: 1 ms (initial delay: 0 ms)
12: MIDI IN [Physis Piano]: CF 01
13: IN 1.0 Program Change on ch. 16 set ‘oo’ to program=1
14: RULE 1.0 expression: (pp=gb-oo) = -1
15: RULE 1.0 condition satisfied: if ppgb then pp=10) = 10
22: RULE 1.1 condition satisfied: if gc>gb then gb=gb+1
23: RULE 1.1 expression: (if gc>gb then gb=gb+1) = 1
24: RULE 1.1 condition satisfied: if gc==gb then exit rules, skip Outgoing Action
25: MIDI IN [Physis Piano]: CF 02
26: IN 1.0 Program Change on ch. 16 set ‘oo’ to program=2
27: RULE 1.0 expression: (pp=gb-oo) = -1
28: RULE 1.0 condition satisfied: if ppgb then pp=10) = 10
35: RULE 1.1 condition satisfied: if gc>gb then gb=gb+1
36: RULE 1.1 expression: (if gc>gb then gb=gb+1) = 2
37: RULE 1.1 condition satisfied: if gc==gb then exit rules, skip Outgoing Action
38: MIDI IN [Physis Piano]: CF 03
39: IN 1.0 Program Change on ch. 16 set ‘oo’ to program=3
40: RULE 1.0 expression: (pp=gb-oo) = -1
41: RULE 1.0 condition satisfied: if ppgb then pp=10) = 10
48: RULE 1.1 condition satisfied: if gc>gb then gb=gb+1
49: RULE 1.1 expression: (if gc>gb then gb=gb+1) = 3
50: RULE 1.1 condition satisfied: if gc==gb then exit rules, skip Outgoing Action
51: MIDI IN [Physis Piano]: CF 00
52: IN 1.0 Program Change on ch. 16 set ‘oo’ to program=0
53: RULE 1.0 expression: (pp=gb-oo) = 3
54: RULE 1.0 assignment: (gc=oo) = 0
55: OUT 1.0 Timer pp times “Change”: 1 ms (initial delay: 0 ms)
56: IN 1.1 On timer “Change”
57: RULE 1.1 condition satisfied: if gc<gb then pp=9
58: RULE 1.1 assignment: (if gc<gb then pp=9) = 9
59: RULE 1.1 condition satisfied: if gc<gb then gb=gb-1
60: RULE 1.1 expression: (if gc<gb then gb=gb-1) = 2
61: MIDI OUT [LoopBe Internal MIDI]: 90 09 7F 90 09 00
62: OUT 1.1 MIDI 6 bytes 90 09 7F 90 09 00
63: IN 1.1 On timer “Change”
64: RULE 1.1 condition satisfied: if gc<gb then pp=9
65: RULE 1.1 assignment: (if gc<gb then pp=9) = 9
66: RULE 1.1 condition satisfied: if gc<gb then gb=gb-1
67: RULE 1.1 expression: (if gc<gb then gb=gb-1) = 1
68: MIDI OUT [LoopBe Internal MIDI]: 90 09 7F 90 09 00
69: OUT 1.1 MIDI 6 bytes 90 09 7F 90 09 00
70: IN 1.1 On timer “Change”
71: RULE 1.1 condition satisfied: if gc<gb then pp=9
72: RULE 1.1 assignment: (if gc<gb then pp=9) = 9
73: RULE 1.1 condition satisfied: if gc<gb then gb=gb-1
74: RULE 1.1 expression: (if gc<gb then gb=gb-1) = 0
75: RULE 1.1 condition satisfied: if gc==gb then exit rules, skip Outgoing Action

My apologies. I had to fix one rule

In timer output I had this:

if gc>gb then pp=10
if gc<gb then pp=9
if gc<gb then gb=gb-1
if gc>gb then gb=gb+1

if gc==gb then exit rules, skip Outgoing Action

 

I had to change the test for skiping the action prior to adjusting the value of gb

if gc>gb then pp=10
if gc<gb then pp=9
if gc==gb then exit rules, skip Outgoing Action
if gc<gb then gb=gb-1
if gc>gb then gb=gb+1

 

This made everything off by one so a single value change didn’t do anything.

Here is the fixed project file

 


Attachments:
1516923810215_Mackie-C4-Layout-2018-01-25.bmtp

This is the one…
Thanks so much for this – it’s something of a game changer for my setup.
Another satisfied customer.
Tom

Happy to help, Tom!