Star Wars Theme Song in Peizo
BoeBot
Posts: 37
Hello everyone,
I have recently created the Star Wars theme song for the Piezo speaker. I made it quickly so it may not be perfect.
Tell me what you think of it or how it should be improved.
I have the file attached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Change is inevitable - except from a vending machine.
Robert C. Gallagher
I have recently created the Star Wars theme song for the Piezo speaker. I made it quickly so it may not be perfect.
Tell me what you think of it or how it should be improved.
I have the file attached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Change is inevitable - except from a vending machine.
Robert C. Gallagher
Comments
Casey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Change is inevitable - except from a vending machine.
Robert C. Gallagher
' {$STAMP BS2}
' {$PBASIC 2.5}
'Good King Wenceslas
Notes········ DATA··· "R", "D", "D", "D", "E", "D", "D", "A", "B", "A", "B", "d", "D", "D",
····················· "D", "D", "D", "E", "D", "D", "A", "B", "A", "B", "d", "D", "D",
····················· "A", "G", "g", "E", "g", "E", "D", "B", "A", "B", "d", "D", "D",
····················· "A", "A", "B", "d", "D", "D", "E", "A", "G", "g", "E", "D", "G", "D", "Q"
Octaves······ DATA··· 0, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7,
····················· 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7,
····················· 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 7,
····················· 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Durations···· DATA··· 1000, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 2, 2,
····················· 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 2, 2,
····················· 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 2, 2,
····················· 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 2, 2, 1
index········ VAR···· Byte
offset······· VAR···· Nib
noteLetter··· VAR···· Byte
noteFreq····· VAR···· Word
noteDuration· VAR···· Word
noteOctave··· VAR···· Nib
DO UNTIL noteLetter = "Q"
· READ Notes + index, noteLetter
······· DEBUG"· ", noteletter
· LOOKDOWN noteLetter, [noparse][[/noparse]· "C",· "d",· "D",· "e",· "E",
························· "F",· "g",· "G",· "a",· "A",
························· "b",· "B",· "R",· "Q"···· ], offset
· LOOKUP offset,······· [noparse][[/noparse] 4186, 4435, 4699, 4978, 5274,
························· 5588, 5920, 6272, 6645, 7040,
························· 7459, 7902,··· 0,··· 0···· ], noteFreq
······· DEBUG "······ ", DEC4 noteFreq
· READ Octaves + index, noteOctave
· noteOctave = 8 - noteOctave
· noteFreq = noteFreq / (DCD noteOctave)
· READ Durations + index, noteDuration
· noteDuration = 1000 / noteDuration
· FREQOUT 8, noteDuration, noteFreq
· index = index + 1
LOOP
END
'R·= rest
'and Q = quit
'The other notes are regular and flats.
If you notice the first thing that comes up in notes is a "R" which is a rest. When I first started it it played the song but ended up with an extra offkey note. I was confused for several days ( Drank Beer ) and then just put·a rest there and my final note went away. I have been going to ask if I did anything wrong but Christmas was six months ago. Maybe somebody will tell me now.
If I make a dollar with this programer·it will be a dollar more than I have calculated. These things are really neat. I hope I keep my mind till I am at least 85 so I can keep having this much fun.
Casey
P.S. I haven't yet fired up my piezo speaker yet to hear your song, but I will.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I fish, therefore I lie!