# HG changeset patch # User Chris Cannam # Date 1401377272 -3600 # Node ID d75c9e0d5e7e06836f81bf9208e9891de5bbcd33 # Parent 515c654770ca624a92b1f2f54860ea0aed2ac108# Parent b9d7352336ce3c0bb82cce206e008779af2d00f8 Merge from default branch diff -r b9d7352336ce -r d75c9e0d5e7e data/model/FlexiNoteModel.h --- a/data/model/FlexiNoteModel.h Mon May 19 10:54:45 2014 +0100 +++ b/data/model/FlexiNoteModel.h Thu May 29 16:27:52 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; }