Has anybody used FPC to control ALSA on Linux? I need to filter a MIDI stream in real time, and handle transposition etc.
If anybody knows of useful resources I'd appreciate any hints.

Mailing lists / fpc-pascal / 2012-05
8 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Has anybody used FPC to control ALSA on Linux? I need to filter a MIDI stream in real time, and handle transposition etc.
If anybody knows of useful resources I'd appreciate any hints.
I have used ALSA to record sound. It was some time ago, I think on Kubuntu 10.04 or so.
I can send you some code I used but I have no idea whether it will work under newer Linux's
Thanks, but since it's specifically MIDI I'm interested in it might not be relevant.
Can you remember which Pascal interface to the ALSA libraries you were using? I think I've seen two, but I've not yet checked to see whether they were actually minor variants of the same thing.
The readme file says:
ALSAPAS (ALSA library for Pascal)
Version 0.9.7, September 2003.
Copyright (c) 2002-2003, Pedro Lopez-Cabanillas
Thanks, but since it's specifically MIDI I'm interested in it might not be relevant. Can…
http://sourceforge.net/projects/fpalsa/
http://sourceforge.net/projects/humus/
The readme file says: ALSAPAS (ALSA library for Pascal) Version 0.9.7, September 2003.…
Hence http://perso.wanadoo.es/plcl/alsapas/alsapas-en.html
http://sourceforge.net/projects/fpalsa/ http://sourceforge.net/projects/humus/ View this…
leledumbo wrote
Thanks for those. Also
http://perso.wanadoo.es/plcl/alsapas/alsapas-en.html so as I thought there appears to be (at least) two sets of ALSA bindings: fpalsa and alsapas.
Noted HuMuS, but that appears to be for PortAudio. However using that as a seed I get to http://breakoutbox.de/pascal/pascal.html#PortAudio which claims to include PortMidi support- this is supposedly cross-platform but requires an additional library which might not be available on all distreaux. Also MIDI is very much the "poor cousin" and operating support is patchy, so since I've got ALSA working I'm reluctant to risk breaking anything.
Since running on anything other than Linux is not a significant priority, I think I'll probably start off with by doing a comparison of fpalsa and alsapas, and writing code that will support either if possible. If I could also code to support PortMidi that would be a bonus, but by no means essential: I'm trying to knock together a MIDI transposer for my own use, and testbed some techniques for another project.
To wrap this up, alsapas is a translation of the ALSA headers etc. as of v0.9.7, and fpalsa is similar but corresponds to the slightly later v1.0.24. They have a slightly different style in that alsapas uses variable parameters while fpalsa uses pointers to be a bit closer to the original (and possibly to allow null parameters); alsapas is attractive in that it's got useful examples.
As far as MIDI is concerned, alsapas still works but there's a handful of parameters named "out" that are no longer compatible with FPC, I've followed the author's convention and renamed those to _out; basic operation appears OK on Debian "Squeeze" x86 with a 3.2 kernel.