All of lore.kernel.org
 help / color / mirror / Atom feed
* Direct Delivery of NoteOn events
@ 2006-10-23 19:58 paul santa clara
  2006-10-24  8:00 ` Clemens Ladisch
  0 siblings, 1 reply; 7+ messages in thread
From: paul santa clara @ 2006-10-23 19:58 UTC (permalink / raw)
  To: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 1205 bytes --]

Hi everyone,
	I am having difficulty getting alsa to actually delivery a noteon  
event for me.  I am came across a list posting from 2004 which  
claimed that Queue's were necessary for NoteOn's to allow alsa to  
schedule the concomitant Noteoff at the appropriate time.   
Nevertheless, i can find nothing in the documentation which  
collaborates this.  Still, i did attempt to use to a Q but was unable  
to produce any results.  Here is the offending code:

snd_seq_ev_clear( &event );	
snd_seq_ev_set_source( &event, our_parcel->out_port );
snd_seq_ev_set_subs( &event );						//subscription was graphically  
verified with Qjack
snd_seq_ev_set_direct( &event );
snd_seq_ev_schedule_tick(  &event, queue, 0, 4 );
snd_seq_ev_set_note( &event, 1, 67, 127, 8 );

//Queue stuff
snd_seq_queue_tempo_t *tempo;
int queue = snd_seq_alloc_queue( our_parcel->seq );
snd_seq_queue_tempo_alloca( &tempo );
snd_seq_queue_tempo_set_tempo( tempo, 100000);
snd_seq_queue_tempo_set_ppq( tempo,64 );
snd_seq_set_queue_tempo( our_parcel->seq, queue, tempo );

snd_seq_start_queue( our_parcel->seq, queue, NULL );
snd_seq_drain_output( our_parcel->seq );

Any help would be much appreciated.
thanks in advance,
-paul


[-- Attachment #1.2: Type: text/html, Size: 9397 bytes --]

[-- Attachment #2: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Direct Delivery of NoteOn events
@ 2006-10-24 22:24 paul santa clara
  0 siblings, 0 replies; 7+ messages in thread
From: paul santa clara @ 2006-10-24 22:24 UTC (permalink / raw)
  To: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 1661 bytes --]

Hi Clemens!

This applies only to note events, not to note on events.
Note events are split into a note on and a note off event.

Gotcha. That is what I meant. :)

int queue = snd_seq_alloc_queue( our_parcel->seq );

You must create the queue before you try to send events through it.

I attempted this which still does not work correctly.  >>> indicates  
changes.

//Queue
	snd_seq_queue_tempo_t *tempo;
 >>>	int queue = snd_seq_alloc_named_queue( our_parcel->seq, "Q1" );
	snd_seq_queue_tempo_alloca( &tempo );
	snd_seq_queue_tempo_set_tempo( tempo, 1000000);
	snd_seq_queue_tempo_set_ppq( tempo, 48 );
	snd_seq_set_queue_tempo( our_parcel->seq, queue, tempo );
 >>>	snd_seq_start_queue( our_parcel->seq, queue, NULL );

	snd_seq_ev_clear( &event );	
	snd_seq_ev_set_source( &event, our_parcel->out_port );
	//snd_seq_ev_set_subs( &event );
	snd_seq_ev_set_dest( &event, dest.client, dest.port );
	snd_seq_ev_schedule_tick(  &event, queue, 0, 20000 );
	snd_seq_ev_set_note( &event, 1, 67, 127, 800 );

Note, that above I have tried both using subscriptions and directly  
sending to the destination port. Neither works correctly when i am  
sending the alsa event to another process, but snd_seq_ev_set_dest()  
does work when sending to another port in the SAME process/client.  I  
verified this using another thread listening on the 2nd port. Pretty  
odd.  Finally, I output the event and drain the output...

 >>>snd_seq_event_output( our_parcel->seq, &event );
	snd_seq_drain_output( our_parcel->seq );

I've read thru a couple of small programs now which seem to do just  
this but actually work.  Any idea what i am missing?
thanks a bunch ,
-paul



[-- Attachment #1.2: Type: text/html, Size: 12198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

end of thread, other threads:[~2006-10-26 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 19:58 Direct Delivery of NoteOn events paul santa clara
2006-10-24  8:00 ` Clemens Ladisch
     [not found]   ` <99C795AE-FCD2-4E95-ABE0-145AA81EFB58@comcast.net>
2006-10-25  8:25     ` Clemens Ladisch
2006-10-25 23:56       ` paul santa clara
2006-10-26  7:23         ` Clemens Ladisch
2006-10-26 19:26           ` paul santa clara
  -- strict thread matches above, loose matches on Subject: below --
2006-10-24 22:24 paul santa clara

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.