Mercurial > hg > svcore
diff data/model/FlexiNoteModel.h @ 926:926f33d3a8b7 tony_integration
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 12:52:27 +0100 |
parents | 49618f39ff09 |
children | 59e7fe1b1003 |
line wrap: on
line diff
--- a/data/model/FlexiNoteModel.h Tue May 13 09:50:59 2014 +0100 +++ b/data/model/FlexiNoteModel.h Tue Jun 17 12:52:27 2014 +0100 @@ -226,25 +226,22 @@ * 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) { velocity = lrintf(pli->level * 127); @@ -257,10 +254,8 @@ note.midiPitch = Pitch::getPitchForFrequency(note.frequency); note.isMidiPitchQuantized = false; } - notes.push_back(note); } - return notes; }