Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] midiin bug ?

Date2006-03-19 18:16
From"Art Hunkins"
SubjectRe: [Cs-dev] midiin bug ?
Yes, I have run up against the same phenomenon: with regard to note events,
about twice as much data seems to be coming through as should come through.

As a result, I shy away from midiin, often using notnum and veloc instead.

OTOH, researching the issue, I seem to recall that the extra messages have
to do with the fact that midiin is receiving all the data, while at the same
time, instrument 1 is also receiving all of channel 1's note information. It
may well be that changing instrument number will solve the problem. (But
maybe not too.)

Art Hunkins

----- Original Message -----
From: "Oeyvind Brandtsegg" 
To: 
Sent: Sunday, March 19, 2006 12:11 PM
Subject: [Cs-dev] midiin bug ?


> I wonder if there's a bug in midiin,
> it seems to register midi note data incorrectly.
>
> Upon receving a midi note on, it reports status byte 144 twice,
> where the first one is correct,
> and the second one seems to be note off of the previous note played
(kstatus = 144, kdata2 = 0).
>
> When I run the following code inside an instr:
>
> kstatus, kchan, kdata1, kdata2 midiin
> printk2 kstatus
> if kstatus == 0 kgoto noprint
> printks "midi in note:%d velocity:%d %n", 1, kdata1, kdata2
> noprint:
>
> If I play the note 48, (on, then off),
> then note 50 (on, then off,
> it will print this:
>
>  i1     0.00000
>  i1   144.00000
> midi in note:48 velocity:10
>  i1   144.00000
> midi in note:48 velocity:10
>  i1     0.00000
>  i1     0.00000
>  i1   144.00000
> midi in note:48 velocity:0
>  i1     0.00000
>  i1   144.00000
> midi in note:52 velocity:30
>  i1   144.00000
> midi in note:48 velocity:0
>  i1     0.00000
>  i1     0.00000
>  i1   144.00000
> midi in note:52 velocity:0
>  i1     0.00000
>
> best
> Oeyvind
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-03-20 03:37
FromIain Duncan
SubjectRe: [Cs-dev] midiin bug ?
> OTOH, researching the issue, I seem to recall that the extra messages have
> to do with the fact that midiin is receiving all the data, while at the same
> time, instrument 1 is also receiving all of channel 1's note information. It
> may well be that changing instrument number will solve the problem. (But
> maybe not too.)

This is how it's supposed to work though. Midiin is only useful if it
gets all midi data from the buffer. If you use the same data elsewhere,
then naturally you wind up with too many midi messages. To use it
properly, you need an always on instrument that gets all the midi input
data and then routes it how you want with some form of conditional
branching.

Iain


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-03-20 09:59
FromOeyvind Brandtsegg
Subjectre: [Cs-dev] midiin bug ?
It does not matter if it is placed in instr 200, which is always on.
The behaviour is the same as long as the midi channel you're playing on is massigned (explicitly or implicit/automatic) to another instr.
The only way I could get rid of the extrea messages was to use massign with -1 as the instr number, disabling "standard" midi handling altogether.

Oeyvind




> From: Iain Duncan [iainduncan@telus.net]
> Sent: 2006-03-20 04:37:44 CET
> To: csound-devel@lists.sourceforge.net
> Subject: Re: [Cs-dev] midiin bug ?
> 
> 
> > OTOH, researching the issue, I seem to recall that the extra messages have
> > to do with the fact that midiin is receiving all the data, while at the same
> > time, instrument 1 is also receiving all of channel 1's note information. It
> > may well be that changing instrument number will solve the problem. (But
> > maybe not too.)
> 
> This is how it's supposed to work though. Midiin is only useful if it
> gets all midi data from the buffer. If you use the same data elsewhere,
> then naturally you wind up with too many midi messages. To use it
> properly, you need an always on instrument that gets all the midi input
> data and then routes it how you want with some form of conditional
> branching.
> 
> Iain
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>