[chuck-users] Begin the beguine

Alberto Alassio alberto.alassio at gmail.com
Mon Sep 24 14:58:14 EDT 2012


Thank you very much! And now my question is: How did you get to know that
that object (or command line, I don't know) - I'm referring to younameit -
has got that use?

Danke Schon

On Mon, Sep 24, 2012 at 7:18 PM, forrest curo <treegestalt at gmail.com> wrote:

>
>
> On Mon, Sep 24, 2012 at 9:47 AM, Alberto Alassio <
> alberto.alassio at gmail.com> wrote:
>
>> http://chuck.cs.princeton.edu/doc/examples/basic/foo.ck
>> That's what I'm talking about.  Here you can find "hi" and "hi.cap" .
>> Thank you for your answer!
>>
>
>
> "// an array
> [ 0, 2, 4, 7, 9, 11 ] @=> int hi[];
>
> while( true )
> {
>     Std.mtof( 45 + Math.random2(0,3) * 12 +
>         hi[Math.random2(0,hi.cap()-1)] ) => s.freq;" ?
>
> Yeah, Math.random2() is one of the built-in functions and "you-name-it.cap"
> would be the number of elements in "you-name-it[]"
>
> so you'd be picking a random element of the array "hi", getting the frequency of that as a midi note,
> putting it into the oscillator ("s") you started a few lines back.
>
>
> _______________________________________________
> chuck-users mailing list
> 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/20120924/681e968d/attachment.html>


More information about the chuck-users mailing list