[fluxus] editor retraction

dave griffiths dave at pawfal.org
Sun Jun 26 08:34:06 PDT 2005


On Sun, 2005-06-26 at 17:53, nik gaffney wrote:
> hello,.
> 
> with this quick hack, its possible to send scheme functions to fluxus using
> osc.,.
> 
> (define (osc-repl)
>  (eval-string (osc-peek)))
> 
> (start-osc "88008")
> (every-frame "(osc-repl)")
> 
> something like the following would have the expected effect
> % sendOSC -h 127.0.0.1 88008 '(build-sphere 12 12)'

ingenious, I hadn't thought of that :)

> however -> every-frame sounds a bit excessive, so the obvious alternative
> looks like engine-callback, but this always gives me an 'Unbound
> variable:engine-callback' error ,. ..
> 
> seems that another advantage of using an engine-callback would be being able
> to do something apart from listening fr osc commands every-frame. or is
> there another way to register more than 1 function to get called each frame?

well, (every-frame) is the same as the old (engine-callback), I just
renamed it to make it clearer. 

I'm not sure I get exactly what you mean, but maybe a better way of
doing this would be to do something like

(define (osc-repl)
    (if (osc-msg "/code") ; if /code message is recieved
        (eval-string (osc 0))) ; read the first argument as code
    (if (osc-msg "/foo") ; if /foo message is recieved
	(do-something-else))
    (render-stuff)) ; call other functions

(start-osc "88008")
(every-frame "(osc-repl)")

then you could send a message along the lines of
/code "(build-sphere 12 12)"

you could send one message for code that is to be evaluated once, and
another for code to be evaluated each frame etc etc.

cheers,

dave




More information about the Fluxus mailing list