[JW Lua] CheckElapsedTime function / Reading the MIDI tempo graph

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Sat Nov 29 17:13:35 CET 2014


I see that you found the answer yourself to this question. The "bug" is 
more that I am still undecided on which "level" I should support 
LoadAll() methods. I don't think I support LoadAll() for any 
measure-attached data at the moment, although I do see benefits of it 
when passively loading data for diagnostic purposes.

At the moment, use LoadAllForItem() for measure-attached data (where the 
data is stored based on the whole vertical measure stack).


Best regards,

Jari Williamsson


On 2014-11-23 21:14, Jan Angermüller wrote:
> Jari,
>
> after experimenting a little bit, I found out that it's probably
> the FCTempoElements:LoadAll() that may be buggy.
>
> While the following code gives tempoelements.Count==0
>
>      local tempoelements=finale.FCTempoElements()
>      tempoelements:LoadAll() --loading all measures
>      print(tempoelements.Count)
>
> this code works fine:
>
>      local tempoelements=finale.FCTempoElements()
>      tempoelements:LoadAllForItem(1)  --loading measure 1 only
>      print(tempoelements.Count)
>
> So if do a loop on all measures I get the same results
> with LoadAllForItem as I would expect with LoadAll.
> Problem solved: reading the MIDI tempo graph is possible,
> but currently only with LoadAllForItem.
>
> Best regards,
> Jan
>
>
> Am 20.11.2014 14:40, schrieb Jan Angermüller:
>> Jari,
>>
>> how can I read the output of the MIDI tempo graph
>> (i.e. what Finale shows me when I select "MIDI Tool / Edit Tempo"
>> in the attached screen shot) ?
>>
>> Is this the FCTempoElement class ? But that one tells me in the
>> example above:
>> FCTempoElements.Count = 0
>> Then I thought it may be the FCMidiExpression class, but that
>> one doesn't hold tempo elements either.
>>
>> Or is this feature not implemented yet ?
>>
>> Reading this tempo graph will probably be the only way to
>> get a good elapsed time approximation.
>> I think it's not possible (or extremely difficult) to get good results by
>> evaluating at the same time:
>> - text expressions
>> - shape expressions
>> - MIDI expressions
>> - HP tempo variations
>> - Elements from the tempo tool
>>
>> BTW, as there is this an "Apply Human Playback" plugin which may be
>> required here before calling my lua script:
>> is this function ("apply human playback") also available through the PDK ?
>> So that I don't have to call it manually before calling the Lua script.
>>
>> Jan
>>
>>
>> Am 12.11.2014 09:07, schrieb Jari Williamsson:
>>> Jan,
>>>
>>> The PDK doesn't provide any such feature. You have to load the
>>> initial tempo in FCPlaybackPrefs, and then browse the expressions and
>>> FCTempoElement(s) separately.
>>>
>>>
>>> Best regards,
>>>
>>> Jari Williamsson
>>>
>>>
>>> On 2014-11-08 17:18, Jan Angermüller wrote:
>>>> Jari,
>>>>
>>>> does the FInale PDK offer a CheckElapsedTime function
>>>> to calculate the playback duration of a certain measure or
>>>> the duration of the piece until measure x ?
>>>>
>>>> Best regards,
>>>> 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
>> Jevenstedter Str. 80
>> 22547 Hamburg
>> Tel. 040 - 28 94 84 82
>> www.angermueller.com
>>
>>
>> _______________________________________________
>> 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
>






More information about the JWLua mailing list