Template for session & tracks like script like Live Band


in continuation to another post [1] on templates, I would like to know what triggers the new template script “Live Band” [2] / [3] to be shown in both, the session template dialogue and the new track dialogue?

I feel this is not so well explained in the scripts, see [4].

Thanks in advance!

[1]: Load and Save MIDI-BUS Presets (Effects etc), https://community.ardour.org/node/15456
[2]: scripts/template_band.lua
[3]: https://github.com/Ardour/ardour/blob/master/scripts/template_band.lua
[3]: https://github.com/Ardour/ardour/blob/master/scripts/session_template_record.lua#L7

Have a look at [3] (template_band.lua) It defines two functions:

  1. function session_setup () return true end. This does allow the script to be used as “new Session template”. New sessions do not have any options. So no parameter are passed to the factory which creates the script.

2> function route_setup () return … end is for Track/Bus Templates. The script can use data from Track/Bus Dialog GUI such as name, group, insert-position as needed. The function needs to return keys for data that it can accept from the GUI. (“name”, “insert_at”, “group”, “strict_io”, “instrument”, “track_mode”, “channels”, “how_many”)

Thanks a lot.

Both functions are not documented in the manual: http://manual.ardour.org/lua-scripting/class_reference/
Is it worth submitting a PR to document above better in the manual and the commented code somewhere?
If yes, where would be the preferred location?

the manual is at https://github.com/Ardour/manual

The class-reference is documenting the Ardour provided classes and functions and automatically generated from ardour’s source (manual edits to that page will be lost).
There is currently little to no documenting the script interface, but some information is at http://manual.ardour.org/lua-scripting/ It would make sense to break down the main-page and add another subchapter for script-types.

In any case, mainly due to lack of time, writing example-scripts has become the preferred method of documentation.