I based my project on the Yamaha DX7, which is an amazing feat of musical engineering. I had to write the code, wire together a MIDI Input, and an audio output (using a DAC). It was one of the coolest projects I've ever made, although I did not get too far.
At the core, all you're doing is generating sine waves. Digital Synths in the 80s would not have the computation power to actually compute sine waves, so what you have to do is precompute the values of a sine wave, and store it in memory [0]. Also, you don't get floats, so it's all fixed point arithmetic [1]. FM Synthesis is essentially a carrier wave and a modulator wave [2]. The DX7 goes beyond that with the concept of Operators, which can be mixed and matched in an Algorithm [3].
I managed to make it produce notes, which were in tune. I started making the envelope (attack, decay, sustain and release), but that's where I got stuck and eventually abandoned it.
[0] https://github.com/fercgomes/churrosfm/blob/master/src/Table...
[1] https://github.com/fercgomes/churrosfm/blob/master/src/Oscil...
[2] https://github.com/fercgomes/churrosfm/blob/master/include/A...
[3] https://djjondent.blogspot.com/2019/10/yamaha-dx7-algorithms...