[JW Lua] Issues with JW Lua's playback function in FCTextExpressionDef

Jan Angermüller jan at angermueller.com
Thu Feb 10 10:57:46 CET 2022


I have just noticed a severe issue which can mess up the expression 
definitions.
I wrote a "Clone" function to copy&paste properties from one expression 
definition to another and used the seemingly undangerous 
ExecutableShapeID property like this:

DestinationExprDef.ExecutableShapeID=SourceExprDef.ExecutableShapeID

But this will not only copy the ExecutableShapeID, but also reset all 
other playback values in that expression defintion - like key velocity, 
tempo, etc.

So, for example, if your source and destination expressions were dynamic 
expressions with the Key Velocity playback type and the destination used 
"Key Velocity: 75", it will change to "Key Velocity: 0". But the code 
line above will have no effect on the ExecutableShapeID as it is 0 in 
both cases.

Robert, could you update this in the documentation?
Currently it only says:
"Setting the shape to 0 can be used to clear the use of executable shape."
But it seems to me like:
"Setting the shape to 0 clears ANY playback value - even if the 
executable shape was not used at all."

And maybe add one line that assigning 0 to ExecutableShapeID will not 
change the "Value" field, if UseExecutableShape is not activated.

Test code:
local textexprdef=finale.FCTextExpressionDef()
textexprdef:Load(1)
local textexprdef2=finale.FCTextExpressionDef()
textexprdef2:Load(2)
textexprdef2.ExecutableShapeID=textexprdef.ExecutableShapeID
textexprdef2:Save()

A few other things that I noticed that affect expression definitions and 
playback and which might need attention:
1.) Get/SetPlaybackType() is listed as "Lua supported in 0.55", but it's 
not supported yet.
2.) SetPlaybackController is supported, but GetPlaybackController is not
3.) Get/SetPlaybackKeyVelocity() are in Jari's framework, but not in JW 
Lua   (probably not needed if you use SetPlaybackController with the key 
velocity type, but GetPlaybackController() isn't supported yet either)
4.) The documentation for SetPlaybackTempo doesn't mention very clearly 
that it turns a non-tempo playback expression into a tempo playback 
expression.
So it not only changes the tempo/duration value, but it seems to set a 
flag internally that the new playback is a "EXPPLAYTYPE_TEMPO" type. I 
had expected that I would have to call SetPlaybackType() additionally to 
change this behaviour.

Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220210/199ff6dd/attachment.htm>


More information about the JWLua mailing list