2 ["type"] = "SessionInit",
3 name = "Live Band Recording Session",
5 This template helps create the tracks for a typical pop/rock band.
7 You will be prompted to assemble your session from a list of track types.
9 Each track comes with its pre-assigned grouping, routing, EQ and plugins.
13 function factory () return function ()
15 --prompt the user for the tracks they'd like to instantiate
16 local dialog_options = {
17 { type = "heading", title = "Select the tracks you'd like\n to add to your session: " },
19 { type = "checkbox", key = "LeadVox", default = false, title = "Lead Vocal" },
21 { type = "checkbox", key = "Bass", default = false, title = "Bass" },
23 { type = "checkbox", key = "Piano", default = false, title = "Piano" },
24 { type = "checkbox", key = "E. Piano", default = false, title = "E. Piano" },
25 { type = "checkbox", key = "Organ", default = false, title = "Organ" },
27 { type = "checkbox", key = "ElecGuitar", default = false, title = "Electric Guitar" },
28 { type = "checkbox", key = "SoloGuitar", default = false, title = "Guitar Solo" },
29 { type = "checkbox", key = "AcousticGuitar", default = false, title = "Acoustic Guitar" },
31 { type = "checkbox", key = "basicDrums", default = false, title = "Basic Drum Mics (Kick + Snare)" },
32 { type = "checkbox", key = "fullDrums", default = false, title = "Full Drum Mics (Kick, Snare, HiHat, 3 Toms)" },
33 { type = "checkbox", key = "overDrums", default = false, title = "Overkill Drum Mics (Kick (2x), Snare(2x), HiHat, 3 Toms)" },
35 { type = "checkbox", key = "Drum O-Heads (2 mono)", default = false, title = "Drum O-Heads (2 mono)" },
36 { type = "checkbox", key = "Drum O-Heads (Stereo)", default = false, title = "Drum O-Heads (Stereo)" },
38 { type = "checkbox", key = "Room (Mono)", default = false, title = "Room (Mono)" },
39 { type = "checkbox", key = "Room (Stereo)", default = false, title = "Room (Stereo)" },
41 { type = "checkbox", key = "BGV", default = false, title = "Background Vocals (3x)" },
43 local dlg = LuaDialog.Dialog ("Template Setup", dialog_options)
50 local channel_count = 0
52 function add_track (io, name)
53 local tl = Session:new_audio_track (io, io, nil, 1, name, ARDOUR.PresentationInfo.max_order, ARDOUR.TrackMode.Normal)
54 for track in tl:iter() do
55 table.insert (track_list, track)
56 channel_count = channel_count + io
60 -- for each selected item, create track(s), add plugins, etc
65 if rv['Room (Stereo)'] then
66 add_track (2, "Room (Stereo)")
72 -- determine the number of physical inputs
73 local e = Session:engine()
74 -- from the engine's POV readable/capture ports are "outputs"
75 local _, t = e:get_backend_ports ("", ARDOUR.DataType("audio"), ARDOUR.PortFlags.IsOutput | ARDOUR.PortFlags.IsPhysical, C.StringVector())
76 -- table 't' holds argument references. t[4] is the C.StringVector (return value)
77 local num_inputs = t[4]:size()
79 if num_inputs < channel_count then
80 -- warn the user if there are less physical inputs than created tracks
81 LuaDialog.Message ("Session Creation", "Check your routing :)", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run ()
85 -- otherwise record arm all created tracks
86 for _, t in ipairs (track_list) do
87 t:rec_enable_control ():set_value (1, PBD.GroupControlDisposition.NoGroup)
91 --fit all tracks on the screen
92 Editor:access_action("Editor","fit_all_tracks")
94 Session:save_state("");