Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 18 of 18

Thread: A subharmonic synthesiser and polymetric sequencer with Teensy 4 and audio library

Threaded View

  1. #1

    A subharmonic synthesiser and polymetric sequencer with Teensy 4 and audio library


    I thought I'd share a project I've been working on for the last 2 months - A subharmonic synthesiser and polymetric sequencer with Teensy 4 and audio library inspired by Euclidean Rhythms, and the Moog Subharmonicon (and standard subtractive synthesis).

    Euclidean rhythms use the Euclidean algorithm to describe how to best allocate some number of beats within a bar of arbitrary size. This connection has only recently come to light - see

    Additionally, the Moog Subharmonicon is a very recent synthesizer that uses polyrhythms to selectively trigger across two 4-note sequencers. Very interesting musical patterns are created by the changing interleaving when the rhythms share no small common divisors.

    I came across these two things at about the same time and thought the double sequencer idea could well be joined with a Euclidean rhythm generator to make an interesting synthesizer. Using a Teensy 4.0 and the Audio shield and library, I created "The Euclidean" - a 4-voice subharmonic synthesizer and polymetric sequencer.
    Here's some pics from while I was building it, and the final prototype (outside of its case still)

    Click image for larger version. 

Name:	Euclid1.jpg 
Views:	139 
Size:	195.8 KB 
ID:	20966
    Click image for larger version. 

Name:	Euclid2.jpg 
Views:	80 
Size:	182.9 KB 
ID:	20967
    Click image for larger version. 

Name:	Euclid3.jpg 
Views:	141 
Size:	110.2 KB 
ID:	20968
    Click image for larger version. 

Name:	Euclid4.jpg 
Views:	101 
Size:	189.9 KB 
ID:	20969

    Brief specs are:
    • 2 primary oscillators supporting various waveshapes, each with an associated sub-oscillator with frequency determined by dividing the primary frequency by an integer from 2 to 16
    • frequency modulation, pulse width modulation, quantisation
    • AD envelope
    • LFO (with multiple waveshapes)
    • Resonant low-pass filter with (positive and negative) envelope and LFO modulation
    • Chorus, Flanger, Delay effects
    • Three independent "Euclidean Rhythm" generators
    • Two independent 4 note sequencers - each driving one of the oscillators, and driven by various combinations of rhythm events.
    • +/-24 semitone steps for each sequencer
    • MIDI and Serial integration

    (Full specs are at the end of this post.)

    Here's some videos of it running.

    Demo of presets
    Making a patch

    MIDI keyboard integration

    This is still very much a work in progress, but I'm really happy having reached a milestone where it is so usable and fun. :-)


    • Two independent oscillator units.
      • 2 unison primary voices (detunable - light, medium, heavy)
      • waveshapes: Sine, Triangle, Square, Sawtooth, Variable Width Pulse
        - The Triangle, Square and Sawtooth waves are bandwidth limited to minimise aliasing.
      • 2 unison sub-voices with frequency determined by dividing the primary frequency by an integer from 2 to 16
      • sub oscillator waveshapes: Sine, Triangle, Square, Sawtooth
      • independent level control of each oscillator (plus toggle for mute)
      • Optionally quantise the frequency to any one of:
        - 12 note chromatic scale,
        - 8 note diatonic major or minor scale,
        - 5 note pentatonic major or minor scale,
        - 8 note just intonation major or minor scale,
        - 8 note Pythagorean major or minor scale.
      • Transposable +/- 24 semitones via a panel control, or arbitrarily via a MIDI keyboard.
    • LFO
      • Optionally modulate any of:
        - oscillator frequency,
        - pulse width,
        - Filter cut-off
      • waveshapes: Sine, Triangle, Square, Sawtooth, Reverse Sawtooth, Sample and Hold
    • Low-pass resonant filter
      • adjustable cut-off frequency
      • adjustable resonance
      • positive and negative adjustable envelope response
    • Envelope
      • There are three independent Attack/Decay envelopes, one for each oscillator group, and one for the filter.
      • Although independent, their settings are common
      • When being played manually, the envelope becomes ASR
    • Effect presets (slow/medium/fast)
      • Chorus
      • Flanger
      • Delay
      • Chorus + Delay
    • Rhythm
      • Three independent "Euclidean Rhythm" generators
      • set the number of main beats, and the bar length for each
      • the maximum bar length is 32
      • the tempo ranges from 30bpm to 1200bpm
    • Sequencers
      • Two independent 4 note sequencers
      • Specify offset for each step from -24 to +24 semitones
      • Apply to main frequency, sub-frequency divisor or both
      • When applied to sub-frequency divider, the offset is divided by 3 (so from -8 to +8)
      • Sequencer 1 drives oscillator 1, and sequencer 2 drives oscillator 2
      • The sequencers can be set to progress on a beat from any of the 3 rhythms, offbeats, or both.
      • The sequencer play mode has three states:
        - Run - progress as specified according to the rhythm
        - Hold - play and hold a single step (useful for individual oscillator tuning)
        - Pause - repeat the current step until pressed again (useful for joint oscillator tuning)
    • Presets
      • Up to 64 presets can be saved on an SD card
    • MIDI
      • If any sequencer is inactive (either because stopped or not set to advance) then the corresponding oscillator (and sub-oscillator) will play according to an incoming MIDI note.
      • If both sequencers are active, played MIDI notes transpose the sequences.
      • <COMING SOON> incoming/outgoing MIDI clock
    • Serial connection
      • A serial connection allows some control from a computer
      • Presets can be queried and restored from backup using serial commands
    Last edited by kallikak; 07-15-2020 at 08:47 AM. Reason: typos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts