C# library for loading SoundFont 2 files.
Install via NuGet:
Install-Package EZSF2 -Version x.x.x
Or via the .NET CLI:
dotnet add package EZSF2 --version x.x.x
using EZSF2;
using BinaryReader br = new BinaryReader(File.OpenRead("soundfont.sf2"));
SF2 soundFont = new SF2(br);
You can access SoundFont data with:
soundFont.Presets
soundFont.Instruments
soundFont.Samples
If you want to get note data for a given preset, note, and velocity, you can use:
soundFont.GetNote(int preset, int note, int velocity)