Mercurial > hg > svcore
comparison plugin/transform/FeatureExtractionModelTransformer.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 | aa8dbac62024 |
children | 46519c04321b |
comparison
equal
deleted
inserted
replaced
339:ba30f4a3e3be | 340:516819f2b97b |
---|---|
493 float duration = 1; | 493 float duration = 1; |
494 if (feature.values.size() > 1) duration = feature.values[1]; | 494 if (feature.values.size() > 1) duration = feature.values[1]; |
495 | 495 |
496 float velocity = 100; | 496 float velocity = 100; |
497 if (feature.values.size() > 2) velocity = feature.values[2]; | 497 if (feature.values.size() > 2) velocity = feature.values[2]; |
498 if (velocity < 0) velocity = 127; | |
499 if (velocity > 127) velocity = 127; | |
498 | 500 |
499 NoteModel *model = getOutput<NoteModel>(); | 501 NoteModel *model = getOutput<NoteModel>(); |
500 if (!model) return; | 502 if (!model) return; |
501 | 503 |
502 model->addPoint(NoteModel::Point(frame, pitch, | 504 model->addPoint(NoteModel::Point(frame, pitch, |
503 lrintf(duration), | 505 lrintf(duration), |
506 velocity / 127.f, | |
504 feature.label.c_str())); | 507 feature.label.c_str())); |
505 | 508 |
506 } else { | 509 } else { |
507 | 510 |
508 DenseThreeDimensionalModel::Column values = feature.values; | 511 DenseThreeDimensionalModel::Column values = feature.values; |