Enabling Logic actions before a project is loaded

Started by norfolkmastering, October 24, 2025, 03:33:16 PM

Previous topic - Next topic

norfolkmastering

Hi Alexey

I have a few Logic actions in AZ which I want to trigger before a project is loaded.
The MIDI to trigger these actions would come from my PIC.

Is there any way to configure AZ Controller to make this possible?

Regards
Robert

azslow3

Hi Robert,

from what I remember, AZ Controller by itself is "working" even when project is not loaded.
But it can do almost nothing in Sonar.

You can execute something on project load/unload. For that:
* create Software Set "Project" with "Unloaded" (default) and "Loaded".
* create Monitor State "Context", Priority 0, with Feedback:
  "Context:NoProject" - Set State "Project" -> "Not loaded", "set engine state" , "final"
  Set State "Project" -> "Loaded"
* create Monitor State "Project", Priority 1, with Feedback:
  "Project:Loaded" - <do what you want on load>
  "Project:Unloaded" - <do what you want on unload>

Extra "Project" is required because Context switch to Track/Console/Plug-in/NoProject and so will be triggered not only on load/unload.

Let say AZ Controller get something from PIC when there is no project.(I assume Sonar deliver, but I have not tested that for a while...). You can set some State, for example
Set State "SendOnLoad" -> "Yes"
Then in already described scenario, in "Project" Monitor, you
"Project:Loaded", "SendOnLoad:Yes" - <do what you want>
"Project:Loaded" - Set State "SendOnLoad" -> "No", "set engine state"

Using that approach you can do something next time some project is loaded based on MIDI fro Pic.


Alexey.

norfolkmastering

Hi Alexey
Thank you for the advice.  I will check out your suggested scheme and report back.

I have a related question please:
When Sonar loads a project, there is a 'dump' of all the current control values from AZ to the allocated MIDI output port.

I have tried using Software Sets to block some or all of this 'dump' but I do not properly understand what is happening.

As an example:
I set up a Software set called 'allowfeedback' with two states 'YES' and 'NO'.
I set the default state to 'NO'

I use this Software State as an Action condition on those Feedback Actions I want to block (in my case I am blocking MIDI CC outputs and some SysEx messages)

What I am finding is that these Feedback Actions are blocked but then released as soon as I change the state to 'YES'. (which I have to do at some time in order to have a functional system!)

What I need is to find a way not just to delay the output of this 'dump' but to 'delete' it so it does not appear when I change the state to 'Yes'

Is there a way to make this possible?

Best regards
Robert

azslow3

Hi Robert,

It is just a guess, but it seems like you conditioning "Monitor" Action itself. Block in the Feedback of it instead, f.e. insert first Action in the Feedback section
"Allosfeedback:No" Undefined, final

When you condition Monitor itself, it keeps old value. And when you "unlock" it, it compare current situation with what it had and so triggered. You should let it trigger, but void what it does.

When a project is loaded, many things "appear" (f.e. "Track 1"), so almost all monitors of Sonar parameters are triggered.

Action condition for Monitors make sense, but in different situation. Let say you don't know PIC is connected. You can condition all Monitors which send something to it with "PIC:Online". When you know it is connected you set "Pic:Online" and Monitors will trigger.
Note Conditions for Monitors have "don't monitor till" meaning, not "delay" (they don't remember they wanted trigger).

Alexey.

norfolkmastering

Hi Alexey

Thanks very much for your further advice and suggestions.

In my test project I created a Software State 'allow' with 'YES' and 'NO (default)' states.
Then I added an additional (first in the action list) feedback action 'allow NO' - Undefined - final, to each of the hardware controls.

So now when Sonar is loaded, or a project is loaded, there are no feedback outputs for controls I have set this way.  Even when I then change to 'allow YES', there is no memory of the feedback actions.  This is exactly what I needed to achieve and will hugely simplify my PIC coding.

It also allows me to deal with the circumstance where Sonar track slot positions are changed.  My present scheme to deal with this is hugely complicated.

When you get time, could I ask you to have a look at why AZ Controller is not able to process control inputs before a Sonar project is loaded.  If it is a restriction in the Cakewalk API then I'll speak to Mark about it and see if it can be changed.

Best regards
Robert

azslow3

Hi Robert,

I have just checked in Sonar 25.09, Sonar doesn't send MIDI to AZ Controller when Project is not loaded...
So ask Mark what he think about that.

Alexey.

norfolkmastering

Hi Alexey
Thanks for information.
I'll contact Mark.
Regards
Robert

norfolkmastering

Hi Alexey

I got a reply back from Mark as follows:

'There's nothing stopping the control surface DLL sending MIDI out before a project is loaded. It'll be down to AZController to do this.

The Mackie Control for example sends/receives sysex if handshake is not disabled. This is sent when the MackieControl.dll is first opened when Sonar first starts up.'

I am not having any problems getting AZ Controller to output MIDI feedback message when Sonar is loaded but before a project is loaded.  The issue is that AZ Controller does not seem to receive any MIDI messages until a project is loaded.

Mark is indicating that Mackie Control is both sending and receiving MIDI, providing handshake is not disabled.

Let me know if this helps at all or whether I should go back to Mark with further questions.

Best regards
Robert

azslow3

Hi Robert,

I can't check Mackie Control now, but AZ Controller's MIDI processing (MidiInShortMsg callback) in not called till a project is loaded, at least in Sonar X2.

Cakewalk "ACT MIDI Controller" is also not receiving MIDI (can't "Learn...") till there is a project. Again, I have checked in X2 only.

Note that messages are "accumulated" by Sonar and delivered once project is loaded.

It can happened Sonar sends messages from plug-in to device. In that case Mackie device will "think" it is connected, even when what it sends is not really delivered. The only visible appearance in Mackie plug-in it has received handshake reply is the status "Connected". Does Mark really see that? I mean why he is sure there is bi-directional communication?

Alexey.

norfolkmastering

Thanks Alexey
I'll go back to Mark with your update and see what he says.
Regards
Robert

azslow3

I have just checked with the latest Sonar. When there is no project:
* MIDI sending from Surface plug-ins is works
* MIDI receiving is NOT working, at least not in "Cakewalk ACT MIDI Controller"

norfolkmastering

Hi Alexey
I got another replay from Mark.

'It seems Alexey is correct. MIDI output messages are sent immediately, but incoming MIDI messages aren't processed until a project is loaded.

This may not be an issue in practice with Sonar: If you have the start screen set to show on startup, there's a hidden project open in the background which is used for previewing projects.

It might be worth Alexey testing with the free version of the latest Sonar, as the start up sequence has changed since X2 (which is now over 13 years old).'

So I tried setting the 'start screen' to show when Sonar is loaded and it does seem to switch on the incoming MIDI messages to AZ Controller, which is good.  I have asked Mark if incoming MIDI can be switched on by default when Sonar is loaded.  I do not like pop up 'splash' screens!

I have done about 50% of the work to update my AZ profiles based on the advice you have given me over the last week.  The results are very encouraging so far.  Much better control of MIDI message flow to and from AZ and my PICs.

I'll let you know how it works out when I've completed the updates.

Best regards
Robert