[chuck-users] chuck output to console on stdout

Jordan Orelli jordanorelli at gmail.com
Wed Dec 12 21:48:15 EST 2012


two ways to do it that I know of:

put it on its own line with this:

<<< T >>>  

or just divide by one sample, because that's the base unit of duration:


T / 1::samp


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.

-jordan



On Wednesday, December 12, 2012 at 9:44 PM, Aurélien Bondis wrote:

> Hi,
>  
> I don't know for sure if this applies to your version but in the doc it
> says chout and stdout have been disabled
>  
> http://chuck.cs.princeton.edu/doc/language/overview.html
> "For the time being, stdout and chout have been temporarily disabled for
> the present release. In their place we have provided a debug print"
>  
> Aurélien
>  
> On Thu, 13 Dec 2012, stephane.poirier at oifii.org (mailto:stephane.poirier at oifii.org) wrote:
>  
> > Hi All,
> >  
> > Here below are 3 lines of code in chuck. How could I modify it to output the value of T in the chout?
> >  
> > // this synchronizes to period
> > 0.75::second => dur T;
> > T - (now % T) => now;
> > // output to console on stdout
> > chout <= 1 <= " foo " <= 5.5 <= IO.newline();
> >  
> > Regards,
> >  
> > Stephane
>  
> > _______________________________________________
> > chuck-users mailing list
> > chuck-users at lists.cs.princeton.edu (mailto:chuck-users at lists.cs.princeton.edu)
> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> >  
>  
>  
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu (mailto:chuck-users at lists.cs.princeton.edu)
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20121212/b455c3cb/attachment.html>


More information about the chuck-users mailing list