I stored each note as a sound with names 1, 2, 3... And then I wrote the sequence in a table of indices that was used to lookup the next tone to play. Initially I though about using the speed factor in the sound component, but the theme only consists of 8 different notes.