mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Play proper pitch for extended notes (Tracker #3284515)
This commit is contained in:
parent
c14ace59f8
commit
ec927024f5
|
@ -887,18 +887,21 @@ void VLSong::DelNote(size_t measure, VLFraction at)
|
|||
fMeasures.pop_back();
|
||||
}
|
||||
|
||||
void VLSong::ExtendNote(size_t measure, VLFraction at)
|
||||
VLNote VLSong::ExtendNote(size_t measure, VLFraction at)
|
||||
{
|
||||
VLNoteList::iterator i = fMeasures[measure].fMelody.begin();
|
||||
VLNoteList::iterator end= fMeasures[measure].fMelody.end();
|
||||
|
||||
if (i==end)
|
||||
return VLNote(); // Empty song, do nothing
|
||||
|
||||
for (VLFraction t(0); i != end && t+i->fDuration <= at; ++i)
|
||||
t += i->fDuration;
|
||||
|
||||
if (i == end)
|
||||
--i;
|
||||
if (i->fPitch == VLNote::kNoPitch)
|
||||
return; // Don't extend rests
|
||||
return *i; // Don't extend rests
|
||||
|
||||
for (;;) {
|
||||
VLNoteList::iterator j=i;
|
||||
|
@ -942,6 +945,7 @@ void VLSong::ExtendNote(size_t measure, VLFraction at)
|
|||
}
|
||||
break;
|
||||
}
|
||||
return *i;
|
||||
}
|
||||
|
||||
bool VLSong::IsNonEmpty() const
|
||||
|
|
|
@ -334,7 +334,7 @@ public:
|
|||
void AddNote(VLLyricsNote note, size_t measure, VLFraction at);
|
||||
void DelChord(size_t measure, VLFraction at);
|
||||
void DelNote(size_t measure, VLFraction at);
|
||||
void ExtendNote(size_t measure, VLFraction at);
|
||||
VLNote ExtendNote(size_t measure, VLFraction at);
|
||||
void AddRepeat(size_t beginMeasure, size_t endMeasure, int times);
|
||||
void DelRepeat(size_t beginMeasure, size_t endMeasure);
|
||||
void AddEnding(size_t beginMeasure, size_t endMeasure, size_t volta);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
}
|
||||
[[self document] willChangeSong];
|
||||
if (fCursorAccidental == kMusicExtendCursor)
|
||||
[self song]->ExtendNote(fCursorMeasure, fCursorAt);
|
||||
newNote = [self song]->ExtendNote(fCursorMeasure, fCursorAt);
|
||||
else if (fClickMode == 'k')
|
||||
[self song]->DelNote(fCursorMeasure, fCursorAt);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user