What is the best way to playback animation exactly N times in blender? - blender

Like in the title. Can be anything, python script or whatever. Also I need to measure time of the playback and/or average framerate. Thanks in advance

Related

Peak detect and hold in Labview

I've inherited a labview "circuit" that integrates G's to output IPS. The problem is, the output text window (double), at full speed, has numbers scrolling so fast, you can't read them. I only need to see the largest number detected. I'm not too well versed in LabView - Can anyone help me through a function that will display the largest number outputted to the text window for a duration of 1/2 second? I'm basically looking for a peak detect-and-hold function... I'd prefer to work with the double precision value that is constantly updated if possible, rather than the array feeding my integrator. I tried looking through the Functions>signal processing menu, saw one peak detector, but not sure that's the right utility.
Thanks!
Easier to use the Array Max & Min PtByPt.vi, this can be found in the signal processing, point by point menu. Below a VI snippit with how it works.
It will update the maximum value every 10 points. Also attached a waveform chart that shows the values.

Oxyplot: IsValidPoint on realtime LineSerie

I've been using oxyplot for a month now and I'm pretty happy with what it delivers. I'm getting data from an oscilloscope and, after a fast processing, I'm plotting it in real time to a graph.
However, if I compare my application CPU usage to the one provided by the oscilloscope manufacturer, I'm loading a lot more the CPU. Maybe they're using some gpu-based plotter, but I think I can reduce my CPU usage with some modifications.
I'm capturing 10.000 samples per second and adding it to a LineSeries. I'm not plotting all that data, I'm decimating it to a constant number of points, let's say 80 points for a 20 secs measure, so I have 4 points/sec while totally zoomed out and a bit more detail if I zoom in to a specific range.
With the aid of ReSharper, I've noticed that the application is calling a lot of times (I've 6 different plots) the IsValidPoint method (something like 400.000.000 times), which is taking a lot of time.
I think the problem is that, when I add new points to the series, it checks for every point if it is a valid point, instead of the added values only.
Also, it spends a lot of time in the MeasureText/DrawText method.
My question is: is there a way to override those methods and to adapt it to my needs? I'm adding 10.000 new values each second, but the first ones remain the same, so there's no need for re-validate them. Also, the text shown doesn't change.
Thank you in advance for any advice you can give me. Have a good day!

How to accurately measure time difference xcode

I need to super accurately measure time difference in xcode. I'm fairly new to Xcode and Objective C but I'm not really sure how to start it.
I need to measure the time difference between when a sound is played through the speaker and when the sound is recorded through the mic.
I'm not sure how to measure time this accurately as it will be a very short amount of time.
Any pointers or help would be much appreciated!
Thanks
The most precise clock is probably mach_absolute_time---returning ticks since the device was last booted. See this Q&A from Apple for an example of how to use it and convert it into a nicer unit.

reduce frame rate

i am using cocos2d, my game is working great but after a while the frame rate is reduce more and more...
i have checked with instruments and there are no leaks or allocations..
i am not allocating anything in my game. and i remove unused frames from cache during game.
the only way it comes back to normal frame rate is if i exit the scene and return back..
i just cant understand who is the cause ! my app is done and i cant publish it like that.
any help ?????
how can i find who is the cause ????
thanks
What exactly are you doing in your game? There are many optimization tips, such as using CCSpriteBatchNode when you have lots of sprites that use the same texture, etc.
If you aren't allocing anything as you say (which I find unlikely), then perhaps you're doing some heavy (and unnecessary) game logic calculations every frame... for instance, having hundreds of sprites and you're doing something like calculate the distance between each of them every frame...
Also, what device are you using?

Objective C - detect sound

How can I detect sound on the iPhone?
I currently have it somewhat working using the method described in this article http://mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/
However, as mentioned in that article, in noisy rooms for example, the method won't work.
So in a way, I'm looking for methods that I can use to separate background noise from actual noise intended?
There probably won't be an existing code on the internet, but if someone can point me to the right direction, it would be very appreciated.
Thank you,
Tee
It's definitely not a great solution, but you could determine a baseline amplitude (ambient sound) and trigger your events when you determine that the amplitude is a certain amount greater for a set amount of time.