Topic: command line options

Is there a way to tell Pianoteq to use jackd or alsa (and its device) from the command line? The only options I can find is to drop all configuration.
When using Pianoteq headless it is kind of needed to have full control by command line or other than "gui" means. Since I think the other means are lacking I would welcome a real Pianoteq daemon which could be controlled by sending commands to a socket (network port or whatever).

Re: command line options

No there is no command line switch for that. You may try to edit the Pianoteq36.prefs files with a script , this is an xml file, search for the devicesetup tag.

Re: command line options

I thought about that option, but it is a clumsy way of doing things.

A script part for handling this could be:

DEVICE_JACKD='deviceType="JACK" audioOutputDeviceName="Auto-connect ON" audioDeviceRate="44100"'
DEVICE_ALSA='deviceType=\"ALSA\" audioOutputDeviceName=\"HD-Audio Generic (1)\" audioInputDeviceName=\"HD-Audio Generic (1)\" audioDeviceRate=\"44100\" audioDeviceBufferSize=\"1024\"'
MYDEVICE="$DEVICE_ALSA"

AWK_SET_AUDIO="sub(/[[:space:]]*DEVICESETUP.*/,\"$MYDEVICE/>\n  \")"
AWK_CLEAR_CRASH="sub(/VALUE name=\"crash_detect\" val=.+\/>/,\"VALUE name=\\\"crash_detect\\\" val=\\\"0\\\"/>\")"
awk "BEGIN {RS = \"<\"; FS=\"\n\";OFS=FS} {$AWK_SET_AUDIO;  $AWK_CLEAR_CRASH; ORS=RT; print } " ~/.config/Modartt/Pianoteq36.prefs

After every Pianoteq update the script has to be checked. A version change will lead to a different  the config name. Maybe device naming has changes or other an other DEVICESETUP part is introduced. There is more stuff which could breaks like the scanning for the xml entries (an improvement would be using a regex excluding escaped (\<) symbols).

There can be done a lot with scripting but it would be nice if the controlling part is separated from the gui and the burden of keeping it working would be shifted to the developers.