Mercurial > hg > svcore
changeset 915:d75c9e0d5e7e tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Thu, 29 May 2014 16:27:52 +0100 |
parents | 515c654770ca (diff) b9d7352336ce (current diff) |
children | c0c679c3b5b9 e88a15c25a4a |
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 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; }