Mercurial > hg > svcore
diff data/fileio/MIDIFileReader.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 | 14e0f60435b8 |
children | 183ee2a55fc7 |
line wrap: on
line diff
--- a/data/fileio/MIDIFileReader.cpp Thu Nov 22 14:17:19 2007 +0000 +++ b/data/fileio/MIDIFileReader.cpp Fri Nov 23 16:48:23 2007 +0000 @@ -1021,8 +1021,10 @@ QString noteLabel = tr("%1 - vel %2") .arg(pitchLabel).arg(int((*i)->getVelocity())); + float level = float((*i)->getVelocity()) / 128.f; + Note note(startFrame, (*i)->getPitch(), - endFrame - startFrame, noteLabel); + endFrame - startFrame, level, noteLabel); // std::cerr << "Adding note " << startFrame << "," << (endFrame-startFrame) << " : " << int((*i)->getPitch()) << std::endl;