While @hexwab 's answer is already quite detailed and contains some very useful information, when I came across it, and after hours of looking on the internet and studying the code, there were still some dark spots.
For example, it was unclear (for anyone who had never done this before), that hexwab was using a phase accumulator technique. The frtab array contains what seems to be tuning words.
Even with that, what confused me are the timer's settings used in the code, which, after looking at the atmega 328p datasheet, aren't fitting the comments that accompany them.
I eventually re-coded a whole project myself, with the help of other resources, heavily helped by this great article.
Finally, I wrote a whole article about how to generate a multi-voice melody. You can find it here. The code for the project is on Github.
Hopefully this helps any one who might need it.