Csound Csound-dev Csound-tekno Search About

[Csnd] alsa midi out problem

Date2010-10-26 23:41
FromSimon Rees
Subject[Csnd] alsa midi out problem
I'm having problems getting midi output working with alsa. I'm using a recent 
build from cvs.
The following command line and the unified file below it does not appear to 
send a midi cc 7 message on channel 1.

csound -d --output=dac:hw:2,0 -+rtaudio=alsa -B 16384 -b 32768 -+rtmidi=alsa -
M hw:1,0,0 -Q hw:1,0,0 midi_test.csd





; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

instr 1
							outic 1, 7, 0, 0, 1
endin



i1 0 200



I've verified the midi device is working by sending 
amidi -p hw:1,0,0 -S "B0 07 0"
and seeing the expected effect.

Any advice on what I might be doing wrong would be welcome.

thanks, Simon


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-10-27 08:28
FromAndres Cabrera
Subject[Csnd] Re: alsa midi out problem
Hi,

Csound uses the rawmidi alsa interface instead of the seq interface.
So you can't use the usual numbers. You need to check for raw midi
devices using:
amidi -l
And use those names. You might need to load the snd-virmidi module if
you don't have any rawmidi devices:
modprobe snd-virmidi
This will create a virtual midi devices connecting rawmidi with all
other seq devices.

Cheers,
Andres

On Tue, Oct 26, 2010 at 11:41 PM, Simon Rees  wrote:
> I'm having problems getting midi output working with alsa. I'm using a recent
> build from cvs.
> The following command line and the unified file below it does not appear to
> send a midi cc 7 message on channel 1.
>
> csound -d --output=dac:hw:2,0 -+rtaudio=alsa -B 16384 -b 32768 -+rtmidi=alsa -
> M hw:1,0,0 -Q hw:1,0,0 midi_test.csd
>
> 
> 
> 
> 
> ; Initialize the global variables.
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> instr 1
>                                                        outic 1, 7, 0, 0, 1
> endin
>
> 
> 
> i1 0 200
> 
> 
>
> I've verified the midi device is working by sending
> amidi -p hw:1,0,0 -S "B0 07 0"
> and seeing the expected effect.
>
> Any advice on what I might be doing wrong would be welcome.
>
> thanks, Simon
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



-- 


Andrés


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-10-31 16:04
FromSimon Rees
Subject[Csnd] Re: Re: alsa midi out problem
Hi Andres

Thanks for the advice. However, it turns out the cause of my problem is more 
to do with csound than alsa...

It appears that I already had rawmidi available as a result of snd_rawmidi 
being loaded so I didn't need to set up virmidi devices. I didn't fully 
realise the distinction between the rawmidi and sequencer interfaces when I 
first posted, so that was interesting to learn about!

The actual problem appears to do with outic sending value zero in a midi cc 
message. I was able to use outic to send a midi message for any value other 
than zero. I think this might be due to csound's representation of the current 
midi cc value for an instrument being zero, so no midi message is sent as 
nothing has changed. An important subtlety seems to be that csound's internal 
representation of the state of the midi controller is per instrument, not 
globally.
This means I can cause a midi cc zero message to be sent if I set the cc value 
for that instrument to a non-zero value beforehand. This behaviour is not 
ideal for me as I'm trying to initialise the state of the midi controller when 
csound starts playing the score and many of the controllers need to be set to 
zero, but I'm sure I can find a work-around.

Any comments as to whether I'm on the right track to understanding this 
problem and work-around suggestions would be most welcome.

thanks, Simon

On Wednesday 27 Oct 2010 08:28:32 Andres Cabrera wrote:
> Csound uses the rawmidi alsa interface instead of the seq interface.
> So you can't use the usual numbers. You need to check for raw midi
> devices using:
> amidi -l
> And use those names. You might need to load the snd-virmidi module if
> you don't have any rawmidi devices:
> modprobe snd-virmidi
> This will create a virtual midi devices connecting rawmidi with all
> other seq devices.
> 
> Cheers,
> Andres
> 
> On Tue, Oct 26, 2010 at 11:41 PM, Simon Rees  wrote:
> > I'm having problems getting midi output working with alsa. I'm using a
> > recent build from cvs.
> > The following command line and the unified file below it does not appear
> > to send a midi cc 7 message on channel 1.
> >
> > csound -d --output=dac:hw:2,0 -+rtaudio=alsa -B 16384 -b 32768
> > -+rtmidi=alsa - M hw:1,0,0 -Q hw:1,0,0 midi_test.csd
> >
> > 
> > 
> > 
> > 
> > ; Initialize the global variables.
> > sr = 44100
> > kr = 4410
> > ksmps = 10
> > nchnls = 2
> >
> > instr 1
> >                                                        outic 1, 7, 0, 0,
> > 1 endin
> >
> > 
> > 
> > i1 0 200
> > 
> > 
> >
> > I've verified the midi device is working by sending
> > amidi -p hw:1,0,0 -S "B0 07 0"
> > and seeing the expected effect.
> >
> > Any advice on what I might be doing wrong would be welcome.
> >
> > thanks, Simon
> >
> >
> > Send bugs reports to the Sourceforge bug tracker
> >            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> > Discussions of bugs and features can be posted here
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> > csound"
> 


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"