Computer Science Canada

Keyboard thing

Author:  MihaiG [ Mon Jul 18, 2005 8:11 pm ]
Post subject:  Keyboard thing

well figure out how to play....hint...(a---A)(w---A#)(s---B)etc....

this wroks on frequencies..not the horendus play function Evil or Very Mad

so far i cna play a bit of mario,tetris,sonic


code:
var a := 440
var a2 := 446
var b := 494
var c := 524
var c2 := 554
var d := 588
var d2 := 622
var e := 660
var f := 698
var f2 := 740
var g := 784
var g2 := 830
var a3 := 880



var key : array char of boolean
loop
    Input.KeyDown (key)
    if key ('a') then
        sound (a, 250)
    elsif key ('w') then
        sound (a2, 250)
    elsif key ('s') then
        sound (b, 250)
    elsif key ('d') then
        sound (c, 250)
    elsif key ('r') then
        sound (c2, 250)
    elsif key ('f') then
        sound (d, 250)
    elsif key ('t') then
        sound (d2, 250)
    elsif key ('g') then
        sound (e, 250)
    elsif key ('h') then
        sound (f, 250)
    elsif key ('u') then
        sound (f2, 250)
    elsif key ('j') then
        sound (g, 250)
    elsif key ('i') then
        sound (g2, 250)
    elsif key ('k') then
        sound (a3, 250)
    end if
end loop

Author:  MysticVegeta [ Tue Jul 19, 2005 12:31 pm ]
Post subject: 

whyd o you need variables to do that? you can use no varibles and do it

Author:  Cervantes [ Tue Jul 19, 2005 1:46 pm ]
Post subject: 

It's more readable, this way. Though it would be better if they were constants.

Author:  Albrecd [ Thu Nov 10, 2005 9:10 am ]
Post subject:  Octaves

You should add Higher/Lower Octaves.

Author:  [Gandalf] [ Thu Nov 10, 2005 4:06 pm ]
Post subject: 

Look here for a much better version of this type idea:
http://www.compsci.ca/v2/viewtopic.php?t=10107


: