public static float FrequencyToMidiCode( float frequency, float tuningA = 440f ) { return 69 + ( 12 * ( Mathf.Log( frequency / tuningA, 2f ) ) ); }