All of lore.kernel.org
 help / color / mirror / Atom feed
* General Guidelines?  (MIDI)
@ 2003-01-11 18:31 Brian Victor
  2003-01-13  9:25 ` Clemens Ladisch
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Victor @ 2003-01-11 18:31 UTC (permalink / raw)
  To: alsa-devel

Are there any documented guidelines on how to make use of ALSA
(especially MIDI) functions?  They seem to be designed with attention to
nomenclature, but I don't have a clear idea of when they're needed.

For example, when using ALSA data type foo, the standard seems to be to
call snd_seq_alloc_foo, manipulate foo as desired, then call
snd_seq_free_foo.  This is easy enough, but sometimes (as in the case of
queue), there is also a create function; how does this differ from
alloc, and is it necessary?

Also, what is the relationship between buffers and queues?  Is a queue
needed prior to buffering output?  Or do they serve completely different
functions?

Thanks in advance to anyone who can clear these things up for me.

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-11 18:31 General Guidelines? (MIDI) Brian Victor
@ 2003-01-13  9:25 ` Clemens Ladisch
  2003-01-13 10:02   ` Takashi Iwai
  0 siblings, 1 reply; 14+ messages in thread
From: Clemens Ladisch @ 2003-01-13  9:25 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

Brian Victor wrote:
> Are there any documented guidelines on how to make use of ALSA
> (especially MIDI) functions?

This is one of the parts still missing from the documentation.

Well, there are example programs ...

> For example, when using ALSA data type foo, the standard seems to be to
> call snd_seq_alloc_foo, manipulate foo as desired, then call
> snd_seq_free_foo.  This is easy enough, but sometimes (as in the case of
> queue), there is also a create function; how does this differ from
> alloc, and is it necessary?

The data type holds properties of the object, but it's only used to
communicate between the application and the ALSA library. The create
function creates the actual object in the kernel.

> Also, what is the relationship between buffers and queues?

Buffers are used to send or receive events to/from the kernel sequencer,
which is responsible for routing them to/from other clients. It's an
internal optimization; usually, you don't have to care about them.

Queues are used to connect two ports and to schedule events to be sent at
a specific time. This can be used to play MIDI files (see
alsa-lib/test/playmidi1).


HTH
Clemens



-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-13  9:25 ` Clemens Ladisch
@ 2003-01-13 10:02   ` Takashi Iwai
  2003-01-14 21:20     ` Brian Victor
  0 siblings, 1 reply; 14+ messages in thread
From: Takashi Iwai @ 2003-01-13 10:02 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: Brian Victor, alsa-devel

At Mon, 13 Jan 2003 10:25:55 +0100 (MET),
Clemens Ladisch wrote:
> 
> Brian Victor wrote:
> > Are there any documented guidelines on how to make use of ALSA
> > (especially MIDI) functions?
> 
> This is one of the parts still missing from the documentation.
> 
> Well, there are example programs ...

for understanding the concept of ALSA sequencer, the old ALSA-lib
document would help, too:

	http://www.alsa-project.org/alsa-doc/alsa-lib-old/

except for functions API, the basic idea and the event record are
identical in both ALSA 0.5.x and 0.9.0.

of course, it would be much nicer if someone helps to port this
document to DocBook...


Takashi


