[JW Lua] Create lyrics

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Apr 1 10:33:22 CEST 2014


Chris,

I'm a bit unsure what you want to achieve with your code sample? Do you 
just want to assign a verse to notes?


Best regards,

Jari Williamsson


On 2014-03-29 20:32, Chris wrote:
> Finally I succeeded. But I do not think this is a good method.
>
>
> function nextVerseSyllable(RawTextNumber)
>      local vs = finale.FCVerseSyllable()
>      local SyllableNumber = 0
>
>      repeat
>          SyllableNumber = SyllableNumber + 1
>          vs.RawTextNumber=RawTextNumber
>          vs.SyllableNumber= SyllableNumber
>      until not vs:IsValidSyllableNumber()
>
>      return SyllableNumber
> end
>
> local lyric = finale.FCVerseLyricsText()
> lyric:Load(1)   -- verse 1
> local nextvs = nextVerseSyllable(1)
> local ind = 1
>
> for noteentry in eachentrysaved(finenv.Region()) do
>      local syllabe=finale.FCString()
>      syllabe.LuaString = " " .. tostring(ind)
>
>      local text = lyric:CreateString()
>      text:AppendString(syllabe)
>      lyric:SetText(text)
>      lyric:Save()
>
>      local vs = finale.FCVerseSyllable()
>      vs:SetNoteEntry(noteentry)
>      vs.RawTextNumber=1
>      vs.SyllableNumber=nextvs
>      vs:SaveRawText(syllabe)
>      vs:SaveNew()
>
>      nextvs = nextvs + 1
>      ind = ind + 1
> end
>
>
> Chris
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list