On Monday 24 May 2004 14:35, you wrote:
> Gilles Dégottex wrote:
> > I'm trying to dispatch midi event directly without queue.
> > I did every thing I read in the alsa doc (for
> > me: /usr/share/doc/libalsa2-docs-1.0.2/seq.html)
> >
> > but when I flush the output, I got an error: "Invalid argument"
> > (when calling snd_seq_drain_output)
>
> This may indicate that some of the event's fields have invalid values.
>
> What does your code to initialize the event structure look like?

Here is my code:

    snd_seq_event_t ev;
    snd_seq_ev_clear(&ev);
    snd_seq_ev_set_source(&ev, g_port);
    snd_seq_ev_set_subs(&ev);
    snd_seq_ev_set_direct(&ev);
    ev.type = SND_SEQ_EVENT_NOTE;
    ev.flags = SND_SEQ_EVENT_LENGTH_FIXED|SND_SEQ_PRIORITY_NORMAL;
    ev.tag = 'a';
    ev.data.note.channel = 1;
    ev.data.note.note = n;
    ev.data.note.velocity = 64;
    ev.data.note.off_velocity = 64;
    ev.data.note.duration = 1000;

P.S. Thanks for your fast answer ! :)


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id66&op=click
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to