-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-13 10:02   ` Takashi Iwai
@ 2003-01-14 21:20     ` Brian Victor
  2003-01-15 11:43       ` Clemens Ladisch
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Victor @ 2003-01-14 21:20 UTC (permalink / raw)
  To: alsa-devel

On Mon, Jan 13, 2003 at 11:02:25AM +0100, Takashi Iwai wrote:
>At Mon, 13 Jan 2003 10:25:55 +0100 (MET), Clemens Ladisch wrote:
>> Well, there are example programs ...
>	http://www.alsa-project.org/alsa-doc/alsa-lib-old/
[snips]

Thanks to both of you for your responses.  The old documentation was
especially helpful, and I feel I have a better, if still imperfect grasp
of things.

I've been following the miniArp.c sample code from Matthias Nagorni's
HOWTO, and trying to break it up into functions for a C++ wrapper I'm
writing.  I'm having the following issues:

  * On first run, the test program will only play the note on tick 0,
    and nothing beyond that.

  * On subsequent runs, the test program doesn't even play that.  I
    would chalk it up to poor garbage collection (I'm doing a ^C to stop
    the program), but miniArp will still run fine after that, and then
    my test program performs as the first run again.

My NoteOn code looks like this (tick is the tick at which the event
should be sent):

void wxMidiQueue::NoteOn(const wxMidiOutput& port, int key,
                         int velocity, int tick, int channel)
{     
  snd_seq_event_t ev;
  snd_seq_ev_clear(&ev);
  snd_seq_ev_set_noteon(&ev, channel, key, velocity);
  snd_seq_ev_set_source(&ev, port.GetAlsaPort());
  snd_seq_ev_set_subs(&ev);
  snd_seq_ev_schedule_tick(&ev, m_queue, 0, tick);
  snd_seq_event_output_direct(m_drv.GetAlsaSeq(), &ev);
}

It's being called like this:
  queue->NoteOn(*out, 60, 80, 0);
  queue->NoteOn(*out, 64, 80, 1);
  queue->NoteOn(*out, 67, 80, 2);

After this the queue is started.  My remaining questions are:
  * Above I use output_direct.  Should I just be using output for events
    that should occur in the future?
  * Does the output pool need to be big enough to accomodate any data my
    program will have in the queue at once?  Or just big enough to allow
    for some buffering?
  * Am I doing something absurdly wrong that you can see?  I've already
    opened the sequencer, opened a port, allocated a queue, and set the
    tempo

Sorry this email was so long.  But if you can provide any insight, I
would really appreciate it.  Thanks!

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-14 21:20     ` Brian Victor
@ 2003-01-15 11:43       ` Clemens Ladisch
  2003-01-16  3:27         ` Brian Victor
  0 siblings, 1 reply; 14+ messages in thread
From: Clemens Ladisch @ 2003-01-15 11:43 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

Brian Victor wrote:
>   * On first run, the test program will only play the note on tick 0,
>     and nothing beyond that.
>
>   * On subsequent runs, the test program doesn't even play that.  I
>     would chalk it up to poor garbage collection (I'm doing a ^C to stop
>     the program), but miniArp will still run fine after that, and then
>     my test program performs as the first run again.

Running queues are visible in /proc/asound/seq/timers IIRC. And in theory,
ALSA should properly free queues/timers when doing ^C.

>   * Above I use output_direct.  Should I just be using output for events
>     that should occur in the future?

Yes. output_direct send the event directly to the destination port,
without going through a queue.

>   * Does the output pool need to be big enough to accomodate any data my
>     program will have in the queue at once?  Or just big enough to allow
>     for some buffering?

No. Yes.


HTH
Clemens



-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-15 11:43       ` Clemens Ladisch
@ 2003-01-16  3:27         ` Brian Victor
  2003-01-16  7:39           ` Clemens Ladisch
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Victor @ 2003-01-16  3:27 UTC (permalink / raw)
  To: alsa-devel

On Wed, Jan 15, 2003 at 12:43:18PM +0100, Clemens Ladisch wrote:
>Running queues are visible in /proc/asound/seq/timers IIRC. And in theory,
>ALSA should properly free queues/timers when doing ^C.

Thanks once more.  I feel like I'm getting closer, but I'm still
struggling.  This is my NoteOn code:

void wxMidiQueue::NoteOn(const wxMidiOutput& port, int key,
                         int velocity, int tick, int channel)
{
  snd_seq_event_t ev;
  snd_seq_ev_clear(&ev);
  snd_seq_ev_set_note(&ev, channel, key, velocity, 10);
  snd_seq_ev_schedule_tick(&ev, m_queue, 0, tick);
  snd_seq_ev_set_source(&ev, port.GetAlsaPort());
  snd_seq_ev_set_subs(&ev);
  snd_seq_event_output_direct(m_drv.GetAlsaSeq(), &ev);
}

For testing, I placed this in a for loop:
for (x=0; x<400; ++x) queue->NoteOn(*out, x, 127, x, 0);

Monitoring /proc/asound/seq/queues shows the events being queued, but as
soon as the queue starts, all 400 notes leave the queue instantly; none
are played.  miniArp, from which this code is extracted nearly verbatim,
will show the "queued tick events" rising and falling as notes are
played and requeued.  The output of /proc/asound/seq/timer when running
miniArp and my test program are identical.

Clearly I'm doing something blatantly wrong, but I've compared my code
to the sample's with a fine-tooth comb, and I can't for the life of me
figure out what.  Can you see where the problem is?

Thank you once again for your patience.

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate 
is essential in establishing user confidence by providing assurance of 
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16  3:27         ` Brian Victor
@ 2003-01-16  7:39           ` Clemens Ladisch
  2003-01-16 13:41             ` Brian Victor
  0 siblings, 1 reply; 14+ messages in thread
