New Teensy 4.1 DIY Synthesizer

No, with I2C the A7 and B7 pins cannot be used reliably as inputs. This is a known silicon bug in the MCP23017, the SPI version (MCP23S17) is OK though - so its 7 encoders per 23017, 8 per 23S17.
 
No, with I2C the A7 and B7 pins cannot be used reliably as inputs. This is a known silicon bug in the MCP23017, the SPI version (MCP23S17) is OK though - so its 7 encoders per 23017, 8 per 23S17.
I only learned about this last year, after having helped design quite a few boards that use MCP23017 for 16 digital inputs. We aren't aware of ever having seen a problem, though. Do you have any insight into the conditions under which it might be a problem?
 
I'm using 3x MCP23017. Two for the 24 keys and one for seven encoders in the Jeannie.
The circuit diagram is not yet complete. An MCP23017 is still needed for the other buttons (24 in total) and the other 5 encoders.

Screenshot 2026-05-03 121759.png
 
I only learned about this last year, after having helped design quite a few boards that use MCP23017 for 16 digital inputs. We aren't aware of ever having seen a problem, though. Do you have any insight into the conditions under which it might be a problem?
No idea, it was and maybe still is a silicon bug, or it might have been fixed. The nice thing about the MCP23S17 is you can multiplex 8 on the same SPI bus with only one CS line, which makes it a no-brainer to chose SPI over I2C if its available, and thus avoid the bug entirely.
 
I'm not using CS handling for the query (I don't have any more free lines) and am using the interrupt signals from the MCP23017. As soon as an interrupt signal from an MCP23017 arrives at the Teensy, I read the 16-bit GPIO register and mask the active encoder. This way, I only need one 16bit read operation on the I2C bus.
 
I have set the resolution for the envelope controls to 0-255. Internally, the values are scaled up to exponential values of 0-11880ms for the audio envelopes using a formula.

C:
// calc expo value ---------------------------------------------
float calc_expo_value(byte value)
{
    float normalized = value / 255.0f;
    float exponent = 1.9; // Curve steepness
    float expoValue = pow(normalized, exponent);
    // scaled to 0-11880
    float finalValue = expoValue * 11880.0f; // scale value
    return finalValue;
}

// Ctrl Handle Group 0 -----------------------------------------
void Ctrl_Handle_Group_0 (uint16_t ctrl_No, byte value)
{
    if (ctrl_No == 20)
            {
                envelope1.delay(calc_expo_value(value));
            }
            else if (ctrl_No == 21)
            {
                envelope1.attack(calc_expo_value(value));
            }
            else if (ctrl_No == 22)
            {
                envelope1.decay(calc_expo_value(value));
            }
            else if (ctrl_No == 23)
            {
                envelope1.sustain(0.00392f * value);
            }
            else if (ctrl_No == 24)
            {
                envelope1.release(calc_expo_value(value));
            }
}

// GUI ctrl_handle ---------------------------------------------
void GUI_Ctrl_Handle (byte ctrl_groub, uint16_t ctrl_No, byte value)
{
    if (ctrl_groub == 0) // Envelopes
    {
        Ctrl_Handle_Group_0(ctrl_No, value);
    }
}

20260506_005417.jpg
Screenshot 2026-05-06 005941.png
 
Superbooth in Berlin :)
I actually thought I had gone a bit overboard with Jeannie—three microcontrollers and 28 LEDs. But the Swedes can do even better :love::love::love::love:
A whopping twelve microcontrollers for 1,500 euros.

Link : https://www.apaeron.com/

Screenshot 2026-05-09 150534.png


 
Last edited:
In the interview, he states that seven microcontrollers are responsible for a total of 35 voices - thats five voices per microcontroller.
 
Jeannie 2 Audio Test with 12 Voices. I'm curious to see if the processor resources are sufficient for 12 filters (one filter per voice).

 
Jeannie 2 Audio Test with 12 Voices. I'm curious to see if the processor resources are sufficient for 12 filters (one filter per voice).

In my TeensyMIDIPolySynth (TMPS), I have implemented a 3-voice 12-poly synth. The audio portion runs on a T4.0 (overclocked at 816MHz with no additional cooling, hovering at or below about 50 degrees C & staying just under 95% loaded when all audio components are active). The display control/traditional 5-pin DIN MIDI/USBmidi/USHhostMIDI portion runs on a T4.1. The two Teensys communicate bidirectionally over a 500kbaud serial connection. Control/setting information flows both ways, as well as selective DEBUG information, between the Teensy processors.

