Skip to content

Kotlin Multiplatform library for sample-based synthesis.

License

Notifications You must be signed in to change notification settings

lemcoder/MikroSoundFont

Repository files navigation

Kotlin Multiplatform SoundFont library

Kotlin
GitHub License

Library for sample-based synthesis to generate audio data. The library allows to load .sf2 files from memory. Is basically a KMP wrapper around TinySoundFont library.

The goal of this library is to allow operations on .sf2 files and generating audio in Kotlin Multiplatform projects. The library has batteries-included so no configuration is required.

Non goals:

  • Audio playback
  • Audio file export (such as WAV or MP3)
  • File I/O operations
  • Audio format conversion
  • Resampling, mixing etc...

Platform support:

Android iOS Mingw X64 Linux X64 MacOs Wasm JS
✔️ ✔️ ✔️ ✔️ ✔️ ✖️

Installation

This library is stored on Maven Central repository. To add library to Your project paste the following snippet in your TOML file.

[versions]
mikrosoundfont = "<latest_version>"

[libraries]
mikrosoundfont = { module = "io.github.lemcoder.mikrosoundfont:soundfont", version.ref = "mikrosoundfont" }

Usage

val sfBuffer   // .sf2 file bytes
    
val soundFont = MikroSoundFont.load(sfBuffer)

.. use soundFont to generate audio data

License

This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details