1 ardour { ["type"] = "Snippet", name = "Track Properties" }
3 function factory () return function ()
4 --- iterate over all tracks
5 for t in Session:get_tracks():iter() do
6 -- t is-a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Track
8 -- operate one those with "Drum" in the name
9 if (t:name ():find ("Drum")) then
11 -- print the name, and number of audio in/out
12 -- see also http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:ChanCount
13 print (t:name (), "| Audio In:", t:n_inputs ():n_audio (), "Audio Out:", t:n_outputs ():n_audio ())
15 -- get the track's http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:PresentationInfo
16 pi = t:presentation_info_ptr ()
18 -- set the track's color to orange - hex RGBA
19 pi:set_color (0xff8800ff)
21 -- phase invert the 1st channel
22 t:phase_control():set_phase_invert (1, true)
24 -- solo the track -- and only the track,
25 -- not other tracks grouped with it.
26 t:solo_control():set_value (1, PBD.GroupControlDisposition.NoGroup)
29 t:mute_control():set_value (0, PBD.GroupControlDisposition.NoGroup)
31 -- add a track comment
32 t:set_comment ("This is a Drum Track", nil)
34 -- and set the fader to -7dB == 10 ^ (0.05 * -7)
35 t:gain_control():set_value (10 ^ (0.05 * -7), PBD.GroupControlDisposition.NoGroup)