Possible to access soundcard's Thru / Phono switches from MidiScript?

Hi Everyone,
I am currently spending some time to learn basic midi scripting.
I was wondering if it is possible to access the soundcard phono/thru hardware switches (of my Traktor Scratch Audio6) directly from the midi-script or via a Mixxx Command (e.g. for a local controller mapping version for individual use).

I am currently have a usable workaround by running a shell script in linux before I start mixxx. and with aseqdump -p ‘myController’ in combination with “xdotool exec amixer” I can change the hardware THRU and PHONO from the same Midi controller I use for other things, but it’s a bit ‘hacky’.

I was just wondering if I could trigger something like this directly from my controller mapping out of Mixxx instead?

Thank you! :slight_smile:

This isn’t possible, but you can toggle Mixxx’s vinyl passthrough switch from a controller.

Thanks Be0,

But using the Software ‘thru’ would mean converting analog vinyl audio to digital and back to analog.

Yes, so it adds some latency compared to the hardware switches.

Did I get your trick right ?

  • you use aseqdump to intercept a midi message from your script
  • you use xdotool to simulate user input to amixer tool

Did you check the output of ‘amixer controls’ ? you might be able to figure out an ‘amixer cset…’ command to get rid of needing xdotool.

If you want a cleaner solution, you could develop a python script (or other language) which would implement a virtual MIDI controller, and run relevant amixer commands in response to MIDI controls that your mixxx script would send to that virtual controller.

have a look at alsaaudio python module : https://askubuntu.com/questions/689521/control-volume-using-python-script
and MIDO for the virtual port part https://mido.readthedocs.io/en/latest/intro.html

1 Like

Unfortunately there is no good way for different controller scripts to communicate. We hope to overcome this limitation with the new controller system.

1 Like

It is not clear for me, do you need to toggle the setting back and forth several times during use, or to set it on one mode at startup, for the whole session ?

Thank you @Be0 and @jaymanu! I really appreciate your input and good tips. My current setup works and I just run a linux shell script before starting Mixxx, I was just wondering if there is a slicker solution.

Yes, I am going forth and back between analog vinyls and Mixx (.flac/mp3).

Cheers! :slight_smile: