Sound in BasicC - mixer, synthesizer, sequencer on 250 lines

I created my own sound system for BasicC, more interesting than SDL_mixer in my opinion. Only 250 lines of code, after small changes it can be used in pure SDL, although I recommend BasicC :).

Custom multi-channel mixer, should be faster than SDL_mixer. In addition, the ability to change the frequency of played sounds, generator of synthesized sounds and a simple sequencer.

I made a demo playing a randomly generated melody… here’s a demo on Youtube (mono):
https://youtu.be/A4sP7AM_Tus

Download here:
https://robosy.itch.io/basicc

Mixer description:
https://pl.wikibooks.org/wiki/BasicC/D%C5%BAwi%C4%99k

I read .OGG files with truncated STB_vorbis, .MOD files with micromod - I don’t want to read .XM, I don’t know why… I couldn’t handle MIDI… maybe some separate small player…

3 Likes

I added MIDI support, in the attachment there is an executable program for Linux that plays music. Please let me know if it works and there is no bass shift. Fluidsynth required.
The number of samples for callback is set to 500, it works for me…
testsnd (45.1 KB)