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

Thread: [queued] TSynth - Two Oscillator Polysynth

  1. #1

    [queued] TSynth - Two Oscillator Polysynth

    Hello. Another day, another Teensy synthesizer. TSynth is a two oscillator, four note polyphonic synthesizer with a large number of waveforms including user defined, state variable filter, two envelopes, PWM options, LFOs for oscillators and filter, effects, patch saving and recall. I went mad with the Audio Library really and cannot begin to express how fantastic it sounds and the possibilities it opens. The full spec is below and it fully utilises the USB host on the Teensy 3.6. It will receive MIDI via the client USB from a pc (which also provides digital audio appearing as a soundcard), the USB host port (I can connect my controller keyboard directly) and normal 5-pin DIN MIDI.

    Click image for larger version. 

Name:	20190829_173056.jpg 
Views:	71 
Size:	242.0 KB 
ID:	17379

    Click image for larger version. 

Name:	20190829_173110.jpg 
Views:	85 
Size:	209.9 KB 
ID:	17380

    Click image for larger version. 

Name:	20190829_173147.jpg 
Views:	51 
Size:	92.6 KB 
ID:	17381

    Most of the pots, switches, buttons, display and encoder are connected via two 16 channel MUXs, the rest to the Teensy pins directly. It is a mess of wires inside and a PCB would be fantastic. A demo video will follow soon.
    Click image for larger version. 

Name:	20190703_104741.jpg 
Views:	103 
Size:	191.2 KB 
ID:	17382

    Teensy 3.6 with Audio board - this shows how the USB host port pins were soldered.
    Click image for larger version. 

Name:	20190703_101229.jpg 
Views:	99 
Size:	172.1 KB 
ID:	17383

    • Four voice polyphony (last note priority), two oscillators per voice, detunable with +/- 2 octaves range, Sine/Sample & Hold (like tuned noise)/Square/Sawtooth/Ramp/PWM/Var Triangle/User waveforms and level
    • Pulse Width/Var Triangle can be set for each oscillator with PWM by dedicated LFO or from the filter envelope
    • Pink noise with level
    • Dedicated LFO for pitch mod (can be retriggered by note on) , Sine/Triangle/Sawtooth/Ramp/Square/S&H waveforms
    • XOR ‘Ring Mod’ (creates lots of harmonics with certain waveforms)
    • Unison with all eight oscillators detunable from each other
    • +/- 12 semitone pitchbend range
    • Mod wheel controls pitch LFO amount

    • State variable 12dB filter (SVF) with continuous mix between LP and HP (provides notch filter) and BP
    • Cutoff freq and resonance
    • Cutoff can be modulated by dedicated ADSR envelope, dedicated LFO and key tracking
    • LFO has same waveforms as pitch LFO (can be retriggered by note on) and rate can be set to match MIDI clock (tempo) with variable delay per bar

    • Dedicated ADSR envelope
    • Glide (up to 1 octave range) with variable time
    • Volume for DAC output
    • Effect amount and mix - currently for stereo chorus but could be set up to allow choices in programmer

    • 160x80 IPS colour display
    • Encoder with button for data entry, Back button for menu navigation
    • Save and Recall buttons for storing patches, holding Recall initialises the current patch to match the panel controls
    • The programmer makes the synth very flexible with possibilities for changing User waveforms, alternative filters, alternative effects with further parameter settings.

    • USB HOST MIDI Class Compliant (direct connection to MIDI controller, no PC needed)
    • USB Client MIDI In from PC
    • MIDI In 5 pin DIN

    • SGTL5000 Audio Shield 16 bit, 44.1 kHz Stereo out
    • USB Audio in/out—appears as 16 bit, 44.1 kHz audio interface on PC

    • Teensy 3.6 with SGTL5000 Audio Shield. Two 4061 multiplexers providing 32 channels from the pots into two ADCs. The rest of the pots and switches use remaining pins on Teensy.
    • Enclosure is laser cut acrylic with etched labels filled with yellow acrylic paint (this technique could be improved with experimentation), end cheeks are 3D printed.

  2. #2
    Member houtson's Avatar
    Join Date
    Aug 2015
    @UHF wow - that looks excellent and super functional, I bet it's been a labour of love for a few months!
    How does it sound ? I'd love to hear your 'Soild Bass' patch

  3. #3
    Hello, here's a demo of TSynth. Not quite Tangerine Dream... but the whole thing was originally inspired by Dave at Notes & Volts TS-1 synth building series. It's designed to show the range of sounds the Audio Library can produce when you take the time to design and try things out. All sounds are from TSynth with built-in stereo chorus, mixed on Ableton Live with volume, EQ and panning adjustments only. I think it could be pushed to 6 or 8 voice polyphony before the Teensy 3.6 cpu runs into problems - it is still running at 180MHz too. Solid Bass at 1:33!

  4. #4
    A screenshot of the Audio Design tool to answer a few questions. The modulation connections make it complicated but more voices could be added.

    Click image for larger version. 

