I am exploring how I can run multiple instances of Cabbage (on Debian 64bit Linux) and have them accept input from the sound card or Ardour, and send their outputs to the sound card or Ardour.
In a previous thread: Multiple instances of Cabbage for the one user? (JACK2 with multiple users) I described how from a single Cabbage executable I used a hex editor to make multiple slightly different executables named Cabbage0 to Cabbage9. I altered the Cabbage source code (following Rory’s suggestion) to cause a second or subsequent instance of Cabbage for the one user to run normally, rather than close. I also used a hex editor to alter the name of the settings directory so each executable uses a different directory. This means I can run up to 10 instances of Cabbage at the same time, as the same user, and each one maintains its own settings.
I found the GUI “bless” hex editor to be unreliable, so I used “tweak” by Simon Tatham (author of PuTTY). I installed it as a Debian package. The man page is: https://www.chiark.greenend.org.uk/~sgtatham/tweak/manpage-3.02.html I ran it with the -f option to disable inserting and deleting bytes - so it can only change them: tweak -f Cabbage0 .
I would like a way of making the window title for each instance of Cabbage contain the number, since at present all such windows are titled just “Cabbage”. I didn’t find a way of doing this with a hex editor and I couldn’t find in the source where this was set. I tried a Debian program xdotool (in a package of the same name) http://manpages.ubuntu.com/manpages/precise/man1/xdotool.1.html Command = “http://manpages.ubuntu.com/manpages/precise/man1/xdotool.1.html” and it did not work.
Rory - can you point me to where in the code the name of the X window is set?
Within JACK, a single instance of Cabbage, the first one which is run, is identified by a single name for Readable Clients (outputs of Cabbage) and Writeable Clients (inputs of Cabbage): “JUCEJack”.
This is not controlled by the Cabbage code. It is set in JUCE: /JUCE-5.2.0/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp . The string “JUCEJack” is easy to find in the executable with a hex editor.
The second instance of Cabbage which registers with JACK must give JACK the same name, and JACK adds a suffix:" -01" to “JUCEJack” and uses this to identify the Readable and Writable ports of this second instance. This identifying name “JUCEJack-01” appears in the JACK Connections (as shown by qjackctl) and in Ardour when I select ports for inputting or outputting audio.
My plan was to carefully start the instances in order: Cabbage0, Cabbage1, Cabbage2 etc. so that these would have their ports identified in an orderly manner as JUCEJack, JUCEJack-01, JUCEJack02 etc. However, this plan is too fragile and the names do not mention “Cabbage”.
So I changed the string in these ten executables to “Cab0” to “Cab9”. These characters replace “JUCE”" and the following ‘J’ is replaced by a hex 00 to terminate the string.
Now, in qjackctl’s Connections, the readable and writable client ports ports are “out_1” to “out_39” and “in_1 to “in-39” both in sections named, for instance, Cab2”. (I am not sure why Cabbage’s JUCE library chooses 39 ports, but I guess it is related in some way to the RayDAT sound card having 32 + 2 + 2 audio ports.)
In the Ardour mixer strip, the input and output buttons (3 and 12 in http://manual.ardour.org/ardours-interface/audio-midi-mixer-strips/) now display, for instance “Cab2”. They do not display the number of the port, which would be helpful.