Mercurial > hg > svcore
changeset 916:c0c679c3b5b9
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Tue, 03 Jun 2014 10:45:39 +0100 |
parents | b9d7352336ce (current diff) d75c9e0d5e7e (diff) |
children | 49618f39ff09 |
files | |
diffstat | 1 files changed, 11 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/data/model/FlexiNoteModel.h Mon May 19 10:54:45 2014 +0100 +++ b/data/model/FlexiNoteModel.h Tue Jun 03 10:45:39 2014 +0100 @@ -226,27 +226,26 @@ * NoteExportable methods. */ - NoteList getNotes() const { + NoteList getNotes() const + { return getNotes(getStartFrame(), getEndFrame()); } - NoteList getNotes(size_t startFrame, size_t endFrame) const { - - PointList points = getPoints(startFrame, endFrame); + NoteList getNotes(size_t startFrame, size_t endFrame) const + { + PointList points = getPoints(startFrame, endFrame); NoteList notes; - - for (PointList::iterator pli = - points.begin(); pli != points.end(); ++pli) { - - size_t duration = pli->duration; + for (PointList::iterator pli = points.begin(); pli != points.end(); ++pli) + { + size_t duration = pli->duration; if (duration == 0 || duration == 1) { duration = getSampleRate() / 20; } + int pitch = lrintf(pli->value); - int pitch = lrintf(pli->value); - int velocity = 100; - if (pli->level > 0.f && pli->level <= 1.f) { + if (pli->level > 0.f && pli->level <= 1.f) + { velocity = lrintf(pli->level * 127); } @@ -257,10 +256,8 @@ note.midiPitch = Pitch::getPitchForFrequency(note.frequency); note.isMidiPitchQuantized = false; } - notes.push_back(note); } - return notes; }