Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Clip Tools

Create, trigger, and edit clips and MIDI notes.

Firing Clips

fire_clip

Start playing a clip.

ParameterTypeDescription
track_indexintegerTrack containing the clip
clip_indexintegerClip slot index

stop_clip

Stop a playing clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip slot index

fire_clip_slot

Fire a clip slot (works even if empty).

Creating Clips

create_clip

Create an empty MIDI clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip slot index
lengthfloatLength in beats (default: 4.0)

Example:

create_clip(track_index: 0, clip_index: 0, length: 8.0)

duplicate_clip

Duplicate a clip to another slot.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerSource clip
target_clip_indexintegerDestination slot

delete_clip

Delete a clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip to delete

Clip Info

list_clips

Get all clips on a track.

ParameterTypeDescription
track_indexintegerTrack index

get_clip_name / set_clip_name

Get or set clip name.

get_clip_length

Get clip length in beats.

get_clip_color / set_clip_color

Get or set clip color.

MIDI Notes

add_midi_notes

Add MIDI notes to a clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip index
notesarrayArray of note objects

Each note object:

{
  "pitch": 60,       // MIDI note (0-127, 60 = C4)
  "start": 0.0,      // Start time in beats
  "duration": 1.0,   // Duration in beats
  "velocity": 100,   // Velocity (1-127)
  "mute": false      // Optional
}

Example: Add a C major chord

add_midi_notes(
  track_index: 0,
  clip_index: 0,
  notes: [
    { pitch: 60, start: 0, duration: 4, velocity: 100 },  // C
    { pitch: 64, start: 0, duration: 4, velocity: 100 },  // E
    { pitch: 67, start: 0, duration: 4, velocity: 100 }   // G
  ]
)

get_midi_notes

Get all MIDI notes in a clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip index

remove_midi_notes

Remove notes from a clip.

ParameterTypeDescription
track_indexintegerTrack index
clip_indexintegerClip index
startfloat?Start beat (optional filter)
endfloat?End beat (optional filter)
pitch_mininteger?Min pitch (optional filter)
pitch_maxinteger?Max pitch (optional filter)

replace_midi_notes

Replace all notes in a clip.

Loop Settings

get_clip_looping / set_clip_looping

Get or set whether clip loops.

get_clip_loop_start / set_clip_loop_start

Get or set loop start point.

get_clip_loop_end / set_clip_loop_end

Get or set loop end point.

Common Workflows

Create a Simple Melody

1. create_clip(0, 0, length: 4)
2. add_midi_notes(0, 0, [
     { pitch: 60, start: 0, duration: 0.5, velocity: 100 },
     { pitch: 62, start: 0.5, duration: 0.5, velocity: 100 },
     { pitch: 64, start: 1, duration: 0.5, velocity: 100 },
     { pitch: 65, start: 1.5, duration: 0.5, velocity: 100 },
     { pitch: 67, start: 2, duration: 2, velocity: 100 }
   ])
3. fire_clip(0, 0)

MIDI Note Reference

NoteMIDINoteMIDI
C348C460
D350D462
E352E464
F353F465
G355G467
A357A469
B359B471