Hi folks,
I have a decibel meter which is hooked up to a microphone in our arena. Long story short, I've animated this meter to fill according to how loud the crowd is. It works, but the animation is choppy.
I've set an animation controller to 100 frames , starting on 0 and ending on 100 to relate to the percentage of how much the decibel meter is filled.
The decibel software is limited to updating once every 500ms, so is there a way to make the animation always take 15 frames (500ms) to complete when the start and stop point are different?
I've included my code here because my explanation isn't the best. Please let me know if you have any suggestions.
OnSetText:
dim meter1 as xpTextObject
dim meter2 as xpTextObject
dim BarUp as xpAnimController
dim divisor as integer
dim minus as integer
scene.GetObjectByName("DB1", meter1)
scene.GetObjectByName("DB2", meter2)
scene.GetAnimControllerByName("BAR UP", BarUp)
divisor = 40
minus = 60
meter1.text = (self.text - minus) / divisor
if meter1.text > meter2.text then
BarUp.PlayRange(meter2.text * 100, meter1.text * 100)
else if meter1.text < meter2.text then
BarUp.PlayRange(meter2.text * 100, meter1.text * 100)
end if
meter2.text = meter1.text