[Fluxus] Music videos with Fluxus

Dave Griffiths dave at pawfal.org
Mon Jan 11 05:17:26 PST 2010


On Mon, 2010-01-11 at 13:42 +0100, gabor papp wrote:
> > Would this be the right way to go about it?
> i'm not sure if i would chose the text storyboard. fluxus scripts are 
> the same, aren't they?
> 
> something like this would be similar to your storyboard:
> 
> (define (render)
>      (let ([t (time)])
>          (cond [(<= 0 t 1)
>                     (draw-cube)]
> 
>                [(<= 1 t 2)
>                    (colour #(1 0 0))
>                    (draw-cube)]
> 
>                [(<= 2 t 3)
>                    (colour #(0 1 0))
>                    (draw-cube)])))
> 
> (every-frame (render))

I agree with gabor - but you could even make a score like this:

(
  ((0 2) "first-script.scm")
  ((2 6) "second-script.scm")
  ((6 10) "third-script.scm")
  ((10 17) "fourth-script.scm")
)

And then use another script like the one above to change scripts at the
right time - no need for eval-string, (load scriptfilename) should do
the job.

If your top level script changing program uses a task rather than
every-frame, the process won't get overwritten by the other scripts.

> 
> > 
> > If so,
> >  * how do you execute code from within code?
> as far as i know scheme bricks uses (eval-string) to do this.
> 
> >  * I'm assuming that (process) doesn't care how long a frame takes to
> > render, so even if the code-timing service took a while to respond the
> > end result would still be smooth?
> ideally yes. maybe it's my fault, but i always had sync issues with 
> longer audio tracks.

One issue with using process - (time) still returns the real time. I
always override it when doing things like this, eg:

(define t 0)
(define dt 0.04) ; 1/25fps
(define (time) t)
(define (delta) dt)
(define (update-time) (set! t (+ t dt))

If you call (update-time) in your every-frame loop everything will be
timed correctly when you make the frames into a movie at 25fps.

cheers,

dave




More information about the Fluxus mailing list