comparison data/fileio/MIDIFileWriter.cpp @ 340:516819f2b97b

* 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 73537d900d4b
children 2e50d95cf621
comparison
equal deleted inserted replaced
339:ba30f4a3e3be 340:516819f2b97b
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);