Midi connection manager

Then I probably didnt see it. I was thinking that RtMidiIn and Out are connected to 28:0, which in that time is OP-1. What kind of information do you need to verify?
I can only say that I had added sucessfully PIsound / Rapsberry to the Virtual Midi Network.
Thanks, Im sorry If my information isnt accurate, trying to do my best.

hi, i would like to send the midi in to midi out of the pisound card, but i don’t see those port whith aconnect -l command; can some one help me? thanks

You should see Pisound’s MIDI ports listed in a way similar to this:

client 20: 'pisound' [type=kernel,card=1]
    0 'pisound MIDI PS-0Z7FE7V'
        Connecting To: 24:0, 129:0[real:0], 131:0, 28:0
        Connected From: 129:0, 131:1

In my experience, the most usual client number is 20:0, so you can try running aconnect 20:0 20:0 to forward incoming data directly to the output.

In amidiauto.conf, i have to write 20<->0 ?

I’m sorry, but still dont understand how the amidiauto.conf file as to be writen. I want to use the midi din5 output as a midi thru from the midi din5 input. Help!!

I meant you can execute aconnect 20:0 20:0 to make the direct connection.

You can put this in /etc/amidiauto.conf:

[allow]
* <-> *
pisound <-> pisound

Afterwards, restart amidiauto server for the changes to take effect:

sudo systemctl restart amidiauto

Running aconnect -l will then produce:

...
client 20: 'pisound' [type=kernel,card=1]
    0 'pisound MIDI PS-2RZAMPG'
        Connecting To: 20:0
        Connected From: 20:0
...
1 Like

Thank you very much for the help, i will try it as soon as possible!

Hi Gedrius,
I did your tips and it works like a charm! I realise now how easy was that, thank you for your patience!

1 Like

Thanks a lot for that super handy deamon. Works like a charm!

1 Like

hey there, after a couple of failing hours i registered here to hopefully get my problems out of the way.

i‘m trying to headless connect different usb gear but i have zero luck. i tried to connect it via amidiauto and the amidiauto.conf route, but nothing seems to work. its starts with aconnect -li where my devices have longer names. in my case i try to connect the squarp pyramid with the minilogue. the client names are already a bit confusing:

client 28: ‘Pyramid MIDI USB’
0 ‘Pyramid MIDI USB MIDI 1’

and for the minilogue:

client 20: ‘minilogue’
0 ‘minilogue MIDI 1’
1 ‘minilogue MIDI 2’

not sure which one is the right one. i guess i tried them all already in the amidiauto.conf:

[allow]
*<->*
Pyramid USB MIDI <-> minilogue

(and every other combination i can think of).

strangly, when i try to connect them via:
aconnect ”Pyramid“ ”minilogue:1”
it works just fine.

it feels like my config file is not recognized or something, i can literally write anything in it and nothing yields problems.

would anyone be so kind and enlighten me? tried pretty much everything from this thread :frowning:

You have to restart the amdiiauto service every time you change the config - it doesn’t autodetect changes. You can restart it by running:

sudo systemctl restart amidiauto

Also, it may output something useful in its log, you can see it by running:

sudo journalctl -u amidiauto

Press ‘end’ button on the keyboard to go to the latest log lines.

Btw, a space on both sides of the <-> could be necessary. :slight_smile:

If I remember right, ALSA uses substrings to match for device names, the first one it finds that fits the substring is the one it uses, so this way, you may use partial names in the config.

thank you for your quick response - have to give away that you seem very patient and nice, seldom nowdays, thanks for that as well.

back to my still unsolved problem:

after changing the config i always restarted the service. the log does not spit out much:

patchbox systemd[1]: started ALSA MIDI autocomnect daemon.

i also have spaces between the hardware names.

another thing to mention: i only use the shell and no other software is started. maybe that is the problem? also, i‘m not really good at linux, googling my way around, but is ist somehow possible to change the path to the .conf or feed it to amidiauto when starting?

