[fpc-pascal] Version 1.9.6[??] on the Mac.
Pedro Lopez-Cabanillas
plcl at telefonica.net
Mon Jan 17 22:32:10 CET 2005
On Monday 17 January 2005 08:38, Marco van de Voort wrote:
> smf compiles fine under freeBSD.
Thanks for testing.
> Alsapas has a unit libc dependancy. Most symbols used seem to be simple
> types that are named slightly differently, but the piping functions use
> libc stdio, which is not defined platform independant for FPC. (since FPC's
> stdio doesn't go through libc).
>
> If you don't really use
>
> inputh.inc:function snd_input_stdio_attach(var inputp:Psnd_input_t;
> fp:PIOFILE; _close:longint):longint;cdecl;external asoundlib_name;
> outputh.inc:function snd_output_stdio_attach(var outputp:Psnd_output_t;
> fp:PIOFILE; _close:longint):longint;cdecl;external asoundlib_name;
>
> then it could be made to compile with FPC without using unit libc I thik.
Those functions are seldom used, but are part of the ALSA library API. And the
main goal for ALSAPAS is to give full support of the ALSA library API.
Besides inputh.inc and outputh.inc, there are more places where Libc is used.
See the pollfd references in rawmidih.inc, or timeval/timespec in globalh.inc
But even if you could take away all of them, I don't understand why to do so.
I mean that ALSA is very Linux specific and it is not possible to use ALSA in
xBSD, MacOS, Solaris or Win32, so there is not a need to use ALSAPAS outside
a Linux box. And the ALSA userspace library, libasound.so, depends on Libc
anyway (and libm, libdl, libpthread...).
> > I've added one more example program, "buildsmf.pas", that creates a MIDI
> > file from scratch, and also fixed several bugs. The ALSA examples still
> > don't run with FPC, because some thread troubles.
>
> buildsmf compiles and generates a 90 byte midifile (under FreeBSD). spysmf
> also compiles. Rest uses ALSA, and doesn't.
OK. Thanks again. I have successfully tested the unit "smf" and the two
programs buildsmf and spysmf in Win32 today. They should work in any
environment supported by FPC. The resulting file "test.mid" is 90 bytes
length, and has a single track with 8 notes, playing a simple C-Major scale.
The other program should give this output on that file:
$ ./spysmf test.mid
0 -- SMF Header Format=0, Tracks=1, Division=120
0 -- Track Start
0 0 Note On 60 120
60 0 Note Off 60 120
60 0 Note On 62 120
120 0 Note Off 62 120
120 0 Note On 64 120
180 0 Note Off 64 120
180 0 Note On 65 120
240 0 Note Off 65 120
240 0 Note On 67 120
300 0 Note Off 67 120
300 0 Note On 69 120
360 0 Note Off 69 120
360 0 Note On 71 120
420 0 Note Off 71 120
420 0 Note On 72 120
480 0 Note Off 72 120
480 -- Meta Event End Of Track
480 -- Track End
As I have said, the programs involving ALSA are Linux only, but if there is
some interest on that, I can prepare and distribute a separated package with
the SMF related files only.
Regards,
Pedro
More information about the fpc-pascal
mailing list