Project
Mackie Control C4 - Template for Sonar
Started by RagsInRags on .
Sign in or create an account to join the conversation.
OK.. This is a bit awkward
I am quite a noob to Lemur and the whole control surface stuff. I own Sonar X3 and wanted a Mackie MCU+C4 desperately. Looking at the price and also the "unavailability" of stock to actually see the product working before buying, I almost gave up my dream of owning them. Thats when Lemur happened...
Long story short - There were (are) not many Sonar Templates on Lemur User Templates section. I spent the last couple of weeks unravelling the inner workings of Lemur Scripting. And I think I have a template based on Mackie Control C4 protocol working for Sonar (I know it works atleast on my machine)!!
ScreenShot.png
Seeing the secrecy surrounding the Mackie C4 protocol, I am not sure if I should upload my template to the user section (dont know if the FBI or MI6 will come knocking on my door stating that I infringed on some copyright law or company confidentiality clause
). This is particularly the case because I have not seen any document outlining the C4-Protocol as yet on the internet in plain english. And it did not take me long to figure out the midi implementation for C4
. If it was this simple, I am wondering why no-one has yet posted any such stuff yet (neither for Sonar nor other DAWs).
I am looking for advice from long-timers on this forum. Any / All guidance that will help me not get into trouble will be appreciated.
I am quite a noob to Lemur and the whole control surface stuff. I own Sonar X3 and wanted a Mackie MCU+C4 desperately. Looking at the price and also the "unavailability" of stock to actually see the product working before buying, I almost gave up my dream of owning them. Thats when Lemur happened...
Long story short - There were (are) not many Sonar Templates on Lemur User Templates section. I spent the last couple of weeks unravelling the inner workings of Lemur Scripting. And I think I have a template based on Mackie Control C4 protocol working for Sonar (I know it works atleast on my machine)!!
ScreenShot.png
Seeing the secrecy surrounding the Mackie C4 protocol, I am not sure if I should upload my template to the user section (dont know if the FBI or MI6 will come knocking on my door stating that I infringed on some copyright law or company confidentiality clause
I am looking for advice from long-timers on this forum. Any / All guidance that will help me not get into trouble will be appreciated.
this is great! Yes, Mackie C4 templates were non existent until now, and it was one of those things I wanted to do. I have a C4, but don't know the protocol. I was hoping to use Lemur as a translator so that I can use the C4 for other software. Especially the text in the scribble strips. But knowing the protocol would of course also be useful to integrate into a pure Lemur template to control the few DAW's that can understand that protocol.
So, how did you do it? My plan was to intercept the MIDI ports of my C4 and note all sysex commands, create a table, and think about how to implement all together into Lemur.
About the secrecy around the C4 protocol: I was asking myself the same question. Probably not many devices were built, and not many software companies have included the protocol, so it hasn't become very popular. I saw one single video on YT that showed custom text appearing on the C4 scribble strips, wrote to the author, no reply. I think it's no breach of any secret if you make your template public. Especially if you found out the MIDI implementation yourself. If you hacked the Mackie website to access that data, that would be another thing of course. But I'm not a lawyer, so better wait a little what others have to say to this.
Meanwhile, I'm interested in your template. I don't have Sonar, but I could try it with Tracktion, Reason, and Logic. Only if you feel good with it, send it to me via PM. If not it's ok, now that I see that it works, I'm more confident to find out the MIDI implementation and build a Lemur template myself. Before your post, I was a bit unsure. And it's not very important, other things are more pressing.
Thanks for your post, that is good news.
So, how did you do it? My plan was to intercept the MIDI ports of my C4 and note all sysex commands, create a table, and think about how to implement all together into Lemur.
About the secrecy around the C4 protocol: I was asking myself the same question. Probably not many devices were built, and not many software companies have included the protocol, so it hasn't become very popular. I saw one single video on YT that showed custom text appearing on the C4 scribble strips, wrote to the author, no reply. I think it's no breach of any secret if you make your template public. Especially if you found out the MIDI implementation yourself. If you hacked the Mackie website to access that data, that would be another thing of course. But I'm not a lawyer, so better wait a little what others have to say to this.
Meanwhile, I'm interested in your template. I don't have Sonar, but I could try it with Tracktion, Reason, and Logic. Only if you feel good with it, send it to me via PM. If not it's ok, now that I see that it works, I'm more confident to find out the MIDI implementation and build a Lemur template myself. Before your post, I was a bit unsure. And it's not very important, other things are more pressing.
Thanks for your post, that is good news.
Hey Phil,
Thanks for being the 1st to reply. You are right. I neither own a C4 nor did I hack into their site
. So I should (theoritically) not be bound to any confidentiality / copyright clauses. For all I know, I may have got the protocol all wrong ! Im just worried about the lack of information there is (especially since it would take not more than a day to figure out the protocol if one has a C4). I think if you know how Traction, Reason or any other DAW queries the C4 and the response it expects, you should be able to use this template with little tweak.
How did I do it?
1. Did quite some reading on MCU protocol. Some were incidental (during my search for info on C4). Others were intentional to understand the structure in which Mackie Protocol works. So have gone through the motions of HUIDocs, MCMap and the likes.
2. Took quite a few clues from softcore MCU template to understand how Sonar reacts to Mackie messages. Added my little programming experience to this and tried to make sense.
3. Used Midi-OX to monitor the midi messages that Sonar sends out. When sonar connects, it sends series of reset/initialize messages. That gave a big clue on what the different controls and sysex might be to communicate with Sonar.
4. Came across Geoff Waddington's work on creating a C4 emulator. I think this is the video you talk off where he shows custom text on a C4 display (http://stash.reaper.fm/v/11712/WaddMCUC4.zip). That gave me lots of clues.
5. After all this, had most of the stuff figured out. What remained was to get the way C4 tells Sonar when an encoder is moved. I did not find that info anywhere (atleast not in a way I could understand it). It took a bit of luck and brute force approach to figure this one out. but I did it !!
. But from what I found, SysEx is used only for display data. Rest are note combinations and controllers (like the MCU - albeit different ones).
My biggest challenge was that not owning a C4, I did not know how the unit works. the documentation is not detailed enough to imagine the unit's behaviour. So there was a lot of guess-work and "connecting the observed behaviour with functionality mentioned in the user guides".
I'll PM you what I have so far. It will also be a good test-run for the template
Thanks for being the 1st to reply. You are right. I neither own a C4 nor did I hack into their site
How did I do it?
1. Did quite some reading on MCU protocol. Some were incidental (during my search for info on C4). Others were intentional to understand the structure in which Mackie Protocol works. So have gone through the motions of HUIDocs, MCMap and the likes.
2. Took quite a few clues from softcore MCU template to understand how Sonar reacts to Mackie messages. Added my little programming experience to this and tried to make sense.
3. Used Midi-OX to monitor the midi messages that Sonar sends out. When sonar connects, it sends series of reset/initialize messages. That gave a big clue on what the different controls and sysex might be to communicate with Sonar.
4. Came across Geoff Waddington's work on creating a C4 emulator. I think this is the video you talk off where he shows custom text on a C4 display (http://stash.reaper.fm/v/11712/WaddMCUC4.zip). That gave me lots of clues.
5. After all this, had most of the stuff figured out. What remained was to get the way C4 tells Sonar when an encoder is moved. I did not find that info anywhere (atleast not in a way I could understand it). It took a bit of luck and brute force approach to figure this one out. but I did it !!
I was also of the belief that there would be a lot of sysex commands to work with. Probably this has been done intentionally to dissuade ppl from investigating. My initial searches were aimed to find SysEx informationMy plan was to intercept the MIDI ports of my C4 and note all sysex commands, create a table, and think about how to implement all together into Lemur.
My biggest challenge was that not owning a C4, I did not know how the unit works. the documentation is not detailed enough to imagine the unit's behaviour. So there was a lot of guess-work and "connecting the observed behaviour with functionality mentioned in the user guides".
I'll PM you what I have so far. It will also be a good test-run for the template
wow, you don't have a C4 and figured it out? That is I think a big achievement. Congratulations, very well done!
I'm currently reading the thread in the Reaper forum. Seems like I didn't know that one.
Really great news, thank you.
Oh, and I think it's not a problem to post the template in the user library or here. You didn't steal anything or broke any contract. Why the C4 implementation is so hard to find may have other, ordinary reasons. But that's just my thinking, one never knows ... better keep it for yourself until we know for sure. Maybe Macciza joins the discussion, I think he has a C4 as well, according to his signature.
I'm currently reading the thread in the Reaper forum. Seems like I didn't know that one.
Really great news, thank you.
Oh, and I think it's not a problem to post the template in the user library or here. You didn't steal anything or broke any contract. Why the C4 implementation is so hard to find may have other, ordinary reasons. But that's just my thinking, one never knows ... better keep it for yourself until we know for sure. Maybe Macciza joins the discussion, I think he has a C4 as well, according to his signature.
Just needed to hear someone else say thatOh, and I think it's not a problem to post the template in the user library or here. You didn't steal anything or broke any contract.
https://liine.net/en/community/user-library/view/448/
Now I will go silent and wait to hear some feedback
just for now, very professional pdf. Impressing. It even takes care of note-on and note-off. Forgive me for praising your work again, but this is rare.
Edit: Reason appears to function very well with this template.
Edit: Reason appears to function very well with this template.
OOOOhhhh niiiice! This will pair up perfectly with my LeMackie! Thanks for the efforts man!
P.S. Yes you can upload it!
look here!
https://liine.net/en/community/user-library/view/342/

P.S. Yes you can upload it!
look here!
https://liine.net/en/community/user-library/view/342/
Oh I also request permission to use your C4 findings as a second page on an upcoming LeMackie update. 
Hmm
Looks very interesting, it's another thing I had started on at one point....
Not got my computer at the moment but when I get it back will check it out..
I have a C4 sitting around so can probably doing comparisons and give additional info...
Cheers
MM
Looks very interesting, it's another thing I had started on at one point....
Not got my computer at the moment but when I get it back will check it out..
I have a C4 sitting around so can probably doing comparisons and give additional info...
Cheers
MM
@Phil - thanks for your kind words. So did it work just like that or did you have to make any changes to get reaper to recognize it? If it worked just like that, I think I should change the name and make ir more generic (not linked to Sonar). A wider audience should be encouraged to use it then. Can you also confirm if the "modifier section" works? I figure since you have a C4, you should know what those buttons are supposed to do.
@Softcore - I've released the template under GNU GPL. So feel free to use it
In fact I was going to reach out to you once I got confirmation that the template works outside of my machine to combine the two of our templates. That will be a powerful combination for Lemur users. I had that in mind when I made the template work on MIDI 1 (and not MIDI 0). I have already done it at my end. If you are OK, I can upload the combined template with the following disclaimer:Disclaimer.png
Will need to tweak the install document and will distribute your installation document along with the template. Offcourse, your next version with more advancements / improvement will be awaited.
@Macciaza - cant wait till you get back to your PC
Dude, we are with absolutely the same mentality here....Do whatever the hell you want with LeMackie! 
Feedback about the template coming your way soon-ish!
Feedback about the template coming your way soon-ish!
Logic: the Assignment buttons don't work. These buttons let you select (together with a push on an encoder) the plugin you want to control. Therefore I'm not even able to do this and plugin parameters cannot be edited. Actually, the top two Assignment buttons (Marker, Track) work, only the lower two (Chan Strip, Function), the most important ones, do not work. That's strange, I have no explanation for this until now.
The split buttons I didn't try, because I never use them on the hardware, I don't even know how to use them.
Reason: template works out of the box. Almost. Again the Chan Strip and Function buttons do not work. In Reason they have transport functions, Stop and Play. Interestingly, when I hit the spacebar for transport control, the said buttons light up accordingly. So the note numbers are correct, Reason sends the info back to the C4.
Other buttons like Track Left/Right, Slot Up/Down, Bank/Single Left/Right, are working as expected.
Now I've hooked up both the hardware and the template, and in a MIDI analyser I can see differences what those two buttons (Chan Strip, Function) are sending. The hardware is sending note-on vel 0 (push) and note-on vel 127 (release), the template is sending both commands upon release. But only on the lower two Assignment buttons, the top ones send the same as the hardware.
Now I see the reason: the lower two buttons have a custom MIDI output, the top ones not. I disabled them and enabled x, now it is working in Logic. Still not quite seeing trough, I think I send the post now and add further findings later. What I can say: it's beautiful. Nice virtual encoders, they alone are something.
Edits: the Modifier buttons are note numbers 13-16. Tested in Reason, working.
The split buttons I didn't try, because I never use them on the hardware, I don't even know how to use them.
Reason: template works out of the box. Almost. Again the Chan Strip and Function buttons do not work. In Reason they have transport functions, Stop and Play. Interestingly, when I hit the spacebar for transport control, the said buttons light up accordingly. So the note numbers are correct, Reason sends the info back to the C4.
Other buttons like Track Left/Right, Slot Up/Down, Bank/Single Left/Right, are working as expected.
Now I've hooked up both the hardware and the template, and in a MIDI analyser I can see differences what those two buttons (Chan Strip, Function) are sending. The hardware is sending note-on vel 0 (push) and note-on vel 127 (release), the template is sending both commands upon release. But only on the lower two Assignment buttons, the top ones send the same as the hardware.
Now I see the reason: the lower two buttons have a custom MIDI output, the top ones not. I disabled them and enabled x, now it is working in Logic. Still not quite seeing trough, I think I send the post now and add further findings later. What I can say: it's beautiful. Nice virtual encoders, they alone are something.
Edits: the Modifier buttons are note numbers 13-16. Tested in Reason, working.
Thanks Phil,
I did not have that insight about the track button together with the push on the encoder. Let me see if I can get that function working on sonar. Meanwhile, the reason I had made custom midi for ChanStrip and Function was that if I made them pads, they would turn on OK. But they then needed to be pressed 2-times to get it to turn on again. This was because Sonar was also sending the same note to indicate the function was on and it was messing with the button state.
For controlling plugins, I thought the only way was to keep "Track" pressed. the display changes. Then select "Plugin" (12th encoder) from there to be displayed on the tracks. I managed to get the plugin data displayed using that route.
Let me know any other updates. Meanwhile, I will try to get the Track+pots working on Sonar.
Edit - the problem also may be with the encoder push message. in the current state, it just resets the value being controlled.
I did not have that insight about the track button together with the push on the encoder. Let me see if I can get that function working on sonar. Meanwhile, the reason I had made custom midi for ChanStrip and Function was that if I made them pads, they would turn on OK. But they then needed to be pressed 2-times to get it to turn on again. This was because Sonar was also sending the same note to indicate the function was on and it was messing with the button state.
For controlling plugins, I thought the only way was to keep "Track" pressed. the display changes. Then select "Plugin" (12th encoder) from there to be displayed on the tracks. I managed to get the plugin data displayed using that route.
Let me know any other updates. Meanwhile, I will try to get the Track+pots working on Sonar.
Edit - the problem also may be with the encoder push message. in the current state, it just resets the value being controlled.
in Logic, one has to hold the Chan Strip button, and select either 'Plugin Mixer' for insert effects or 'Instrument Mixer' for virtual instruments. It's working fine with the few changes I applied to the template.RagsInRags wrote: For controlling plugins, I thought the only way was to keep "Track" pressed. the display changes. Then select "Plugin" (12th encoder) from there to be displayed on the tracks. I managed to get the plugin data displayed using that route.
Edit: just checked with the hardware. It's not quite true what I said, what you said is true. The template behaves differently. I'll have a closer look at it.
I think they're alright. Encoder push does indeed reset values when controlling a plugin in Logic and Reason and possibly other DAW's.RagsInRags wrote:the problem also may be with the encoder push message. in the current state, it just resets the value being controlled.
And I understand the custom MIDI, sometimes the buttons do not reflect the current state correctly. This can be problematic sometimes. But I'm sure we find a solution, with Lemur there's always one.
Mackie Control C4 - for Sonar V1.02.zip
Great stuff Phil. I downloaded your changes. In Sonar, it works. but it has a glitch.
- start with Chan Strip on (when connected for first time)
- Click Chan Strip once. Light goes off. But nothing happens to displays.
- Click Chan Strip again. Display changes. Sonar responds with a note off and turns the swtich back off.
So it requires 1 click to get into Chan Strip mode and 2 Clicks to get out of it. There may be one of possible 2 solutions:
1. Send only Note On message (no note off). Sonar responds with a corresponding note on (for chan strip on) and note off (for chan strip off)
2. Make the button independant of the midi and have an LED display the chan strip status.
I'll give it a think over the weekend and possibly upload an update if I fins a better approach
- start with Chan Strip on (when connected for first time)
- Click Chan Strip once. Light goes off. But nothing happens to displays.
- Click Chan Strip again. Display changes. Sonar responds with a note off and turns the swtich back off.
So it requires 1 click to get into Chan Strip mode and 2 Clicks to get out of it. There may be one of possible 2 solutions:
1. Send only Note On message (no note off). Sonar responds with a corresponding note on (for chan strip on) and note off (for chan strip off)
2. Make the button independant of the midi and have an LED display the chan strip status.
I'll give it a think over the weekend and possibly upload an update if I fins a better approach
button states can be tricky. The same problem with the AlphaTrack emulation (where I also used custom MIDI), but I don't exactly remember which method worked best. Having the LED indicator and the button (not showing any state) separated is probably the best method, although at first it does not make sense because both send/receive the same note value.
Note-on vel 0 is not the same as note-off, and in the C4 hardware I never observed a note-off message. Only note-on with velocity 0 or 127. I was too lazy to get to the ground with these buttons in the AlphaTrack emulation, so I still don't know for sure how it's done. Maybe I should have a look at some MCU templates, how it is done there.
Note-on vel 0 is not the same as note-off, and in the C4 hardware I never observed a note-off message. Only note-on with velocity 0 or 127. I was too lazy to get to the ground with these buttons in the AlphaTrack emulation, so I still don't know for sure how it's done. Maybe I should have a look at some MCU templates, how it is done there.
Sorry - my bad. Yes I meant Note On with Vel 0 when I was refering to Note OFF. I will also change the document to reflect thatNote-on vel 0 is not the same as note-off, and in the C4 hardware I never observed a note-off message. Only note-on with velocity 0 or 127.
I have added LEDs to indicate status of ChanStrip and Track. Sonar never reacts to a Note On Vel 0. It however toggles its state when I send a Note on Vel 7F. So in this version, I am sending only a Note On Vel 7F. Depending on the response from Sonar, the LED status is changed.
Let me know if this works in Logic / Reason. And thank you for doing the tests for me. If this gets sorted, the template can work for a wider set of DAWs !
Once you confirm, I'll upload the new version to the forum.
Mackie Control C4 - for Sonar V1.03.zip
will test this tonight. I think status LED's are best. Not entirely sure. Also, to repeat, the hardware is sending note-on vel 0 (push encoder) and note-on vel 7F (release encoder). May be relevant for one DAW, and may not be relevant for another. And I probably forgot to say v.1.02, the one I modified, does not exactly work as the hardware. I first thought it did, and had to correct my post later.
I have a feeling we will get the right button commands soon. It looks rather trivial actually. I feared to break my C4-Logic-setup, which happened more than once and added to my reluctance to make any changes to my C4 setup. But it's simpler than I thought. I just have to exchange the MIDI ports in Logic C4 setup to switch between Lemur and hardware. And I just need to switch off the hardware after changing the ports to Lemur, otherwise I get a mess with two non-functional C4's inside Logic.
Edit: hm, this again is not correct. The hardware is sending note-on vel 7F on push, and vel 0 on release. But I swear it was the other way round yesterday.
Another thing: I think I know now why the buttons sometimes have to be pushed twice when the connection is made with x. When the DAW sends info back to the LED, sometimes the button catches that note earlier than the LED, and is lit (x=1). Then one has to push the button first to set x to 0, and the next push does what one wants. So the solution is to make the buttons only send, and not receive. You probably knew that already, that's why you have MIDI out scripts.
I have a feeling we will get the right button commands soon. It looks rather trivial actually. I feared to break my C4-Logic-setup, which happened more than once and added to my reluctance to make any changes to my C4 setup. But it's simpler than I thought. I just have to exchange the MIDI ports in Logic C4 setup to switch between Lemur and hardware. And I just need to switch off the hardware after changing the ports to Lemur, otherwise I get a mess with two non-functional C4's inside Logic.
Edit: hm, this again is not correct. The hardware is sending note-on vel 7F on push, and vel 0 on release. But I swear it was the other way round yesterday.
Another thing: I think I know now why the buttons sometimes have to be pushed twice when the connection is made with x. When the DAW sends info back to the LED, sometimes the button catches that note earlier than the LED, and is lit (x=1). Then one has to push the button first to set x to 0, and the next push does what one wants. So the solution is to make the buttons only send, and not receive. You probably knew that already, that's why you have MIDI out scripts.
Yes.. watching numbers for a long time can do that sometimesEdit: hm, this again is not correct. The hardware is sending note-on vel 7F on push, and vel 0 on release. But I swear it was the other way round yesterday.
Yes. I figured that the buttons and the LED's both react to the incoming messages. So in v1.03, I have made the buttons independent of incoming ones. It only send out midi messages. Now what remains to be seen is if Logic needs a vel 7F to switch on and vel 0 to switch off. Sonar seems to require 7F for both.So the solution is to make the buttons only send, and not receive.
I'll wait for you to test it out
I have tested a further version of v.1.02, but it is probably the same. Only sending MIDI using two separate scripts. One for velocity 127 when x goes to positive, one for velocity 0 when x goes to zero. And voilà, it works as the hardware in Logic. Well, almost. There are a few differences:
- the scribble strips (the bottom line) does not always show.
- the first letter of the top line is sometimes missing.
- Assignment buttons need to be pressed for a short moment. Very short presses are not registered by Logic.
- the double-click is working, but sometimes I doubt the called functions in Logic are always correct. Maybe one has to do the same thing with the buttons, press, tiny pause, then release.
- split: not sure if it's working correctly. Split 1/3 LED lights up after having pressed 'Split', but now I can't change that anymore. I need first to find out how it works, on the hardware, then compare with Lemur.
But generally it's working, one can navigate through a project (only with the additional help of arrow keys to change the current channel), select this effect or that softsynth, step through parameter pages, etc. Only sometimes one has to know which encoder to double-click, because the second text line is missing some info.
The display is very nicely done. I'm far from understanding how it works. Just some clever code, and not even much at all.
I tried v.1.03, and it's working as well, but it's different. I don't have to hold the Chan Strip button while selecting an encoder to push, I can do one after the other now. Maybe even a better workflow like this? I'll test more. Still have this #@*% split on, can't switch it off, even after restarting Logic and Lemur.
Mackie Control C4 - for Logic V1.02p.zip
- the scribble strips (the bottom line) does not always show.
- the first letter of the top line is sometimes missing.
- Assignment buttons need to be pressed for a short moment. Very short presses are not registered by Logic.
- the double-click is working, but sometimes I doubt the called functions in Logic are always correct. Maybe one has to do the same thing with the buttons, press, tiny pause, then release.
- split: not sure if it's working correctly. Split 1/3 LED lights up after having pressed 'Split', but now I can't change that anymore. I need first to find out how it works, on the hardware, then compare with Lemur.
But generally it's working, one can navigate through a project (only with the additional help of arrow keys to change the current channel), select this effect or that softsynth, step through parameter pages, etc. Only sometimes one has to know which encoder to double-click, because the second text line is missing some info.
The display is very nicely done. I'm far from understanding how it works. Just some clever code, and not even much at all.
I tried v.1.03, and it's working as well, but it's different. I don't have to hold the Chan Strip button while selecting an encoder to push, I can do one after the other now. Maybe even a better workflow like this? I'll test more. Still have this #@*% split on, can't switch it off, even after restarting Logic and Lemur.
Mackie Control C4 - for Logic V1.02p.zip