/GDSoundFontParser

SoundFont parser

Primary LanguageSwiftMIT LicenseMIT

GDSoundFontParser

MIT License Stargazers Forks Issues

Platforms Swift 5

Sponsors

Table of Contents

Summary

This is a Swift package for parsing SoundFonts

Project Documentation

Blog post for this example

Blog post

Usage

Read the blog post. Or just read the code. Or run the tests.

e.g. Listing the preset names

import GDSoundFontParser

func getPresets() {
    let parser = GDSoundFontParser()
    let sf: SoundFont
    
    guard let fileURL = Bundle.module.url(forResource: "FreeFont", withExtension: "sf2") else {
        return
    }
    do {
        sf = try parser.parse(fileURL: fileURL)
        
        let presets = sf.getPresets()

        for p in presets {
            print("\(p.name) (\(p.bank):\(p.preset)) \(p.presetBagIndex)")
        }
    } catch {
        print("\(error.localizedDescription)")
    }
}

Issues

If you find one, please add it to Issues

Buy my kitty Giacomo some cat food

Paypal

Giacomo Kitty

Licensing

MIT License article on Wikipedia

Please read the LICENSE for details.

Credits

Gene De Lisa's development blog

Gene De Lisa's music blog

Twitter @GeneDeLisaDev

LinkedIn

Stackoverflow