Selecting specific events via Project Logical Editor/Macro

I want to select specific events in an audio track but I’m not sure if there’s a way to do this.

For example, in a single track there 20 groups of 6 audio events back to back. I want to select 3 and 4 of each group.

I know logical editor very well but I can’t figure out a way to do this. Or even via macros.

Anyone have any ideas on how to achieve this if possible?

Hi,

Sorry, I’m not with Cubase, so I can’t try it.

If I understand you right, you have an Audio Part including 6 Audio Events and you want to select the 3rd and 4th Audio Event of every Audio Part. Am I right?

I’m afraid, this is not possible, because you cannot use a variable (to be able to count) in the PLE.

I’m also not sure, if the PLE can go the level down from the Parts to the Events.

First I would try to make a PLE:

  • If Container Type is Equal Event
  • Select

This will show us, if Cubase goes down into the Parts.

Actually, I’m not talking about parts. It’s just 3 events back to back in a single track. But several of those groups. Like this:

I want to select events 3 and 4 of each group all at once so I can use the command Create Markers from Selection (Current Settings) to create cycle markers for those selected events using the event’s name all at once. Otherwise I have to individually select each one which can be a huge pain if you have over 100 events in a single track. Then multiply that by many tracks.

You can create a macro with Navigate - Right, then Add Right, but once I’ve added the 4th event, the next command has to be Navigate - Right because I don’t want to add the 5th event to the selection, but that completely removes the previous selection. So that’s no good.

Hi,

There are no groups in the Audio Tracks, there are Events and Parts only. It’s important to know, which one do you mean, please?

Unless they’re taking about:

Hi,

From the screenshot it looks like an Audio Events, which are next to each other.

Then you can make a Macro, but Cubase will blindly just fire it without any control, what is really going on.

I’m not talking about actual Cubase groups using Edit > Group. I’m just talking about 6 events that I put back to back, then a space, then another 6 events back to back, then a space, then some more lol just visually grouped.

Let’s reset. Just forget that I said groups lol I have 100 audio events in a single track and I want to select every 4th and 5th audio event in that track. Can you think of any way to do that?

Hi,

The only way is to make a Macro.

  • Navigation Right
  • Navigation Right
  • Navigation Right
  • Navigation Right

The 4th event is selected.

  • Select Next

The 5th event is selected.

Right. I had started with that and that works for just the first 3rd and 4th event. Then for all the remaining events I can’t use this because what I’m trying to do is select every 3rd and 4th event simultaneously all the way through to the last of the 100 events.

But I suppose that just confirms that it’s not possible to select specific sequence of events in a track. I hope they add the ability to target specific numbers of events in a track with PLE.

Hi David, I too think this is not possible using PLEs, however, it is doable using the midi remote, IF I understood correctly what you want to achieve. But obviously, I wouldn’t recommend this approach, except of course if it is something often repeatable, and actually I’m really curious to know the use case.

Anyway, is it something like this you want to achieve?

2 Likes

Yes, that’s exactly what I’m trying to do with one small but important difference. I need to use the Project > Create Markers from Selected Events (with Current Settings).

The reason this is important is because I need to take the event name/description and attach it to the cycle marker. This command does that. I had created a macro that does it exactly the way you did it but there is one problem: When using “Create Markers from Selected Events (with Current Settings)” command, it selects the marker after renaming it, which causes the audio event and audio track to lose its selection and basically resets, so it can’t continue doing it for the remaining events. That’s why I’m trying to select all audio events in one fell swoop, so that then I can use Create Markers from Selected Events (with Current Settings) and it will rename all cycle markers appropriately simultaneously.

Now, to answer your question about use case, I’m a sample developer and I do everything in Nuendo except seamless loops. I’ve had to do that in Reaper. I hate Reaper so I’m just trying to figure out a way to do this efficiently in Nuendo. Anyways, what I’m trying to do is this:

I need to create seamless loops but Cubase/Nuendo doesn’t have “2nd Pass” export. So what I have to do in order to avoid pops is have 3 exact copies of the loop back to back and export the middle one. So I’m trying to create a PLE or macro that will select every 3rd and 4th event in that group of 6, create a single cycle marker covering those 2 events, then rename that cycle marker with the exact same name as event. Then I can export every cycle marker and it will be properly named.

Except I have to do this for hundreds of events in a single track. And because of the selection issue I mentioned above, the only way to achieve the cycle marker creation is if all events are selected at once.

Btw, how did you do that with the MIDI Remote? I didn’t know it was possible to create a macro in MIDI Remote.

m.c. wrote a custom MIDI Remote script in JS using the MIDI Remote API which was introduced in Cubase 12.

This was the macro I created which is pretty much the same thing you did except it dies after the first “Create Marker” because it selects the cycle marker.
Screenshot 2024-03-14 at 8.52.58 AM

Oh, it was a custom script. That’s why. I can’t script so that wasn’t really an option for me.

So my next question would be, via the script, is it possible to select events the way I’m describing above?

