[CM] Some Grace questions

Rick Taube taube at uiuc.edu
Sat, 2 Feb 2008 06:15:15 -0600


let me respond in reverse order since its easier:

> Also, if I have a library of scheme files where can I put these so
> that grace loads them at startup?

there is no autoloading in 1.0.0. its easy enough to implement so I  
will add it as a Preference to the next feature release.

> B) So that instead of sprouting a fininte number of "simp"s it would
> continue indefinetly untill told otherwise?

just use #f as the test form in the termination clause, that will  
cause it to never end:

(define (simp )
   (go ((i 0 (+ i 1))
        (k 60 (ran 30 70)))
       (#f  )
     (send "mp:note" #:key k)
     (wait .2)))

(sprout (simp))

once sprouted you will either (1) select Hush in the MidiOut menu or  
(2) call (stop)  to stop it.

also, if you associate an id with a process when you sprout it you  
can stop just that unique process:

	(sprout (simp ) 0 666)
         (sprout (simp ) )
         (sprout (simp ) )
         (stop 666)

will stop just the first instance.

> How (if its possible with Grace), would you change this so that -
> A) If I was to eval "simp" then sprout some copies of "simp", then
> alter "simp" and re-eval.
>     Is it possible to make the process' that are waiting to be
> sprouted use the new definition?

no. this isnt a limitation its just that you cant "side effect"  
functions. you could do something like this by calling 'eval' inside  
the running function. but the safest way to "redefine" a process  is  
to stop the first version and sprout a new one. you could do this by  
associating different ids with the running processes.


at some point we will have a GUI window that lets you enter scheme  
sexprs that you then click on to sprout/stop. you could also  
associate specific input keynums to trigger by incoming messages.  
would be cool!