3 ms·
With microcontrollers being as fast as they are, and most having some hardware PWM capability even the very tiny ones, like the ATTiny85 can be startlingly capa
by Nihilartikel 6y ago
With microcontrollers being as fast as they are, and most having some hardware PWM capability even the very tiny ones, like the ATTiny85 can be startlingly capable synths, if you're satisfied with ~15khz 8bit audio fidelity.
At 8/16 mhz there are plenty of cycles for multi-channel audio synthesis. Not much room for samples, but a lot can be done with envelopes, saw, square, and noise waveforms.
https://github.com/blakelivingston/DuinoTune https://github.com/blakelivingston/DuinoTune
https://www.youtube.com/watch?v=G3baH5iTcFM https://www.youtube.com/watch?v=G3baH5iTcFM
- salehenrahman 6y agoI could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz. Obviously it's not going to be ideal for an audiophile, but the quality is not too shabby. A fun project for those curious. Still, stick to off-the-shelf class-D amplifiers, such as the PAM8403. https://www.youtube.com/watch?v=O8of40tFsD8 https://www.youtube.com/watch?v=O8of40tFsD8
- Nihilartikel 6y agoThat would be really cool. Never got around to trying it, but I'm really curious about the subjective quality on the 12bit A/D conversion looping back to PWM D/A. LoFi effects pedals could be fun.
- lb1lf 6y ago-The 12 bit A/D provides a (theoretical) 72dB of S/N, so if you can do that at a decent sample rate to get sufficient bandwidth, the digitizing should be good. As long as the PWM D/A has a good clock to keep the PWM ratio accurate, I think it should be eminently listenable, given a proper reconstruction filter and a decent power supply. It would be fun to try this.
- GeorgeTirebiter 6y agoCheck this out -- really good discussion of bits and SNR: https://www.xiph.org/video/vid2.shtml https://www.xiph.org/video/vid2.shtml jump to the 11:00 mark to find out just how many 'equivalent bits' those old cassette 'mix tapes' of yours had...
- squarefoot 6y ago> I could almost swear that you can even create a class-D amplifier with the ATTiny85, with a clock rate of ~15kHz. Pretty sure you can do that. A Class D amplifier is to a class A/B traditional one what a switching power supply is to a linear one, so I would expect to be able to make a class D amplifier using for example a PWM driven H bridge usually employed to drive electric motors, or a chip used to make switching power supplies. If they can work at high frequencies (say 50KHz or more) then they should work; all it's needed is modulating their input or feedback pins the right way. Probably not HiFi for the sensitive ear, still good enough.
- squarefoot 6y agoInteresting, thanks for sharing. I'd be interested in experimenting a hybrid approach in which the microcontroller takes MIDI in then generates basic waves (saw, square, sine etc) to keep resource consumption as low as possible while maximizing poliphony (layering with detune, etc), then leaving to analog circuitry noise generation, filtering, enevelopes etc. It would make things more complicated hardware-wise but I'm sure the sound would improve significantly, at least for us old beards who still love analog synths from the 70s.
- nitrogen 6y agoI have an Ensoniq SQ-80 synthesizer that did something like that. A microcontroller generates 8 channels of sounds from a PCM wavetable, and those are fed into 8 analog filters before mixing down to stereo. But all of the waveforms and envelopes were digital.