Math functions, variables, message construction

Started by mgr, March 24, 2025, 05:49:30 PM

Previous topic - Next topic

mgr

One more thing I have noticed, I am sure you will have explanation.
When Transport Stop action is performed, Cakewalk sends out plenty of CC messages.
I believe it is done by Cakewalk, not the AZC, as it is being sent to all active MIDI outputs,
not just the one used by AZC.

And yet another question.
Transport Stop action not only stops playback, but also returns the play head to the beginning.
I would like to implement a dual stage Stop action, where pressing Stop button first time while Playing/Recording
would stop transport, but stay where it is in timeline (probably more Pause than Stop),
and only second press of Stop button would perform a full Stop Function and return to the beginning.
However, I don't know which function to use for Pause.
I have seen there is Play/Pause command, which I guess is a toggle between Play and Pause,
but I prefer not having a toggle. Can you please advice Function or Command for Pause?

Thank you very much

azslow3

Quote from: mgr on April 16, 2025, 01:55:07 PMOne more thing I have noticed, I am sure you will have explanation.
:)
QuoteWhen Transport Stop action is performed, Cakewalk sends out plenty of CC messages.
I believe it is done by Cakewalk, not the AZC, as it is being sent to all active MIDI outputs,
not just the one used by AZC.
It is for "real" MIDI devices. Controlled by "Project/MIDI/Zero controllers when play stops" option.
You can set "Block all channel messages" and "Block all SysEx messages" in AZ Controller Options.
From what I remember, in this case Cakewalk will realize that your device is just controller and will not send anything there (even when enabled in Cakewalk preferences)

QuoteTransport Stop action not only stops playback, but also returns the play head to the beginning.
I would like to implement a dual stage Stop action, where pressing Stop button first time while Playing/Recording
would stop transport, but stay where it is in timeline (probably more Pause than Stop),
and only second press of Stop button would perform a full Stop Function and return to the beginning.
However, I don't know which function to use for Pause.
I have seen there is Play/Pause command, which I guess is a toggle between Play and Pause,
but I prefer not having a toggle. Can you please advice Function or Command for Pause?
There are several related commands (easier to search in Cakewalk keyboard bindings, since there you can really search...). Some are affected by options like "On Stop, rewind to Now marker". For fine control you can use "Function/Transport" Action.

Do decide what to do in particular situation, use "Transport" and "Pause" Action Conditions for required Actions. F.e:
* 'Pause:On' - Function/Transport/Play OFF
* 'Pause:On' - Command 'RTZ'
* 'Transport:Play' - Function/Transport/Pause
Will pause when playing/recording and stop with rewind when paused.

Note Cakewalk reports some combinations of transport and pause not intuitive way (that can be version dependent).

mgr

Thank you very much, will try those.

One problem is, that the DM24 sends out combination of Stop and Play MMC commands when I press Play. I have no idea why it does that, but it effectively means I have to somehow filter out the Stop part of the Stop/Play message combination, but I do not know what is the most effective way to do that, given that I also need to implement isolated Stop messages.

I need to wait for a (very) short time after every Stop message to see if Play message arrives, and if it does, treat it as Play, otherwise treat it as Stop.

So one idea is:

1. Stop message arrives, I set a WaitingForPlay state to Yes, and start a short ontime timer, but perform no Action.
2. Play message arrives, I set a WaitingForPlay state to No, and perform Play Action
3. In Timer feedback for Stop, if WaitingForPlay is Yes, I perform Stop Action, otherwise I do nothing

Would that work?

azslow3

During 3, you can't Stop from timer directly. That is the case when you need to "send loop" something (I propose OSC '/stop' with value 1) and define "real" stop Control assigned to this OSC.

mgr

Quote from: azslow3 on April 16, 2025, 03:22:48 PMDuring 3, you can't Stop from timer directly. That is the case when you need to "send loop" something (I propose OSC '/stop' with value 1) and define "real" stop Control assigned to this OSC.

I suspected that, OK, so I will loop then, got it.

mgr

OK, so everything seems to work as intended, including dual-stage Stop button (Pause on first press, Return to Landmarks on second press).
So 32 tracks are covered.

Things to do next:

Implement SOLO, meaning using the MUTE buttons for SOLO function. DM24 has a switch for this,
but it does not send any MIDI, and neither are the MUTE buttons in SOLO mode,
so I have to come up with something to switch between MUTE and SOLO.
There are at least two buttons that send SysEx that I have no use for yet, so I will probably use one of those as a SOLO/MUTE switch.

Also, it would be nice to be able to control even more channels with some sort of bank switching. I could use the other unused SysEx button to switch the banks, but I need to understand how to do this in AZ Controller. I am sure you have some bank switching functionality there. :-)

azslow3

For switch, toggle some State, f.e. "SoloMode" "Solo"/"Mute". Then you need to duplicate "Strip" Actions in the corresponding controls, change one to Mute and add "SoloMode:xxx" conditions to both.

For banks. Current setup is WAI based. You can move by mouse or call "Strip" Action to selected desired new first strip (f.e. WAI + 16) followed by "WAI" Action to set new WAI region.

mgr

Thank you very much.

I will also have to make the lights on DM24 buttons reflect the bank switch.
For WAI shift I need to query the state (REC, Mute, Fader, Pan) of the newly selected channels and update the DM24 to reflect that.

For the Mute/Solo switch, I will need to query the Solo state of every channel and send that to DM24's Mute buttons when I switch from Mute to Solo, and query Mute states when switching back to Mute.


azslow3

When lights are as desired for current channels, they should be ok after WAI is moved.
As I have written before, well made preset for AZController  does that automatically. When you move controller channels or change controlled parameter, corresponding Monitors will re-trigger and send feedback.

mgr

#39
I have another question.
DM24 can store up to 10 timecode location points and send MMC LOCATE commands when I press DIRECT button and a number (0 to 9).

If I understand it correctly, AZC does not implement GOTO command that would set cursor to some absolute time.

So I guess I would need to use mouse to set location points (markers) in Cakewalk, and manually set the 10 location points on DM24 to some well known timecode values, and use those to move to Cakewalk location points.
This can be done once and will be remembered by the console after restart.

For example, I could set the timecode presets 0-9 like this:

0 - 00:00:00:00 - go to to marker 0
1 - 00:00:00:01 - go to to marker 1
2 - 00:00:00:02 - go to to marker 2
3 - 00:00:00:03 - go to to marker 3
4 - 00:00:00:04 - go to to marker 4
5 - 00:00:00:05 - go to to marker 5
6 - 00:00:00:06 - go to to marker 6
7 - 00:00:00:07 - go to to marker 7
8 - 00:00:00:08 - go to to marker 8
9 - 00:00:00:09 - go to to marker 9

EDIT: I have already implemented it like this, it works fine and makes sense. I just had to change the timecode values as the DM24 does not send frames, so I used second to number the markers.

azslow3

You have considered right direction. I had discussions before about a possibility to use absolute time, but use cases are questionable. Markers are project independent.