; C C# D D# E F F# G G# A A# B pause
EEPROM 0, (26,28,30,32,34,36,38,40,42,44,46,48,0,0,0,0) ; low octave
EEPROM 16, (51,54,57,60,63,66,69,72,75,78,81,84,0,0,0,0) ; middle octave
EEPROM 32, (86,88,90,92,94,96,98,100,102,103,104,105,0,0,0,0) ; high octavae
; next line is cut from sample tunes for the PICAXEs with the TUNE function
'Greensleaves
EEPROM 50, ($27,$EA,$00,$02,$43,$02,$C0,$29,$25,$67,$29,$EA,$27,$27,$65,$27,$E9,$25,$E2,$27,$EA,$00,$02,$44,$02,$C0,$29,$25,$67,$29,$2A,$69,$27,$26,$64,$26,$E7)
for b8 = 50 to 87 ; manually count number of notes for this (could change to a do until $FF later)
read b8, b9 ; fetch data for next note
b7 = b9 / 64
if b7 = 0 then ; calculate duration of note (rough at moment - could use speed from tune command to auto adjust later
b6 =36 ; quarter
elseif b7 = 1 then
b6 = 18 ; eigth
elseif b7 = 2 then
b6 = 150 ; full
else
b6 = 75 ; half
endif
b2 = b9 / 16
b2 = b2 AND 3 ; extract octave number
if B2 = 1 then ; then hi octave
B1 =32
elseif b2 = 0 then ; else lo octave
b1 =16
else ; else the mid octave
b1=0
endif
b5 = b9 AND 15 ; extract the note
b5=b5+b1 ; add offset to right octave
read b5,b4 ; read value for note
sound 5,(b4,b6) ; play the note
next
end