The Transport→Create Markers from Selected Events (with Current Settings) is from Nuendo, right? I don’t have Nuendo to give it a try. Perhaps later tonight (after the dentist :smiley: )

Till then, here’s a draft snippet, just to answer your question about whether MIDI Remote can create Macros. Not only it can, but we can also add some delays between commands, because it’s well known that sometimes Macros tend to fail because of the absence of such delays.

var midiremote_api = require('midiremote_api_v1')

var deviceDriver = midiremote_api.makeDeviceDriver('Test', 'Select 3-4 events from 6 then empty', 'Someone')


var midiInput = deviceDriver.mPorts.makeMidiInput("anInput")
var midiOutput = deviceDriver.mPorts.makeMidiOutput("anOutput")

var detectUnit=deviceDriver.makeDetectionUnit()
detectUnit.detectPortPair(midiInput,midiOutput)
    .expectInputNameEquals("an input port")
    .expectOutputNameEquals("an output port")


var surface = deviceDriver.mSurface

var btn=surface.makeButton(0,0,1,1)
btn.mSurfaceValue.mMidiBinding
    .setInputPort(midiInput)
    .bindToControlChange(0,24)

//First element of each, set to command category. Second element to command name. Third element to some delay added to perform accurately. This delay is measured in cycles of a custom variable trigger
var sequence=[
    ['Transport', 'Locate Next Event','0'],
    ['Transport', 'Locate Next Event','0'],
    ['Transport', 'Locate Next Event','0'],
    ['Navigate', 'Add Right','5'],
    ['Transport', 'Locators to Selection','5'],
    ['Transport', 'Insert Cycle Marker','5'],
    ['Transport', 'Locate Next Event','0'],
    ['Transport', 'Locate Next Event','0'],
    ['Transport', 'Locate Next Event','0'],
    ['Transport', 'Locate Next Event','0']
   
]

var sequenceRepeats=5 //Number of times to repeat the sequence



var customVars=[]
for(var i=0;i<sequence.length;i++){

    var customVar=surface.makeCustomValueVariable("customVar"+i)
    customVars.push(customVar)

}

var customTimer=surface.makeCustomValueVariable("customTimer")


var page=deviceDriver.mMapping.makePage("page")

var dummyStart=page.mCustom.makeHostValueVariable("dummyStart")

page.makeValueBinding(btn.mSurfaceValue,dummyStart).mOnValueChange=function(activeDevice,activeMapping,value,diff){
    
    if(value==1){

        page.mHostAccess.mTransport.mTimeDisplay.mPrimary.mTransportLocator.setTime(activeMapping,"-1")
    
        activeDevice.setState("counter",sequenceRepeats.toString())
        
        initTimer(activeDevice,0)
        
    }
    
}

for(var i=0;i<sequence.length;i++){
    
    var step=sequence[i]
    var commandCategory=step[0]
    var command=step[1]
    
    page.makeCommandBinding(customVars[i],commandCategory,command).mOnValueChange=function(activeDevice,activeMapping,value,diff){

        if(value==1){
    
            var i=this.i 
    
            customVars[i].setProcessValue(activeDevice,0)
    
            var newStepCount=i+1
    
            if(i==sequence.length-1){
            
                newStepCount=0
                var counter=parseInt(activeDevice.getState("counter"))
                counter--
            
                if (counter==0) {

                    return 
                
                }
                
                activeDevice.setState("counter",counter.toString())
            
            } 

            initTimer(activeDevice,newStepCount)
        
        }
    
    }.bind({i})

}


customTimer.mOnProcessValueChange=function(activeDevice,value,diff){

    if(value>0){
       
        value--
        customTimer.setProcessValue(activeDevice,value)
       
        return 

    }

    var customTimerAction=parseInt(activeDevice.getState("customTimerAction"))
    customVars[customTimerAction].setProcessValue(activeDevice,1)

}

function initTimer(activeDevice,customTimerAction){

    activeDevice.setState("customTimerAction",customTimerAction.toString())
    var timerSteps=parseInt(sequence[customTimerAction][2])
    customTimer.setProcessValue(activeDevice,timerSteps)

}

1 Like

Ahh, yeah sorry it is Nuendo. I posted in Cubase forum because Nuendo doesn’t have anything that Cubase doesn’t have when it comes to this kind of event selection I’m trying to achieve. That specific marker command is not in Cubase but selection part which is what I’m really after should be the same in both.

Man, I wish they would expand MIDI Remote to be able to do some of these things in the UI for people like me haha

Well, this is something really challenging, to not mention that in occasions as the one you describe in your post, would be almost impossible, I mean, without coding. On the positive side, if one has a script already setup for a controller, adding such snippets is not a really hard work, though not the easiest one of course, I’m nowhere near expecting musicians to turn into programmers, nor I find this cool. In the future, perhaps, more and more scripts will be available (mainly from manufacturers, and I do see some already scripting for their new devices) and then the community could offer such snippets to copy-paste in them, or even alter and share, making things easier for all us users :slight_smile: