[CM] Grace help examples

Heinrich Taube taube at uiuc.edu
Mon May 19 09:15:18 PDT 2008


In the meantime here are fixes to the immediate problems you posted:
---------


define variable pi = 3.141592653589793

loop for x from 0 to 1 by 1/8
   print "x=", x, " sin(2pi*x)/2=", sin(2 * pi * x) / 2
end

define process piano-phase (stop, keys, rate)
   run with pat = make-cycle(keys)
     until elapsed() >= stop
     send "mp:midi", key: next(pat), dur: rate
     wait rate
   end

begin
   with trope = {e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5} ,
        nsecs = 20
   sprout list( piano-phase(nsecs, key(trope), .167),
                piano-phase(nsecs, key(trope), .17))
end



>
>
> I've tried on Mac and PC versions of Grace and get the same error:
> >>> Error: unbound variable: pi
>
> I'm also getting the same error on OSX when executing, but am  
> wondering if I'm missing something?
>
> print *midi-player*
>
>
> I'm outputting MIDI ok when I try the menu /Ports/Midi Out/Test Output
>
> Finally, I'm also getting an error when trying to execute:
>
> begin
>   with notes = {e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5} ,
>        stop = 20
>   open "reich.mid"
>   sprout list( piano-phase(stop, notes, .167),
>                piano-phase(stop, notes, .17))
> end
>
> The error is:
> >>> Error: Illegal statement:
>   open "reich.mid"
>   ^
>
> Apologies for the barrage of questions, I can get the more complex  
> examples to execute, and understand the principal of what's  
> happening but some of these simple ones are foxing me.
>
>
> Thanks in advance.
>
> David
> PS All examples copied and pasted from help files.
>
>
> Sent from Yahoo! Mail.
> A Smarter Email._______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist



More information about the Cmdist mailing list