Mercurial > hg > svcore
changeset 914:515c654770ca tonioni
implemented move by one note (replacing big jumps left/right)
author | matthiasm |
---|---|
date | Thu, 22 May 2014 17:49:58 +0100 (2014-05-22) |
parents | 2175c2ebd5c6 |
children | d75c9e0d5e7e |
files | data/model/FlexiNoteModel.h |
diffstat | 1 files changed, 11 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- 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; }