Csound Csound-dev Csound-tekno Search About

MIDI under ALSA

Date2005-12-30 22:25
From"S. Massy"
SubjectMIDI under ALSA
AttachmentsNone  

Date2005-12-30 22:33
FromIstvan Varga
SubjectRe: MIDI under ALSA
AttachmentsNone  

Date2005-12-31 01:22
From"S. Massy"
SubjectRe: MIDI under ALSA
AttachmentsNone  

Date2005-12-31 08:38
FromIstvan Varga
SubjectRe: MIDI under ALSA
AttachmentsNone  

Date2006-01-01 00:44
From"S. Massy"
SubjectRe: MIDI under ALSA
AttachmentsNone  

Date2006-01-01 16:00
FromAtte André Jensen
SubjectRe: MIDI under ALSA
S. Massy wrote:

> I feel obtuse, but, how can I send data to csound if I don't know what
> MIDI port it's listening on?

What I normally do is having csound read from midi through, which is 
device 0 on my system. And midi through *is* listed in "aconnect -io".

To figure out where midi through is on your system (from csound's point 
of view) run csound with -M set to a huge number:

[atte@aarhus misc]$ csound -M 100 ping.csd

  *** PortMIDI: error: device number is out of range
The available MIDI in devices are:
    0: Midi Through Port-0 (ALSA)
    1: MK-249C USB MIDI keyboard MIDI  (ALSA)
  *** error opening MIDI in device: -1 (Unknown MIDI error)


Then I have in my ~/.csoundrc

[atte@aarhus ~]$ cat ~/.csoundrc
-+rtaudio=alsa
-o dac:hw:0
--sched
--expression-opt
-b 128
-B 256
-d
-m 0
-M 0

And:

[atte@aarhus ~]$ aconnect -io
client 0: 'System' [type=kernel]
     0 'Timer           '
     1 'Announce        '
client 62: 'Midi Through' [type=kernel]
     0 'Midi Through Port-0'
client 72: 'MK-249C USB MIDI keyboard' [type=kernel]
     0 'MK-249C USB MIDI keyboard MIDI '

Another nice thing with this approach is that I can route all my usb 
keyboards and controllers to midi through and set them to send on 
different midi channels. This works well for my purposes, with csound 
playing different instruments on different midi channels.

> Sorry if I'm being silly,

I think you're not...

-- 
peace, love & harmony
Atte

http://www.atte.dk

Date2006-01-01 17:00
FromDave Phillips
SubjectRe: MIDI under ALSA
Atte André Jensen wrote:

> What I normally do is having csound read from midi through, which is 
> device 0 on my system. And midi through *is* listed in "aconnect -io".

And just in case you don't already have it loaded:

    modprobe snd-seq-dummy

(as root, of course)