SyntaxBoom

Languages & Coding => Other Languages => Topic started by: Jackdaw on Jun 30, 2025, 04:28 PM

Title: Audio Library for Lazarus/Free Pascal
Post by: Jackdaw on Jun 30, 2025, 04:28 PM
While searching for Pascal Audio libraries. I came upon United OpenLib of Sound (https://github.com/fredvs/uos/).
I shall have to have a play around with this.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Baggey on Jun 30, 2025, 05:06 PM
Quote from: Jackdaw on Jun 30, 2025, 04:28 PMWhile searching for Pascal Audio libraries. I came United OpenLib of Sound (https://github.com/fredvs/uos/).
I shall have to have a play around with this.

What are you upto? Are you integrating this to CerberusX?
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Jackdaw on Jun 30, 2025, 05:31 PM
Quote from: Baggey on Jun 30, 2025, 05:06 PMWhat are you upto? Are you integrating this to CerberusX?
Well I won't be integrating that into Cerberus X. Monkey X and Cerberus X are not the easiest things to integrate anything into it. And as this is a Pascal library, it's not as straight forward to write a Pascal library that can be called from C/C++, which is what the desktop targets for Cerberus X output.

And what am I up to, well I'm seeing if it's going to be any good for any future project I may start. Plus it's also being added to those lists of useful development tools I've be updating every so often.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Baggey on Jun 30, 2025, 07:14 PM
Quote from: Jackdaw on Jun 30, 2025, 05:31 PM
Quote from: Baggey on Jun 30, 2025, 05:06 PMWhat are you upto? Are you integrating this to CerberusX?
Well I won't be integrating that into Cerberus X. Monkey X and Cerberus X are not the easiest things to integrate anything into it. And as this is a Pascal library, it's not as straight forward to write a Pascal library that can be called from C/C++, which is what the desktop targets for Cerberus X output.

And what am I up to, well I'm seeing if it's going to be any good for any future project I may start. Plus it's also being added to those lists of useful development tools I've be updating every so often.

Hows about BlitzmaxNG  :P
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Jackdaw on Jun 30, 2025, 07:20 PM
Quote from: Baggey on Jun 30, 2025, 07:14 PMHows about BlitzmaxNG  :P
Same problem.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Baggey on Jun 30, 2025, 08:00 PM
Quote from: Jackdaw on Jun 30, 2025, 07:20 PM
Quote from: Baggey on Jun 30, 2025, 07:14 PMHows about BlitzmaxNG  :P
Same problem.

I thought BlitzmaxNG is C  ???
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Jackdaw on Jun 30, 2025, 08:13 PM
Quote from: Baggey on Jun 30, 2025, 08:00 PMI thought BlitzmaxNG is C  ???
Yes but the posted audio library is written in Pascal. They use totally different calling conventions.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Baggey on Jun 30, 2025, 09:13 PM
Quote from: Jackdaw on Jun 30, 2025, 08:13 PM
Quote from: Baggey on Jun 30, 2025, 08:00 PMI thought BlitzmaxNG is C  ???
Yes but the posted audio library is written in Pascal. They use totally different calling conventions.

When i was doing audio @midimaster helped me get Beeper and AY going. You need to check midimaster's mima.audio. It's a lovely piece of work and is a C file originaly.

I have it still if it has been lost! I use it in my ZX Spectrum 128K emulator when i compile.

Im sure @midimaster will be back on the scene soon!  ;) He's defo your man! And he aint going to stay away for long, im sure off it!  :D

Kind Regards Baggey
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Jackdaw on Jun 30, 2025, 09:50 PM
He's wrote a BliztMax wrapper for minaudio by David Reid (aka mackron) (https://github.com/mackron/miniaudio).

Now I could write a Free Pascal language binding, providing it's not doing C specific data structures, like unnamed unions. I never did figure out how to get the z80 emulator data structure to work correctly with Pascal.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Midimaster on Jun 30, 2025, 11:42 PM
Here is the GitHub-Page where you can find the BlitzMax wrapper for MiniAudio.

It contains all code you need to run it: And also a manual /reference) and lot of blitzmax code examples.

https://github.com/MidimasterSoft/BlitzMax-Miniaudio-Wrapper (https://github.com/MidimasterSoft/BlitzMax-Miniaudio-Wrapper)

The tutorial got lost, when Syntaxbomb closed... Maybe somebody will find it on wayback machine...


The wrapper code can also be a good source for how to bind C-libraries into languages like basic.
Title: Re: Audio Library for Lazarus/Free Pascal
Post by: Dabzy on Jul 01, 2025, 07:12 AM
QuoteThe tutorial got lost, when Syntaxbomb closed... Maybe somebody will find it on wayback machine...

It's on me todo list to get stuff like that, I just havent had the time to have a good dig at it.

Dabz