Author Topic: Logic execution order  (Read 79 times)

Offline educampi

  • Newbie
  • *
  • Posts: 9
Logic execution order
« on: June 29, 2019, 08:38:04 PM »
Hello,
I'm trying to configure a few functions and having issues with that.
If I play step by step on the logic tab, it works fine.
If I select them all, and click play, or just try to use the hardware controller, then it doesn't work properly.
I guess it's not executing in sequential order.

I tried defining 'Last Action: OK' as condition but it seems it still not working. How should I do it?

The 2 examples I have are:

1) Restart Play. Which should be equivalent to pressing STOP and then PLAY.
Tried defining 2 actions:
Play Off
Play On

It seems it just stops but doesn't execute Play On.

2) Move a Loop selection. Basically moving the area that is being looped across the timeline.
In this case I have many actions
Go to Loop In
Move time to timeline
Move time to right or left (base on value of CC)
Select start time
Go to Loop Out
Move time to timeline
Move time to right or left (base on value of CC)
Select continue time
Command -> Set loop to selection.

I added and removed things to this logic, to try multiple things, but that's the current status.
It works if I do step by step, but doesn't otherwise, as if the 'move' time to right happens before the move to timeline, or similar, so there's an offset that messes things up.

Anyway, If anyone has more information, that would be great.
Apologies if the question is very basic, but it's the first time I'm trying to configure a controller.

Thanks!!

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1227
Re: Logic execution order
« Reply #1 on: June 30, 2019, 10:18:24 AM »
Cakewalk need some "time" between certain operations, it is not queuing commands. AZ Controller is a bit tricky to use in this case, it is not possible to "delay" inside one logical sequence since the control should be returned to Cakewalk in-between. Also most commands are not possible to call in "Feedback".

Stop/Start sequence can be done like (assuming the control is assigned to some MIDI):
Monitor (Timer, Once)
'Transport:Stop'  - Command 'Play/Pause' * (* means final)
Command  'Stop'
Reset monitor (this control Timer) , trigger during next cycle

In the feedback for this timer:
Send Control MIDI, Value1, loop
--------
How that works:
* Note that "Timer" (and other monitors) in the logic sequences is not executed directly
* If we are in stop, Play command is executed. It is final, so no other actions executed.
* If we are in play/rec, we first "Stop" and schedule the timer
* timer loop sends activating MIDI, so we are called again, this time in Stop
--------

With loop selection change that is way more tricky, you will need some Set to remember how far you can move and some Set for "State machine". The delay between operations should be more then "next cycle" (if I remember correctly, Cakewalk can glitch otherwise). I can make an example preset if you want.



Offline educampi

  • Newbie
  • *
  • Posts: 9
Re: Logic execution order
« Reply #2 on: July 07, 2019, 07:43:05 PM »
Thanks,
The first part worked fine.
I'm trying to understand timers and feedback now, to see If i can figure it out how to do the loop thingy.

I'll give it another try next week, and let you know if I still can't figure it out.

Thanks!

Offline educampi

  • Newbie
  • *
  • Posts: 9
Re: Logic execution order
« Reply #3 on: July 13, 2019, 09:32:47 PM »
Alright, I'm lost. /shrug

Would you please give it a try if you have a bit of free time?
The 'Moving the selection loop across the timeline' thing.

Thanks!

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1227
Re: Logic execution order
« Reply #4 on: Yesterday at 09:32:57 PM »
Yes, that is a bit complicated. An example is attached.

The explanation:
* assignable controls are MoveLeft and MoveRight. They set the direction for the movement and then call the procedure in _MoveLoop. They also check that we are not currently moving (in case you press the control too fast)
* _Jog simply move current time in required direction, I have separated it in case you want something more fancy
* _MoveLoop first stop transport. Moving current time will not work otherwise, corrupting the movement. Also stopping takes a bit more time then usual, so it has separate "Reset monitor" is longer period. In case we are not playing, that step is skipped (advancing the state).
Then one step is done, according to the current step. The timer is triggered, which advance the state (after check we are not done yet) and loop sends OSC message (to call _MoveLoop again, could be MIDI loop send).