🎹 [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 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

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.

Small, compact music player written with Rust.

trill Small, compact music player based on rodio. Usage Run the program with --help to see the available options. To just play a sound file: trill -p

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

Releases(v0.1.0)
  • v0.1.0(Sep 30, 2022)

    • Standalone wrapper app with real-time audio output (#1) & midi input (#2)
    • Polyphonic sampler instrument with linear ADSR envelope (#3)
    • Multiple sample layers based on note and velocity
    • SFZ format loader (see supported opcodes) (#5)
    • Supported audio file formats: WAV (#4)
    Source code(tar.gz)
    Source code(zip)
Owner
soaky audio
soaky audio
Drumsthesia is a simple software that helps you to learn how to play the drums (or midi controllers).

Drumsthesia A shameless copy of Neothesia adapted for e-Drums. Youtube Video Binaries for MacOS, Linux (untested) and Windows (untested). Download Scr

Rodrigo Watanabe 4 Mar 20, 2023
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 14.1k Jan 1, 2023
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çı 551 Dec 21, 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 273 Jan 7, 2023
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 376 Jan 3, 2023
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 81 Dec 29, 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 278 Dec 13, 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 141 Nov 23, 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 412 Dec 30, 2022