| 48 | } |
| 49 | |
| 50 | CStringA GetPitchText(int digits, int period, double freq) { |
| 51 | const LPCSTR fmt = "pitch = $%0*X (%7.2fHz %s %+03i)"; |
| 52 | const double note = NoteFromFreq(freq); |
| 53 | const int note_conv = note >= 0 ? int(note + 0.5) : int(note - 0.5); |
| 54 | const int cents = int((note - double(note_conv)) * 100.0); |
| 55 | |
| 56 | if (freq != 0.) |
| 57 | return FormattedA(fmt, digits, period, freq, GetNoteString(ft0cc::doc::pitch_from_midi(note_conv), ft0cc::doc::oct_from_midi(note_conv) + 1).data(), cents); |
| 58 | return FormattedA(fmt, digits, period, 0., "---", 0); |
| 59 | }; |
| 60 | |
| 61 | } // namespace |
| 62 |
no test coverage detected