rsc3/doc/examples/graph/harmonic-swimming.rkt

22 lines
505 B
Racket
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang racket
;; status - working as of 20220820
(require rsc3)
;; harmonic swimming (jmcc)
(define harmonic-swimming
(let* ((a 0.02)
(f 50)
(p 20)
(z 0)
(l (line kr 0 (neg a) 60 0))
(o (lambda (h)
(let* ((r (clone 2 (rand 2 8)))
(n (lf-noise1 kr r))
(e (u:max 0 (mul-add n a l))))
(mul (f-sin-osc ar (* f (+ h 1)) 0) e)))))
(mix-fill p o)))
(audition (out 0 harmonic-swimming))