[JW Lua] FCNoteEntry:PreviousInFrame()

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Mon Sep 11 13:26:57 CEST 2017


Pat,

Can you please check if the 64-bit Windows version of beta v.54 runs on 
your Finale 25?

Regarding your question about eachentry[saved], you should not use the 
"each" iterators to process data that is dependent on data objects 
earlier/later in the each chain. However you could store and "move" the 
duration values in the loop, similar to:

---
local currentdur = nil
local earlier_dur = nil
local even_earlier_dur = nil
for noteentry in eachentrysaved(finenv.Region()) do
    even_earlier_dur = earlier_dur
    earlier_dur = currentdur
    currentdur = noteentry.Duration
end
---

Another alternative would be to load and parse a FCNoteEntryLayer object.


Best regards,

Jari Williamsson


On 2017-09-10 18:33, Mr.Pat wrote:
> Hi Jari etal,
> 
> I'm running a script that used to run under 0.45 but doesn't under the 
> latest beta. I'm running on Finale 2014. (Still can't get JWLua to run 
> on Finale 25).
> 
> Anyway, I want to read the duration of a note two notes back from an 
> existing note, all notes in the same measure.
> 
> local pass = 1
> 
> for noteentry in eachentrysaved(finenv.Region()) do
> 
> print (noteentry.Duration)
> 
>      if pass == 1 then
> 
> print (noteentry.Duration)
> 
>      end
> 
>      if pass == 2 then
> 
>          pastnote = noteentry:PreviousInFrame()
> 
> print (pastnote.Duration)
> 
>      end
> 
>      if pass == 3 then
> 
>          pastnote2 = pastnote:PreviousInFrame()
> 
> print (pastnote2.Duration)
> 
>      end
> 
>      pass = pass + 1
> 
> end
> 
> It fails on pass 3 saying pastnote2 is a nil value. It used to work. Any 
> ideas?
> 
> Pat
> 
> 
> 
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
> 





More information about the JWLua mailing list