8 commands for what goes in and out: play live MIDI through a virtual port, write notes as a region, import audio and MIDI files, export a MIDI region, bounce the song or a section, export every track, and measure a file.
Your agent sends each command to the one tool, named logic: {command: "fader", params: {strip: "Bass", db: -6, confirmed: true}}. The reply says verified: true only when Logic showed the expected state.
midiPlay live MIDI into Logic through a virtual port: notes, chords, controllers, program change, pitch bend, sequences, MMC.
midi {} lists the MIDI ports of this Mac and ours ('Nucleus Blast'). With confirmed: true: midi {action: 'note', pitch, velocity?: 100, duration_ms?: 500, channel?: 1} | {action: 'chord', pitches: [60, 64, 67], …} | {action: 'cc', controller, value} | {action: 'program', program} | {action: 'pitch_bend', value: -8192…8191} | {action: 'aftertouch', pressure, pitch?} | {action: 'sysex', bytes: [240, …, 247]} | {action: 'play', notes: 'pitch,offsetMs,durMs[,velocity[,channel]];…'} (played in real time, 2 minutes at most) | {action: 'mmc', mmc: 'play' | 'stop' | 'record' | 'pause' | 'rewind' | 'fast_forward' | 'locate', seconds?, start_hours?: 1} | {action: 'panic'} | {action: 'step', pitch | pitches: [60, 62, 64], velocity?} (step input: each pitch is written into the region open in the Piano Roll at the playhead, which moves one step; 'MIDI In (Step Record)' is turned on for the call; each note is read back). Logic receives the port like a keyboard: what is sent is played by the selected or armed software instrument track, can be heard, and is recorded when Logic records. Sound cannot be read back: verified stays false, except for MMC play and stop.
Reads freely. Each change it makes needs confirmed: true.
import_audioAdd an audio file to the arrangement, at the playhead on the selected track.
import_audio {path: absolute file (wav, aif, caf, mp3, m4a, flac), tempo?: 'import' | 'keep', confirmed: true}. No keystroke: the menu and the file panel are driven by Accessibility. The file must be reachable from the panel's sidebar (home, Desktop, Downloads, Documents, Music, Applications, a volume). Position the playhead (goto) and select the track (track_select) first. tempo answers ONLY the 'contains tempo information' dialog ('import' for a new song, 'keep' for a song already set up); any other dialog is returned, never answered. The new region is read back.
Reads freely. Each change it makes needs confirmed: true.
import_midiImport an existing MIDI file as new tracks and regions.
import_midi {path: absolute .mid file, bar?: 1, confirmed: true}. The file is copied to a transit folder that Logic's panel can reach, imported from there at the given bar, and the copy is removed. Logic's tempo question is declined (the project keeps its tempo). The new region is read back.
Reads freely. Each change it makes needs confirmed: true.
export_midiWrite ONE MIDI region of the project to a .mid file.
export_midi {region: 'Pad', index?: 0, path: '/Users/me/Desktop/pad.mid', confirmed: true}. The region is selected alone (exact name; index when several regions share it, 0 = highest on screen), exported with File > Export > Selection as MIDI File…, then the file is read back (it is a MIDI file, with notes) and moved to path. Nothing is ever overwritten. The answer gives notes, pitches and the path. The region selection is left on that region.
Reads freely. Each change it makes needs confirmed: true.
sequenceWrite notes as a MIDI region on a new track.
sequence {notes: 'pitch,offsetMs,durMs[,velocity[,channel]];…', bar?: 1, tempo?: project tempo, time_signature?: '4/4', confirmed: true}. Pitch 60 = middle C. Writes a MIDI file and imports it on a NEW track; the new region is read back. Bars are counted in time_signature (give it when the song is not in 4/4). Playback is stopped and the playhead is left at bar 1.
Reads freely. Each change it makes needs confirmed: true.
bounceBounce the project or a section to a file (WAV, AIFF, MP3, M4A).
Defaults: normalize 'On' and add_to_project true (the file is added to the project's audio files); give normalize: 'Off' | 'Overload Protection Only' or add_to_project: false to do otherwise. With add_to_project: true the save panel is driven to the destination folder and Logic writes the file there directly (no move afterwards), so the project's reference stays good. bounce {path: absolute file, format?: 'wave' | 'aiff' | 'mp3' | 'm4a', bit_depth?, sample_rate?, start_bar?, end_bar?, mode?: 'Offline' | 'Realtime', normalize?, tail?, add_to_project?: true, timeout_s?, confirmed: true}. Never overwrites. Default range = the cycle. Offline is silent; Realtime plays out loud. Waits for the file and reports its size and the settings Logic showed.
Reads freely. Each change it makes needs confirmed: true.
audio_analyze {path} is read-only and needs no Logic: format, sample rate, channels, duration, peak and RMS per channel, crest, integrated loudness (LUFS, ITU-R BS.1770), clipped samples, silence at both ends, silence ratio. spectrum: true adds the energy per band (sub … air), the spectral centroid, resonances and the strongest frequencies, plus a coarse character guess. eq: true adds cuts to try (frequency, gain, Q, confidence) to apply with eq_band. Checks, each reported as passed or not (a failed check makes the call fail): min_duration_s, expected_duration_s (± max_duration_drift_s, default 0.5), min_file_size_bytes, max_peak_db, max_silence_ratio (blocks under near_silence_db, default -60), expected_sample_rate, expected_channels, min_lufs, max_lufs, no_clipping: true. within: '/folder' refuses a file outside it; max_seconds (default 900) bounds what is read. Use it after bounce or export_tracks to check what was written.
Reads, or moves the view, the transport or the selection: no confirmation needed.
export_tracksExport every track as its own audio file.
export_tracks {folder: absolute destination folder, file_type?: 'WAVE' | 'AIFF', bit_depth?, range?, normalize?, bypass_effects?, automation?, tail?, timeout_s?, confirmed: true}. One file per track that has content, named after the track. Never overwrites. Two tracks with the same name give one file: rename them first. export_tracks {folder, dry_run: true} changes nothing and needs no confirmation: it lists the tracks with the file each would give, the files of the same name already in the folder, and what would spoil the export (solo, mute, empty tracks, shared names, an open dialog).
Reads freely. Each change it makes needs confirmed: true.