Create or duplicate tracks
Goal: Add a new MIDI or audio track, or duplicate an existing track, from Live’s right-click menu.
Time: ~15 minutes
Steps
- Open Create MIDI Track from Templates (or a duplicate-track template if available).
- Set trigger scope to On MIDI Track or On Audio Track — match where you will right-click in Live.
- Add Song context; wire Song into createMidiTrack (or the create/duplicate action your graph uses).
- Wire trigger Run → create action Run; chain set track name inside a Transaction if you rename in the same step.
- To duplicate instead of create empty, use the duplicate action from the palette and wire target track into it (template or PatchAI can suggest the layout).
- Set Extension name and Build & Run.
- In Live, right-click a track (or empty track area per your trigger) → Extensions → your command.
- Confirm the new or duplicated track appears with the expected name.
Expected result
Live shows a new track at the end of the list (or a duplicate next to your workflow’s SDK behavior). One undo removes the track if you wrapped creation in Transaction.
If something goes wrong
| Problem | What to do |
|---|---|
| Nothing added | Song must be wired; Run must reach the create/duplicate node |
| Wrong track type | Use createMidiTrack for MIDI; pick audio create nodes for audio tracks |
| Command on clip menu | Track creation needs a track trigger, not On MIDI Clip |
| Duplicate wrong track | Wire target from trigger into duplicate input |
| Async delay | Some create actions finish after a short wait — Patchwright handles this; rebuild if build warns about async |