Macros do not execute correctly

I’ve created a macro that trims all controller data outside of a part, using it sometimes does what it’s supposed to, sometimes it deletes all controller data. This timing issue with macros has been there since at least 2015 and Cubase 8, judging by when other people have reported the same kind of issues with macros.

How to reproduce:

  1. Create two logical presets as follows:

‘Delete controller data before cursor’
(Type Is - Equal - Controller) - And
(Position - Before Cursor - PPQ)
Leave ‘Action Target’ empty
Function - Delete

‘Delete controller data after cursor’
(Type Is - Equal - Controller) - And
(Position - Beyond Cursor - PPQ)
Leave ‘Action Target’ empty
Function - Delete

  1. Create a new macro ‘Trim Controller Data’ that consists of the following commands in order:
  • Transport - Locate Selection Start
  • Process Logical Preset - Delete controller data before cursor
  • Transport - Locate Selection End
  • Process Logical Preset - Delete controller data after cursor
  1. Create an instrument or midi track
  2. Draw a part on the track
  3. Add controller data to the part that exceeds the start and end of the part
  4. Deselect any possible events inside the part
  5. Use the ‘Trim Controller Data’ macro either by Edit->Macros->Trim Controller Data or via a key bind
    → Result: sometimes the controller data is correctly deleted just outside the part, sometimes partly from inside the part as well, sometimes all controller data is deleted

Cubase 11.0.20 Build 371
Windows 10 Pro 10.0.18363 Build 18363

Yeah, you’re right. Sounds like the last step of the macro is happening before the cursor moves to the end of the selection. I think a major refresh of the L.E. and the macro system will be needed for this to be fixed.

But in the meantime, have you tried separating the macro in two?

Or, what sometimes works is adding some do-nothing commands to the macro, to slow it down.

Finally, I did not test this, but something like this should work also, with only that midi part open in the editor:

Select the midi part, open it in the editor and then:
Locators to selection
Select Controllers inside cycle
Invert Selection

I managed to get it to work more reliably by adding a ‘Panel’ command between the transport and PLP commands. The opening and closing of the transport panel slows down the execution of the controller data deletion command enough so that the macro actually manages to do what it’s supposed to. But the fact that one has to resolve the issue with this kind of a kludge is beyond comprehension. Since the first reports of the macro execution issues on this forum date back to at least Cubase 8 and 2015 certainly gives a pretty clear picture about how much Steinberg cares about fixing bugs.

This doesn’t say anything about whether the company cares or doesn’t care. Cubase is a vast program, and a fix for this involves making changes that require other changes, which subsequently require yet other changes, etc., etc., etc.

This has been reported to Steinberg. Nonetheless, personally I view this as a trivial issue since there are several easy workarounds, as you have seen. It’s an annoyance, yes. But the workaround will keep workarounding. :slight_smile:

It is just not this particular issue that gives me that impression, it’s the fact that there is a vast number of issues that have been reported years ago and which still plague Cubase. It is this that drove me away from Cubase in the first place, and it seems things haven’t really changed since then.

While the issue might be trivial, the workarounds are not clean at all since surely no one knows whether the one I used works on all machines. And the workaround you suggested has a side effect of trashing the currently used cycle. I have not tried yours as a macro so I don’t know how well it behaves.