Where is a tutorial for making music from plain code?
It depends on what you mean by "music".
[u]This Example[/u] shows you how to make simple tones/notes. The Arduino doesn't have a digital-to-analog converter or true analog out.
If you want to get more like real music, look into MIDI. MIDI is basically the same concept.. It's like sheet music for computers - Your sketch need to provide the "notes & timing", but in addition, with MIDI you can specify the instrument(s) and the loudness ("velocity" in MIDI terms) of each note.
Since a MIDI file only stores the "notes" and not the "sound", MIDI files are small compared to MP3 or WAV files. But, a full multi-instrument MIDI song still might not fit into the Arduino's built-in memory.
You send those instructions to a MIDI instrument and the music plays. Every soundcard has a basic MIDI synthesizer built-in, so if you want, you can download some free MIDI files and play them on your computer. Almost all of the background music you hear in modern movies is MIDI, but it's done with high-quality sampled-instruments. It can sound like a real orchestra, but it can't replace a singer.
There are MIDI shields for the Arduino, but I've never used one.... I don't know if they actually have the MIDI instrument capability built-in, or if they are just an interface to a MIDI instrument.