Output current time of running buffer

genekogan's icon

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

MIB's icon

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

genekogan's icon

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~?

MIB's icon

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

genekogan's icon

perfect, thank you.