Improved Working Macro for Midi Part Auto Trimming / Crop to Content Trimming

My process during composing is often:

  1. start the sequencer
  2. listen to what I’ve got so far, if anything
  3. play something against click
  4. hit retrospective record
    -or-
  5. hit record
  6. play something

In any case, I often have parts that are much longer/larger than what I’ve played or edited.
Fastest way to edit seems to be

  1. scissor or cut with alt-click the parts left and right, delete remaining bits
  2. in the key editor, move the start end end points individually.

either option requires at least 2-3 clicks before it’s done, and that is without deleting anything.

I would love a command that trims a part (either the left, right or both sides) on the following conditions:
-part start end end is trimmed to the nearest bar before midi data starts
-the same as above but for notes only (ignoring where midi cc’s start or end)
-to a user selection (i.e a range in the project page, or selected notes/data in the key editor

In addition, I would love for these to be used from the PLE in combination with Macro’s as well, so that we can program our own functionality
(i.e retrospective record>trim to nearest bar by notes)

Anyone with me?

Check out this macro: (invoke it from the project view)

It needs a couple commands to do more precisely what’s on your list.

Thanks for that! I’ll give it a go. Would still like to have a proper feature, but this might work for the time being:)

Anyone figured out a working macro/LE preset for this?

If you don’t know what it does - it simply crops a midi event at either end so that only the part with data remains. Very very useful, especially given Cubase’s habit of making these giant tails at either end of the midi region when the loop is active.

I’ve found a number of macros and logical editor presets kicking around on this forum, but they are all fairly old, and none of them seemed to work reliably with C10 (partly due to Cubase’s lack of a ‘Pause’ function in the macro editor it seems).

I know there could be an issue with CC data not causing it to trim properly, or the macro potentially ignoring CC data, but I’m not too bothered about this. If it’s just trimming the region to the start and end of any actual notes that’s fine for me, but if it can include CC data then even better.

It seems like this should be fairly easy for one of you Logical Editor/Macro masters?

Thanks in advance!

If you use the In-Place midi editor you can do that with the range tool.

Here’s one macro to do it, but it only works for a track with a single midi part on it. Maybe you can develop it. Select the track first.

looking at this 2 macros to quickly trim a midi part to it’s content >

first one is not working “as is” because “crop range” command only work with range tool… but it was close,

and this one working but only for single midi part on the track >

improving from those two ( thanks guys ! ), i got a working macro which work in project view.
you have to select the midi part you want to trim first of course


Editors - open key editor
Edit - select all
transport - locators to selection
file - close
tool - range selection tool
transport - go to left locator
edit - left selection side to cursor
transport - go to right locator
edit - right selection side to cursor
edit - crop range
// optional last line //
tool - object selection tool

working on cubase 10.5

In fact this is not really working : it will crop ALL tracks…
i didn’t find a way to make it work on only selected track
“crop range” command seems to cut all tracks, anyway.


I made a simpler also almost working one :
( you have to select the midi part you want to trim first )

Editors - open key editor
Edit - select all
transport - locators to selection
file - close
Edit - split loop

but the draw back is that you have to delete the empty parts yourself,

Any ideas to improve it ?