program (code) to generate full song of twinkle twinkle little star
papu
Posts: 5
hello everyone
················ if anybody have a program (code) to generate full song of twinkle twinkle little star please provide me.
Post Edited By Moderator (Chris Savage (Parallax)) : 3/28/2007 12:14:55 AM GMT
················ if anybody have a program (code) to generate full song of twinkle twinkle little star please provide me.
Post Edited By Moderator (Chris Savage (Parallax)) : 3/28/2007 12:14:55 AM GMT
Comments
I'm sure you can take it from there,
craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
http://forums.parallax.com/showthread.php?p=619826
Scroll to the bottom and look for _Music-player_REL.bsp and _Music-4kEEdata_REL.bsp. I use an external EEPROM for storing musical scores, but they can be put into DATA statements just as easily (you would need to change the I2CIN statements to READ statements).
The only transcription I was able to find (in a quick google search) for TTLS is below.... you will need to transcribe this transcription into a format for the music engine referenced above, of course. Hopefully this will get you started.
Since the melody is almost all whole notes, it shouldn't be too tricky.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
t var nib
x var byte
a con 40
c con 24
d con 27
e con 30
f con 32
g con 36
q con 1
h con 2
for x=0 to 26
lookup x,[noparse][[/noparse]c,c,g,g,a,a,g,f,f,e,e,d,d,c,g,g,f,e,e,d,g,g,f,f,e,e,d],n
lookup x,[noparse][[/noparse]q,q,q,q,q,q,h,q,q,q,q,q,q,h,q,q,h,q,q,h,q,q,q,q,q,q,h],t
freqout 0,t*300,n*11
next
for x=0 to 13
lookup x,[noparse][[/noparse]c,c,g,g,a,a,g,f,f,e,e,d,d,c],n
lookup x,[noparse][[/noparse]q,q,q,q,q,q,h,q,q,q,q,q,q,h],t
freqout 0,t*300,n*11
next