Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pedro Lopez-Cabanillas <plcl@telefonica.net>
To: Brian Victor <bhv1@psu.edu>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: General Guidelines?  (MIDI)
Date: Thu, 16 Jan 2003 22:27:35 +0100	[thread overview]
Message-ID: <200301162227.36021.plcl@telefonica.net> (raw)
In-Reply-To: <E18ZGLH-0005nh-00@sc8-sf-list2.sourceforge.net>

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

       reply	other threads:[~2003-01-16 21:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E18ZGLH-0005nh-00@sc8-sf-list2.sourceforge.net>
2003-01-16 21:27 ` Pedro Lopez-Cabanillas [this message]
2003-01-16 22:37   ` General Guidelines? (MIDI) Brian Victor
2003-01-19 22:21     ` Frank van de Pol
2003-01-11 18:31 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301162227.36021.plcl@telefonica.net \
    --to=plcl@telefonica.net \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=bhv1@psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox