[JW Lua] Slurs Data...
Simon Leclerc
simon at prodsl.ca
Sat Apr 15 22:30:58 CEST 2017
Jan,
So I looked at it and I’m at the same point. Thanks though, for pointing out the weird semantic of the endpoints.
I’ll try to phrase it differently: if I just want to change the height of a non-edited slur and nothing else, right now, I would need to know the other 2 (or 3) parameters of the control points. Since to change the height (ctrlpoint:SetControlPoint1OffsetY() and ctrlpoint:SetControlPoint2OffsetY()) I need to put the slur in "ctrlpoint:SetCustomShaped(true)”, as soon as I do it, all parameters are reset to zero.
In your example, you’re giving new values to all 4 parameters, which I understand.
I’m looking for a way to make an actual “read out” of the default values. The only way that I can see right now is to move manually the slur (and back to its original position) and then, Finale considers that the slur is “custom” and I can get through LUA an actual read out of all 4 parameters of the controlpoints.
Here’s a snippet:
local marks = finale.FCSmartShapeMeasureMarks()
marks:LoadAllForRegion(finenv.Region(), true)
for mark in each(marks) do
local smartshape = mark:CreateSmartShape()
if (smartshape ~= nil) and smartshape:IsSlur() then
local leftseg=smartshape:GetTerminateSegmentLeft()
local rightseg=smartshape:GetTerminateSegmentRight()
ctrlpoint=smartshape:GetCtrlPointAdjust()
-- ctrlpoint:SetCustomShaped(true)-- if used on a non-edited slur, I get a flat line (and zero for all parameters)
print("vertical left =", ctrlpoint:GetControlPoint1OffsetY())
print("vertical right =", ctrlpoint:GetControlPoint2OffsetY())
print("custom =",ctrlpoint:GetCustomShaped())
-- smartshape:Save()
end
end
This will return:
vertical left = 0
vertical right = 0
custom = true
for a non-edited slur,
And this, on a manually edited slur:
vertical left = 60 (actual read out)
vertical right = 60 (actual read out)
custom = true
> On Apr 15, 2017, at 11:17, Simon Leclerc <simon at prodsl.ca> wrote:
>
> Thank you very much, Jan. I’ll check it later today.
>
> And yes, I knew the height was controlled by the ctrlpoints, but since I had trouble accessing them on a non-edited slur, I put everything together. I’ll try with your suggested semantic.
>
>
>> On Apr 15, 2017, at 10:44, Jan Angermüller <jan at angermueller.com <mailto:jan at angermueller.com>> wrote:
>>
>> Changing the "height" is not changed by the endpoints, but by the controlpoints (or do I misunderstand you?).
>> And changing the ctrlpoints of the slurs is possible. The code snippet is in the below mentioned PDF under 17.)
>> SetCustomOffset has a bit weird semantics:
>> if it's the left segment, you must set it to false, if it's the right segment, you must set it to true.
>>
>>
>> Am 15.04.2017 um 16:32 schrieb Simon Leclerc:
>>> Thanks for the input Jan.
>>>
>>> But I noticed in Jari’s “Change”, that for slurs, he manages to change only the height of a non-edited slur.
>>> The slur then becomes “custom”.
>>>
>>> Am I missing the right way to do this?
>>>
>>>
>>>
>>>
>>>> On Apr 15, 2017, at 09:43, Jan Angermüller <jan at angermueller.com <mailto:jan at angermueller.com>> wrote:
>>>>
>>>> This is a known bug of JW Lua going back to 2014 with unfortunately no workaround at the moment.
>>>> The same goes for BreakOffset on hairpins.
>>>> A bit more info can be found on 7.) and 17.) on my Lua bug/wish list:
>>>> https://elbsound.studio/img/JWLuaBugAndWishList.pdf <https://elbsound.studio/img/JWLuaBugAndWishList.pdf>
>>>>
>>>> Jan
>>>>
>>>>
>>>> Am 15.04.2017 um 15:31 schrieb Simon Leclerc:
>>>>> Hi to all,
>>>>>
>>>>> I’m having difficulties gathering the data surrounding un-altered slurs (or default).
>>>>>
>>>>> The “GetCtrlPointAdjust()” returns zero for all parameters if the slur is in a “SetCustomShaped(false)” state, and resets every parameters to zero as soon as you set it to “SetCustomShaped(true)”.
>>>>>
>>>>> If I alter the slur manually (just by moving it up or down and back to its original position) I then have access to the data.
>>>>>
>>>>> The same goes for the “GetEndpointOffsetX()”, but for those, I can obtain them via “CalcLeft/RightEntryMetricPos()”.
>>>>>
>>>>> Is there a workaround to “fool” JW Lua and Finale into thinking the slur has been modified without loosing all the data (inset, vertical point, etc…)?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Simon Leclerc
>>>>> 60, Mirabelle
>>>>> Ste-Agathe-des-Monts, Québec
>>>>> J8C 0W9
>>>>> simon at prodsl.ca <mailto:simon at prodsl.ca>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> JWLua mailing list
>>>>> JWLua at jwmusic.nu <mailto:JWLua at jwmusic.nu>
>>>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu <http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu>
>>>>
>>>> _______________________________________________
>>>> JWLua mailing list
>>>> JWLua at jwmusic.nu <mailto:JWLua at jwmusic.nu>
>>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu <http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu>
>>>
>>>
>>>
>>>
>>>
>>> Simon Leclerc
>>> 60, Mirabelle
>>> Ste-Agathe-des-Monts, Québec
>>> J8C 0W9
>>> simon at prodsl.ca <mailto:simon at prodsl.ca>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> JWLua mailing list
>>> JWLua at jwmusic.nu <mailto:JWLua at jwmusic.nu>
>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu <http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu>
>>
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu <mailto:JWLua at jwmusic.nu>
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
>
>
>
> Simon Leclerc
> 60, Mirabelle
> Ste-Agathe-des-Monts, Québec
> J8C 0W9
> simon at prodsl.ca <mailto:simon at prodsl.ca>
>
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
Simon Leclerc
60, Mirabelle
Ste-Agathe-des-Monts, Québec
J8C 0W9
simon at prodsl.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170415/bd8b4591/attachment.htm>
More information about the JWLua
mailing list