Trevliga Spel forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Building a DAW Transport for Cakewalk Sonar

2 posters

Go down

Building a DAW Transport for Cakewalk Sonar Empty Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Wed Aug 02, 2023 6:58 pm

Greetings Trevliga Spel forum folks!

Newbie here, having some learning curve hurdles, hope to learn more about best practices.
I have several questions, but will try to take one topic at a time.

Using StreamDeck Mini --> with the Trevliga Spel MIDI Plugin with 3 buttons for
Stop  (Mackie Control Stop)
Play   (Mackie Control Play)
Record (Mackie Control Record)

Windows PC running Cakewalk Bandlab (Sonar) DAW.

StreamDeck buttons are configured as a "Mackie Control" on the loopMIDI port mackie2daw with the "Sonar" layout.

StreamDeck MIDI Plug-in is the Only "device" using the mackie2daw MIDI port (daw2mackie is not used).

Cakewalk has a control surface "Mackie Control" with input from coming from the mackie2daw port.

Here is the odd behaviors at least to my semi-logical thinking:

Press StreamDeck Record button, DAW engages Record mode and transport begins rolling.

While still rolling, Pressing the StreamDeck Record button, the DAW dis-engages Record mode and transport keeps rolling.

So far, so good!

But, if, instead, while Record is engaged and transport is rolling, 
I press the StreamDeck Play button,
it acts like a STOP, and returns transport to 0:00:00

That is not how the Cakewalk program responds to it's built-in transport ...
If while it is Recording & Rolling, pressing Play in Cakewalk will indeed STOP but it Stops at that point in time (it does not return to 0:00:00).  I've checked all Cakewalk settings regarding that, and that option is set to Off.

Should I be using another feature of the MIDI Plugin like Sysex or MMC or Scripting Variables (!)
or is this a known issue?  I didn't find any mention of Cakewalk transport in the forums here.

Thanks for any advise or suggestions.

My next adventure is to make these StreamDeck buttons communicate to a MIDI Solutions "Relay" device on a separate MIDI port to turn my red recording light on and off based on the buttons pressed ... but that is a question for another time ...

Thanks!

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Admin Wed Aug 02, 2023 9:10 pm

Hi, welcome to the forum.

Unfortunately, I have no experience with Cakewalk, but I have tested your scenario in Cubase and Studio One. Neither has a toggle function on Play, i.e., if you press Play, it plays. If you press Play while it is playing, it continues to play. If you press Stop, it stops where it is.

