diff audioio/AudioGenerator.cpp @ 61:215b8b1b0308

* Add Erase tool and mode * Add icons for Normalize buttons in property boxes, and for Show Peaks * Add support for velocity in notes -- not yet reflected in display or editable in the note edit dialog, but they are imported from MIDI, played, and exported * Begin work on making pastes align pasted times (subtler than I thought)
author Chris Cannam
date Fri, 23 Nov 2007 16:48:23 +0000
parents 3c5756fb6a68
children 448ff6e34b99
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Thu Nov 22 14:17:19 2007 +0000
+++ b/audioio/AudioGenerator.cpp	Fri Nov 23 16:48:23 2007 +0000
@@ -735,6 +735,12 @@
                 onEv.data.note.note = lrintf(pli->value);
             }
 
+            if (pli->level > 0.f && pli->level <= 1.f) {
+                onEv.data.note.velocity = lrintf(pli->level * 127);
+            } else {
+                onEv.data.note.velocity = 100;
+            }
+
 	    plugin->sendEvent(eventTime, &onEv);
 
 #ifdef DEBUG_AUDIO_GENERATOR