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

Thread: Board advice for synth project. Does 4.0 make sense?

  1. #1

    Board advice for synth project. Does 4.0 make sense?

    I am trying to choose a board for my next synth. For the first one (https://hackaday.io/project/163160-c...c-button-synth) I just used one of the DAC channels on the 3.6. It is just doing simple wave form synthesis. When I play more then 3 or 4 notes at the same time things get pretty crunchy and distorted.

    For V2 (see chasis here: https://photos.app.goo.gl/UojEQzD4vJLHp2LP6) I have added a 3 axis joystick so I can play around with some FM synthesis. I would also like to get up to 8 note polyphony.

    Im curious for my application if I could get by with the PT8211 audio kit or should I splurge for audio shield? With the new Teensy 4.0 boards has there been any improvements to the onboard DAC that for a simple application like mine would make the additional components unnecessary?
    thanks!

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,317
    Quote Originally Posted by colorado_hick View Post
    I am trying to choose a board for my next synth. For the first one (https://hackaday.io/project/163160-c...c-button-synth) I just used one of the DAC channels on the 3.6. It is just doing simple wave form synthesis. When I play more then 3 or 4 notes at the same time things get pretty crunchy and distorted.

    For V2 (see chasis here: https://photos.app.goo.gl/UojEQzD4vJLHp2LP6) I have added a 3 axis joystick so I can play around with some FM synthesis. I would also like to get up to 8 note polyphony.

    Im curious for my application if I could get by with the PT8211 audio kit or should I splurge for audio shield? With the new Teensy 4.0 boards has there been any improvements to the onboard DAC that for a simple application like mine would make the additional components unnecessary?
    thanks!
    The Teensy 4.0 does not have an onboard DAC, though if you aren't using a SPI device, you can use the MQSL and MQSR pins (pins 10 and 12).

    Instead of a DAC, it is probably best to use I2S output and do digital sound output. I had a thread about doing sound output without using the audio shield that gives two sample sketches, one using a cheap I2S amplifier to a mono speaker (or possibly I2S amplifier to stereo speakers), and also using MQS to output sound:


    Here is the I2S mono amplifier that I used, plus another I2S board that can do stereo (I haven't tried the stereo board yet):




    Note, the Teensy 4 has multiple different sound inputs/outputs:
    • Main I2S channel, with 4 separate outputs (OUT1A, OUT1B, OUT1C, OUT1D), 1 input (IN1), plus the 3 clocking pins (MCLK1, BCLK1, and LRCLK1);
    • Second I2S channel, with 1 output (OUT2), 1 input (IN2), plus the 3 clocking pins (MCLK2, BCLK2, and LRCLK2);
    • MQS (medium quality sound) left/right output;
    • S/PDIF input/output (IIRC, while the pins are defined, there isn't yet library support for this);
    • I would imagine you can probably use the 6 serial ports for MIDI in/output;
    • USB audio is a possibility, though I don't know what level of support there is;
    • I have no idea whether the CAN buses can be used for sound; and
    • Using a PWM pin for output with appropriate capacitors and amplification.
    Last edited by MichaelMeissner; 09-19-2019 at 10:13 PM.

  3. #3
    Thanks Micheal.
    This is really helpful (especially after I researched some of these protocols that I do not know much about!) I guess what it comes down to for me is the most likely scenario is that I would be interfacing I2S to some sort of external DAC. The amplifier is not that intriguing to me because I want line level signal only.

    I am still missing some basics. If I am using the audio libraries to do FM synthesis, then interfacing I2S to something else for digital -> audio conversion, does that 'something else' have impact on the quality of my audio signal or the complexity of what I can do with synthesis or my polyphony level? Or does all of that synthesis and waveform summing happen on the teensy board before the I2S interface? If the only thing that happens after the I2S interface is digital audio conversion then it seems like the 8211 kit (https://www.pjrc.com/store/pt8211_kit.html) would be a great option for me. In other words I am assuming that what the audio shield brings to the table that the 8211 kit doesn't have is the audio-> digital conversion and the SD card slot, neither of which impact me, but I would love to have someone validate that assumption.

    Is the PT8211 audio kit compatible with teensy 4.0 just using header pins?

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,317
    Quote Originally Posted by colorado_hick View Post
    Thanks Micheal.
    This is really helpful (especially after I researched some of these protocols that I do not know much about!) I guess what it comes down to for me is the most likely scenario is that I would be interfacing I2S to some sort of external DAC. The amplifier is not that intriguing to me because I want line level signal only.

    I am still missing some basics. If I am using the audio libraries to do FM synthesis, then interfacing I2S to something else for digital -> audio conversion, does that 'something else' have impact on the quality of my audio signal or the complexity of what I can do with synthesis or my polyphony level? Or does all of that synthesis and waveform summing happen on the teensy board before the I2S interface? If the only thing that happens after the I2S interface is digital audio conversion then it seems like the 8211 kit (https://www.pjrc.com/store/pt8211_kit.html) would be a great option for me. In other words I am assuming that what the audio shield brings to the table that the 8211 kit doesn't have is the audio-> digital conversion and the SD card slot, neither of which impact me, but I would love to have someone validate that assumption.

    Is the PT8211 audio kit compatible with teensy 4.0 just using header pins?
    Somebody with more depth in the sound processing area will have to answer most of these questions. I believe (but I certainly do not know) that everything wtihin the Teensy is handled in a digital fashion (i.e. I2S).

    I believe the PT8211 kit will not work with the Teensy 4.0 if you attach it directly, due to the pinout differences for sound between the Teensy 3.2/3.5/3.6 and Teensy 4.0. Like the larger audio adapter, you would likely need to use jumper wires, etc. to reroute the pins.

  5. #5
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,219
    Quote Originally Posted by colorado_hick View Post
    ... When I play more then 3 or 4 notes at the same time things get pretty crunchy and distorted...
    Assuming you new to this it sounds like you are overflowing the signal and you are hearing digital clipping.... which even a bit of is very nasty.

    I don't use the audio library so I don't know how various moduals deal with signal overflow specifically but you definitely need lower gain if you are handling multiple voices.

    https://forum.pjrc.com/threads/35400...-gain-clipping


    Use more attenuation before/when mixing signals together. You don't need to reduce each to 1/n gain to avoid clipping as the signal phases tend to cancel out much of the 'gain' from adding signals. Making soft synths I used to start with about 20% gain to allow for polyphonic output and the tweak upwards.

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,219
    I should mention it's very unlikely running your code on a T4 will improve anything. Also I believe some of the audio options mentioned above are not available yet for T4.


    fyi... should read 'Assuming you're new to this...' above

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,958
    As MichaelM noted - I can confirm the PT8211 kit works {at least on the minimal testing done in Beta} with T4 - when properly wired - same changes as needed for the Audio card where pin locations changed - for the fewer pins used.

  8. #8
    Quote Originally Posted by colorado_hick View Post
    Thanks Micheal.
    This is really helpful (especially after I researched some of these protocols that I do not know much about!) I guess what it comes down to for me is the most likely scenario is that I would be interfacing I2S to some sort of external DAC. The amplifier is not that intriguing to me because I want line level signal only.

    I am still missing some basics. If I am using the audio libraries to do FM synthesis, then interfacing I2S to something else for digital -> audio conversion, does that 'something else' have impact on the quality of my audio signal or the complexity of what I can do with synthesis or my polyphony level? Or does all of that synthesis and waveform summing happen on the teensy board before the I2S interface?
    The Teensy 4.0 has far more horsepower for synthesis and any I2S->audio card can be patched onto the output pins so no need to stay with the one suggested. Loads on Aliexpress and elsewhere. My personal preference is the PCM5102 for synthesisers, but the AKM velvet sound ones for mixers.

    Always best to try to use 96kHz sampling so you reduce the likelihood of aliases coming into the audio band. Needs twice the horsepower of course but the Teensy 4 isn't bad.

  9. #9
    Hello, I am a beginner, and the horsepower you alluded to is what made me buy the teensy on a whim after a review by hackaday. I regret it now since all this is overwhelming. I gave up on trying to use the 4.0 as a USB host and midi to cv converter. so Please I wanted to ask what would be the best way to use the teensy as a polyphonic/wavetable/fm synthesizer and send the output to a headphone or speaker. Thank you

  10. #10
    Quote Originally Posted by Orhema View Post
    Hello, I am a beginner, and the horsepower you alluded to is what made me buy the teensy on a whim after a review by hackaday. I regret it now since all this is overwhelming. I gave up on trying to use the 4.0 as a USB host and midi to cv converter. so Please I wanted to ask what would be the best way to use the teensy as a polyphonic/wavetable/fm synthesizer and send the output to a headphone or speaker. Thank you
    If you're a beginner it's always best to build someone else's design first.
    Google for existing projects such as
    https://www.pjrc.com/polymod-polypho...modular-synth/
    https://www.hackster.io/news/teensy-...r-e57fcee233b7
    or many others. Build one of them and get it working and you'll then learn the basics to move onto designing your own synth.

Posting Permissions

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