[JW Lua] Saving a Time Signature for Display

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Thu Aug 28 08:51:23 CEST 2014


Bart,

Yes, there is a bug here somewhere. I was able to work around it by 
assigning the actual time signature to an object, like this:
---
local timesig = theMeasure.TimeSignature
timesig.Beats = inputTimeSig.Beats
timesig.BeatDuration = inputTimeSig.BeatDuration
---

I'll log the bug and take a look at it.


Best regards,

Jari Williamsson


On 2014-08-27 21:59, Bart Visser wrote:
> Hi Jari,
>
> I've written a function to save a TimeSignatureForDisplay in a FCMeasure-object. I'm pretty sure it used to work (I've tested it on multiple occasions) but now (with the latest beta?) it doesn't seem to work anymore. I'm I doing something wrong?
>
> function setDisplayTimeSig(theMeasure, inputTimeSig)
> 	-- inputTimeSig is a Time Signature that's been calculated earlier in the script e.g.:
> 	-- inputTimeSig = {["Beats"] = 4, ["BeatDuration"] = 1024}
> 	
> 	theMeasure.UseTimeSigForDisplay = true
> 	-- First save the 'old' Time Signature for display purposes
> 	theMeasure.TimeSignatureForDisplay.Beats = theMeasure.TimeSignature.Beats
> 	theMeasure.TimeSignatureForDisplay.BeatDuration = theMeasure.TimeSignature.BeatDuration
> 	
> 	-- Than change the actual Time Signature
> 	theMeasure.TimeSignature.Beats = inputTimeSig.Beats
> 	theMeasure.TimeSignature.BeatDuration = inputTimeSig.BeatDuration
> 	
> 	theMeasure:Save()
> end
>
> I'm using it for a smarter version of the Split Measure plugin. Most other steps are working now (although it isn't finished yet), only this step doesn't.
>
> Thanks,
>
>
> Bart Visser
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>






More information about the JWLua mailing list