Skip to main content

Introduction

Documentation Status Discord Build Status Code Style: Ruff

CircuitPython library with tools for making synths with synthio

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install synthtools

Or the following command to update an existing version:

circup update

Usage Example

import time
from synth_setup import synth as engine
from synthtools import Patch, SubtractiveSynth

patch1 = Patch(name="fat bass", wave="ASAW", detune=1.004,
               filt_type="LPF", filt_f=800, filt_q=1.4,
               amp_env=[0.01, 0.1, 0.8, 0.4],
               vib_rate=5.5, vib_depth=0.0,
               # AHR filter envelope: cutoff swings 800 -> 3800 Hz and back
               fenv_amount=3000, fenv_attack=0.02, fenv_release=0.30,
               # a slow cyclic wobble on top of it (0 = off)
               filt_lfo_rate=0.4, filt_lfo_amount=0.3)
synth = SubtractiveSynth(engine, patch1)
arp = (36, 39, 43, 48)
i = 0
sweep = 0
while True:
    synth.note_on(arp[i % len(arp)], velocity=110)
    time.sleep(0.11)
    synth.note_off(arp[i % len(arp)])
    time.sleep(0.02)
    i += 1
    if i % 32 == 0:  # flip waveforms now and then
        synth.wave = "ASQU" if synth.wave == "ASAW" else "ASAW"

What’s Included

  • Synth – synth engine base: shared voice, patch, and modulation handling, with mono mode for a single-voice synth with glide_time portamento

  • SubtractiveSynth – subtractive two-oscillator synth w/ detune

  • WavetableSynth – wavetable-playback with adjustable wave_pos

  • BasslineSynth – TB-303-style acid bassline: monophonic, one oscillator, a decay-only filter sweep, per-step slide and accent

  • EffectsChain – post-synth audio effects: extra filter stages that track the synth’s cutoff for a steeper slope, plus optional distortion and tempo-synced echo (needs audiofilters in the build)

  • Patch – inert, JSON-able patch data; save/load with save_patches() / load_patches()

  • Wavetable – loads a wavetable WAV file and lerps between frames

  • AHREnvelope – shared-block attack/release envelope, used for both the filter and pitch envelopes

  • Waves – waveform factory (saw, square, sine, triangle, noise, and “analog” variants)

  • Arpeggiator / StepSequencer / TrigSequencer – poll-based sequencers with on/off callbacks

  • Param / ParamSet – knob-pickup and scaling for UIs with fewer knobs than parameters

  • Glider – a standalone pitch-slide block for hand-built synthio.Note graphs (the engines above have their own portamento, via mono + glide_time)

  • RollingAverage – moving-average smoothing for noisy knob reads

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for circuitpython-synthtools 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for circuitpython-synthtools 0.5
File Size Uploaded
circuitpython_synthtools-0.5.tar.gz 320.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for circuitpython-synthtools 0.5
File Interpreter ABI Platform
circuitpython_synthtools-0.5-py3-none-any.whl Python 3 none any Details

Total release size: 373.5 kB

Release files / circuitpython_synthtools-0.5.tar.gz

Download URL circuitpython_synthtools-0.5.tar.gz
Size 320.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19765e0430d1e4ecdda9e8b4edb891feba50079cf193343bbccba0d1b27f6015
BLAKE2b-256 checksum
How to use checksums
3c9f2507f246d4eae3cb7f60506ff611406623efc2e0544055d6c406f2d62c52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / circuitpython_synthtools-0.5-py3-none-any.whl

Download URL circuitpython_synthtools-0.5-py3-none-any.whl
Size 53.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0705718725e3eca19b4fd461a76eaf9dc26f7a1c6c47f26dd551e2ca54fdd5d
BLAKE2b-256 checksum
How to use checksums
a8cc4acb02ca061efa0408e353f0cb3edbe8b9b899abd62efca1200fe439b292
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

This release

0.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page