[JW Lua] Enharmonic Flip Bit

Jan Angermüller jan at angermueller.com
Thu Feb 23 14:57:06 CET 2023


Thank you! This helps indeed.

Am 23.02.2023 um 14:49 schrieb Robert Patterson:
> That 4 value appears to be the enharmonic flip bit, which is not 
> documented in the PDK. I have sent a message to Makemusic to get 
> clarification on how it works. Once I hear back, I will add it to the 
> PDK Framework and Lua.
>
> The 13 is a custom font id. However, 13 is the font ID for Finale 
> Music, so it's the same as the default font. Furthermore, since the 
> "UseCustomFont" option is false, the custom font id is ignored anyway. 
> The 13s appear to be cruft in the file.
>
> You may encounter this situation with any Special Tools modification 
> that is unlinkable, including FCNoteheadMods. It will appear to have 
> all default values in the score but is modified in one or more parts. 
> There is no way to determine this except to compare in all parts that 
> contain the staff.
>
> You may know that my Mass Copy plugin has a "Relink" option. Relinking 
> is not directly supported in the PDK. The way my plugin works is that 
> it makes a copy of the values it wants to relink to, deletes the item 
> entirely and then re-adds it in the score with the copied values.
>
> If you delete seemingly empty note details in the score, you are 
> removing unlinked values from the parts and relinking them to the score.
>
> I hope this helps.
>
> On Thu, Feb 23, 2023 at 3:06 AM Jan Angermüller <jan at angermueller.com> 
> wrote:
>
>     Robert,
>
>     I have recently had a document that included seemingly "empty"
>     FCNoteheadMods.
>     I.e. all options from the NoteheadMod dialog were set to the
>     default value.
>
>     So I deleted it with nh:DeleteData(), because I thought it was an
>     unnecessary/corrupt FCNoteheadMod.
>     This lead to a problem:
>     When you do the CreateRawDataDump and list the 11th value, it may
>     include a "4", and 13th value may include a "13".
>
>     local nu=nh:CreateRawDataDump()
>     print(nu:GetItemAt(10).Int)
>
>     If this returns 4, then the "Enharmonic" bit is activated.
>     Otherwise it returns 0.
>     If you delete the FCNoteheadMod in this case, the enharmonic flip
>     disappears.
>     nu:GetItemAt(12).Int sometimes returns "13". I didn't find out
>     what this is.
>
>     As Perfect Layout wants to delete corrupt/empty FCNoteheadMods by
>     default, it's difficult to find out when looking at the score only:
>     If the enharmonic flip is only in a linked part and you load the
>     FCNoteheadMod in the score, you won't recognize that there may be
>     a flip in a part.
>     Or in other words: if you analyze the DataDump in the score, it
>     looks like the FCNoteheadMod doesn't make sense, because all
>     values are set to 0 (except the 100 resize value).
>
>     My questions:
>     - Maybe you could add the GetEnharmonic() to FCNoteheadMod?
>     - Maybe you know what the 13 is?
>     - Do you know if there is a simple way to decide when looking at
>     the FCNoteheadMod in the score whether this is a "false/empty"
>     FCNoteheadMod or if this is actually an unlinked FCNoteheadMod?
>     According to my documentation there have been situations (maybe in
>     corrupt documents?) where false/empty FCNoteheadMods should be
>     deleted.
>     Until now I did when all values where set to the default values in
>     the score. And I don't want to switch through all parts at that
>     point, if possible.
>
>     Here is a test script for the attached document:
>     local reg=finale.FCMusicRegion()
>     reg:SetFullDocument()
>     local parts=finale.FCParts()
>     parts:LoadAll()
>     for p in each(parts) do
>         p:SwitchTo()
>         for e in eachentry(reg) do
>             if e.NoteDetailFlag then
>                 local nhmods=e:CreateNoteheadMods()
>                 for nh in each(nhmods) do
>                     local nu=nh:CreateRawDataDump()
>                     if nu then
>     print(p.ID,e.Measure,e.MeasurePos,nu:GetItemAt(10).Int,nu:GetItemAt(12).Int)
>                     end
>                 end
>             end
>         end
>         p:SwitchBack()
>     end
>
>     Running [Unnamed Script] ======>
>     0 1 0 0 0  --> Score: Measure 1, Pos 0, all default values (=0)
>     0 1 2048 0 0
>     0 2 0 0 13  -->  13 is set
>     0 3 2560 4 13  --> 4 and 13 is set
>     9 1 0 4 0   --> 4 is set
>     9 1 2048 4 0   --> 4 is set
>     9 2 0 4 13   --> 4 and 13 is set
>     9 3 2560 0 13   --> 13 is set
>     <======= [Unnamed Script] succeeded (Processing time: 0.000 s).
>
>     Four notes have enharmonic flips and two also have the "13" value.
>     Three notes have the "4" in the linked part, one note has it in
>     the score.
>
>     Jan
>
>
>
>     _______________________________________________
>     JWLua mailing list
>     JWLua at jwmusic.nu
>     http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-- 
Jan Angermüller
Orchideenstieg 13
22297 Hamburg
Tel. 040 - 28 94 84 82
Mobil 0173 - 99 33 904
www.elbsound.studio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20230223/40c213aa/attachment-0001.html>


More information about the JWLua mailing list