[JW Lua] Staff Styles

Emile Meuffels e.meuffels at gmail.com
Sun Oct 4 15:33:36 CEST 2020


I have been experimenting with adding staff styles through JW Lua to change
the transposition of an instrument and I'm getting some results I don't
understand...

My code is based on the example script on the Lua-site (where "style" is a
local decided by the program before):

    local musicRegion = finale.FCMusicRegion()
    musicRegion:SetCurrentSelection()
    local startbar = musicRegion:GetStartMeasure()
    local endbar = musicRegion:GetEndMeasure()
    local ssa = finale.FCStaffStyleAssign()
    ssa.StyleID = style
    ssa.StartMeasure = startbar
    ssa.StartMeasurePos = 0
    ssa.EndMeasure = endbar
    ssa:SetEndMeasurePosRight()
    ssa:SaveNew(1)

If I create a Staff Style and I name it "22. Transposition in G" and then
set the local "style" to 22, this script works as expected.
For the next step I created all the necessary staff styles and saved them
as a library. If I load the library in a new file, I can see the "22.
Transposition in G" staff style, but when I run the script, a staff style
is added, but this one doesn't transpose. It also doesn't show a name...

Any idea how I can make this work?

All the best,

Emile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20201004/917ef535/attachment.htm>


More information about the JWLua mailing list