Giter Club home page Giter Club logo

amidiauto's People

Contributors

gtrainavicius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amidiauto's Issues

is it possible to connect devices with multiple midi ports

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 ?

Segmentation fault in Raspbian 11

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

Raspbian Buster: must build with CXXFLAGS=-O0

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.

Allow to address an ALSA subdevice

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.