[JW Lua] Calculating the highest displacement/pitch/staff position

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Mon Feb 9 17:31:29 CET 2015


Jan,

Displacement and pitch is not the same thing. If you want the highest 
pitch, use FCNoteEntry::CalcHighestNote() to get the note object.

But I agree with replacing ActualDisplacement with something else. 
StaffPosition sounds good to me.


Best regards,

Jari Williamsson


On 2015-02-09 13:16, Jan Angermüller wrote:
> Jari,
>
> if I want to calculate the highest *staff position* of a note entry,
> (i.e. taking into account any clef or mid measure-clef changes)
> this can be done by comparing all entries from
> *FCNote*:CalcActualDisplacement() in a for-loop.
>
> If I want to calculate the highest *pitch *of a note entry (i.e. NOT
> taking into account clef changes),
> it can be solved with FCNote*Entry*:CalcHighestDisplacement().
>
> I wonder if those method names are so self-explaining and if their placement
> is so obvious for the developer (one in FCNote and one in FCNoteEntry).
>
> My suggestion:
> - put both methods in FCNoteEntry, but also keep the
> FCNote:CalcActualDisplacement() for calculating on a single note
> - Rename the CalcHighestDisplacement() in FCNoteEntry to CalcHighestPitch()
> - Rename the CalcActualDisplacement() in FCNoteEntry to
> CalcHighestDisplacement()  (or CalcHighestStaffPosition())
> - Rename the CalcActualDisplacement() in FCNote to CalcDisplacement()
> (or CalcStaffPosition())
>
> All the best,
> Jan
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>






More information about the JWLua mailing list