comparison 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
comparison
equal deleted inserted replaced
339:ba30f4a3e3be 340:516819f2b97b
1019 !sharpKey); 1019 !sharpKey);
1020 1020
1021 QString noteLabel = tr("%1 - vel %2") 1021 QString noteLabel = tr("%1 - vel %2")
1022 .arg(pitchLabel).arg(int((*i)->getVelocity())); 1022 .arg(pitchLabel).arg(int((*i)->getVelocity()));
1023 1023
1024 float level = float((*i)->getVelocity()) / 128.f;
1025
1024 Note note(startFrame, (*i)->getPitch(), 1026 Note note(startFrame, (*i)->getPitch(),
1025 endFrame - startFrame, noteLabel); 1027 endFrame - startFrame, level, noteLabel);
1026 1028
1027 // std::cerr << "Adding note " << startFrame << "," << (endFrame-startFrame) << " : " << int((*i)->getPitch()) << std::endl; 1029 // std::cerr << "Adding note " << startFrame << "," << (endFrame-startFrame) << " : " << int((*i)->getPitch()) << std::endl;
1028 1030
1029 model->addPoint(note); 1031 model->addPoint(note);
1030 break; 1032 break;