Skip to content

Send CC Automation

.cc(number) on a MIDI track gives a CC lane. Send it a value, a pattern or a signal with <<. The lane is in the MIDI reference.

let synth = MidiTrack("synth");
synth >> MidiOutput("synth");
synth.cc(7) << 100;

The value is sent once, and again whenever you change it.

Send a signal. Its value is sent 30 times a second, and only when it changes:

use "std/signals" { Sine };
let synth = MidiTrack("synth");
synth >> MidiOutput("synth");
synth << [C4 E4 G4 C5];
synth.cc(74) << Sine(0.5).range(0, 127);

A signal lane keeps sending with the transport stopped, like a knob on the synth would.

Send a pattern. Each value is sent on its step, like a note, and only while the transport runs:

synth.cc(1) << [0 64 127 64];

A controller’s CC is a signal too, so you can pass it on under another number — here the mod wheel drives the synth’s cutoff:

use "std/signals" { Cc };
let synth = MidiTrack("synth");
synth >> MidiOutput("synth");
synth.cc(74) << Cc(1).range(0, 127);

.set_send_rate(hz) changes how often a signal is sent. Higher is smoother, and uses more of the port’s bandwidth:

synth.cc(74).set_send_rate(60) << Cc(1).range(0, 127);

At most one message is sent per audio buffer, about 90 per second at common settings, so a much higher rate gains nothing.