On Sunday 15 June 2003 18.16, Joern Nettingsmeier wrote:
[...]
>          /*{SND_SEQ_EVENT_NONREGPARAM, extra_decode_nrpn},*/
>          /*{SND_SEQ_EVENT_REGPARAM, extra_decode_rpn},*/
> };
>
> which makes me think it might not yet be implemented....

I'm using NRPNs to control the mixer in the current development 
version of Audiality, and they appear to be working just fine, and 
just like one would expect.


> any hints or fine manuals around ?

Do you need one? :-)

What you get is plain <control, value> tuples, and that's all there is 
to it. (Well, it's all I *want* anyway, as I don't want to do stuff 
that's outside the MIDI spec...)

Here's some code, which isn't heavily tested, but does seem to do the 
job:

static void alsaseq_read(struct A_device *dev, unsigned frames)
{
        int more = 1;
        snd_seq_event_t *ev;
        ALSASEQ_data *d = (ALSASEQ_data *) dev->driver_data;
        dev->read_ms->time = aev_timer;
        while(more)
        {
                more = snd_seq_event_input(d->seq_handle, &ev);
                if(more < 0)
                        break;

                switch (ev->type)
                {
                  case SND_SEQ_EVENT_CONTROLLER:
                        dev->read_ms->control(
                                        ev->data.control.channel,
                                        ev->data.control.param,
                                        ev->data.control.value);
                        break;
                  case SND_SEQ_EVENT_NONREGPARAM:
                        dev->read_ms->nrpn(ev->data.control.channel,
                                        ev->data.control.param,
                                        ev->data.control.value);
                        break;

                ...

                  case SND_SEQ_EVENT_PITCHBEND:
                        dev->read_ms->bend(ev->data.control.channel,
                                        ev->data.control.value);
                        break;
                }
                snd_seq_free_event(ev);
        }
}


//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---



-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to