"C","C#","D","D#","E","F","F#","G","G#","A","A#","B","H"
double frequency = 440.0 * Math.pow(1.05956, index - 9); p8.strings[index] = new GuitarString(frequency);
0 - middle C ("C") 1 - C# above middle C ("C#") 2 - D above middle C ("D") 3 - D# above middle C ("D#") 4 - E above middle C ("E") 5 - F above middle C ("F") 6 - F# above middle C ("F#") 7 - G above middle C ("G") 8 - G# above middle C ("G#") 9 - A above middle C ("A") 10 - A# above middle C ("A#") 11 - B above middle C ("B") 12 - high C ("H") The above notes represent one octave of a piano from middle C to high C.
public GuitarString (double frequency); // Constructor public void pluck(); // Pluck string public void tic(); // Advance simulation public double sample(); // Get next sample
String keyboard = "Q2W3ER5T6Y7UI";
Q maps to "C" 2 maps to "C#" W maps to "D" 3 maps to "D#" E maps to "E" R maps to "F" 5 maps to "F#" T maps to "G" 6 maps to "G#" Y maps to "A" 7 maps to "A#" U maps to "B" I maps to "H"