Mairo Theme song for the BS2
Hey all,
I'm tring to get the mairo theme song to play on the BS2. I have the setup done, but I need the code for it. I have started it, but I don't have the timeing down. I need help here. I will get any info that I can get.
Ferris!!!!
I'm tring to get the mairo theme song to play on the BS2. I have the setup done, but I need the code for it. I have started it, but I don't have the timeing down. I need help here. I will get any info that I can get.
Ferris!!!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Ferris!!!!
Main:
FREQOUT 10, 500, 1400
FREQOUT 10, 500, 1100
FREQOUT 10, 500, 1400
FREQOUT 10, 500, 493
FREQOUT 10, 500, 1650
FREQOUT 10, 500, 1100
FREQOUT 10, 500, 1650
FREQOUT 10, 500, 1400
FREQOUT 10, 1000,440
FREQOUT 10, 1000,493
FREQOUT 10, 1000,466
FREQOUT 10, 1000,440
FREQOUT 10, 1000,392
FREQOUT 10, 1000,1400
FREQOUT 10, 1000,783
FREQOUT 10, 1000,659
FREQOUT 10, 1000,587
FREQOUT 10, 1000,293
END
You are going to use up a lot of program space with all those sequential FREQOUT commands.· Have you taken a close look at the later activities in Chapter 8 of "What's a Microcontroller?"· (WAM). There are more efficient ways to write programs to play songs that also allow for easier control of timing.··You will need to figure out the duration of how long each note lasts by just listening to it over··It takes a while to work out the timing.
There is·also an example program for playing RTTTL cell phone ringtones.· You may be able to purchase the RTTTL file for the Mario song you need online.·
The WAM book and the Nokia ringtone player program can be downloaded here:
http://www.parallax.com/detail.asp?product_id=28152
-Stephanie Lindsay
Editor, Parallax Inc.
·
Ferris!!!!
Here is the sheet music that I kind of used.
http://www.jimmyr.com/mario/mariotheme.pdf
Post Edited (Ferris_Bue) : 9/28/2007 4:31:46 PM GMT
http://www.jimmyr.com/Free_Mario_Sheet_Music.php
http://www.datadragon.com/education/reading/
p.s. - ringtones seem to be about $1.99 in case that's an option for you.
' {$STAMP BS2}
I VAR Byte
FR VAR Word
SE VAR Byte
F CON 349
E CON 329
G CON 392
LD CON 146
HD CON 293
C CON 261
A CON 440
T CON 500
Check_Status:
I=0
IN4=0 THEN Mario
GOTO Check_Stauts
Mario:
FOR I= 0 TO 27
LOOKUP I, [noparse][[/noparse]E,E,E,E,C,E,G,G,C,G,E,E,A,B,B,A,G,E,G,AF,G,E,C,D,B,C,G]
LOOKUP I, [noparse][[/noparse](T+T),T,T,T]
FREQOUT 2,SE,FR
IF I=27 THEN Check_Status
NEXT
I need help!!!
Ferris!!!!
Did you copy & paste this from your BASIC Stamp Editor? It has a few bugs. I used the Editor's syntax checker and Error messages to locate them:
There are some characters in your LOOKUP list that have no CON declaration - that's the Undefined Symbol error.
IN4=0 THEN Mario ' THEN without an IF, giving you
Error message " Expected ',' ": Your LOOKUP lists need to be followed with a comma and then your target variable (see LOOKUP on page 277 of the BASIC Stamp Manual or the Editor's Help) I noticed you defined FR and SE, then use them in your FREQOUT command, but don't involve them in your LOOKUP commands.
GOTO Check_Stauts ' you've got a simple typo causing the Undefined Label error message.
-Stephanie
Ferris!!!!
You could also have easier control of the timing this way. Make a Time variable, then declare 4 constants: T1 CON 250, T2 CON 500, T3 CON 750, T4 CON 1000, etc. Then expand the last LOOKUP list to have one T-number for each note. That way, every time through your loop, the right duration, frequency 1, and frequency 2 get put into the FREQOUT command. The only thing here is that the two notes would play for the same length of time.
-Stephanie
Ferris!!!
Post Edited (Ferris_Bue) : 9/26/2007 3:53:55 PM GMT
But for hooking up amps, that's not my area. Since this is a new problem, it would be good to start a new thread with a title about selecting the amp type, so folks who know about those will find your question.
-Stephanie
Ferris!!!!
humanoido
Ferris!!!!
I don't recognize the tune as the
original Mario Brothers Song.
Is this a newer one?
humanoido
Ferris!!!!