Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 hammer
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bored_hacker




PostPosted: Thu Jul 07, 2005 10:11 am   Post subject: hammer

I got bored so I decided to write out the BGM for when you pick up the hammer on Super Smash Bros Melee.

code:
loop
    Music.Sound (270, 200)
    Music.Sound (270, 100)
    Music.Sound (270, 100)
    Music.Sound (270, 250)
    Music.Sound (270, 200)
    Music.Sound (335, 200)
    Music.Sound (270, 200)
    Music.Sound (335, 200)
    Music.Sound (270, 200)
    Music.Sound (335, 200)
    Music.Sound (335, 100)
    Music.Sound (335, 100)
    Music.Sound (335, 200)
    Music.Sound (335, 200)
    Music.Sound (400, 200)
    Music.Sound (335, 200)
    Music.Sound (400, 200)
    Music.Sound (335, 200)
end loop
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Thu Jul 07, 2005 12:23 pm   Post subject: (No subject)

Cute. Try doing something similar to that using the 'play()' command. And add an exit condition in there (like 'exit when hasch') since infinite loops are never a good idea!
TokenHerbz




PostPosted: Tue Jul 19, 2005 2:54 pm   Post subject: (No subject)

How do you know how to make the notes???
i cant make a song, GJ!
Delos




PostPosted: Tue Jul 19, 2005 4:02 pm   Post subject: (No subject)

Well, in bored_hacker's method, he used known frequencies of sounds and given lengths to produce a tone that we recognize as a particular note. For instance, 440 Hz is the note 'A'. This can be produced using the Music.Sound() command.
On the other hand, using the play command produces a midi-like note, or series thereof.
For example, the scale of D-major is thus:

Turing:

  play ("4def+gabc+>d")


The '4' stands for a crotchet (quater note), the letters are...well...the notes, the + stands for sharp (- for flat), and the > means up an octave (< for down).
[Gandalf]




PostPosted: Wed Jul 20, 2005 11:39 am   Post subject: (No subject)

You also have to keep in mind that when you go up an octave, it stays in effect for the whole song. So to go back down you need to put a < before the next note.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: