# HG changeset patch # User matthiasm # Date 1400777398 -3600 # Node ID 515c654770ca624a92b1f2f54860ea0aed2ac108 # Parent 2175c2ebd5c6ff89360cd0904ecd46b11914df45 implemented move by one note (replacing big jumps left/right) diff -r 2175c2ebd5c6 -r 515c654770ca data/model/FlexiNoteModel.h --- a/data/model/FlexiNoteModel.h Wed May 14 09:58:07 2014 +0100 +++ b/data/model/FlexiNoteModel.h Thu May 22 17:49:58 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; }