I've played around with this idea on and off over the past few weeks, and finally figured out how to turn the "beep" command into all 66 notes of the keys of a piano. In fact, just in case anyone else needs to know how to do the same, I've listed the frequencies for each of the 66 keys in the code box that follows this request for information.
In the meantime, what I've been trying to figure out is how to affect the duration of the "beep" so that it makes one steady note for as long as I press any of the 66 keys (buttons) for my homemade synthesizer. Granted, I can program the beep duration to last as long as I like ahead of time for one particular note of a piece of music, but the problem is how to allow it to play the correct duration of time for any number of varying times, so that the duration is different every time I press a key, depending on how long I hold it down. That part I haven't figured out yet.
Code: Select all
PIANO KEY FREQUENCIES
Key 66: D6 = 1174.66
Key 65: C♯6/Dâ™6 = 1108.73
Key 64: C6 (Soprano C) = 1046.50
Key 63: B5 = 987.767
Key 62: A♯5/Bâ™5 = 932.328
Key 61: A5 = 880.000
Key 60: G♯5/Aâ™5 = 830.609
Key 59: G5 = 783.991
Key 58: F♯5/Gâ™5 = 739.989
Key 57: F5 = 698.456
Key 56: E5 = 659.255
Key 55: D♯5/Eâ™5 = 622.254
Key 54: D5 = 587.330
Key 53: C♯5/Dâ™5 = 554.365
Key 52: C5 (Tenor C) = 523.251
Key 51: B4 = 493.883
Key 50: A♯4/Bâ™4 = 466.164
Key 49: A4 (A440) = 440.000
Key 48: G♯4/Aâ™4 = 415.305
Key 47: G4 = 391.995
Key 46: F♯4/Gâ™4 = 369.994
Key 45: F4 = 349.228
Key 44: E4 = 329.628
Key 43: D♯4/Eâ™4 = 311.127
Key 42: D4 = 293.665
Key 41: C♯4/Dâ™4 = 277.183
Key 40: C4 (Middle C) = 261.626
Key 39: B3 = 246.942
Key 38: A♯3/Bâ™3 = 233.082
Key 37: A3 = 220.000
Key 36: G♯3/Aâ™3 = 207.652
Key 35: G3 = 195.998
Key 34: F♯3/Gâ™3 = 184.997
Key 33: F3 = 174.614
Key 32: E3 = 164.814
Key 31: D♯3/Eâ™3 = 155.563
Key 30: D3 = 146.832
Key 29: C♯3/Dâ™3 = 138.591
Key 28: C3 (Low C) = 130.813
Key 27: B2 = 123.471
Key 26: A♯2/Bâ™2 = 116.541
Key 25: A2 = 110.000
Key 24: G♯2/Aâ™2 = 103.826
Key 23: G2 = 97.9989
Key 22: F♯2/Gâ™2 = 92.4986
Key 21: F2 = 87.3071
Key 20: E2 = 82.4069
Key 19: D♯2/Eâ™2 = 77.7817
Key 18: D2 = 73.4162
Key 17: C♯2/Dâ™2 = 69.2957
Key 16: C2 (Deep C) = 65.4064
Key 15: B1 = 61.7354
Key 14: A♯1/Bâ™1 = 58.2705
Key 13: A1 = 55.0000
Key 12: G♯1/Aâ™1 = 51.9130
Key 11: G1 = 48.9995
Key 10: F♯1/Gâ™1 = 46.2493
Key 9: F1 = 43.6536
Key 8: E1 = 41.2035
Key 7: D♯1/Eâ™1 = 38.8909
Key 6: D1 = 36.7081
Key 5: C♯1/Dâ™1 = 34.6479
Key 4: C1 = 32.7032
Key 3: B0 = 30.8677
Key 2: A♯0/Bâ™0 = 29.1353
Key 1: A0 = 27.5000