Version 2 of Automatically starting up a chain of mastering effects with tcl

Updated 2010-10-19 21:59:03 by AMG

While trying out Linux mastering audio effect chains using jackrack and other programs, I had to start up 10 multiband compressor units and other programs and lay connections using the the Jack audio tools, without laying dozens of audio connections by hand, so I tried using a Tcl script to see if that would work and what the difficulties would be:

 set u onebandco

 for {set i 1} {$i<=10} {incr i} {
   after 2000
   exec jack-rack -c 2 -s $i /home/theo/Jackrack/${u}b$i &
 }

 catch {
 exec meterbridge -t dpm -n bridge -r 0  1 2 3 4 5 6 7 8 9 10  &
 exec jack-rack -c 2 -s aaa /home/theo/Jackrack/10bandinoutloudness2  &
 exec jack-rack -c 2 -s par /home/theo/Jackrack/10bandpar2  &
 }

 after 5000

 for {set i 1} {$i<=10} {incr i} {
   catch "exec jack_connect jack_rack_$i:out_1 bridge:meter_$i"
   catch "exec jack_connect jack_rack_$i:out_2 bridge:meter_$i"
 }

 for {set i 1} {$i<=10} {incr i} {
   catch "exec jack_connect jack_rack_$i:out_1 jack_rack_par:in_1"
   catch "exec jack_connect jack_rack_$i:out_2 jack_rack_par:in_2"
 }

 for {set i 1} {$i<=10} {incr i} {
   catch "exec jack_connect jack_rack_aaa:out_1 jack_rack_$i:in_1"
   catch "exec jack_connect jack_rack_aaa:out_2 jack_rack_$i:in_2"
 }

The above script works, but it doesn't check when the started programs are ready to lay connections to (the jack conenection part has have had to run) it simply delays an amount of time to make sure the processing programs and their UI's have started up with X windows.

An impression of the result:

http://82.171.148.176/Kurz/calforg135m.jpg

Clearly, before I could use BWise for similar and more tasks like this I need to check out jack-connections and communicate the results back to tcl (tk), maybe I'll try a hack to check the output of the programs (they report on stdout), and then make sure they continue to run after the startup script has terminated.