(posted separately on the wiki, not knowing exactly where to post).
I'm a newcomer to ALSA development and currently focusing on ALSA MIDI sequencing, for the purpose of developing a new, more complete Perl interface for ALSA Seq, as well as an API for Erlang.
This is an on-going effort needed for bigger projects, and currently receiving all my development time.
I have spent the last few weeks reading ALSA MIDI Seq source code (both the alsa-lib, for clients, and the kernel code) in search of a better understanding of the overall picture.
Lots of code, not necessarily easy to read.
As such I still have quite some blind spots regarding how MIDI events actually flow thru the whole architecture, from the time they get into the system from, say, a hw port, to a chain of apps, thru ports and queues, and back to many synth (for instance). (I've written client seq that work perfectly, yet not enough to fully understand how things work in the core for the sake of writing efficent and convenient APIs).
Re input and output ports used by ALSA MIDI Seq clients. They are both created thru the same code, using flags to set read or write capabilities.
I seem to understand the role of an input port, as a device that allows a MIDI client seq to receive direct or scheduled events (I would something resembling a fifo/pipe mechanism - the kernel writes into it, the client reads it. Though internally it seems to rely not on real pipes (fd) but on linked list of MIDI event cells).
However, even after reading the source code (both alsa-lib API and kernel code -lots of code), I sill completely miss the role of the output port.
Indeed, the kernel code does not seem to use "output ports" at all to dispatch MIDI events to seq clients : the code I have read seems to operate either way :
enqueue an output event if it is scheduled to be delivered some time in the future (either RT or thru MIDI ticks [tempo/BPM]
ot disptach it immediately and direclty to the input ports of the subscribing seq clients.
As such, whatis the role and the importance of a MIDI seq client output port, and how do they fit in the overall picture in respect to the circulation and delivery of MID events ?
Any precise answer, possibly with comprehensive snippets of code, will certainly be most helpful to write write convenient and efficient APIs.
Thank you for any help in these directions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
(posted separately on the wiki, not knowing exactly where to post).
I'm a newcomer to ALSA development and currently focusing on ALSA MIDI sequencing, for the purpose of developing a new, more complete Perl interface for ALSA Seq, as well as an API for Erlang.
This is an on-going effort needed for bigger projects, and currently receiving all my development time.
I have spent the last few weeks reading ALSA MIDI Seq source code (both the alsa-lib, for clients, and the kernel code) in search of a better understanding of the overall picture.
Lots of code, not necessarily easy to read.
As such I still have quite some blind spots regarding how MIDI events actually flow thru the whole architecture, from the time they get into the system from, say, a hw port, to a chain of apps, thru ports and queues, and back to many synth (for instance). (I've written client seq that work perfectly, yet not enough to fully understand how things work in the core for the sake of writing efficent and convenient APIs).
Re input and output ports used by ALSA MIDI Seq clients. They are both created thru the same code, using flags to set read or write capabilities.
I seem to understand the role of an input port, as a device that allows a MIDI client seq to receive direct or scheduled events (I would something resembling a fifo/pipe mechanism - the kernel writes into it, the client reads it. Though internally it seems to rely not on real pipes (fd) but on linked list of MIDI event cells).
However, even after reading the source code (both alsa-lib API and kernel code -lots of code), I sill completely miss the role of the output port.
Indeed, the kernel code does not seem to use "output ports" at all to dispatch MIDI events to seq clients : the code I have read seems to operate either way :
As such, whatis the role and the importance of a MIDI seq client output port, and how do they fit in the overall picture in respect to the circulation and delivery of MID events ?
Any precise answer, possibly with comprehensive snippets of code, will certainly be most helpful to write write convenient and efficient APIs.
Thank you for any help in these directions.