Hi,
I would like to use pd with midi under linux, alsa-0.9.0beta7, but it doesn't work. [Well, see below, it works now]
My goal is, to send midi data from a sequencer to pd, so that pd plays the incoming notes.
For this I set up a virtual midi device as card 3 (numbered as 2) with alsa's virmidi module: # modules conf alias sound-service-2-1 snd-seq-oss alias sound-service-2-8 snd-seq-oss # virtual midi alias snd-card-2 snd-card-virmidi
Then I 'aconnect' two ports: aconnect 80:0 81:0
This gives: client 80: 'Virtual Raw MIDI 2-0' [type=kernel] 0 'VirMIDI 2-0 ' Connecting To: 81:0 client 81: 'Virtual Raw MIDI 2-1' [type=kernel] 0 'VirMIDI 2-1 '
I can then use /dev/snd/midiC2D0 as a raw midi port in the sequencer, /dev/snd/midiC2D1 gets all that is send to midiC2D0.
I also made these links: /dev/midi20 => /dev/snd/midiC2D0 /dev/midi21 => /dev/snd/midiC2D1
This setup works nice with csound:
$ csound -M /dev/midi21 midi.[orc|sco] plays the midi data, the sequencer sends to /dev/midi20
But I cannot tell PD to read this data! No matter how I start PD, the "Test AUDIO/MIDI" patch doesn't show any incoming notes. And yes, I did turn on "compute audio".
$ pd -midiindev 1,2,3 -midioutdev 1,2,3 gives no errors, but also gets no data.
$ pd -midiindev 21 -midioutdev 21 or $ pd -midiindev 21 also gives no errors, but it doesn't work also.
######## Now it comes! ##########################
Until here, this was the mail I was about to send, when I tried this:
$ pd -midiindev 22
and I tell you what, now it worked. Maybe my mail is interesting anyways, because it describes how to set up virtual midi with alsa for use with PD.
__ __
Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______
/ __// __ /__/ __// // __ \ / / __ \ ___\
/ / / ____/ / / / // ____// /\ \ ___\____ \
/_/ /_____/ /_/ /_//_____// / \ \_____\_____
/_/ _\
I think it works like this
-midiindev 1 -> /dev/midi -midiindev 2 -> /dev/midi01 or, if it fails with that device, /dev/midi1 -midiindev 3 -> /dev/midi02 or /dev/midi2 -midiindev 4 -> /dev/midi03 or /dev/midi3 ...
and the same with -midioutdev
nicolas
----- Original Message ----- From: "Frank Barknecht" barknech@ph-cip.uni-koeln.de To: pd-list@iem.kug.ac.at Sent: Saturday, September 01, 2001 1:46 PM Subject: [PD] MIDI under linux (solved, but maybe interesting anyways)
Hi,
I would like to use pd with midi under linux, alsa-0.9.0beta7, but it
doesn't
work. [Well, see below, it works now]
My goal is, to send midi data from a sequencer to pd, so that pd plays the incoming notes.
For this I set up a virtual midi device as card 3 (numbered as 2) with
alsa's
virmidi module: # modules conf alias sound-service-2-1 snd-seq-oss alias sound-service-2-8 snd-seq-oss # virtual midi alias snd-card-2 snd-card-virmidi
Then I 'aconnect' two ports: aconnect 80:0 81:0
This gives: client 80: 'Virtual Raw MIDI 2-0' [type=kernel] 0 'VirMIDI 2-0 ' Connecting To: 81:0 client 81: 'Virtual Raw MIDI 2-1' [type=kernel] 0 'VirMIDI 2-1 '
I can then use /dev/snd/midiC2D0 as a raw midi port in the sequencer, /dev/snd/midiC2D1 gets all that is send to midiC2D0.
I also made these links: /dev/midi20 => /dev/snd/midiC2D0 /dev/midi21 => /dev/snd/midiC2D1
This setup works nice with csound:
$ csound -M /dev/midi21 midi.[orc|sco] plays the midi data, the sequencer sends to /dev/midi20
But I cannot tell PD to read this data! No matter how I start PD, the
"Test
AUDIO/MIDI" patch doesn't show any incoming notes. And yes, I did turn on "compute audio".
$ pd -midiindev 1,2,3 -midioutdev 1,2,3 gives no errors, but also gets no data.
$ pd -midiindev 21 -midioutdev 21 or $ pd -midiindev 21 also gives no errors, but it doesn't work also.
######## Now it comes! ##########################
Until here, this was the mail I was about to send, when I tried this:
$ pd -midiindev 22
and I tell you what, now it worked. Maybe my mail is interesting anyways, because it describes how to set up virtual midi with alsa for use with PD.
bye,
__ __
Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______ / __// __ /__/ __// // __ \ / / __ \ ___
/ / / ____/ / / / // ____// /\ \ ___\____
/_/ /_____/ /_/ /_//_____// / \ \_____\_____
/_/ _\
Nicolas Lhommet hat gesagt: // Nicolas Lhommet wrote:
I think it works like this
-midiindev 1 -> /dev/midi -midiindev 2 -> /dev/midi01 or, if it fails with that device, /dev/midi1 -midiindev 3 -> /dev/midi02 or /dev/midi2 -midiindev 4 -> /dev/midi03 or /dev/midi3 ...
and the same with -midioutdev
What is "-midiindev 22" then, and why does PD receive midi data there?
(I use 0.34-beta5, beta8 wouldn't build with alsa beta7 here. All those beta's...)
"-midiindev 22" should try /dev/midi21. Personally, I've never gone past /dev/midi0.
As to compiling with Alsa, did you try "./configure --enable-alsa"?" And did the compilation fail? I'd better look into this one...
cheers Miller
What is "-midiindev 22" then, and why does PD receive midi data there?
(I use 0.34-beta5, beta8 wouldn't build with alsa beta7 here. All those beta's...) -- __ __ Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______ / __// __ /__/ __// // __ \ / / __ \ ___\ / / / ____/ / / / // ____// /\ \ ___\____ \ /_/ /_____/ /_/ /_//_____// / \ \_____\_____
/_/ _\
Miller Puckette hat gesagt: // Miller Puckette wrote:
As to compiling with Alsa, did you try "./configure --enable-alsa"?" And did the compilation fail? I'd better look into this one...
The SNDRV_* definitions in asoundlib.h changed again in alsa beta7. I tried a brute force approach: "perl -pi -e 's/SNDRV/SND/g' src/*" and then pd-0.34 did compile with alsa beta7, but i could not open the audio devices due to a missing symbol:
ALSA lib dlmisc.c:54:(snd_dlsym_verify) unable to verify version for symbol _snd_pcm_hw_open snd_pcm_open (input): No such file or directory ALSA lib dlmisc.c:54:(snd_dlsym_verify) unable to verify version for symbol _snd_pcm_hw_open snd_pcm_open (output): No such file or directory realtime setting failed because not root
audio I/O stuck... closing audio
__ __
Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______
/ __// __ /__/ __// // __ \ / / __ \ ___\
/ / / ____/ / / / // ____// /\ \ ___\____ \
/_/ /_____/ /_/ /_//_____// / \ \_____\_____
/_/ _\
Yep. In other words, devices count from 1, not 0; this also holds for "-alsadev 1" (which opens "hw:0").
-midiindev 1 actually tries /dev/midi, /dev/midi0, and /dev/midi00...
I'd better explain this better in the doc...
cheers Miller
On Sat, Sep 01, 2001 at 05:37:44PM +0200, Nicolas Lhommet wrote:
I think it works like this
-midiindev 1 -> /dev/midi -midiindev 2 -> /dev/midi01 or, if it fails with that device, /dev/midi1 -midiindev 3 -> /dev/midi02 or /dev/midi2 -midiindev 4 -> /dev/midi03 or /dev/midi3 ...
and the same with -midioutdev
nicolas