From: Clemens Ladisch @ 2003-01-16  7:39 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

Brian Victor wrote:
> Monitoring /proc/asound/seq/queues shows the events being queued, but as
> soon as the queue starts, all 400 notes leave the queue instantly; none
> are played.
>
>   snd_seq_ev_schedule_tick(&ev, m_queue, 0, tick);

What is the queue's tempo? 400 ticks may not be much.

>   snd_seq_ev_set_subs(&ev);

This will send the note events to the subscribers of your program's port.
Are there any?


HTH
Clemens



-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate 
is essential in establishing user confidence by providing assurance of 
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16  7:39           ` Clemens Ladisch
@ 2003-01-16 13:41             ` Brian Victor
  2003-01-16 15:32               ` Tim Goetze
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Victor @ 2003-01-16 13:41 UTC (permalink / raw)
  To: alsa-devel

On Thu, Jan 16, 2003 at 08:39:23AM +0100, Clemens Ladisch wrote:
>Brian Victor wrote:
>> Monitoring /proc/asound/seq/queues shows the events being queued, but as
>> soon as the queue starts, all 400 notes leave the queue instantly; none
>> are played.
>>
>>   snd_seq_ev_schedule_tick(&ev, m_queue, 0, tick);
>What is the queue's tempo? 400 ticks may not be much.

[before starting]
owned by client    : 128
lock status        : Locked
queued time events : 0
queued tick events : 400
timer state        : Stopped
timer PPQ          : 128
current tempo      : 12000000
current BPM        : 5
current time       : 0.000000000 s
current tick       : 0

[after starting]
queue 0: [Queue-0]
owned by client    : 128
lock status        : Locked
queued time events : 0
queued tick events : 0
timer state        : Running
timer PPQ          : 128
current tempo      : 12000000
current BPM        : 5
current time       : 1.140000000 s
current tick       : 12

(Which begs another question: what does PPQ stand for?  Something per
quarter?)

>>   snd_seq_ev_set_subs(&ev);
>This will send the note events to the subscribers of your program's port.
>Are there any?

Yes.  I have a sleep in my program that allows me to run from another
terminal: aconnect 64:0 128:1; aconnect 128:0 64:0  (Yes, there's an
input port, too.)

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16 13:41             ` Brian Victor
@ 2003-01-16 15:32               ` Tim Goetze
  2003-01-16 17:23                 ` Brian Victor
  2003-01-16 18:14                 ` Takashi Iwai
  0 siblings, 2 replies; 14+ messages in thread
From: Tim Goetze @ 2003-01-16 15:32 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

Brian Victor wrote:

>On Thu, Jan 16, 2003 at 08:39:23AM +0100, Clemens Ladisch wrote:
>>Brian Victor wrote:
>>> Monitoring /proc/asound/seq/queues shows the events being queued, but as
>>> soon as the queue starts, all 400 notes leave the queue instantly; none
>>> are played.

afaik, you should use snd_seq_event_output() instead of
snd_seq_event_output_direct() -- the latter is supposed
to by-pass the queue for instant transmission.

you may want to look at alsa-lib/test/playmidi1.c for
another reference.

>(Which begs another question: what does PPQ stand for?  Something per
>quarter?)

ticks/quarter (aka 'parts per quarter').

hth, tim



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16 15:32               ` Tim Goetze
@ 2003-01-16 17:23                 ` Brian Victor
  2003-01-16 18:14                 ` Takashi Iwai
  1 sibling, 0 replies; 14+ messages in thread
From: Brian Victor @ 2003-01-16 17:23 UTC (permalink / raw)
  To: alsa-devel

