🎹 [WIP] Full-fledged software sampler written in Rust.

Overview

sampler

This project aims to be a full-fledged software sampler written in Rust. While I initially used Apple's AUSampler for sampled instruments in my iOS app soundboard, its largely undocumented behavior and mysterious bugs called for a better alternative.

sampler is open source, so feel free to contribute and to use the code in your own projects :). It shall also serve as a larger example of using Rust for real-time audio processing.

Contents

Build Instructions

Active development currently happens on macOS only. There are few things that might fall apart on other systems, so any help with cross-platform support is appreciated :).

  1. Prerequisites
  2. Clone the repo
    # clone via ssh
    git clone [email protected]:soakyaudio/sampler.git
    
    # or via https
    git clone https://github.com/soakyaudio/sampler.git
  3. Build and start the app
    cd sampler
    cargo run
  4. Optional commands
    # run unit tests
    cargo test
    
    # build documentation
    cargo doc

Features

  • Standalone wrapper app with real-time audio output & midi input
  • Polyphonic sine-wave instrument with linear ADSR envelope
  • Here's some music while you wait for more features...

Roadmap

0.1.0

  • Code style, rustfmt
  • Fix compiler warnings
  • Multiple velocities
  • SFZ format
  • Unit tests
  • Voice stealing
  • WAV samples

0.2.0

  • Looped samples
  • Round robin

0.3.0

  • Disk streaming
  • Filter per voice

0.4.0

  • AUv3 plugin wrapper

Ideas

  • FX automation / routings
  • Get rid of Send trait and replace Arc with lifetimes if possible
  • Setup CI/CD pipeline with GitHub Actions
  • Write contribution guide

Third-Party Credits

  • cpal (Apache 2.0): Cross-platform audio I/O library in pure Rust.
  • hound (Apache 2.0): A wav encoding and decoding library in Rust.
  • midir (MIT): Cross-platform realtime MIDI processing in Rust.
  • ringbuf (MIT): Lock-free SPSC FIFO ring buffer with direct access to inner data.
  • And thanks to all the unmentioned thousands of contributers behind the amazing projects that keep this software running.

License

This project is released under the MIT License.

MIT License

Copyright (c) 2022 Micha Hanselmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
A simple GUI audio player written in Rust with egui. Inspired by foobar2000.

Music Player A simple GUI music player inspired by foobar2000 written in Rust using egui. The goal of this project is to learn about making gui/ nativ

Small music theory library with MIDI capabilities written in Rust
Small music theory library with MIDI capabilities written in Rust

mumuse Small music theory library with MIDI capabilities written in Rust (wip). Examples Creating notes and transpositions // Declare Note from &str l

A terminal music player written in the Rust language.
A terminal music player written in the Rust language.

A terminal music player written in the Rust language. (Windows) Requirements Configuration file path: C:\Users\xxx\.config\music_player\config.yml # P

Tool for solving music harmonics written in rust.
Tool for solving music harmonics written in rust.

Harmonized Tool for solving harmonics tasks Installation steps Requirements Make shure you have installed rust cargo If not: Download and run rust ins

API-agnostic audio plugin framework written in Rust

Because everything is better when you do it yourself - Rust VST3 and CLAP framework and plugins

ncspot is a ncurses Spotify client written in Rust using librespot.
ncspot is a ncurses Spotify client written in Rust using librespot.

ncspot is a ncurses Spotify client written in Rust using librespot. It is heavily inspired by ncurses MPD clients, such as ncmpc. My motivation was to provide a simple and resource friendly alternative to the official client as well as to support platforms that currently don't have a Spotify client, such as the *BSDs.

Tools for working with MIDI files - written by All the Music LLC for musicians.

Tools for Generating and Working with MIDI Files NOTICE: This repo is under construction and is not ready for use. Once it is ready, and the other rep

A rust binding for the FMOD library

rust-fmod This is a rust binding for FMOD, the library developped by FIRELIGHT TECHNOLOGIES. FMOD website : www.fmod.org You can also find it on crate

Easy Api in Rust to play Sounds

ears ears is a simple library to play sounds and music in Rust. Provides an access to the OpenAL spatialization functionality in a simple way. Accepts

Owner
soaky audio
soaky audio
Spotify for the terminal written in Rust 🚀

Spotify TUI A Spotify client for the terminal written in Rust. The terminal in the demo above is using the Rigel theme. Spotify TUI Installation Homeb

Alexander Keliris 13.3k Sep 28, 2022
A music theory guide written in Rust.

Rust Music Theory A library and executable that provides programmatic implementation of the basis of the music theory. Table of Contents Overview Usag

Ozan Kaşıkçı 523 Sep 28, 2022
musify is a simple discord bot to play music within a voice channel, written in the rust programming language.

musify-rs musify is a simple discord bot to play music within a voice channel, written in the rust programming language. Features A simple song queue

NV6 5 Aug 14, 2022
A Spotify downloader written in rust, which does not require a premium account

DownOnSpot A Spotify downloader written in Rust Disclaimer DownOnSpot was not developed for piracy. It is meant to be used in compliance with DMCA, Se

oSumAtrIX 216 Sep 25, 2022
Terminal Music Player written in Rust

Terminal Music Player written in Rust Listen to music freely as both in freedom and free of charge! Freedom: As time goes by, online service providers

null 313 Sep 23, 2022
Loopers is graphical live looper, written in Rust, designed for ease of use and rock-solid stability

Loopers Loopers is a graphical live looper, written in Rust, designed for ease of use and rock-solid stability. It can be used as a practice tool, com

Micah Wylde 75 Aug 10, 2022
A drum machine written in Rust

rudiments rudiments is a step-sequencing drum machine that plays rhythm patterns using audio samples. Features 16-step programmable measures. Configur

Jonas Michel 140 Sep 14, 2022
Synthesizer IO - a synthesizer written in Rust.

Synthesizer IO Hopefully, this will become a synthesizer written in Rust. At the moment, it's experimental bits of technology toward that end. Running

Raph Levien 275 Sep 9, 2022
VST2 frequency modulation synthesizer written in Rust

OctaSine VST2 frequency modulation synthesizer written in Rust. Official website with downloads OctaSine.com Audio examples SoundCloud Screenshots Lig

Joakim Frostegård 357 Sep 21, 2022
🎵 A super simple VST written in Rust

DigiDist This is a simple little VST plugin, developed in Rust using the vst2 crate. It doesn't sound particularly great, but it demonstrates just how

Joe Clay 34 May 29, 2022