Output current time of running buffer

Jan 29, 2010 at 2:46am

Output current time of running buffer

Hi all,

How can I get the current time of a buffer~ while I am playing through it using groove~? The rightmost outlet gives me a normalized time from 0 to 1… but how can I simply get the time that it is at at any given moment? Seems like this should be easy to do but neither play~ nor groove~ seem to spit this out.

Thanks!!

gene

#48096
Jan 29, 2010 at 2:51am

just multiply the normalized 0-1 by the length of the buffer, voila buffer time.

#173006
Jan 29, 2010 at 3:02am

The problem is I start groove~ at a different start time sometimes and it still goes from 0 to 1. I know I can do some complex logic like (start time in ms) + (normalized 0-1)*(length buffer minus start time) or something but I was hoping there’d be a much simpler way to do so, particularly because this application I’m building might be CPU-intensive with a lot of buffers and I want to keep unnecessary calculation steps to a minimum… Isn’t there an easier way? Or an alternative to groove~?

#173007
Jan 29, 2010 at 3:29am

does it have to be buffer~ based? sfplay~ does exactly what you want…

#173008
Jan 29, 2010 at 7:09am

perfect, thank you.

#173009

You must be logged in to reply to this topic.