changeset 37:58cf1620d6e3

* Add units repository, and unit property on time-value and note layers.
author Chris Cannam
date Thu, 11 May 2006 15:02:14 +0000
parents b9e76c9e631c
children 54287e5e7451
files audioio/AudioGenerator.cpp
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Thu May 11 11:35:46 2006 +0000
+++ b/audioio/AudioGenerator.cpp	Thu May 11 15:02:14 2006 +0000
@@ -18,6 +18,7 @@
 #include "base/TempDirectory.h"
 #include "base/PlayParameters.h"
 #include "base/PlayParameterRepository.h"
+#include "base/Pitch.h"
 
 #include "model/NoteModel.h"
 #include "model/DenseTimeValueModel.h"
@@ -691,7 +692,11 @@
             Vamp::RealTime eventTime = Vamp::RealTime::frame2RealTime
 		(pliFrame, m_sourceSampleRate);
 	    
-	    onEv.data.note.note = lrintf(pli->value);
+            if (nm->getScaleUnits() == "Hz") {
+                onEv.data.note.note = Pitch::getPitchForFrequency(pli->value);
+            } else {
+                onEv.data.note.note = lrintf(pli->value);
+            }
 
 	    plugin->sendEvent(eventTime, &onEv);