On Thu, Jan 16, 2003 at 04:32:05PM +0100, Tim Goetze wrote:
>afaik, you should use snd_seq_event_output() instead of
>snd_seq_event_output_direct() -- the latter is supposed
>to by-pass the queue for instant transmission.

I've tried both, actually.  output() does not show any queued events in
/proc/asound/seq/queues; output_direct() does.  miniArp.c uses
output_direct, and seems to work.  Neither produces any output in my
test program.

I've removed all attachments to wxWindows, so anyone should be able to
compile my test program.  So I don't have to keep sending snippits out
of context, the code is here:

http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc      or
http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc.html (syntax colored)
(g++ nowx.cc -o nowx -lasound)

>you may want to look at alsa-lib/test/playmidi1.c for
>another reference.

That could be useful, but at a glance I don't see anything important in
there that I'm not doing.  This is really perplexing me.

>>(Which begs another question: what does PPQ stand for?  Something per
>>quarter?)
>ticks/quarter (aka 'parts per quarter').

I figured it was something like that.  Thanks.

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16 15:32               ` Tim Goetze
  2003-01-16 17:23                 ` Brian Victor
@ 2003-01-16 18:14                 ` Takashi Iwai
  1 sibling, 0 replies; 14+ messages in thread
From: Takashi Iwai @ 2003-01-16 18:14 UTC (permalink / raw)
  To: Tim Goetze; +Cc: Brian Victor, alsa-devel

At Thu, 16 Jan 2003 16:32:05 +0100 (CET),
Tim Goetze wrote:
> 
> Brian Victor wrote:
> 
> >On Thu, Jan 16, 2003 at 08:39:23AM +0100, Clemens Ladisch wrote:
> >>Brian Victor wrote:
> >>> Monitoring /proc/asound/seq/queues shows the events being queued, but as
> >>> soon as the queue starts, all 400 notes leave the queue instantly; none
> >>> are played.
> 
> afaik, you should use snd_seq_event_output() instead of
> snd_seq_event_output_direct() -- the latter is supposed
> to by-pass the queue for instant transmission.

well, this is not exact:  snd_seq_event_output_direct() sends the
event without "output buffer" on the user-space.
if the event record has a proper queue value (i.e. event.queue !=
SND_SEQ_QUEUE_DIRECT), it is scheduled on the specified queue.

for by-passing the scheduling on the queue, you need to mark the queue
via snd_seq_ev_set_direct().

snd_seq_event_output() will put the event onto the output buffer.
the buffered events won't be sent and stay on the buffer until either
the buffer becomes full or snd_seq_drain_output() is called
explicitly.

this i/o-buffer was introduced to reduce the amounts of read/write,
ioctls.  this could be implemented more sofisticatedly as a high-level
library...


Takashi


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
       [not found] <E18ZGLH-0005nh-00@sc8-sf-list2.sourceforge.net>
@ 2003-01-16 21:27 ` Pedro Lopez-Cabanillas
  2003-01-16 22:37   ` Brian Victor
  0 siblings, 1 reply; 14+ messages in thread
From: Pedro Lopez-Cabanillas @ 2003-01-16 21:27 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

On Thursday 16 January 2003 21:08, Brian Victor wrote:
> I've removed all attachments to wxWindows, so anyone should be able to
> compile my test program.  So I don't have to keep sending snippits out
> of context, the code is here:
>
> http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc      or
> http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc.html (syntax colored)
> (g++ nowx.cc -o nowx -lasound)

In short: start the queue before sending events, add snd_seq_drain_output at 
end of SetTempo method.

I wrote some example programs in plain C while learning ALSA API (player, 
recorder, metronome, monitor...)
http://perso.wanadoo.es/plcl/alsautil.tar.bz2

More examples, for Kylix and FreePascal:
http://perso.wanadoo.es/plcl/

HTH

--- nowx.cc.old Thu Jan 16 22:11:17 2003
+++ nowx.cc     Thu Jan 16 22:08:59 2003
@@ -64,14 +64,14 @@
   wxMidiOutput outport(sequencer);
   wxMidiQueue queue(sequencer);
   int x;
-  for (x = 0; x < 400; ++x)
-  {
-    queue.NoteOn(outport, x, 127, x);
-  }
   cout << "Queue will start in five seconds" << endl;
   sleep(5);
   cout << "Starting queue" << endl;
   queue.StartQueue();
+  for (x = 0; x < 400; ++x)
+  {
+    queue.NoteOn(outport, x , 127, x);
+  }
   while (1) {
     sleep(1);
   }
@@ -181,6 +181,7 @@
   snd_seq_queue_tempo_set_ppq(tpo, 128);
   snd_seq_set_queue_tempo(m_drv.GetAlsaSeq(), m_queue, tpo);
   snd_seq_queue_tempo_free(tpo);
+  snd_seq_drain_output(m_drv.GetAlsaSeq());
 }

 void wxMidiQueue::StartQueue()



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16 21:27 ` Pedro Lopez-Cabanillas
@ 2003-01-16 22:37   ` Brian Victor
  2003-01-19 22:21     ` Frank van de Pol
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Victor @ 2003-01-16 22:37 UTC (permalink / raw)
  To: alsa-devel