The daw controls the functionality of each button; the plugin sends the Play command (which, in fact, is just an A#6 note), and the daw and the Mackie Control driver in the daw determine the result of that command. If the Play command from the plugin works differently from the built-in transport buttons, I guess it's the Mackie Control driver in Cakewalk that introduces the different behavior. If the Mackie Control control surface in Cakewalk has some configuration, you might find something to change the behavior. If not, I'm afraid it is built-in to the Mackie Control driver.

If you cannot change the behavior of the Mackie Control driver, you may get a better result from a Stream Deck Control Change button. I assume Cakewalk can "learn" remote control commands, so you can configure a CC Stream Deck button and learn the command on the Cakewalk Play button. An important thing is to use a separate midi port for those kinds of commands since they otherwise may be interpreted by the Mackie Control driver as something completely different. If you follow my suggested naming scheme, you should use a "StreamDeck2Daw" midi port for this.

Is there any specific reason why you don't use the "daw2mackie" midi port? You will not get any state feedback on Stream Deck. The transport buttons will work regardless of this, but other functions, like faders and Vpots, will not; they are totally dependent on state feedback for their functionality.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Wed Aug 02, 2023 9:47 pm

Thank you for the suggestions and timely response! 

The MIDI plugin for StreamDeck is Cool! But deep ...

I will check with Cakewalk forums about accessing any parameters/configuration of the Mackie Control driver.
The usual configuration menu option I've seen for other hardware control surfaces just greys out when chosen, and the config screen doesn't load.

I can certainly enable the daw2mackie port - I was eliminating variables to see if they affected the issue.

I will try an approach using your mention of cc: and using the StreamDeck2Daw port.

Cakewalk has what they term "Key Bindings" which can be either the QWERTY keyboard, or a MIDI note, I haven't found a way for it to "learn", but I will look.

Thank you so much for your help (and patience!)

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Thu Aug 03, 2023 12:46 am

hi Admin -

After some more testing, I've come to the same conclusion -- that there is almost certainly an unexpected response by Cakewalk's transport interpretation of the standard "PLAY" command that the Mackie Control action sends.

However, after thinking about your suggestions, which generally helped opening my thinking to consider that there might be more than one way to do this, it dawned on me that StreamDeck offers System Hot-Key actions, which, in my use case, work as I would want - which is to say, in the same way that the PC Keyboard works with Cakewalk !

So, I've added the "Spacebar" hotkey into the PLAY button, which makes my PLAY button act like a PLAY/PAUSE control.

First press, Playback starts, next press, Playback pauses/stops at that point.
Next press, Playback resumes.

Stop is a pure Mackie Control transport STOP which works as-expected and stops at the point when pressed.

RECORD button is also a pure Mackie Control transport RECORD which now works as-expected.
First press, Recording is engaged (whether from Stop state or rolling)
Next press, Recording is dis-engaged, but Transport continues to roll.

Yay! Super Yay!

Since I have the basic Transport operations working now, I have enhanced each button to control a Relay-controlled red "RECORDING" light.

I have a MIDI Solutions "Relay" box that has a dc-level contact output jack; that output is connected to a relay-switched AC power outlet box.

The most interesting part being, I have used your MIDI Script action, and this script:
[(press){noteon:16,95,127}]
[(press){noteoff:16,95,127}]
{nextpress:2}

When the "Relay" receives NoteOn B6 95 on MIDI Port 5 Channel 16, the red light comes on !

And, with the help of the nextpress, the next time the REC button is pressed, the light goes off.

Which I would suggest represents a "smart toggle".

So, by combining several different button action types I've arrived at a configuration for DAW Transport that works for me.

Although I'm not feeling brave enough at the moment, having arrived at a working solution, is it within the capabilities of the plug-in to poll or to receive the state of the Cakewalk DAW - if , for example, I am using the PC Keyboard for transport, would the StreamDeck buttons be able to "know" that state and control the light?

Again, thanks so very much for your input.

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Admin Thu Aug 03, 2023 10:24 am

Great that you managed to get the Play/Stop work as you wanted.

The "{nextpress:2}" is written out of context as it has no function; it is treated as a comment by the plugin. I suggest that you remove it.

If you want to have the light control button to react on the daw state, you need to use a script like this:

[(noteon:1,94,127){@l_state:1}]
[(noteon:1,94,0){@l_state:0}]
[(press)(@l_state:0){@l_state:1}]
[(press)(@l_state:1){@l_state:0}]
[(@l_state:1){noteon:16,95,127}]
[(@l_state:0){noteoff:16,95,127}]

This script is reacting to the Mackie Control Play command, setting the local variable "l_state" to 1 when Play is activated and 0 when it is stopped. The (press) commands toggle the "l_state" variable
between 0 and 1. Finally, the (@l_state:x) commands send the light commands depending on the content of the "l_state" variable. IMPORTANT: for this script to work, the Script button must have the "Daw2Mackie" midi port as the input port and whatever port the light is responding to as the output port.

Personally, I would have preferred using Midi instead of key commands since Midi always works, while key commands require the daw window to be the active window on the screen to work. Had you used Midi to control the Play button, the script would have been able to control both the Play button and the light at the same time. If you right-click the Play button in Cakewalk, don't you get options to set remote control for the button?
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Fri Aug 04, 2023 7:24 pm

hi Admin -

Thanks for the excellent feedback and comment -- I see your point about using MIDI instead of HotKey - I of course discovered this when my Notepad++ document was foreground, and pressed the StreamDeck Play button thinking it would start Cakewalk, only to find there was now a text space character in my document!

The Cakewalk Play button doesn't have a right-click action to map remote control, but it does have what they term as MIDI Key bindings, so that in theory a MIDI note# can be mapped to a transport action, and, indeed, to lots of application-specific actions as well.

Based on the documentation:
If Cakewalk receives a specific Controller message, the app is ready to interpret the following MIDI note as a command, which can then be mapped to actions, including transport, like Play, Stop, Record etc.

Setup in Cakewalk:
Turn on MIDI "Shift" and assign an (unused) controller to signal the shift, ex: [3]
Assign a MIDI Key (note#) binding to signal a transport action, ex: 94 (A#6)

The StreamDeck MIDI Plugin multi-action button for PLAY would have these actions:
Control Change/NRPN: send command [3]  on MIDI port StreamDeck2Daw
Note On/OFF: send MIDI NoteOn 94 (A#6) on MIDI port StreamDeck2Daw

Additionally, StreamDeck would have Script actions to control the light, as your example showed, in-synch, based on state of the DAW (which would be super-Cool!).

So, I have a lot of setup and testing to do on this approach, but will let you know how it goes!

Regarding the script example, for all of the StreamDeck buttons that do transport control to be in-synch with DAW state, does that same script need to be in each of the buttons? (with appropriate on/off commands)

Thanks again!

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Admin Fri Aug 04, 2023 11:14 pm

Whenever you can, use the Mackie Control buttons, the Mackie Control protocol is predefined and bidirectional. With Mackie Control, the only thing you need to define is which function to control; the protocol handles the rest.

The only reason I can see to use the Script button instead of a Mackie Control button (on Stream Deck) is for the special light functionality; all other buttons should be OK, just being Mackie Control buttons.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Fri Nov 24, 2023 1:37 pm

hello again Trevliga Spel - 
Some great progress on getting the StreamDeck MIDI working as needed - firstly, have changed almost all of my actions to MIDI scripts or Mackie Control.
After some deeper dives into Cakewalks forums, the very helpful msmcleod pointed out that he has created an alternative Mackie control surface definition - it provides multiple instances of the device, allowing each to be configured in Cakewalk for different MIDI I/O - StreamDeck2DAW, DAW2StreamDeck, DAW2FaderPort8, FaderPort82DAW, DAW2RecLight, etc.

Once that was installed, having separate ports sorted out the conflicts that appear to have been the root of the problems I was having (besides brain fog ! )

So, thanks overall to yourself for providing suggestions on scripting.

Lastly, could you advise if there is a method in the StreamDeck MIDI plugin to "press" another different button in the Profile?
Or is that feature of StreamDeck itself?

Cheers and hope all is well - certainly happier now that my Transport woes appear resolved.

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Admin Fri Nov 24, 2023 2:49 pm

Great that you've got things working. cheers

The Stream Deck architecture does not allow a button to access other buttons, so it is impossible to "press" other buttons.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by freddie_tane Wed Nov 29, 2023 11:55 pm

Would having two buttons in a "Latch Group" provide similar functionality?

And, maybe a little off-topic, but is there an XML export facility either in the MIDI Plugin or in Streamdeck itself?  It is a little inconvenient to get a handle on what scripting, configs, ports, etc. are embedded in buttons ... just thinking an XML method would be cool ...

freddie_tane

Posts : 7
Join date : 2023-07-31
Location : Connecticut USA

https://www.tanetunes.com

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Admin Thu Nov 30, 2023 10:18 am

freddie_tane wrote:Would having two buttons in a "Latch Group" provide similar functionality?
I don't know exactly what functionality you want so I can't answer that.  Very Happy

freddie_tane wrote:
And, maybe a little off-topic, but is there an XML export facility either in the MIDI Plugin or in Streamdeck itself?  It is a little inconvenient to get a handle on what scripting, configs, ports, etc. are embedded in buttons ... just thinking an XML method would be cool ...
There are no XML export features in the plugin or in Stream Deck. The closest thing is the manifest files that define profiles and pages but that is json, and contains way too much information to serve your purpose.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Building a DAW Transport for Cakewalk Sonar Empty Re: Building a DAW Transport for Cakewalk Sonar

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum