Computer Science Canada Musical keyboard |
Author: | petree08 [ Thu Oct 26, 2006 8:20 am ] | ||
Post subject: | Musical keyboard | ||
This is a fun little program I wrote when i started using the sound command. All the keys on the computer make a different sound, Plus it looks cool (i put in some screen effects. You can change how long the notes can go by using the arrow keys.
|
Author: | jr.ranger.33 [ Sat Nov 04, 2006 5:51 pm ] |
Post subject: | Bored |
I was really bored so i took your idea and created an onscreen keyboard that does pretty much the same thing, so here's the code: import GUI setscreen ("graphics:400;300") procedure sound1 sound (25,50) end sound1 procedure sound2 sound (125,50) end sound2 procedure sound3 sound (225,50) end sound3 procedure sound4 sound (253,50) end sound4 procedure sound5 sound (425,50) end sound5 procedure sound6 sound (525,50) end sound6 procedure sound7 sound (625,50) end sound7 procedure sound8 sound (725,50) end sound8 procedure sound9 sound (825,50) end sound9 procedure sound10 sound (925,50) end sound10 procedure sound11 sound (50,50) end sound11 procedure sound12 sound (150,50) end sound12 procedure sound13 sound (250,50) end sound13 procedure sound14 sound (350,50) end sound14 procedure sound15 sound (450,50) end sound15 procedure sound16 sound (550,50) end sound16 procedure sound17 sound (650,50) end sound17 procedure sound18 sound (750,50) end sound18 procedure sound19 sound (850,50) end sound19 procedure sound20 sound (950,50) end sound20 procedure sound21 sound (75,50) end sound21 procedure sound22 sound (175,50) end sound22 procedure sound23 sound (275,50) end sound23 procedure sound24 sound (375,50) end sound24 procedure sound25 sound (475,50) end sound25 procedure sound26 sound (575,50) end sound26 procedure sound27 sound (675,50) end sound27 procedure sound28 sound (775,50) end sound28 procedure sound29 sound (875,50) end sound29 procedure sound30 sound (975,50) end sound30 procedure sound31 sound (100,50) end sound31 procedure sound32 sound (200,50) end sound32 procedure sound33 sound (300,50) end sound33 procedure sound34 sound (400,50) end sound34 procedure sound35 sound (500,50) end sound35 procedure sound36 sound (600,50) end sound36 procedure sound37 sound (700,50) end sound37 procedure sound38 sound (800,50) end sound38 procedure sound39 sound (900,50) end sound39 procedure sound40 sound (1000,50) end sound40 var button1:int:=GUI.CreateButton(20,270,10,"1",sound1) var button2:int:=GUI.CreateButton(55,270,10,"2",sound2) var button3:int:=GUI.CreateButton(90,270,10,"3",sound3) var button4:int:=GUI.CreateButton(125,270,10,"4",sound4) var button5:int:=GUI.CreateButton(160,270,10,"5",sound5) var button6:int:=GUI.CreateButton(195,270,10,"6",sound6) var button7:int:=GUI.CreateButton(230,270,10,"7",sound7) var button8:int:=GUI.CreateButton(265,270,10,"8",sound8) var button9:int:=GUI.CreateButton(300,270,10,"9",sound9) var button0:int:=GUI.CreateButton(335,270,10,"0",sound10) var buttonq:int:=GUI.CreateButton(20,247,10,"q",sound11) var buttonw:int:=GUI.CreateButton(55,247,10,"w",sound12) var buttone:int:=GUI.CreateButton(90,247,10,"e",sound13) var buttonr:int:=GUI.CreateButton(125,247,10,"r",sound14) var buttont:int:=GUI.CreateButton(160,247,10,"t",sound15) var buttony:int:=GUI.CreateButton(195,247,10,"y",sound16) var buttonu:int:=GUI.CreateButton(230,247,10,"u",sound17) var buttoni:int:=GUI.CreateButton(265,247,10,"i",sound18) var buttono:int:=GUI.CreateButton(300,247,10,"o",sound19) var buttonp:int:=GUI.CreateButton(335,247,10,"p",sound20) var buttona:int:=GUI.CreateButton(20,224,10,"a",sound21) var buttons:int:=GUI.CreateButton(55,224,10,"s",sound22) var buttond:int:=GUI.CreateButton(90,224,10,"d",sound23) var buttonf:int:=GUI.CreateButton(125,224,10,"f",sound24) var buttong:int:=GUI.CreateButton(160,224,10,"g",sound25) var buttonh:int:=GUI.CreateButton(195,224,10,"h",sound26) var buttonj:int:=GUI.CreateButton(230,224,10,"j",sound27) var buttonk:int:=GUI.CreateButton(265,224,10,"k",sound28) var buttonl:int:=GUI.CreateButton(300,224,10,"l",sound29) var buttonsemicolon:int:=GUI.CreateButton(335,224,10,";",sound30) var buttonz:int:=GUI.CreateButton(20,201,10,"z",sound31) var buttonx:int:=GUI.CreateButton(55,201,10,"x",sound32) var buttonc:int:=GUI.CreateButton(90,201,10,"c",sound33) var buttonv:int:=GUI.CreateButton(125,201,10,"v",sound34) var buttonb:int:=GUI.CreateButton(160,201,10,"b",sound35) var buttonn:int:=GUI.CreateButton(195,201,10,"n",sound36) var buttonm:int:=GUI.CreateButton(230,201,10,"m",sound37) var buttoncomma:int:=GUI.CreateButton(265,201,10,",",sound38) var buttonperiod:int:=GUI.CreateButton(300,201,10,".",sound39) var buttonslash:int:=GUI.CreateButton(335,201,10,"/",sound40) loop exit when GUI.ProcessEvent end loop |
Author: | araevin [ Sun Nov 05, 2006 12:36 pm ] |
Post subject: | |
my computer crashed when i ran this .... prolly just my computer |