olivarra1 Posted March 28, 2008 Share Posted March 28, 2008 I've just made a simple programe that makes your computer an instrument this are the notes keyboard letter => note letter (ABCDEFG) (in spansih are La, Si, Do, Re, Mi, Fa, Sol) A => C W => C# or Db S => D E => D# or Eb D => E F => F T => F# or Gb G => G Y => G# or Hb H => A U => A# or Bb J => B K => C you have to press the "home" key to start, press some key and finsh with the key "end", and the computer will give you the sound ^^ (the instrument is made only by beeps) expandcollapse popup#include <Misc.au3> $num = 1 + 100; max notes dim $nota[$num][2]; 0: freq., 1: time. While 1 $i = 0 while _IsPressed("24") = False ;sleep(5) WEnd while _IsPressed("23") = False Select Case _IsPressed("41") $crono = TimerInit() While _IsPressed("41") sleep(5) WEnd $nota[$i][0] = 261.63 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("53") $crono = TimerInit() While _IsPressed("53") sleep(5) WEnd $nota[$i][0] = 293.66 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("44") $crono = TimerInit() While _IsPressed("44") sleep(5) WEnd $nota[$i][0] = 329.63 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("46") $crono = TimerInit() While _IsPressed("46") sleep(5) WEnd $nota[$i][0] = 349.23 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("47") $crono = TimerInit() While _IsPressed("47") sleep(5) WEnd $nota[$i][0] = 392.00 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("48") $crono = TimerInit() While _IsPressed("48") sleep(5) WEnd $nota[$i][0] = 440.00 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("4A") $crono = TimerInit() While _IsPressed("4A") sleep(5) WEnd $nota[$i][0] = 493.88 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("4B") $crono = TimerInit() While _IsPressed("4B") sleep(5) WEnd $nota[$i][0] = 523.25 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("57") $crono = TimerInit() While _IsPressed("57") sleep(5) WEnd $nota[$i][0] = 277.18 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("45") $crono = TimerInit() While _IsPressed("45") sleep(5) WEnd $nota[$i][0] = 311.13 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("54") $crono = TimerInit() While _IsPressed("54") sleep(5) WEnd $nota[$i][0] = 369.99 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("59") $crono = TimerInit() While _IsPressed("59") sleep(5) WEnd $nota[$i][0] = 415.30 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 Case _IsPressed("55") $crono = TimerInit() While _IsPressed("55") sleep(5) WEnd $nota[$i][0] = 466.16 $nota[$i][1] = TimerDiff($crono) $i = $i + 1 case Else $crono = TimerInit() While 1 If _IsPressed("41") Or _IsPressed("53") Or _IsPressed("44") Or _IsPressed("46") Or _IsPressed("47") Or _IsPressed("48") Or _IsPressed("4A") Or _IsPressed("4B") Or _IsPressed("57") Or _IsPressed("45") Or _IsPressed("54") Or _IsPressed("59") Or _IsPressed("55") Or _IsPressed("23") Then ExitLoop EndIf ;sleep(5) WEnd $nota[$i][0] = "pause" $nota[$i][1] = TimerDiff($crono) $i = $i + 1 EndSelect WEnd for $j = 0 to $i If $nota[$j][0] = "pause" Then Sleep($nota[$j][1]) Else Beep($nota[$j][0], $nota[$j][1]) EndIf Next WEnd Then I will make it with some Gui so you can save your music ^^ olivarra1 PD: I'm very sorry because my english >.< Link to comment Share on other sites More sharing options...
BananaFredSoft Posted March 29, 2008 Share Posted March 29, 2008 I made a program almost exactly like this, except it had a GUI. -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now