Each of the three voices includes the following capability:

Each VFO is amplitude adjustable, and the waveform generation can be any mix (positive or negative, amplitude adjustable) of sine, duty controllable square, triangle, and saw oscillators, with +/- 3-octave selection/control, with individual tuning, plus overall gross tuning.

Each VFO can be modified by an LFO. Each LFO is frequency adjustable from 0-30Hz, depth adjustable (how much modulation is applied to the VFO), which can be any mix (positive or negative, amplitude adjustable) of sine, square, duty controllable pulse, triangle, and saw oscillators, S&H, or pink/white noise, and can be DC adjusted by +/- 1.0.

Each LFO is followed by an envelope generator, with adjustable delay, attack, hold, decay, sustain, and release.

Each modulated VFO is followed by an envelope generator, with adjustable delay, attack, hold, decay, sustain, and release.

Each LFO is followed by a filter than can be selectively enabled/disabled, and when enabled can be configured as LP, BP, HP, notch, with selectable number of octaves (how far the LFO sweeps the VFO), as well as adjustable resonance & bandwidth.

Each LFO filter can be modulated by an LFO that is frequency adjustable from 0-30Hz, depth adjustable (how much modulation is applied to the VFO), which can be any mix (positive or negative, amplitude adjustable) of sine, square, duty controllable pulse, triangle, and saw oscillators, S&H, or pink/white noise, and can be DC adjusted by +/- 1.0.

Each modulated VFO is followed by a filter than can be selectively enabled/disabled, and when enabled can be configured as LP, BP, HP, notch, with selectable number of octaves, as well as adjustable resonance & bandwidth.

Each of the three voices also includes an independent strings generator that can be frequency modulated by the same LFO modulating the VFO. The strings generator includes controls for octave selection and drive-level.

The TMPS includes independent white noise and pink noise generators that are mixed in at the top-most level (parallel to the modulated/filtered voices/notes). In addition, there is a simulated moog-style ladder filter that can be added after all of the voice generator objects in the audio processing chain. The ladder filter includes controls for knee freqency, resonance level, number of octaves, passband gain, overdrive, sweep time in milliseconds, beginning level, and ending level.

The TMPS also includes an SC reverb following the ladder filter, which includes controls for reverb percentage (wet/dry mix), duration, and damping.

The three voices are independently frequency tuneable, and the TMPS includes a master tuning control. There is a master amplifier volume control, as well as volume controls for each voice. Glissando/glide (of the last MIDI note input) is implemented as a software-generated linear frequency sweep algorithm.

Headphone volume and LINE OUT volume are independently adjustable. There is an on-screen CLIPPING indicator and an on-screen battery level monitor/indicator, as well as an on-screen clock. Real-time LED-style indication is displayed on-screen for MIDI note on / MIDI note off & MIDI control messages.

The TMPS includes a simple on-screen 1-key rollover keyboard, allowing the 12-poly capabilty to be exercised using an on-screen sustain pedal control, as well as on-screen pitch bend and mod wheel controls (these on-screen controls also follow any actual external hardware controls providing the same functionality, e.g. MIDI keyboard with pitch bend/mod wheel, and/or sustain pedal). All controls are implemented on the RA8875 800x480 touchscreen display as graphical buttons and sliders.

The TMPS has the ability to store & instantly recall up to 16 saves of all settings & parameters.

All of this capability is implemented in & comprised of 640 audio objects, with 1200 interconnection patch cords, all laid out using the standard Teensy Audio System Design Tool. If there's any question as to whether the Teensy is capable of running as a high-poly, multi-functional digital synthesizer, this is an actual case-in-point that proves, YES IT CAN !!

Mark J Culross
KD5RXT

P.S. Someday, I may actually get around to posting all of the design info, sources, PCB info, 3D-printed housing, etc. I just haven't made the time to do so yet. In the meantime, I'm extremely happy with the TMPS as an extremely capable, digitial musical synth, & I'm enjoying playing with it, as are several of my friends that I've given copies to as well. I haven't made any changes to the firmware in over a year, so it seems to be very stable at this point. MJC
 
Hallo..
In planning and testing: Jeannie_2, featuring 12 voices, a biquad filter with Low Pass, High Pass, Band Pass, Notch, Low Shelf, and High Shelf modes, and adjustable filter slope.

Screenshot 2026-05-14 131836.png


The two numbers above the envelope curve are the temperatures of the Audio MCU and the GUI CPU.

 
Last edited:
Back
Top