Create a MIDI clip in a slot
Goal: Add a new empty MIDI clip in a session slot from your extension command.
Time: ~15 minutes
Steps
- Choose a trigger that matches where you right-click — often On MIDI Track or On Clip Slot depending on your template.
- Choose the right clip-creation action: action:ClipSlot.createMidiClip (takes a ClipSlot input) or action:MidiTrack.createMidiClip (takes a MidiTrack input). If your trigger is On Clip Slot, the ClipSlot comes directly from the trigger's target output — no Song context node required. Song is only needed if you must traverse Song → tracks → ClipSlot/MidiTrack to reach the target.
- Wire Run from the trigger through create clip (or equivalent) actions.
- If you set clip name or length afterward, wire the new clip output from the create action into those setters.
- Wrap related changes in a Transaction if you want one undo for “new clip + name.”
- Set Extension name, Build & Run, then in Live right-click the track or slot your trigger expects.
- Confirm the new clip appears in the slot and opens in the piano roll when double-clicked.
Expected result
A new MIDI clip slot contains an empty (or named) clip ready for notes. Your command appears only on the menu scope you chose.
If something goes wrong
| Problem | What to do |
|---|---|
| Clip on wrong track | Match trigger scope to where you right-click; wire track from target when needed |
| No clip created | Check Run chain reaches the create action; verify the ClipSlot or MidiTrack input is wired to the action |
| Command on clip menu only | Creating clips on a track usually needs track or slot trigger, not On MIDI Clip on an existing clip |
| Build error — missing input on create action | Wire a ClipSlot (from trigger target or traversed via Song → tracks) or MidiTrack into the create action |
| Undo only removes name | Put create + rename inside one Transaction if you want single undo |