From: Pieter Palmers <pieterp@joow.be>
To: "M. Gagnon" <fire_void@hotmail.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Development Question
Date: Sun, 18 Mar 2007 11:29:32 +0100 [thread overview]
Message-ID: <45FD148C.4020305@joow.be> (raw)
In-Reply-To: <BAY120-F17E8FDED841B64CE8247F09C770@phx.gbl>
M. Gagnon wrote:
> This is interesting, Pieter, however my app already has the knowledge of
> notes and events, the only reason i had midi bytes was because i converted
> the events into bytes because then i could make them play using a single
> function on mac.
>
> Apparently on Linux/Alsa it's not this way, so i should probably learn how
> to put a serie of events in a sequence and then play it. The most recent
> sample of this i found was dated '2002' and didn't work, and my own attempts
> with the documentation didn't either.
>
> I am already able to send events directly. Where can i find recent
> infomation on how to schedule them in a queue and play them after?
I found the doxygen docs that come with alsa-devel sufficient.
What you have to do is convert your own 'events' into ALSA seq events,
and then use the snd_seq_event_output function. Things as timestamps
etc... are properties of ALSA seq events, and can be set using
snd_seq_event_* functions.
Pieter
PS: One tricky thing if you use multiple ports is that the port an event
should be sent to is also a property of the event.
>
> thanks
>
>
>> From: Pieter Palmers <pieterp@joow.be>
>> To: "M. Gagnon" <fire_void@hotmail.com>
>> CC: alsa-devel@lists.sourceforge.net
>> Subject: Re: [Alsa-devel] Development Question
>> Date: Sat, 17 Mar 2007 22:36:31 +0100
>>
>> M. Gagnon wrote:
>>> Hi, i am now trying to port an application to linux using Alsa. At some
>>> point, i have midi bytes as char* and i have to play them. This is exactly
>>> the same data you'd find in a file, expect that it's in memory instead.
>>> How is that possible?
>>>
>>> If this is not possible, i could always take any help on playing midi
>>> using sequencers I looked at the docs, i found a few samples, but they
>>> seemed to be outdated and the one that could interest me segfaulted. After
>>> i debugged it and fixed the segfault, it played nothing... (and i'm sure
>>> my midi is configured correctly BTW, pmidi works and i also succeeded in
>>> getting single notes to play)
>> This is how I do playback in the freebob backend for jack:
>>
>> for (s=0;s<samples_read;s++) {
>> signed int *byte=(buff+s);
>> snd_seq_event_t ev;
>> if ((snd_midi_event_encode_byte(
>> port->parser,(*byte) & 0xFF, &ev)
>> ) > 0) {
>> // a midi message is complete, send it out to ALSA
>> snd_seq_ev_set_subs(&ev);
>> snd_seq_ev_set_direct(&ev);
>> snd_seq_ev_set_source(&ev, port->seq_port_nr);
>> snd_seq_event_output_direct(port->seq_handle, &ev); }
>> }
>>
>> you can check the freebob_driver_midi_* functions in the freebob jack
>> backend for more detail.
>>
>> Pieter
>>
>
> _________________________________________________________________
> Windows Live Spaces: partagez vos photos avec vos amis!
> http://spaces.live.com/?mkt=fr-ca
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next prev parent reply other threads:[~2007-03-18 10:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.0.1174159191.971.alsa-devel@lists.sourceforge.net>
2007-03-17 19:27 ` Development Question M. Gagnon
2007-03-17 21:36 ` Pieter Palmers
2007-03-18 1:19 ` M. Gagnon
2007-03-18 10:29 ` Pieter Palmers [this message]
2007-03-18 18:08 ` M. Gagnon
2007-03-19 8:33 ` Clemens Ladisch
2007-03-20 0:27 ` M. Gagnon
2007-03-20 1:58 ` raghvendra misra
2007-03-20 8:12 ` Clemens Ladisch
2007-03-21 1:02 M. Gagnon
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=45FD148C.4020305@joow.be \
--to=pieterp@joow.be \
--cc=alsa-devel@lists.sourceforge.net \
--cc=fire_void@hotmail.com \
/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 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.