Mercurial > hg > svgui
changeset 544:1dd2cddc32eb
* Show MIDI pitch number as well as note name and frequency
author | Chris Cannam |
---|---|
date | Tue, 18 Aug 2009 11:01:57 +0000 |
parents | b73f486fc2e4 |
children | be5c35d3f409 |
files | layer/NoteLayer.cpp |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/NoteLayer.cpp Wed Aug 05 16:36:07 2009 +0000 +++ b/layer/NoteLayer.cpp Tue Aug 18 11:01:57 2009 +0000 @@ -454,14 +454,17 @@ int mnote = lrintf(note.value); int cents = lrintf((note.value - mnote) * 100); float freq = Pitch::getFrequencyForPitch(mnote, cents); - pitchText = tr("%1 (%2 Hz)") - .arg(Pitch::getPitchLabel(mnote, cents)).arg(freq); + pitchText = tr("%1 (%2, %3 Hz)") + .arg(Pitch::getPitchLabel(mnote, cents)) + .arg(mnote) + .arg(freq); } else if (m_model->getScaleUnits() == "Hz") { - pitchText = tr("%1 Hz (%2)") + pitchText = tr("%1 Hz (%2, %3)") .arg(note.value) - .arg(Pitch::getPitchLabelForFrequency(note.value)); + .arg(Pitch::getPitchLabelForFrequency(note.value)) + .arg(Pitch::getPitchForFrequency(note.value)); } else { pitchText = tr("%1 %2")