christmas song
benitoleyva
Posts: 1
in BASIC Stamp
Hi I am new to basic stamp.....question how can I play my song on my basic board over and over....I know I little bit of code....thnakx
Comments
It may be as simply adding a repeat at the end of your code. If you could post your code that you are using now, a suggestion could be made.
SONG CODE
loop
Easy Peasy!
just saying'
Pa-rum-pum-pum-pum...
Speaking of which, benitoleyva please post a Youtube vid or such, and you'll be the first entry into the 2015 Hack the Halls contest. Ken, Matt, what can we win this year? And no, I don't need ANOTHER S3.
This the season to buy a Harley. You can get one and join the zoo.
Now we don our gay apparel, fa la la, fa la la, fa la la LA."
I hope you don't expect us to take a musical score and convert all the notes to frequencies and timing to delays to get the actual output. That would best be first done in a spreadsheet, like Excel. Then the BS2 could just use FREQOUT and a bit of clever timing loops to look up the data pairs.
It might be easier to try something short for a first go - like "Hi Ho Hi, it's off to work we go". If that works, then tackle something longer.
+++++++++++++++++
I heard this song below once again today and actually began to wonder if this was indeed 'The Last Christmas'.
Last Christmas, I gave you my heart
But the very next day, you gave it away
This year, to save me from tears
I'll give it to someone special
Last Christmas, I gave you my heart
But the very next day, you gave it away
This year, to save me from tears
I'll give it to someone special (special)
Once bitten and twice shy
I keep my distance but you still catch my eye
Tell me baby do you recognize me?
Well it's been a year, it doesn't surprise me
I wrapped it up and sent it
With a note saying "I Love You" I meant it
Now I know what a fool I've been
But if you kissed me now I know you'd fool me again
Last Christmas, I gave you my heart
But the very next day, you gave it away
This year, to save me from tears
I'll give it to someone special (special)
Last Christmas, I gave you my heart
DO
SONG CODE
VOLUME=VOLUME+1
TEMPO=TEMPO+1
LOOP
If you don't know a bass cleft from a treble cleft, 3/4 time versus 6/8, a note from a rest, key signatures, and so on --- you are not really prepared to program music on a microcontroller.
This all reminds me of a guy that refused to pay is bookie who broke all his fingers. So the guy goes to the ER to get help. After treatment, he asks the doctor one question.
Guy - "Doctor, will I be able to play the piano?"
Doctor - "The prognosis is good, I doubt that you will have any problems."
Guy - "I don't understand."
Doctor - "Yes, you will be able to play the piano."
Guy - "That's great. I never could before."
IOW -- Background skills might be required to program music. Other projects may require different background skills.
The BASIC Stamp Manual has an explanation of every BS2 command and how to use it.
DO...LOOP is on page 175 (page 179 of the PDF)
FREQOUT is on page 199 (page 203 of the PDF)
https://www.parallax.com/sites/default/files/downloads/27218-Web-BASICStampManual-v2.2.pdf
Chapter 8 of What's a Microcontroller shows you how to make sounds and music with the piezospeaker (page 245).
You can also see an example of a DO...LOOP on page 39.
https://www.parallax.com/sites/default/files/downloads/28123-Whats-a-Micro-v3.0.pdf
This project shows how to play sheet music on the piezospeaker.
http://learn.parallax.com/project/playing-sheet-music-piezospeaker
This project is a Christmas caroling light display.
http://learn.parallax.com/project/christmas-caroling-device-light-display
Now is also a good time to buy the BASIC Stamp Activity Kit or a BS2 module since both are on sale.
https://www.parallax.com/product/90005
https://www.parallax.com/product/bs2-ic
I bet you meant treble clef & bass clef when you and your staff waltzed in. Noted for the rest of us.