diff audioio/AudioGenerator.cpp @ 179:0db3fc28a2a1

* debug only
author Chris Cannam
date Tue, 18 Aug 2009 11:08:29 +0000
parents 7dae51741cc9
children 67cea66bd588
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Tue Aug 18 11:01:32 2009 +0000
+++ b/audioio/AudioGenerator.cpp	Tue Aug 18 11:08:29 2009 +0000
@@ -211,6 +211,7 @@
 
     if (configurationXml != "") {
         PluginXml(plugin).setParametersFromXml(configurationXml);
+        setSampleDir(plugin);
     }
 
     configurationXml = PluginXml(plugin).toXmlString();
@@ -570,7 +571,7 @@
 		offEv.data.note.note = noteOffs.begin()->pitch;
 
 #ifdef DEBUG_AUDIO_GENERATOR
-		std::cerr << "mixModel [sparse]: sending note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << std::endl;
+		std::cerr << "mixModel [sparse]: sending note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << " pitch " << noteOffs.begin()->pitch << std::endl;
 #endif
 
 		plugin->sendEvent(eventTime, &offEv);
@@ -603,7 +604,7 @@
 	    offEv.data.note.note = noteOffs.begin()->pitch;
 
 #ifdef DEBUG_AUDIO_GENERATOR
-		std::cerr << "mixModel [sparse]: sending leftover note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << std::endl;
+            std::cerr << "mixModel [sparse]: sending leftover note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << " pitch " << noteOffs.begin()->pitch << std::endl;
 #endif
 
 	    plugin->sendEvent(eventTime, &offEv);
@@ -667,8 +668,11 @@
     size_t got = blocks * m_pluginBlockSize;
 
 #ifdef DEBUG_AUDIO_GENERATOR
-    std::cout << "mixModel [note]: frames " << frames
-	      << ", blocks " << blocks << std::endl;
+    Vamp::RealTime startTime = Vamp::RealTime::frame2RealTime
+        (startFrame, m_sourceSampleRate);
+
+    std::cout << "mixModel [note]: frames " << frames << " from " << startFrame
+	      << " (time " << startTime << "), blocks " << blocks << std::endl;
 #endif
 
     snd_seq_event_t onEv;
@@ -714,7 +718,7 @@
 		offEv.data.note.note = noteOffs.begin()->pitch;
 
 #ifdef DEBUG_AUDIO_GENERATOR
-		std::cerr << "mixModel [note]: sending note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << std::endl;
+		std::cerr << "mixModel [note]: sending note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << " pitch " << noteOffs.begin()->pitch << std::endl;
 #endif
 
 		plugin->sendEvent(eventTime, &offEv);
@@ -739,7 +743,7 @@
 	    plugin->sendEvent(eventTime, &onEv);
 
 #ifdef DEBUG_AUDIO_GENERATOR
-	    std::cout << "mixModel [note]: point at frame " << pliFrame << ", block start " << (startFrame + i * m_pluginBlockSize) << ", resulting time " << eventTime << std::endl;
+	    std::cout << "mixModel [note]: point at frame " << pliFrame << ", pitch " << (int)onEv.data.note.note << ", block start " << (startFrame + i * m_pluginBlockSize) << ", resulting time " << eventTime << std::endl;
 #endif
 	    
 	    size_t duration = pli->duration;
@@ -750,6 +754,10 @@
 	    noff.pitch = onEv.data.note.note;
 	    noff.frame = pliFrame + duration;
 	    noteOffs.insert(noff);
+
+#ifdef DEBUG_AUDIO_GENERATOR
+            std::cout << "mixModel [note]: recording note off at " << noff.frame << std::endl;
+#endif
 	}
 
 	while (noteOffs.begin() != noteOffs.end() &&
@@ -762,7 +770,7 @@
 	    offEv.data.note.note = noteOffs.begin()->pitch;
 
 #ifdef DEBUG_AUDIO_GENERATOR
-		std::cerr << "mixModel [note]: sending leftover note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << std::endl;
+            std::cerr << "mixModel [note]: sending leftover note-off event at time " << eventTime << " frame " << noteOffs.begin()->frame << " pitch " << noteOffs.begin()->pitch << std::endl;
 #endif
 
 	    plugin->sendEvent(eventTime, &offEv);