On Thu, Jan 16, 2003 at 10:27:35PM +0100, Pedro Lopez-Cabanillas wrote:
>In short: start the queue before sending events, add snd_seq_drain_output at 
>end of SetTempo method.

...and then there was light!  Er.. sound!

Now that it's working, I'm left again with conceptual questions.  I was
under the impression that I could put events in a queue, start it, stop
it, and start it from the beginning again.  Is that not the case?  The
events seem to leave the queue once sent.

Likewise, I was under the impression that queues handled sequencing
events by timestamp if they arrived in non-sequential order.  Is that
so?  Do I just need to stay ahead of the queue for this to work?  Does
that mean, I can't reliably send the queue all events for one voice,
followed by all events for another voice?

Thank you, Pedro, for showing me how to fix my code.  That was a huge
help.

-- 
Brian


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: General Guidelines?  (MIDI)
  2003-01-16 22:37   ` Brian Victor
@ 2003-01-19 22:21     ` Frank van de Pol
  0 siblings, 0 replies; 14+ messages in thread
From: Frank van de Pol @ 2003-01-19 22:21 UTC (permalink / raw)
  To: Brian Victor; +Cc: alsa-devel

On Thu, Jan 16, 2003 at 05:37:35PM -0500, Brian Victor wrote:
> 
> Likewise, I was under the impression that queues handled sequencing
> events by timestamp if they arrived in non-sequential order.  Is that
> so?  

Yes, the sequencer's priority queues automatically order the events enqueued
by timestamp.

> Do I just need to stay ahead of the queue for this to work?  Does
> that mean, I can't reliably send the queue all events for one voice,
> followed by all events for another voice?

Because of memory sizes for the event pool, this depends on the number of
events you want to enqueue. Of course you'll need to stay ahead of the queue
or the event wil be emitted immediately (when T[scheduled] < T[queue head]).

Yes, you can enqueue all events for one voice followed by next voices as
long as you do not exceed the size of the queue. In practice you'll enqueue
the events for a (small) timeframe, eg. one bar, and let the sequencer
handle the scheduling. 

Frank.

-- 
+---- --- -- -  -   -    - 
| Frank van de Pol                  -o)    A-L-S-A
| FvdPol@home.nl                    /\\  Sounds good!
| http://www.alsa-project.org      _\_v
| Linux - Why use Windows if we have doors available?


-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-01-19 22:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-11 18:31 General Guidelines? (MIDI) Brian Victor
2003-01-13  9:25 ` Clemens Ladisch
2003-01-13 10:02   ` Takashi Iwai
2003-01-14 21:20     ` Brian Victor
2003-01-15 11:43       ` Clemens Ladisch
2003-01-16  3:27         ` Brian Victor
2003-01-16  7:39           ` Clemens Ladisch
2003-01-16 13:41             ` Brian Victor
2003-01-16 15:32               ` Tim Goetze
2003-01-16 17:23                 ` Brian Victor
2003-01-16 18:14                 ` Takashi Iwai
     [not found] <E18ZGLH-0005nh-00@sc8-sf-list2.sourceforge.net>
2003-01-16 21:27 ` Pedro Lopez-Cabanillas
2003-01-16 22:37   ` Brian Victor
2003-01-19 22:21     ` Frank van de Pol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.