[JW Lua] Create lyrics
Jari Williamsson
jari.williamsson at mailbox.swipnet.se
Tue Apr 1 12:10:22 CEST 2014
Chris,
This example would assign verse syllables for verse 1 note-by-note in
the region. It assumes that a lyrics text already exists for verse 1.
If you need to save a text as a verse/chorus/section,
FCVerseLyricsText/etc should be able to do that.
I also limited this example to only work on 1-staff selections and only
process layer 1 entries.
Although my example doesn't do it, I don't think it's an error to assign
syllable numbers larger than what's available in the text. Finale
handles syllables dynamically and if the string grows later, the
syllables will show up.
---
local region = finenv.Region()
if region:CalcStaffSpan() ~= 1 then return end
local syllable = 1
for e in eachentrysaved(region) do
if e:IsNote() and (e.LayerNumber == 1) then
local vs = finale.FCVerseSyllable()
vs.RawTextNumber = 1
vs.SyllableNumber = syllable
vs:SetNoteEntry(e)
if vs:IsValidSyllableNumber() then
vs:SaveNew()
syllable = syllable + 1
else
print("Syllable", syllable, "doesn't exist")
end
end
end
---
Best regards,
Jari Williamsson
On 2014-04-01 10:45, Chris wrote:
> Jari
>
> Yes I want to add new lyrics (verse, chorus or section) to notes
> and as I can't do with SaveRawText I searched the number of the next
> syllable to insert.
>
> Since I noticed that I did not need the line : vs:SaveRawText(syllabe)
>
> Thanks
>
> Chris
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
More information about the JWLua
mailing list