[JW Lua] Note displacement

Mr.Pat Mr.Pat at pdreditions.com
Mon May 16 00:18:12 CEST 2016


I'm using the following to get the vertical position of a note on a staff.

 

Region = finenv.Region()

for fcnoteentry in eachentry(region) do

   if fcnoteentry:IsNote() then

      for note in each(fcnoteentry) do

         offset = note.Displacement

         print (offset)

      end

   end

end

 

The documentation says:

 

0 is middle C. Positive values is above middle C, negative is below.

 

All is well in C Major but things go south for any other key. Most often the
displacement is relative to the tonic, but an octave off. Sometimes I can't
even figure out where the number comes from.

 

Any ideas on what I'm seeing or what I'm doing wrong?

Pat

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160515/2d72c9c4/attachment.htm>


More information about the JWLua mailing list