Alsa sequencer port type flags
What is the use, in a programmer view, of alsa sequencer port type flags? How this transcends to the 'user experience'?
(Context: Keep doing with the sequencer chapter of the Alsa user conceptual model, an spanish documentation to be translated soon, at:
http://www.salleurl.edu/~is04069/Modders/Docs/alsadoc-sequencer.html)
Signature · 12 lines
David García Garzón <[email protected]> Phone: 034 93 542 21 99 Music Technology Group, Institut Universitari de l'Audiovisual Universitat Pompeu Fabra ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 5 lines · David Garcia Garzon
(Context: Keep doing with the sequencer chapter of the Alsa user conceptual model, an spanish documentation to be translated soon, at:
http://www.salleurl.edu/~is04069/Modders/Docs/alsadoc-sequencer.html)
Nice work. I have added a link to the docs page. Let us know if you need it hosted permanently.
Signature · 22 lines
Patrick Shirkey - Boost Hardware Ltd. Http://www.boosthardware.com Http://www.djcj.org - The Linux Audio Users guide ======================================== Apparently upon the beginning of the barrage, the donkey broke discipline and panicked, toppling the cart. At that point, the rockets disconnected from the timer, leaving them strewn around the street. Tethered to the now toppled cart, the donkey was unable to escape before the arrival of U.S. troops. United Press International Rockets on donkeys hit major Baghdad sites By P. MITCHELL PROTHERO Published 11/21/2003 11:13 AM ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A Dimecres 10 Desembre 2003 12:44, Patrick Shirkey va escriure:
Quoted 7 lines
Quoted 3 lines · David Garcia Garzon
(Context: Keep doing with the sequencer chapter of the Alsa user conceptual model, an spanish documentation to be translated soon, at:
http://www.salleurl.edu/~is04069/Modders/Docs/alsadoc-sequencer.html)Nice work. I have added a link to the docs page. Let us know if you need it hosted permanently.
Thanks a lot. :-) Notice that the link i wrote was only the sequencer chapter, the full document to link at is:
http://www.salleurl.edu/~is04069/Modders/Docs/alsadoc.html
But, most chapters are not as complete as sequencer chapter :-( i'll keep working on them.
Back to the question. Anybody knows about the usefulness of sequencer port types?
The API docs specifies that values:
<quote>
Each port has also the type bitmasks defined as follows:SND_SEQ_PORT_TYPE_SPECIFIC Hardware specific port SND_SEQ_PORT_TYPE_MIDI_GENERIC Generic MIDI device SND_SEQ_PORT_TYPE_MIDI_GM General MIDI compatible device SND_SEQ_PORT_TYPE_MIDI_GS GS compatible device SND_SEQ_PORT_TYPE_MIDI_XG XG compatible device SND_SEQ_PORT_TYPE_MIDI_MT32 MT-32 compatible device SND_SEQ_PORT_TYPE_SYNTH Synth device SND_SEQ_PORT_TYPE_DIRECT_SAMPLE Sampling device (supporting download) SND_SEQ_PORT_TYPE_SAMPLE Sampling device (sample can be downloaded at any time)SND_SEQ_PORT_TYPE_APPLICATION Application (sequencer/editor)
A port may contain specific midi channels, midi voices and synth voices. These values could be zero as default.
</quote>
But which are the implications of setting up a port with such flags?
- Are they merely informative?
- Will Alsa coerce or enhance the port usage depending on that type?
- Can the user see that information in any way?
Signature · 12 lines
David García Garzón <[email protected]> Phone: 034 93 542 21 99 Music Technology Group, Institut Universitari de l'Audiovisual Universitat Pompeu Fabra ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 6 lines · David Garcia Garzon
[...]
Each port has also the type bitmasks defined as follows:SND_SEQ_PORT_TYPE_SPECIFICHardware specific portSND_SEQ_PORT_TYPE_MIDI_GENERICGeneric MIDI deviceSND_SEQ_PORT_TYPE_MIDI_GMGeneral MIDI compatible device [etc]
I am absolutely not an expert on this, but it's very similar to a question I've asked before on this list so I'll summarise my understanding of it and hope for corrections.
These flags indicate what sorts of sequencer events the port expects to be able to handle. The fact that they refer to types of event rather than what the port does with those events seems to be quite an important distinction: for example, a port setting TYPE_SYNTH is saying nothing about whether it handles MIDI events or implements a MIDI synth, it's only saying that it can handle the direct synthesis class of event. Equally it appears that an application should not necessarily set TYPE_APPLICATION unless it expects application-specific events, and so on.
For my purposes, the upshot was that I could not rely on these flags to find out what sort of application was implementing the port; I had hoped to test for soft synths with TYPE_SYNTH and TYPE_APPLICATION, for example, and that proved not to be possible.
Quoted 1 line
- Are they merely informative?
I think so. I'm just not sure who the information is for.
Quoted 2 lines
- Will Alsa coerce or enhance the port usage depending on that type?
I don't think so.
Quoted 1 line
- Can the user see that information in any way?
I don't know. I don't think it would be terribly useful though.
Chris
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 1 line · David Garcia Garzon
SND_SEQ_PORT_TYPE_SPECIFICHardware specific port
something hardware-specific (obviously :-)
Quoted 1 line
SND_SEQ_PORT_TYPE_MIDI_GENERICGeneric MIDI device
Understands MIDI events/commands.
Quoted 4 lines
SND_SEQ_PORT_TYPE_MIDI_GMGeneral MIDI compatible deviceSND_SEQ_PORT_TYPE_MIDI_GSGS compatible deviceSND_SEQ_PORT_TYPE_MIDI_XGXG compatible deviceSND_SEQ_PORT_TYPE_MIDI_MT32MT-32 compatible device
Support for these standards. Not necessarily full support, and the availability of instruments may depend on loaded soundfonts, but basic things like bank selection and drum channel selection should work.
This is not set for external ports like MPU-401 which may have a compatible device connected to them.
Quoted 1 line
SND_SEQ_PORT_TYPE_SYNTHSynth device
Device can playback sound via the SAMPLE_* events. (The OPL3 driver sets this flag too, so either this driver or my description is wrong.)
Quoted 1 line
SND_SEQ_PORT_TYPE_DIRECT_SAMPLESampling device (supporting download)
Can download instrument samples (SND_SEQ_EVENT_INSTR_PUT etc.)
Quoted 1 line
SND_SEQ_PORT_TYPE_SAMPLESampling device (sample can be downloaded at any time)
No ALSA driver sets this. I don't know what "at any time" means; the INSTR_* events _can_ be sent at any time.
Quoted 1 line
SND_SEQ_PORT_TYPE_APPLICATIONApplication (sequencer/editor)
This port is (usually) controlled by the user, and not by events sent to it.
Quoted 2 lines
But which are the implications of setting up a port with such flags?
- Are they merely informative?
Yes.
Quoted 1 line
- Will Alsa coerce or enhance the port usage depending on that type?
No. ALSA never looks at these flags, except when someone wants to read port information.
Quoted 1 line
- Can the user see that information in any way?
It isn't even shown in the proc files AFAIK.
Quoted 2 lines
What is the use, in a programmer view, of alsa sequencer port type flags?
Not much. They're more or less useless for automatic selection/ filtering of ports. It may be possible to show them to the user, but they won't be accurate in every case.
HTH
Clemens
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/