Name:	Annotation 2019-09-06 001358.jpg 
Views:	236 
Size:	108.6 KB 
ID:	17512

  5. #5
    Junior Member
    Join Date
    Sep 2019
    Very nice project I listened demo on YT and it sounds for me like good VA - some thin, metallic sound, and some good basses.

    But indeed, routing in design tool is kinda messy. In my first thread I asked about merging audio objects into bigger class, hope somebody will help

  6. #6
    There are quite a few improvements that could be made and it would probably end up looking like it's main rival, the Axoloti. A major improvement to the quality is anti-aliasing the waveforms and better control of the effects. Running polyphonically on a T4, you could blow away a few sub $500 synths.

  7. #7
    @UHF What a super project! Are you planning to make the code available for others? I'm really interested in building one.

  8. #8
    Hello, yes I'll publish the code sometime. The sound creation and the control of it is finished. All the front panel controls have MIDI CC numbers set up. Patch saving and recall isn't finished (it needs a way to handle these properly and allow naming with the encoder) and the TFT display will show parameter values as they're being changed and reverts back to the patch name after a time delay - but not totally reliably (threading). I don't like coding in C and am tolerating it. The code isn't too difficult to change for different hardware, such as display, choice of MIDI inputs.

    If you decide to build something like TSynth, the wiring is the worst aspect and you either need a proper pcb or come up with a way of neatly soldering very flexible wires to every control and routing them to MUXs and the Teensy. I used stiff DuPont wires and had to solder a pin header to each control. You can disassemble it, but it's not something you would ever want to do. It is a one-off prototype.

  9. #9
    Very, very nice. If this is what your prototype looks like, I would love to see your production design.

  10. #10
    Quote Originally Posted by UHF View Post
    A screenshot of the Audio Design tool to answer a few questions. The modulation connections make it complicated but more voices could be added.

    Click image for larger version. 

Name:	Annotation 2019-09-06 001358.jpg 
Views:	236 
Size:	108.6 KB 
ID:	17512
    Really nice design and clean finish. Hope you made it possible to add a few more oscillator controls. It's very similar to the one I have been building off and on. With similar complexity I have gone to 8 note poly as 3 modulated waveform objects as the core oscillators with 1 PWM, 1 FM and 1 pseudo ring modulator each fed the outputs from the original 3 waveforms in combination changing switch arrangement. Each channel goes to it's own filter and all feed to a delay loop. At the moment I can switch in a LFO modulation setup with its own filter. With the code compiled to 192MHz It all just fits in without crashing and the memory usage is about 50%. At times I have thought about going to 6 or 4 note poly but the fat chords from 8 notes are too tempting. At the moment I'm idling on this one and waiting for the development of the T4.0 to move ahead.

  11. #11
    Hello, many thanks for the front page feature. Just an update - TSynth is just about completely nearly finished . The synth part hasn't changed except key tracking works individually for each note as you would expect and the new stereo ensemble chorus sounds fantastic thanks to @quarterturn Also I need to thank @KurtE and everyone who worked on getting the frame buffering working on the latest releases of Teensyduino. Just two lines of code cut a whole load of complexity that never really worked properly. Display updates are now rapid and smooth - it was an 'oh thank god' moment when I tried it and it all just worked. Patch save, recall, delete and renaming also works now. All controls work via MIDI including program change commands. One thing I would have liked to add is a control for pitch modulation amount by the filter envelope. I'll do another video demo of some sounds and general use soon.

    I've released the code here You'll see quite quickly that I'm not a fan of c programming. Please feel free to do something about any bad practice and wrongness. The synth does work very reliably however. If you want to try it out for yourself, it isn't too difficult to remove any hardware specific code. This is written for a Teensy 3.6 with USB Type: USB + MIDI + Audio.

    I am playing with the idea of designing a PCB and a PCB-based front panel (for the first time). However, I want it to use a Teensy 4 in 3.6 form factor as I need USB host and extra IO pins. Perhaps next year if Teensy 4.x goes ahead! An alternative to the micro USB connector or pins on the PCB to connect to it, would also be welcome.
    Last edited by UHF; 12-03-2019 at 01:33 PM.

  12. #12
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Ayer Massachussetts
    Quote Originally Posted by UHF View Post
    I am playing with the idea of designing a PCB and a PCB-based front panel (for the first time). However, I want it to use a Teensy 4 in 3.6 form factor as I need USB host and extra IO pins. Perhaps next year if Teensy 4.x goes ahead! An alternative to the micro USB connector or pins on the PCB to connect to it, would also be welcome.
    If you aren't afraid of a little soldering (both through hole and surface mount), you might want to check out this board designed by trainer4edu/frdm4236. Note for USB host, there will be extra pins for the host pins, so you have to carefully plan how to place the board if you want to connect the USB host pins to the prototype board (or just design it in):

    Or there are two other designs going on, but don't use the Teensy 3.6 form factor:

    Note, be sure to check the boards, as sometimes the PCB foundary misses creating the castellated cuts.

    For USB host, you would typically use a cable like this.

  13. #13
    Hello, I've seen the breakout boards. My intention is to simply make a PCB and front panel and the rest is up to the individual to get the components and solder them. I want to make this as easy as possible, although the 4067 MUXs are surface mount only. The front panel will be attached above the PCB with spacers. I will probably design an enclosure similar to the prototype with laser-cut and 3D printed parts, if anyone wanted to use those. Other problems are the longevity of the micro USB on the Teensy's for long-term use to power the synth. And the audio board which will be mounted on the Teensy with the 2.5mm jack as the audio output.

  14. #14
    Junior Member
    Join Date
    Nov 2019
    @UHF Congrats, very nice project and build. It sounds great, could be tempted to build one as all my synth are analog mono, a nice Teensy poly synth would complete my setup perfectly

    @RogerD What are you exactly waiting for about T4 ? I use one T4 with audio shield Rev D for a multi FC and it works perfectly.

Posting Permissions

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