All Projects → gyng → synthrs

gyng / synthrs

Licence: MIT license
Toy audio synthesizer library in Rust with basic MIDI support.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to synthrs

CureSynth Whip
Polyphonic MIDI Synthesizer for STM32F7
Stars: ✭ 45 (-38.36%)
Mutual labels:  midi, synthesizer
Shaden
🎧 A modular audio synthesizer.
Stars: ✭ 175 (+139.73%)
Mutual labels:  midi, synthesizer
Miti
miti is a musical instrument textual interface. Basically, its MIDI, but with human-readable text. 🎵
Stars: ✭ 103 (+41.1%)
Mutual labels:  midi, synthesizer
Audiobench
Open source modular synthesizer
Stars: ✭ 63 (-13.7%)
Mutual labels:  midi, synthesizer
Adlplug
FM Chip Synthesizer — OPL & OPN — VST/LV2/Standalone
Stars: ✭ 249 (+241.1%)
Mutual labels:  midi, synthesizer
Minibae
The platform-neutral Beatnik Audio Engine, Mini Edition (miniBAE) is an exceptionally mature, well-rounded, and reliable computer music and sound system specially customized for small-footprint and embedded applications.
Stars: ✭ 82 (+12.33%)
Mutual labels:  midi, wav
Fsynth
Web-based and pixels-based collaborative synthesizer
Stars: ✭ 146 (+100%)
Mutual labels:  midi, synthesizer
Romplayer
AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player
Stars: ✭ 445 (+509.59%)
Mutual labels:  midi, synthesizer
Mt32 Pi
🎹🎶 A baremetal kernel that turns your Raspberry Pi 3 or later into a Roland MT-32 emulator and SoundFont synthesizer based on Circle, Munt, and FluidSynth.
Stars: ✭ 231 (+216.44%)
Mutual labels:  midi, synthesizer
Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+213.7%)
Mutual labels:  midi, synthesizer
Esp8266audio
Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
Stars: ✭ 972 (+1231.51%)
Mutual labels:  midi, wav
guitar
🎸 Online guitar toy and tablature recorder/player
Stars: ✭ 80 (+9.59%)
Mutual labels:  midi, synthesizer
Fluidsynth
Software synthesizer based on the SoundFont 2 specifications
Stars: ✭ 811 (+1010.96%)
Mutual labels:  midi, synthesizer
Audiokitsynthone
AudioKit Synth One: Open-Source iOS Synthesizer App
Stars: ✭ 1,258 (+1623.29%)
Mutual labels:  midi, synthesizer
Webaudiofont
Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
Stars: ✭ 600 (+721.92%)
Mutual labels:  midi, synthesizer
Lick
LiCK, Library for ChucK
Stars: ✭ 118 (+61.64%)
Mutual labels:  midi, synthesizer
arduino-midi-sound-module
Turn your Arduino Uno into a 16-voice MIDI sound synthesizer
Stars: ✭ 43 (-41.1%)
Mutual labels:  midi, synthesizer
Awesome Music Production
A curated list of software, services and resources to create and distribute music.
Stars: ✭ 340 (+365.75%)
Mutual labels:  midi, synthesizer
Omnimidi
A software MIDI synthesizer for professional use.
Stars: ✭ 181 (+147.95%)
Mutual labels:  midi, synthesizer
webaudio-synth
WebAudio Polyphonic Synthesizer
Stars: ✭ 83 (+13.7%)
Mutual labels:  midi, synthesizer

synthrs

Documentation

Toy synthesiser library in Rust.

For programmatic playback, please check out the cpal integration.

Features

  • Not too difficult syntax for writing your own tones (see examples)
  • Basic filters (low-pass, high-pass, band-pass, band-reject, all-pass, comb, delay line, attack/decay envelope)
  • Basic waveforms (sine, square, triangle, sawtooth, tangent, bastardised Karplus-Strong, and more)
  • MIDI synthesis
  • Basic sample synthesis (WAV)
  • PCM or WAV output

Integrations

Examples (loud)

You have to right-click > download the bigger ones to your computer because GitHub does not like to stream audio

Try

To run examples (list below)

cargo run --example EXAMPLE_NAME

To use as a library, add this to Cargo.toml

[dependencies.synthrs]
git = "https://github.com/gyng/synthrs"
rev = "the commit you want"

To write a custom tone to a WAV file

extern crate synthrs;

use synthrs::synthesizer::{ make_samples, quantize_samples };
use synthrs::wave::sine_wave;
use synthrs::writer::write_wav_file;

fn main() {
    // Using a predefined generator
    write_wav_file("out/sine.wav", 44_100,
        &quantize_samples::<i16>(
            &make_samples(1.0, 44_100, sine_wave(440.0))
        )
    ).expect("failed to write to file");

    // `make_samples` takes in the duration, sample rate, and a generator closure.
    // It returns an iterator which `quantize_samples` wraps around (setting the bit depth).
    write_wav_file("out/sine_closure.wav", 44_100,
        &quantize_samples::<i16>(
            &make_samples(1.0, 44_100, |t| (t * 440.0 * 2.0 * 3.14159).sin())
        )
    ).expect("failed to write to file");
}

More examples are in examples/.

Examples

Check out Cargo.toml for the full example list.

  • simple generates simple tones in out/
  • telecoms generates phone tones in out/
  • filters generates examples of audio filtering in out/
  • midi synthesises a few MIDI files in out/

This generates WAV or PCM files which can be opened in Audacity. Example MIDI files are public domain as far as I can tell.

cpal

Example usage with cpal

midi-to-wav

midi-to-wav, a simple cli to convert MIDI files to WAV

wasm

Audacity PCM import settings

File > Import > Raw Data...

  • Signed 16-bit PCM
  • Little-endian
  • 1 Channel (Mono)
  • Sample rate: 44_100Hz (or whatever your samples generated have)

License

synthrs is licensed under the MIT License. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].