Stable and predictable MIDI connection with ALSA
Date | 2017-07-13 20:48 |
From | Anton Kholomiov |
Subject | Stable and predictable MIDI connection with ALSA |
Can you help me? I use many csound files as MIDI-synthesizers. I use alsa sequencer midi driver. Recently I've run into problem with MIDI device IDs. the identifiers for MIDI devices. So I have to change the device IDs for all files. MIDI-keyboard in this case? More reliable way to do it Thanks! Anton |
Date | 2017-07-13 20:50 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Is it possible for example to connect to device by it's name instead of id?2017-07-13 22:48 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-13 21:20 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Hi Anton, Off the top of my head I can think of: * Using JACK for midi? * Fixing the assignments somehow. If it's USB something like: http://www.familjenpalo.se/vpo/SoundAndMIDI * Using raw MIDI instead of alsaseq. * Calling a (non-portable) bash script with system_i and fixing the connection with aconnect. Cheers. On 13/07/17 16:50, Anton Kholomiov wrote: > Is it possible for example to connect to device by it's name > instead of id? > > > 2017-07-13 22:48 GMT+03:00 Anton Kholomiov |
Date | 2017-07-13 21:47 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Thanks Guillermo I will investigate the options. Do you think that JACK for midi is more appropriate?2017-07-13 23:20 GMT+03:00 Guillermo Senna <gsenna@gmail.com>: Hi Anton, |
Date | 2017-07-13 22:00 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Scratch that. I've tried alsaseq and this one worked for me: csound -+rtmidi=alsaseq -M'Scarlett 2i4 USB'. Check the output of "aconnect -l" to see if you can find the name of the card. On 13/07/17 17:47, Anton Kholomiov wrote: > Thanks Guillermo I will investigate the options. > > Do you think that JACK for midi is more appropriate? > I have never tried it with Csound > > 2017-07-13 23:20 GMT+03:00 Guillermo Senna |
Date | 2017-07-13 22:02 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Wow! That's exactly what I need! 2017-07-14 0:00 GMT+03:00 Guillermo Senna <gsenna@gmail.com>: Scratch that. I've tried alsaseq and this one worked for me: csound |
Date | 2017-07-13 22:02 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Thanks alot! 2017-07-14 0:02 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-13 22:13 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Sure. Cheers! On 13/07/17 18:02, Anton Kholomiov wrote: > Thanks alot! > > 2017-07-14 0:02 GMT+03:00 Anton Kholomiov |
Date | 2017-07-13 22:14 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Alas it's not working for me. I've tried And it says-M'UMX 250' ALSASEQ: connection failed from 'UMX, port 0 (Operation not permitted) 2017-07-14 0:02 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-13 22:14 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
It's on my list as follows client 32: 'UMX 250' [type=kernel,card=4] 0 'UMX 250 MIDI 1 ' Connecting To: 128:0[real:0], 130:0 Connected From: 128:0 2017-07-14 0:14 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-13 22:25 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Latest Csound? I'm using Ubuntu Studio 17.04. My aconnect -l says: client 28: 'Scarlett 2i4 USB' [type=kernel,card=3] 0 'Scarlett 2i4 USB MIDI 1' Connecting To: 128:0[real:0] Connected From: 128:0 I can't imagine why it would work for me, but not for you. My libasound2 version is 1.1.3-5. On 13/07/17 18:14, Anton Kholomiov wrote: > It's on my list as follows > > client 32: 'UMX 250' [type=kernel,card=4] > 0 'UMX 250 MIDI 1 ' > Connecting To: 128:0[real:0], 130:0 > Connected From: 128:0 > > 2017-07-14 0:14 GMT+03:00 Anton Kholomiov |
Date | 2017-07-13 22:34 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
I'm using Csound 6.09. Not sure on the version of libasound2 2017-07-14 0:25 GMT+03:00 Guillermo Senna <gsenna@gmail.com>: Latest Csound? I'm using Ubuntu Studio 17.04. My aconnect -l says: |
Date | 2017-07-13 22:49 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
apt-cache show libasound2 | grep Version Although I doubt that's what's happening. Maybe you could try connecting first to the Midi Through port (in my case, csound -+rtmidi=alsaseq -M14) and later in another terminal: aconnect 'UMX 250' 'Csound'. Then check if the connection is made. On 13/07/17 18:34, Anton Kholomiov wrote: > I'm using Csound 6.09. Not sure on the version of libasound2 > > 2017-07-14 0:25 GMT+03:00 Guillermo Senna |
Date | 2017-07-13 22:50 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
if aconnect can't do it, it's alsaseq and your card. Otherwise it is probably Csound. On 13/07/17 18:49, Guillermo Senna wrote: > apt-cache show libasound2 | grep Version > > Although I doubt that's what's happening. Maybe you could try connecting > first to the Midi Through port (in my case, csound -+rtmidi=alsaseq > -M14) and later in another terminal: aconnect 'UMX 250' 'Csound'. Then > check if the connection is made. > > > On 13/07/17 18:34, Anton Kholomiov wrote: >> I'm using Csound 6.09. Not sure on the version of libasound2 >> >> 2017-07-14 0:25 GMT+03:00 Guillermo Senna |
Date | 2017-07-14 01:08 |
From | Forrest Curo |
Subject | Re: Stable and predictable MIDI connection with ALSA |
I think that alsa is not always consistent with how it assigns midi ports after reboot. On Thu, Jul 13, 2017 at 2:50 PM, Guillermo Senna <gsenna@gmail.com> wrote: if aconnect can't do it, it's alsaseq and your card. Otherwise it is |
Date | 2017-07-14 03:16 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
That's correct. But we were trying to make the connection by name. On 13/07/17 21:08, Forrest Curo wrote: > I think that alsa is not always consistent with how it assigns midi ports > after reboot. > > On Thu, Jul 13, 2017 at 2:50 PM, Guillermo Senna |
Date | 2017-07-14 09:31 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Although I doubt that's what's happening. Maybe you could try connecting This recipe works! Maybe I need to update Csound to the very latest version... to work it directly But atleast I have some predictable way to to it now. 2017-07-14 5:16 GMT+03:00 Guillermo Senna <gsenna@gmail.com>: That's correct. But we were trying to make the connection by name. |
Date | 2017-07-14 10:49 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
I think it's have to do with interpretation of unary quotes ' ' on my system Unfortunately when I try to automize your solution whenever I try toinvalid sender address 'UMX aconnect 28 129 2017-07-14 11:31 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-14 11:10 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
If I type it by hand it works on terminal: aconnect 'UMX 250' 'Csound' but I don't have the way to automate this process..2017-07-14 12:49 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-14 11:14 |
From | Victor Lazzarini |
Subject | Re: Stable and predictable MIDI connection with ALSA |
did you try this script? #!/usr/sh csound … & aconnect ‘UMX 250’ ‘Csound’ ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Jul 2017, at 11:10, Anton Kholomiov |
Date | 2017-07-14 11:23 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
It gives the same error: ... csound output...> sh 00-dream-pad.sh invalid sender address ‘UMX Script content: #!/usr/sh csound 00-dream-pad.csd & aconnect ‘UMX 250’ ‘Csound’ 2017-07-14 13:14 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: did you try this script? |
Date | 2017-07-14 11:27 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
That's the strange why something that works when I type it doesn't work when I execute it from script. I think it's not the question for the list.2017-07-14 13:23 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-14 11:32 |
From | Victor Lazzarini |
Subject | Re: Stable and predictable MIDI connection with ALSA |
I think it might be because the script runs it immediately after starting Csound. Maybe Csound has not opened alsaseq in time. You can try adding a sleep: csound … & sleep 1 aconnect … ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Jul 2017, at 11:27, Anton Kholomiov |
Date | 2017-07-14 11:37 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
I've make it work by creating a script connect_umx_csound that just connects the Csound: aconnect 'UMX 250' 'Csound' phew... 2017-07-14 13:32 GMT+03:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: I think it might be because the script runs it immediately after starting Csound. Maybe Csound has not |
Date | 2017-07-14 11:48 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Thanks Victor for the hint with the script! I think I can also put in the script the jack connection commands.2017-07-14 13:37 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2017-07-14 13:26 |
From | Guillermo Senna |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Just for the record, Anton, could you try running Csound with the following options? All of these work for me. csound -+rtmidi=alsaseq -M"UMX 250" csound -+rtmidi=alsaseq -M"UMX\ 250" csound -+rtmidi=alsaseq -MUMX\ 250 We obviously weren't reading the error message correctly. It is clear that the problem (as usual) was the quotes and then the space between UMX and 250: ALSASEQ: connection failed from 'UMX, port 0 (Operation not permitted) On 14/07/17 07:48, Anton Kholomiov wrote: > Thanks Victor for the hint with the script! > I think I can also put in the script the jack connection commands. > That way I can get reliable jack connections without ladish sessions. > > 2017-07-14 13:37 GMT+03:00 Anton Kholomiov |
Date | 2017-07-14 13:55 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
Ok, finally This way it works:-+rtmidi=alsaseq --midi-device="UMX 250" --midi-device="UMX 250" -+rtmidi=alsaseq Unknown RawMidi UMX 250 2017-07-14 15:26 GMT+03:00 Guillermo Senna <gsenna@gmail.com>: Just for the record, Anton, could you try running Csound with the |
Date | 2017-07-14 13:57 |
From | Anton Kholomiov |
Subject | Re: Stable and predictable MIDI connection with ALSA |
With the latest Csound. It was just announced 2017-07-14 15:55 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|