it seems like its not recognizing the conf (i assume that it should throw some errors in the log if i enter gibberish into the amidiauto.conf?)

one last thing to note, i write the outputs with my phone (got no internet connection on the pi) so theres a chance for typos in my code-posts.

thanks in advance for reading this!!

One more thing to check is the version of amidiauto - I think the one that is published in the Patchbox OS image is 1.00, while rule parsing appeared in 1.01. You can check the version using:

amidiauto -v

You can update it by running:

sudo apt-get update && sudo apt-get install amidiauto

sadly i am already on 1.01. got the latest patchbox three days ago. also tried to update via apt-get. is there maybe a way to export aconnects current connections to the amidiauto.conf?

The 1.01 version should print Reading rules in '...' in its log output.

You may try to manually run amidiauto to get the full output instead of going through journalctl, which buffers the logs and the latest lines may not be available immediately until there’s more output or some time has passed.

To run amidiauto manually, first stop and disable the service:

sudo systemctl disable amidiauto
sudo systemctl stop amidiauto

Then simply run amidiauto with no arguments, hit Ctrl+C to quit.

Btw, what is the output of which amidiauto?

so, i could resolve my problems. apt-get was not working, as it was using my ethernet connection which did not have internet access. by disabling eth0 i was able to use wlan0s internet connection. the strange thing was, that apt-get yielded that i’m already on the latest amidiauto (1.0.-1) so i was confused.

now everything seems to work fine except one thing:

i try to connect the minilogue over usb, problem is, minilogue has two midi devices in one client. the first one is the physical in and out ports of the machine, the second is for midi over usb.

client 20: 'minilogue' [type=Kernel,card=1]
    0 'minilogue MIDI 1'
        verbunden zu: 128:0[real:0], 28:0
        verbunden von: 128:0, 28:0
    1 'minilogue MIDI 2'
        verbunden zu: 128:0[real:0]
        verbunden von: 128:0

how do i connect it to the second client / device?
i tried almost anything in the amidiauto.conf, but was only able to connect to the first device / client.

is there a trick for that?

The current implementation of amidiauto works only with the very first port of a client. (this is to avoid making too many connections automatically, like Super Collider creates 4 or 8 ports, connecting a MIDI keyboard to all of them while having some synth patch would mean same note would cause 4 or 8 notes to be generated). I am considering expanding the configuration file to allow specifying the port ID as well, but can’t promise any estimate of when I’ll get to actually do it. Knowing that there’s interest in it will help give it a higher priority though. :slight_smile:

In the mean time, for your particular case, I think you could write a ‘udev’ rule that gets executed every time your minilogue gets attached to the system and you may make it run some desired aconnect command to make the connections. I haven’t done this myself, but I’m pretty sure you should be able to find some useful info on the internet.

The package manager keeps a database of what software is available and its versions, it gets updated when running sudo apt-get update, so if it wasn’t run or was unsuccessful due to no access to the internet or other reasons, then it would be using whatever information it had at the time when trying to install/update software.

1 Like

can’t thank you more, udev fixed the last missing bit in completing my setup! :slight_smile:

maybe interesting for others:

to create a udev rule you need to know some ids of your device. i used lsusb to find out idVendor and idProduct of the minilogue (Bus 001 Device 009: ID 0944:012c KORG, Inc.) where the first part of the 8 digit id is idVendor and the second part idProduct).

then i created the file /etc/udev/rules.d/50-minilogue.rules with the following contents:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0944", ATTR{idProduct}=="012c", RUN+="/usr/bin/aconnect Pyramid minilogue:1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0944", ATTR{idProduct}=="012c", RUN+="/usr/bin/aconnect minilogue:1 Pyramid"

and all the magic will be done when you connect the device.

once again, @Giedrius can’t thank you more for your patience. big ups!

3 Likes

Any news on amidiauto to control the default midi port?
Pd: Thank you so much for amidiauto, It´s a must have tool!!!

Do you mean the specifying of port index? If so, then no, not yet… :slight_smile: