[chuck-users] chuck output to console on stdout

Kassen signal.automatique at gmail.com
Thu Dec 13 07:28:52 EST 2012

On Wed, Dec 12, 2012 at 09:48:15PM -0500, Jordan Orelli wrote:
> will yield the number of samples in the duration.  That's how it's normally printed with <<< T >>> anyway.  Getting the human time like having it say 1.5s would mean you'd have to factor in the current sampling rate, not sure if that's accessible from ChucK code itself.

It is. Dividing by a second will give you the duration in seconds,
regardless of the sample-rate. In fact;

second / sample => float sample_rate;

is valid and the easy way to detect the sample-rate from inside of
ChucK, potentially useful for custom DSP stuff that needs to be tuned.

Hope that helps,

More information about the chuck-users mailing list