I just got it in my head to make our robot for the Botball competition play music from SMB or Zelda. It has a function which will play a certain frequency for a certain period of time. Unfortunately, all the sheet music I've found for those games is rather complicated (for me, at least) and I'm not sure it's feasible to actually use it. Is there any simple way to do this?
Announcement
Collapse
No announcement yet.
music help (especially computer people)
Collapse
X
-
This will be of no help whatsoever Kuci, but I *used* to know how to do this! I can't for the life of me remember.
In the 'olden days' of computers a lot of programming languages used to take commands alond the lines of "Sound (duration), (frequency), (pitch(?)), I used to know how to convert, lemme think...........
Comment
-
void play_music() {
while(1) {
tone(nb,2.*bl);
tone(nd,bl);
tone(na,2.*bl);
tone(ng/2.,bl/2.);
tone(na,bl/2.);
tone(nb,2.*bl);
tone(nd,bl);
tone(na,2.*bl);
sleep(bl);
tone(nb,2.*bl);
tone(nd,bl);
tone(2.*na,2.*bl);
tone(ng,bl);
tone(nd,2.*bl);
tone(nc,bl/2.);
tone(nb,bl/2.);
tone(na,2.*bl);
sleep(bl);
tone(nb,2.*bl);
tone(nd,bl);
tone(na,2.*bl);
tone(ng/2.,bl/2.);
tone(na,bl/2.);
tone(nb,2.*bl);
tone(nd,bl);
tone(na,2.*bl);
sleep(bl);
tone(nb,2.*bl);
tone(nd,bl);
tone(2.*na,2.*bl);
tone(ng,bl);
tone(2.*nd,6.*bl);
sleep(bl);
tone(2.*nd,2.*bl);
tone(2.*nc,bl/2.);
tone(2.*nb,bl/2.);
tone(2.*nc,bl/2.);
tone(2.*nb,bl/2.);
tone(ng,2.*bl);
tone(2.*nc,2.*bl);
tone(2.*nb,bl/2.);
tone(2.*na,bl/2.);
tone(2.*nb,bl/2.);
tone(2.*na,bl/2.);
tone(ne,2.*bl);
tone(2.*nd,2.*bl);
tone(2.*nc,bl/2.);
tone(2.*nb,bl/2.);
tone(2.*nc,bl/2.);
tone(2.*nb,bl/2.);
tone(ng,bl);
tone(2.*nc,bl);
tone(2.*ng,6.*bl);
sleep(4.);
}
}
EDIT: it killed my indents
Comment
Comment