[CM] Realtime Grace with Scheme

Rick Taube taube at uiuc.edu
Tue, 27 Nov 2007 19:27:30 -0600


Something to cluck about!  Grace now has real time scheduling with  
Chicken Scheme as its extension language. This new scheme system is  
not Common Music, its smaller, simpler and designed from the bottom  
up for realtime. However a number of CM functions are there (along  
with some new ones) and more will certainly follow. a first cut at  
documentation is here:

http://pinhead.music.uiuc.edu/~hkt/grace/doc/scheme.html

This doc is also available in Grace's Help Menu.

Right now we have the midi port's note method going. midi input is  
actually working too (see the Test Input menu item) but we dont have  
the ability yet to set a scheme hook. sending to plotter and  
sequences are in the works. we will try to implement realtime audio  
using JUCE's new audio plugin framework after that.

To build Grace with Scheme you need JUCE and Chicken (2.731 or  
higher) installed on your system. Then do:

     svn co http://commonmusic.svn.sf.net/svnroot/commonmusic/trunk/ 
grace
     cd grace
     scons JUCEDIR=/path/to/juce-1.45 SCHEME=1
     scons install

I have to say its alot of fun! (playing with it, not building it...)

(define (pinkdorian len)
   ;; map pink noise onto dorian scale
   (go ((dorian (steps 50 20 2 1 2 2 2 1 2))
        (i 0 (+ i 1)))
       ((= i len) )
     (send "mp:note" #:key (discrete (ranpink) -1 1 dorian))
     (wait .2)))

(sprout (pinkdorian 100))

Grace with scheme builds and works on OSX and linux and i dont see  
why it wouldnt work on windows as well. We do plan to start releasing  
Grace binaries at the end of the year.

there is (at least) one outstanding issue: if scheme runs out of  
heap, it crashes the app. right now we initialize the heap to 1Meg  
and stack to 64000. You can set these to higher values if you need to  
by editing your Grace.prefs file (sorry, no dialog box yet!)

for information on building grace with scheme see:

http://pinhead.music.uiuc.edu/~hkt/grace/doc/install.html