[JW Lua] Problem with the new FCSmartShapeEntryConnectStyle: only first image updated and not affecting the slurs
Robert Patterson
robert at robertgpatterson.com
Mon Jun 5 16:30:07 CEST 2023
To be clear, the connection index names and values are not mine. They are
MakeMusic's. (And they are named correctly.) Finale does not store the
connection indices in numerical order. RGP Lua currently does not allow you
to update a value pair with the wrong connection index, but it is
predicated on the requirement that the connection indices have been
correctly populated in the document file. The problem is, apparently, that
Finale does not populate the indices when updating a V2 or earlier file.
On Sun, Jun 4, 2023 at 10:30 AM Jan Angermüller <jan at angermueller.com>
wrote:
> Thank you again, Robert, for your explanation.
> Yes, I can confirm that it seems to work old Finale v3 documents, but not
> in Finale v2 documents.
>
> But are you sure that the placement values are not sorted?
>
> In my code below I didn't use your indices (SSENTCNCTSTYLE_HEAD_LEFT_TOP,
> SSENTCNCTSTYLE_HEAD_RIGHT_TOP, SSENTCNCTSTYLE_HEAD_RIGHT_BOTTOM ...),
> because they seemed to be irritating for me:
> they don't reflect the order of the images in the Smart Shape Placement
> dialog.
>
> For example to get the values from the second image from the Smart Shape
> Placement dialog (slur below head, default values 0/-12) which I would
> refer to as "Head Left Bottom/Head Right Bottom" in your naming convention
> is index 4 / 5.
> But index 4/5 is called "STEM_LEFT_TOP / STEM_RIGHT_TOP" in your enum.
>
> Instead I ran a loop that printed me all default values from Finale 27
> like this:
> local numentr=29
> local i
> for i=1,numentr do
> local prefs=finale.FCSmartShapePrefs()
> prefs:LoadFirst()
> local a
> =prefs:CreateEntryConnectStyle(finale.SSENTCNCTSTYLETYPE_SLURS,i-1)
> if a then
> print(a.HorizontalOffset,a.VerticalOffset)
> end
> end
>
> With this list it was easy to reproduce the order of the indices.
> I just had to compare them with the values from the images.
>
> Jan
>
> Am 03.06.2023 um 14:56 schrieb Robert Patterson:
>
> On further review, it seems the conversion from Finale v2 is not complete.
> The connection indices aren't set/ Currently, the only way to fix the issue
> is manually hit the reset button for each of the slur contours. Adding a
> mechanism to do this in RGP Lua is problematic because the contour values
> do not appear to be sorted in any particular way. Only the app knows how to
> do it.
>
>
> On Sat, Jun 3, 2023 at 7:35 AM Jan Angermüller <jan at angermueller.com>
> wrote:
>
>> Thanks, Robert.
>>
>> Sorry, maybe I was a bit unclear. This was not the problem that I meant.
>> I know that that the slur won't update as it is beat-attached.
>> And yes, the next step would be the TG Tools tool to make it
>> note-attached (However, it has a number of problems with more complex slurs
>> like the ones used in this score).
>>
>> I meant the problem with the "Smart Shape Placement" dialog not being
>> correctly updated.
>> It won't update when I apply the RGP Lua script - except for the very
>> first image (top slur).
>>
>> So any new (note-attached) slur that I create afterwards still uses the
>> old offsets, although the "Smart Shape Placement" dialog shows the correct
>> new values that the RGP Lua script has created.
>>
>> Looks like some internal thing is not updated through RGP Lua - only for
>> the first "Slur Placement" image, but not for the following images.
>> Only after I click on "Reset" in the Smart Shape Placement dialog, the
>> values won't change - as they are already the correct default values.
>> But the image will update and also the (note-attached) slurs in the score.
>>
>> Attached is another file with two additional note-attached slurs.
>> Here is another short video: https://www.youtube.com/watch?v=lqcz6Fe4nh0
>> 1.) after I apply the "Update slur placement script" (code from my first
>> email), the "Under" slur in the last measure still starts directly on the
>> notehead instead of -12 EVPU away from it.
>> However, the "Over" slur in the second bar is correctly updated (the
>> first preview image in the Smart Shape Placement dialog is also correct -
>> it's only all other images that are not correct)
>> 2.) When I enter the Smart Shape Placement dialog, it show the correct
>> -12 EVPU value for the "Under" slur, but the preview image doesn't display
>> -12.
>> 3.) Only after I click on "Reset" in the "Smart Shape Placement" dialog,
>> Finale actually seems to write the existing -12 EVPU value into its memory
>> and update the slur. The -12 EVPU doesn't change by clicking "Reset", but
>> the preview image (and the slurs in the score) are updated.
>>
>> Jan
>>
>>
>> Am 03.06.2023 um 14:03 schrieb Robert Patterson:
>>
>> As near as I can tell, I believe the chief issue you have is that the
>> slur is beat-attached. This is a legacy slur mode, no longer well-supported
>> in the UI, though it has its uses. (For example, I use them as arpeggiation
>> ties and lv ties. I also use them when a measure is partially hidden with
>> alt notation, because note-attached slurs get hidden on the entire measure
>> if the first part of the measure is hidden.)
>>
>> Finale v1, iirc, did not have smart shapes at all.
>> Finale v2 had smart shapes but only beat-attached smart shapes.
>>
>> I'm guessing the file was imported from v2. If so, all slurs will be
>> legacy beat-attached slurs. The best tool I know of to convert
>> beat-attached to note-attached is one of the TGTools plugins. Of course, it
>> should be possible to write a lua script to do it.
>>
>>
>> On Sat, Jun 3, 2023 at 5:20 AM Jan Angermüller <jan at angermueller.com>
>> wrote:
>>
>>> Robert,
>>>
>>> I was just playing a bit the new FCSmartShapeEntryConnectStyle-stuff as
>>> I received an old Finale score where the slur placement wasn't setup yet
>>> (all values set to 0).
>>> I don't know what Finale version this score was created in, probably in
>>> Finale v1 or v2.
>>> The user wrote that he has been using Finale since v1.0.
>>> The file info lists creation date and application as "unknown".
>>> However, the score was imported into Finale 27 and sent to me as a
>>> Finale 27 document.
>>>
>>> When I run the script below in Finale 27, the default slur placement
>>> settings are correctly written into the slur placement dialog.
>>> However, the preview images in the slur placement dialog are not updated
>>> - except for the very first image (slur above downstem notes).
>>> And when I attach a new slur it still uses the old 0,0 values instead of
>>> the values written.
>>>
>>> It seems like only the images of the first dialog are updated (slur
>>> above downstem notes) and only the first four values are actually used from
>>> Finale - although all other values look fine in the Slur Placement dialog.
>>> Could it be that there is something missing in your code that actually
>>> writes the new values (after value 1-4) more deeply into Finale?
>>>
>>> Below is my test code.
>>> For trying to track down the problem I have reloaded the
>>> FCSmartShapePrefs for each value pair and immediately saved it.
>>> But it's the same result when I load it only once and save it after the
>>> loop.
>>>
>>> Attached is the file excerpt and here is a screencam video that shows
>>> the problem:
>>> https://www.youtube.com/watch?v=LPa0LeALXCs
>>> I have tested it both with RGP Lua v0.66 and v0.67. Same result.
>>>
>>> Any ideas?
>>>
>>> local defvalues=
>>> {0,12,0,12,
>>> 12,-24,-12,-24,
>>> 0,-12,0,-12,
>>> 12,24,-12,24,
>>> 12,-24,-12,-24,
>>> 6,4,-12,-48,
>>> 8,0,-6,48,
>>> 0,-3,-24,-3,
>>> 0,3,0,9,
>>> 0,12,0,12,
>>> 0,-12,0,-12,
>>> 24,-24,
>>> 24,-24,
>>> 24,24,
>>> 0,8,0,8,
>>> 0,-8,0,-8}
>>>
>>> local numentr=29
>>> local index=1
>>> local i
>>> for i=1,numentr do
>>> local prefs=finale.FCSmartShapePrefs()
>>> prefs:LoadFirst()
>>> local a
>>> =prefs:CreateEntryConnectStyle(finale.SSENTCNCTSTYLETYPE_SLURS,i-1)
>>> if a then
>>> a:SetHorizontalOffset(defvalues[index])
>>> a:SetVerticalOffset(defvalues[index+1])
>>>
>>> prefs:SaveEntryConnectStyle(a,finale.SSENTCNCTSTYLETYPE_SLURS,i-1 )
>>> prefs:Save()
>>> end
>>> index=index+2
>>> end
>>>
>>> Jan
>>> _______________________________________________
>>> JWLua mailing list
>>> JWLua at jwmusic.nu
>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>>
>>
>> _______________________________________________
>> JWLua mailing listJWLua at jwmusic.nuhttp://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>>
>> --
>> Jan Angermüller
>> Orchideenstieg 13
>> 22297 Hamburg
>> Tel. 040 - 28 94 84 82
>> Mobil 0173 - 99 33 904www.elbsound.studio
>>
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>
> _______________________________________________
> JWLua mailing listJWLua at jwmusic.nuhttp://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> --
> Jan Angermüller
> Orchideenstieg 13
> 22297 Hamburg
> Tel. 040 - 28 94 84 82
> Mobil 0173 - 99 33 904www.elbsound.studio
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20230605/38f11d86/attachment.htm>
More information about the JWLua
mailing list