[JW Lua] Saving a Time Signature for Display

Bart Visser bartvisser at me.com
Wed Aug 27 21:59:23 CEST 2014


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



More information about the JWLua mailing list