Version 2 of Manipulating Jack/Ladspa Audio processing graphs from Bwise

Updated 2013-03-21 01:19:56 by theover

The objective here is to automatically create a usable tcl script like this:


exec bash -c export LADSPA_PATH=/usr/lib64/ladspa/

set cc 0

catch {
 exec jack-rack -c 2 -s innoi innoi -x [incr cc 20] -y $cc -w 584 -l 1170 &
 exec jack-rack -c 2 -s 4cdplay 4cdplay_pro -x [incr cc 20] -y $cc -w 584 -l 1170 &
 exec jack-rack -c 2 -s lowmidspea lowmidspea14 -x [incr cc 20] -y $cc -w 584 -l 1170 &
 exec jack-rack -c 2 -s compdrive compdrive -x [incr cc 20] -y $cc -w 584 -l 1170 &
 exec jack-rack -c 2 -s dellex dellex -x [incr cc 20] -y $cc -w 584 -l 1170 &
  after 500
 exec meterbridge -t dpm -r 0 -c 2 1 2  -n in &
  after 500
  catch "exec jack_connect system:capture_1 jack_rack_innoi:in_1"
  catch "exec jack_connect system:capture_2 jack_rack_innoi:in_2"
  catch "exec jack_connect system:capture_1 in:meter_1"
  catch "exec jack_connect system:capture_2 in:meter_2"
  catch "exec jack_connect jack_rack_innoi:out_1 jack_rack_4cdplay:in_1"
  catch "exec jack_connect jack_rack_innoi:out_2 jack_rack_4cdplay:in_2"

  catch "exec jack_connect jack_rack_dellex:out_1 system:playback_1"
  catch "exec jack_connect jack_rack_dellex:out_2 system:playback_2"

set u ./b

catch { 
after 1000
exec jack-rack -s del2 -c 2 del2 -x [incr cc 20] -y $cc -w 584 -l 1170 &
exec jack-rack -s del3 -c 2 del3 -x [incr cc 20] -y $cc -w 584 -l 1170 &
#gets stdin
catch { 
exec meterbridge -t dpm -n bridge -r 0  6 7 8 9 10 11 12 13 &
exec meterbridge -t dpm -r 0 -c 2 1 2 -n om &
exec meterbridge -t dpm -r 0 -c 2 1 2 -n om2 &
exec meterbridge -t dpm -r 0 -c 2 1 2 -n out &


  after 1500
  catch "exec jack_connect jack_rack_innoi:out_1 jack_rack_4cdplay:in_1 "
  catch "exec jack_connect jack_rack_innoi:out_2 jack_rack_4cdplay:in_2 "
  catch "exec jack_connect jack_rack_4cdplay:out_1 jack_rack_del2:in_1"
  catch "exec jack_connect jack_rack_4cdplay:out_2 jack_rack_del2:in_2"

  after 500
  catch "exec jack_connect jack_rack_del2:out_1 jack_rack_del3:in_1"
  catch "exec jack_connect jack_rack_del2:out_2 jack_rack_del3:in_2"

catch { 
exec jack-rack -c 2 -s aaa aaa_lim  -x [incr cc 20] -y $cc -w 584 -l 1170 &

catch { 
exec jack-rack -c 2 -s par par_tube  -x [incr cc 20] -y $cc -w 584 -l 1170 &
  after 1500

for {set i 6} {$i<=13} {incr i} {
  append o [exec jack-rack -c 2 -s $i Autom/b$i -x [incr cc 20] -y $cc -w 584 -l 1170 &] " "
  after 500
  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"
  after 500
  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"
  after 500

for {set i 6} {$i<=13} {incr i} {
  append o [exec jack-rack -c 2 -s df$i df$i -x [incr cc 20] -y $cc -w 584 -l 1170 &] " "
  after 500
  catch "exec jack_connect jack_rack_compdrive:out_1 jack_rack_df$i:in_1"
  catch "exec jack_connect jack_rack_compdrive:out_2 jack_rack_df$i:in_2"
  after 500
  catch "exec jack_connect jack_rack_df$i:out_1 jack_rack_$i:in_1"
  catch "exec jack_connect jack_rack_df$i:out_2 jack_rack_$i:in_2"

  after 500
for {set i 6} {$i<=14} {incr i} {
  after 400
  catch "exec jack_connect jack_rack_$i:out_1 bridge:meter_[expr $i-5]"
  catch "exec jack_connect jack_rack_$i:out_2 bridge:meter_[expr $i-5]"

  after 500
  catch "exec jack_connect jack_rack_del3:out_1 out:meter_1"
  catch "exec jack_connect jack_rack_del3:out_2 out:meter_2"
  catch "exec jack_connect jack_rack_par:out_1 om:meter_1"
  catch "exec jack_connect jack_rack_par:out_2 om:meter_2"
  catch "exec jack_connect jack_rack_par:out_1 out:meter_1"
  catch "exec jack_connect jack_rack_par:out_2 out:meter_2"

  after 500
  catch "exec jack_connect jack_rack_dellex:out_1 om2:meter_1"
  catch "exec jack_connect jack_rack_dellex:out_2 om2:meter_2"

catch { 
exec jamin -p -n jam -f ./harmo4.jam &
  after 500
  after 500

  catch "exec jack_connect jam:out_L jack_rack_aaa:in_1"
  catch "exec jack_connect jam:out_R jack_rack_aaa:in_2"

  after 500
set u ./b

catch { 
after 800
exec jack-rack -c 2 -s higpas higpasslow -x [incr cc 20] -y $cc -w 584 -l 1170 &
exec jack-rack -c 2 -s higcom higexp -x [incr cc 20] -y $cc -w 584 -l 1170 &
catch { 
exec meterbridge -t dpm -r 0 -c 2 1 2 -n hico1 &


  after 500
  catch "exec jack_connect jack_rack_4cdplay:out_1 jack_rack_lowmidspea:in_1 "
  catch "exec jack_connect jack_rack_4cdplay:out_2 jack_rack_lowmidspea:in_2 "
  catch "exec jack_connect jack_rack_lowmidspea:out_1 jack_rack_compdrive:in_1 "
  catch "exec jack_connect jack_rack_lowmidspea:out_2 jack_rack_compdrive:in_2 "
  catch "exec jack_connect jack_rack_4cdplay:out_1 jack_rack_higcom:in_1 "
  catch "exec jack_connect jack_rack_4cdplay:out_2 jack_rack_higcom:in_2 "
  catch "exec jack_connect jack_rack_higpas:out_1 out:meter_1 "
  catch "exec jack_connect jack_rack_higpas:out_2 out:meter_2 "
  catch "exec jack_connect jack_rack_higpas:out_1 hico1:meter_1 "
  catch "exec jack_connect jack_rack_higpas:out_2 hico1:meter_2 "

  append o [catch "exec jack_connect jack_rack_higcom:out_1 jam:in_L "]
  append o [catch "exec jack_connect jack_rack_higcom:out_2 jam:in_R "]
  append o [catch "exec jack_connect jack_rack_lowmidspea:out_1 jam:in_L "]
  append o [catch "exec jack_connect jack_rack_lowmidspea:out_2 jam:in_R "]
  append o [catch "exec jack_connect jam:out_L jack_rack_higpas:in_1 "]
  append o [catch "exec jack_connect jam:out_R jack_rack_higpas:in_2 "]

  append o [catch "exec jack_connect out:monitor_1 jack_rack_dellex:in_1 "]
  append o [catch "exec jack_connect out:monitor_2 jack_rack_dellex:in_2 "]
  after 501

puts $o

  after 1500

puts $o

from a BWise graph, so as to rearange audio signal paths for Linux machines (maybe Windows "Jack" and Mac Jack can work too), composed of multiple interconnected "jack-rack" processing blocks, with associated DSP definition files.

For me these tcl scripts (I'll make a shorter, explained version soon) make it possible to run a great audio processing chain to correct CD files and postproduce for instance "HDtracks" high quality tracks, without having to start up all the jack-rack programs+interface by hand. These scripts gets my I7 machine running these heavy graphs reliably in a few tens of seconds, bu now want to take parts of various types of processing, and make new graphs, so I adapt BWise a bit.

First we make "dummy" bwise blocks for each file in a diretory with the effect files we want to use:

   set downc 20
   foreach i [glob Jackrack/*] {
      newproc {} [file tail $i] i o 40 {} jack [expr 40 + 100 *($downc / 1000)] [expr 20 + ($downc % 1000) ]
      incr downc 66

Now we use bwise to select the blocks we use (for the moment) and connect them:

Now we can list the relevant connections:

 % netlistout jack
   {aaa_lim o b6 i} {compdrive o df6 i} {higexp o aaa_lim i} {higexp o higpasslow i} {lowmidspea14 o compdrive i} {lowmidspea14 o higexp i} {df6 o b6 i} {b6 o higpasslow i}

and construct tcl commands to start the jack programs:

 % foreach i [listunion [$mc find withtag selection0] [$mc find withtag bb]] {puts "exec jack-rack -s [set tm [block_name_fromid $i]] Jackrack/$tm"}
   exec jack-rack -s aaa_lim Jackrack/aaa_lim
   exec jack-rack -s b6 Jackrack/b6
   exec jack-rack -s compdrive Jackrack/compdrive
   exec jack-rack -s df6 Jackrack/df6
   exec jack-rack -s higexp Jackrack/higexp
   exec jack-rack -s higpasslow Jackrack/higpasslow
   exec jack-rack -s lowmidspea14 Jackrack/lowmidspea14