Next: , Previous: Introduction, Up: Top



2 Quickstart

For a quick introduction to fluxus, try entering the following command once you have started the fluxus scratchpad and see the yellow cursor in the top left of the screen.

     (build-cube)

Now press f5 - the script will be executed, and a white cube should appear in the centre of the screen. Use the mouse and to move around the cube, pressing the buttons to get different movement controls.

To animate this cube, it will have to be called a little differently:

     (start-audio "jack-port-to-read-sound-from" 256 44100) ; buffersize and samplerate need to match jack's
     
     (define (render)
         (colour (vector (gh 1) (gh 2) (gh 3)))
         (draw-cube))
     
     (every-frame (render))

Briefly, the (every-frame) function takes a function which is called once per frame by fluxus's internal engine. In this case it calls a function that sets the current colour using harmonics from the incoming sound with the (gh) - get harmonic - function; and draws a cube. Note that this time we use (draw-cube) not (build-cube). The difference will be explained below.

If everything goes as planned, and the audio is connected with some input - the cube will flash in a colourful manner along with the sound.