SF2Lib ~ SoundFont (SF2) Synthesizer In C++


This library can read SF2 SoundFont files and render audio samples from them in real-time. It properly reads in a compliant SF2 file and can be used to obtain meta data such as preset names. It also has an audio rendering engine that can generate audio samples for key events that come from (say) a MIDI keyboard. This library is currently being used by my SoundFonts and SoundFontsPlus applications for SF2 file parsing and, in the latter app, as the sample generating engine.

Although most of the library code is generic C++17/23, there are a few bits that expect an Apple platform that has the AudioToolbox and Accelerate frameworks available. The goal is to be a simple library for reading SF2 files as well as a competent SF2 audio renderer whose output can be fed to any sort of audio processing chain, but it would probably take some effort to remove it from the Apple ecosystem.

github.com/bradhowes/SF2Lib
swiftpackageindex.com/bradhowes/SF2Lib

Leave A Reply