insert_groove
Render a drum DSL to MIDI and insert it onto a REAPER track in one call, applying humanized timing and velocity. Preview with dry_run before mutating the project.
Instructions
Render a drum DSL to MIDI and insert it on a track in ONE call — the engine (skills/drum-apparatus/) humanizes velocity, fatigue and timing at placement. Give the DSL EITHER inline as dsl_text OR as a file with dsl_path, never both. MUTATES the project (undo-block wrapped, one Ctrl/Cmd+Z reverts); supports dry_run. Refuses in ~0 s when the bridge heartbeat is dead, before generating anything. The rendered .mid is KEPT under rendered-midi/ — REAPER imports MIDI by reference on this build, so a deleted render leaves an empty take. Kit map: the DSL's own @map wins, then this map argument, then drum-config.json, then GM Standard. Track: named track, else drum-config.json's default, else REAPER's selected track. A bad DSL comes back as DSL_ERROR with the engine's own message — fix the DSL from it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| map | No | Drum-kit map name (see reaperd.py list-maps). The DSL's @map wins over this. | |
| seed | No | RNG seed for the humanizer; same seed + same DSL = same MIDI. | |
| track | No | Exact track name (case-insensitive). | |
| dry_run | No | Preview: return what would run without changing the project. | |
| dsl_path | No | Absolute path to a .dsl file. Mutually exclusive with dsl_text. | |
| dsl_text | No | The groove DSL inline. Mutually exclusive with dsl_path. | |
| position | No | Where to insert: a position object like {"type":"bar","bar":33} (see insert_midi_file) or a plain number of seconds. Default: the edit cursor. | |
| track_contains | No | Case-insensitive substring; errors if it matches more than one track. | |
| target_track_guid | No | Stable REAPER track GUID; preferred when available. | |
| use_selected_track | No | Target the currently selected track instead of naming one. |