[chuck-users] converting from dur to float

Rogan Carr rogan.carr at gmail.com
Sat Feb 28 01:34:21 EST 2009


Hi Robert,

I usually do something like this

1::second => dur sampled;
1::ms => dur timing_rate;

sampled / timing_rate => float ratio;

<<< ratio >>>;  // gives a float

I'm not sure if there's a way to do an explicit cast, though.

Rogan

On Fri, Feb 27, 2009 at 11:49 PM, Robert Poor <rdpoor at gmail.com> wrote:
> Is there truly no way to cast from a dur to a float?
>
> I'm writing a sketch of a TapTempo object.  It measures the duration between
> events to estimate a tempo (in my case, expressed in Hz), which of necessity
> means *somewhere* I need to convert from a dur to a float.
>
> But I haven't figured out how to do that.  Suggestions?
>
> - r
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>


More information about the chuck-users mailing list