mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Fix and repair incorrect tie information
This commit is contained in:
parent
9f52fc0010
commit
0a45e471b0
|
@ -1699,7 +1699,9 @@ std::string VLSong::GetWord(size_t stanza, size_t measure, VLFraction at)
|
||||||
VLFraction now(0);
|
VLFraction now(0);
|
||||||
|
|
||||||
while (note != end) {
|
while (note != end) {
|
||||||
if (now >= at && note->fPitch != VLNote::kNoPitch) {
|
if (now >= at && note->fPitch != VLNote::kNoPitch
|
||||||
|
&& !(note->fTied & VLNote::kTiedWithPrev)
|
||||||
|
) {
|
||||||
if (word.size())
|
if (word.size())
|
||||||
word += '-';
|
word += '-';
|
||||||
if (stanza <= note->fLyrics.size()) {
|
if (stanza <= note->fLyrics.size()) {
|
||||||
|
@ -1794,6 +1796,8 @@ void VLSong::SetWord(size_t stanza, size_t measure, VLFraction at, std::string w
|
||||||
note->fLyrics[stanza-1].fKind = kind;
|
note->fLyrics[stanza-1].fKind = kind;
|
||||||
if (type == '-')
|
if (type == '-')
|
||||||
kind |= VLSyllable::kHasPrev;
|
kind |= VLSyllable::kHasPrev;
|
||||||
|
else
|
||||||
|
kind &= ~VLSyllable::kHasPrev;
|
||||||
}
|
}
|
||||||
now += note->fDuration;
|
now += note->fDuration;
|
||||||
++note;
|
++note;
|
||||||
|
|
|
@ -604,6 +604,8 @@ int8_t sStepToPitch[] = {
|
||||||
|
|
||||||
VLRepeat repeat;
|
VLRepeat repeat;
|
||||||
bool inRepeat = false;
|
bool inRepeat = false;
|
||||||
|
uint8_t prevKind[20];
|
||||||
|
memset(prevKind, 0, 20);
|
||||||
|
|
||||||
for (NSXMLElement * measure; measure = [e nextObject]; ) {
|
for (NSXMLElement * measure; measure = [e nextObject]; ) {
|
||||||
VLProperties & prop = song->fProperties.front();
|
VLProperties & prop = song->fProperties.front();
|
||||||
|
@ -622,6 +624,16 @@ int8_t sStepToPitch[] = {
|
||||||
|
|
||||||
for (NSXMLElement * note; note = [n nextObject]; ) {
|
for (NSXMLElement * note; note = [n nextObject]; ) {
|
||||||
VLLyricsNote n = [self readNote:note withUnit:unit];
|
VLLyricsNote n = [self readNote:note withUnit:unit];
|
||||||
|
//
|
||||||
|
// Sanitize syllabic information which was corrupt in early
|
||||||
|
// versions.
|
||||||
|
//
|
||||||
|
for (size_t i = 0; i<n.fLyrics.size(); ++i)
|
||||||
|
if (n.fLyrics[i].fText.size()) {
|
||||||
|
if (!(prevKind[i] & VLSyllable::kHasNext))
|
||||||
|
n.fLyrics[i].fKind &= ~VLSyllable::kHasPrev;
|
||||||
|
prevKind[i] = n.fLyrics[i].fKind;
|
||||||
|
}
|
||||||
song->AddNote(n, m, at);
|
song->AddNote(n, m, at);
|
||||||
at += n.fDuration;
|
at += n.fDuration;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user