Controlling Ardour with SC
From SuperCollider wiki
[edit] Controlling Ardour with SuperCollider via Open Sound Control (OSC)
Ardour is an open source digital audio workstation which can be freely downloaded from http://ardour.org/, although its lead developer strongly encourages donations. Many of its functions can be controlled via OSC.
(back to Code Pool)
The default port that Ardour uses is 3819.
// define NetAddr on local machine with Ardour's port number
a = NetAddr("127.0.0.1", 3819);
Mixer
// channel arguments start with 1,
// and depends on what order your channels have been ordered within ardour
a.sendMsg("/ardour/routes/mute", 1, 1); // mute: channel, status (0 = unmuted, 1 = muted)
a.sendMsg("/ardour/routes/solo", 1, 1); // solo: channel, status (0 = solo off, 1 = solo on)
a.sendMsg("/ardour/routes/recenable", 1, 1); // record enable on channel: channel, status
a.sendMsg("/ardour/routes/gainabs", 1, 1.0);
// mixer gain abs: channel, value (from 0.0 to 2.0, 1.0 is equal to 0.0 db)
a.sendMsg("/ardour/routes/gaindB", 1, 0.0); // mixer gain db: channel, value ( -inf to +6)
a.sendMsg("/ardour/rec_enable_toggle"); // global record enable toggle
a.sendMsg("/ardour/toggle_all_rec_enables");
// will record enable every channel
// (dispite the use of the word toggle, ths does not result in toggle behaviour)
Transport
a.sendMsg("/ardour/transport_play"); // transport play
a.sendMsg("/ardour/transport_stop"); // transport stop
a.sendMsg("/ardour/rewind"); // transport rewind
a.sendMsg("/ardour/ffwd"); // transport fast forward
a.sendMsg("/ardour/goto_start"); // transport go to start (if playing, will stop playback)
a.sendMsg("/ardour/goto_end"); // transport go to end marker (if playing, will stop playback)
a.sendMsg("/ardour/loop_toggle");
// toggle loop status: if not playing, playback will start, if playing, playback will stop
a.sendMsg("/ardour/add_marker"); // adds a marker at the current playback position
a.sendMsg("/ardour/prev_marker"); // jump to previous marker (will work during playback)
a.sendMsg("/ardour/next_marker"); // jump to next marker (will work during playback)
a.sendMsg("/ardour/set_transport_speed", 0.0);
// set speed of playback, from -8.0 to 8.0. negative values result in backwards playback.
// setting this value to 0.0 will cause playback to be stopped altogether.
// extreme values may result in very quiet and / or garbled audio.
Operation
a.sendMsg("/ardour/toggle_punch_in"); // toggles punch in status
a.sendMsg("/ardour/toggle_punch_out"); // toggles punch out status
a.sendMsg("/ardour/undo"); // undo the last operation
a.sendMsg("/ardour/redo"); // redo the last operation
a.sendMsg("/ardour/save_state"); // saves the current song to disk