The way to do this is with the known frequencies of musical notes, found here. Then, you look at sheet music of a given song (like this sheet music for the star wars main theme), and plot the frequencies with durations corresponding to the length of each note.