cw_write_midi_file
Writes a Standard MIDI File (format 1) from note and CC events so you can place notes and set track channel, initial volume, and pan for reliable SONAR imports.
Instructions
Generate a Standard MIDI File (format 1) from note and CC events. Each track needs a MIDI channel; CC7/CC10 written at tick 0 become that track's initial volume and pan when SONAR imports the file. This is the reliable way to set mixer values and place notes, because the in-app controls are read-only through automation on this build.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | ||
| path | Yes | Where to write the .mid | |
| tracks | Yes | ||
| overwrite | No | Replace an existing file. Without this, writing over a path that already exists is refused |