mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Fix lyrics import errors
This commit is contained in:
parent
37954c7b4f
commit
cb762c4eee
|
@ -376,11 +376,13 @@ while tokens.length > 0
|
||||||
stack.push([block, level, ""])
|
stack.push([block, level, ""])
|
||||||
block = token
|
block = token
|
||||||
level = nestLevel
|
level = nestLevel
|
||||||
stanzas.push(lyrics= [])
|
stanzas.push(lyrics= []) if block == '\lyricmode'
|
||||||
when '\chordmode'
|
when '\chordmode'
|
||||||
stack.push([block, level, ""])
|
stack.push([block, level, ""])
|
||||||
block = '\chords'
|
block = '\chords'
|
||||||
level = nestLevel
|
level = nestLevel
|
||||||
|
when '\lyricsto'
|
||||||
|
tokens[0..3] = nil
|
||||||
when '\new'
|
when '\new'
|
||||||
if tokens[0] == "Lyrics"
|
if tokens[0] == "Lyrics"
|
||||||
stack.push([block, level, ""])
|
stack.push([block, level, ""])
|
||||||
|
@ -495,13 +497,13 @@ while notes.size > 0 || chords.size > 0
|
||||||
if lyrics.size > 0
|
if lyrics.size > 0
|
||||||
stanza = i+1
|
stanza = i+1
|
||||||
syll = lyrics.shift
|
syll = lyrics.shift
|
||||||
ly.push({'text' => syll[0], 'kind' => syll[1]})
|
ly.push({'text' => syll[0].gsub('_', ' '), 'kind' => syll[1]})
|
||||||
else
|
else
|
||||||
ly.push({'text' => '', 'kind' => 0})
|
ly.push({'text' => '', 'kind' => 0})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if stanza < ly.size
|
if stanza < ly.size
|
||||||
ly[ly.size-stanza..-1] = nil
|
ly[stanza..-1] = nil
|
||||||
end
|
end
|
||||||
note['lyrics'] = ly if stanza > 0
|
note['lyrics'] = ly if stanza > 0
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user