Thank you, good luck! It's pretty terrible code to use as a reference but I was just trying to get something working as a proof of concept. I noticed one mistake with the code I uploaded when refactoring it, line 141 of main.c uses envelope_c_amplitude when it should use envelope_m_amplitude to scale the modulator's amplitude. Giving the "brass" modulator a higher amplitude makes the sound brighter, for example.
@@benryves Please tell us in more detail about the principles of FM synthesis. What built-in peripheral devices of the microcontroller are involved and for what. With code examples in C whenever possible. And also why only 2 channels are implemented? Many years ago I met Elm Chen's project, which synthesized an incredibly beautiful polyphonic sound on ATtiny45. The melody was, if I'm not mistaken, Beethoven's Für Elise.
@@benryves Personally, I tried to synthesize 4 simultaneously sounding square waves, sum their amplitudes, modulate 1 PWM channel with them and play them using a speaker. Everything was implemented on a single timer, which worked in PWM mode with a fixed frequency, and its interrupts were used to calculate the periods of four waves and their sum.
Thank you for making the code for this open source! Made my coding a whole lot easier!
Cool Project! Can it emulate an acoustic piano?
You sound like like Fred Harris!!
Haha, you're not the first to point that out! :D
Good project. I will try to replicate it but with Raspberry pi and python.
Thanks once again for the inspirational idea.
Cheers ✨✨
Thank you, good luck! It's pretty terrible code to use as a reference but I was just trying to get something working as a proof of concept. I noticed one mistake with the code I uploaded when refactoring it, line 141 of main.c uses envelope_c_amplitude when it should use envelope_m_amplitude to scale the modulator's amplitude. Giving the "brass" modulator a higher amplitude makes the sound brighter, for example.
@@benryves Please tell us in more detail about the principles of FM synthesis. What built-in peripheral devices of the microcontroller are involved and for what. With code examples in C whenever possible. And also why only 2 channels are implemented? Many years ago I met Elm Chen's project, which synthesized an incredibly beautiful polyphonic sound on ATtiny45. The melody was, if I'm not mistaken, Beethoven's Für Elise.
@@benryves Personally, I tried to synthesize 4 simultaneously sounding square waves, sum their amplitudes, modulate 1 PWM channel with them and play them using a speaker. Everything was implemented on a single timer, which worked in PWM mode with a fixed frequency, and its interrupts were used to calculate the periods of four waves and their sum.