comparison data/fileio/MIDIFileWriter.cpp @ 384:6f6ab834449d spectrogram-cache-rejig

* Merge from trunk
author Chris Cannam
date Wed, 27 Feb 2008 11:59:42 +0000
parents 73537d900d4b
children 2e50d95cf621
comparison
equal deleted inserted replaced
337:a6fab10ff9e6 384:6f6ab834449d
367 367
368 double seconds = double(frame) / double(m_model->getSampleRate()); 368 double seconds = double(frame) / double(m_model->getSampleRate());
369 double quarters = (seconds * m_tempo) / 60.0; 369 double quarters = (seconds * m_tempo) / 60.0;
370 unsigned long midiTime = lrint(quarters * m_timingDivision); 370 unsigned long midiTime = lrint(quarters * m_timingDivision);
371 371
372 // We don't support velocity in note models yet
373 int velocity = 100; 372 int velocity = 100;
373 if (i->level > 0.f && i->level <= 1.f) {
374 velocity = lrintf(i->level * 127.f);
375 }
374 376
375 // Get the sounding time for the matching NOTE_OFF 377 // Get the sounding time for the matching NOTE_OFF
376 seconds = double(frame + duration) / double(m_model->getSampleRate()); 378 seconds = double(frame + duration) / double(m_model->getSampleRate());
377 quarters = (seconds * m_tempo) / 60.0; 379 quarters = (seconds * m_tempo) / 60.0;
378 unsigned long endTime = lrint(quarters * m_timingDivision); 380 unsigned long endTime = lrint(quarters * m_timingDivision);