blokaslabs / amidiauto Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
I have at problem getting amidiauto to map devices with multiple midi ports.
It looks like it only maps the first port (port 0) of the device
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
Connecting To: 128:0
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 28: 'Virtual Raw MIDI 3-0' [type=kernel,card=3]
0 'VirMIDI 3-0 '
client 29: 'Virtual Raw MIDI 3-1' [type=kernel,card=3]
0 'VirMIDI 3-1 '
client 30: 'Virtual Raw MIDI 3-2' [type=kernel,card=3]
0 'VirMIDI 3-2 '
client 31: 'Virtual Raw MIDI 3-3' [type=kernel,card=3]
0 'VirMIDI 3-3 '
client 32: 'H9 Pedal' [type=kernel,card=4]
0 'H9 Pedal MIDI 1 '
Connecting To: 129:0
Connected From: 36:0, 129:0
client 36: 'ESI MIDIMATE eX' [type=kernel,card=5]
0 'ESI MIDIMATE eX MIDI 1'
Connecting To: 32:0, 40:0, 129:0
Connected From: 129:0
1 'ESI MIDIMATE eX MIDI 2'
client 40: 'GT-1000' [type=kernel,card=6]
0 'GT-1000 MIDI 1 '
Connecting To: 129:0
Connected From: 36:0, 129:0
1 'GT-1000 MIDI 2 '
client 129: 'Net Client' [type=user,pid=568]
0 'Network '
Connecting To: 32:0, 36:0, 40:0
Connected From: 32:0, 36:0, 40:0
My /etc/amidiauto.conf looks like this
[allow]
ESI MIDIMATE eX -> H9 Pedal
ESI MIDIMATE eX -> GT-1000
ESI MIDIMATE eX <-> Net Client
GT-1000 <-> Net Client
GT-1000 <-> midibri01blu
H9 Pedal <-> Net Client
Any way around this ?
Hi! any guess on the segmentation fault at runtime?
pi@raspberrypi:~/tmp/amidiauto-1.01 $ sudo apt install libasound2-dev
pi@raspberrypi:~/tmp/amidiauto-1.01 $ make
g++ -c -O3 amidiauto.cpp -o amidiauto.o
amidiauto.cpp: In function ‘int portsInit()’:
amidiauto.cpp:553:1: warning: no return statement in function returning non-void [-Wreturn-type]
553 | }
| ^
g++ amidiauto.o -o amidiauto -lasound
strip amidiauto
pi@raspberrypi:~/tmp/amidiauto-1.01 $ ./amidiauto
Reading '/etc/amidiauto.conf' failed! (-2)
Using default 'allow all' rule.
Allowing '*' -> '*'
Segmentation fault
System info,
pi@raspberrypi:~/tmp/amidiauto-1.01 $ uname -a
Linux raspberrypi 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l GNU/Linux
pi@raspberrypi:~/tmp/amidiauto-1.01 $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
In such a setup
$ amidi -l IO hw:0,0,0 Circuit Mono Station MIDI 1 IO hw:4,0,0 Circuit MIDI 1
any rule for "Circuit" would also match for "Circuit Mono Station" since partial matches are allowed in https://github.com/BlokasLabs/amidiauto/blob/master/amidiauto.cpp#L170
In order to stay downward compatible this should probably not change.
I suggest to add a syntax like
UMC204HD -> "Circuit"
to qualify for "exact match".
Hi
I am building a headless GM sound module with Fluidsynth on a Pi Zero W with Raspbian Buster. amidiauto looks like a good solution for connecting a keyboard to Fluidsynth when it is plugged in.
Unfortunately the program crashed, with what appeared to be stack corruption, and I was unable to track down where this was occuring. I eventually found that the program would work when built with -O0.
The following shows what happens when building with -03, -02, -01 (strange result) and -00 (where I disconnect and connect the keyboard to show it is working).
Adrian.
pi@raspberrypi:~ $ git clone https://github.com/BlokasLabs/amidiauto.git
Cloning into 'amidiauto'...
remote: Enumerating objects: 96, done.
remote: Total 96 (delta 0), reused 0 (delta 0), pack-reused 96
Unpacking objects: 100% (96/96), done.
pi@raspberrypi:~ $ cd amidiauto/
pi@raspberrypi:~/amidiauto $ CXXFLAGS=-O3 make
g++ -c -O3 amidiauto.cpp -o amidiauto.o
amidiauto.cpp: In function ‘int portsInit()’:
amidiauto.cpp:553:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
g++ amidiauto.o -o amidiauto -lasound
strip amidiauto
pi@raspberrypi:~/amidiauto $ ./amidiauto
Reading rules in '/etc/amidiauto.conf'...
Allowing '*' -> '*'
Connecting 20:0 to 128:0
Segmentation fault
pi@raspberrypi:~/amidiauto $ make clean
rm -f amidiauto *.o
rm -f amidiauto.deb
rm -f debian/usr/bin/amidiauto
gunzip `find . | grep gz` > /dev/null 2>&1 || true
pi@raspberrypi:~/amidiauto $ CXXFLAGS=-O2 make
g++ -c -O2 amidiauto.cpp -o amidiauto.o
amidiauto.cpp: In function ‘int portsInit()’:
amidiauto.cpp:553:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
g++ amidiauto.o -o amidiauto -lasound
strip amidiauto
pi@raspberrypi:~/amidiauto $ ./amidiauto
Reading rules in '/etc/amidiauto.conf'...
Allowing '*' -> '*'
Connecting 20:0 to 128:0
Segmentation fault
pi@raspberrypi:~/amidiauto $ make clean
rm -f amidiauto *.o
rm -f amidiauto.deb
rm -f debian/usr/bin/amidiauto
gunzip `find . | grep gz` > /dev/null 2>&1 || true
pi@raspberrypi:~/amidiauto $ CXXFLAGS=-O1 make
g++ -c -O1 amidiauto.cpp -o amidiauto.o
amidiauto.cpp: In function ‘int portsInit()’:
amidiauto.cpp:553:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
g++ amidiauto.o -o amidiauto -lasound
strip amidiauto
pi@raspberrypi:~/amidiauto $ ./amidiauto
Reading rules in '/etc/amidiauto.conf'...
Allowing '*' -> '*'
Connecting 20:0 to 128:0
Usage: amidiauto
That's all there is to it! :)
Version 1.01, Copyright (C) Blokas Labs https://blokas.io/
Segmentation fault
pi@raspberrypi:~/amidiauto $ make clean
rm -f amidiauto *.o
rm -f amidiauto.deb
rm -f debian/usr/bin/amidiauto
gunzip `find . | grep gz` > /dev/null 2>&1 || true
pi@raspberrypi:~/amidiauto $ make clean
rm -f amidiauto *.o
rm -f amidiauto.deb
rm -f debian/usr/bin/amidiauto
gunzip `find . | grep gz` > /dev/null 2>&1 || true
pi@raspberrypi:~/amidiauto $ CXXFLAGS=-O0 make
g++ -c -O0 amidiauto.cpp -o amidiauto.o
amidiauto.cpp: In function ‘int portsInit()’:
amidiauto.cpp:553:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
g++ amidiauto.o -o amidiauto -lasound
strip amidiauto
pi@raspberrypi:~/amidiauto $ ./amidiauto
Reading rules in '/etc/amidiauto.conf'...
Allowing '*' -> '*'
Connecting 20:0 to 128:0
20:0 port removed.
20:1 port removed.
20:0 port appeared.
Connecting 20:0 to 128:0
20:1 port appeared.
In such a setup:
$ amidi -l IO hw:5,0,0 minilogue MIDI 1 IO hw:5,0,1 minilogue MIDI 2
it is currently not possible to address the second hardware port/subdevice (I am unsure about the naming).
Currently the device can only be matched against the string "minilogue".
What could we do about it?
Should we allow a "minilogue MIDI 2" syntax (as output by amidi -l
and aconnect -l
) in amidiauto.conf
and build such a string here https://github.com/BlokasLabs/amidiauto/blob/master/amidiauto.cpp#L142
Or would it be easier to allow a "minilogue:1" syntax?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.