Skip to content

The Dynamic Python Synthesizer ๐ŸŽน๐ŸŽถ

Notifications You must be signed in to change notification settings

JoramMillenaar/Synthon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

drawing

Synthon: The Dynamic Python Synthesizer ๐ŸŽน๐ŸŽถ

Synthon transforms your MIDI inputs into a symphony of synthesized sounds, all powered by Python. Dive into a world where digital audio meets creativity, with a synthesizer that's as versatile as it is powerful. Whether you're a musician, a hobbyist, or an audio enthusiast, Synthon offers an immersive experience in sound synthesis.

Key Highlights

  • ๐ŸŽš๏ธ Customizable Timbre: Craft your unique sound with adjustable ADSR envelopes, vibrato, tremolo, and harmonics.
  • ๐ŸŽง Real-Time MIDI Support: Connect any MIDI device and turn keystrokes into music.
  • ๐Ÿ”Š Robust Output Pipeline: Direct your audio masterpiece to speakers or record it seamlessly.
  • ๐Ÿ› ๏ธ Fine-Tune Your Experience: Full control over sample rate, chunk size, and volume, all through an intuitive command-line interface.
  • ๐Ÿ“ Template-Based Configuration: Easily set up and reuse configurations with JSON templates.
  • ๐Ÿ“ Save Your Creations: Output your audio directly to a file for easy sharing and editing.

Features

  • Output Pipeline: Direct audio output to speakers or save it to a file.
  • Synthesizer: High-quality sound generation with adjustable sample rate and chunk size.
  • MIDI Compatibility: Use any MIDI input device to control the synthesizer.
  • Customizable Timbre: Fine-tune the sound with adjustable ADSR envelope, vibrato, tremolo, and harmonics.
  • Template-Based Configuration: Simplify setup using customizable JSON templates for different sound configurations.

Getting Started

Prerequisites

  • Python 3.x
  • MIDI input device (or use our companion project to turn your computer's keyboard into a MIDI device)

Dependencies

pip install mido sounddevice numpy

Usage

Run synthon.py with the desired arguments or use a JSON template for quick setup. For example:

python synthon.py --volume 0.5 --attack 0.01 --harmonic 2,0.5,None --harmonic 3,0.3,0.8

Or using a template:

python synthon.py --template my_config.json

Command Line Arguments

  • --template: Path to a JSON template file for predefined configurations (default: 'default.json').
  • --volume: Set a note's volume (default: 0.3)
  • --sample_rate: Sample rate for the synthesizer (default: 44100)
  • --chunk_size: Chunk size for the synthesizer (default: 512)
  • --attack, --decay, --sustain-amplitude, --sustain, --release: Configure the ADSR envelope.
  • --vibrato-rate, --vibrato-depth: Configure the rate and depth of vibrato.
  • --tremolo-rate, --tremolo-depth: Configure the rate and depth of tremolo.
  • --harmonic: Add a harmonic in the format "multiple,amplitude,sustain duration (None for infinite)". Repeatable for multiple harmonics.
  • --disable_speaker: Disable output to speaker.
  • --output: Filename for the output file.
  • --port_name: MIDI input port name (default: 'IAC Driver Bus 1').

Templates

Templates are JSON files that pre-define configurations for Synthon. They can specify any command-line arguments. Place your templates in the templates directory of the project root. By default, Synthon uses default.json from this directory.

No MIDI Keyboard?

If you don't have a MIDI keyboard, check out my other project which allows you to turn your computer's keyboard into a MIDI device.

About

The Dynamic Python Synthesizer ๐ŸŽน๐ŸŽถ

Topics

Resources

Stars

Watchers

Forks

Languages