rsc3/doc/examples/graph/half-life.rkt

17 lines
374 B
Racket
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang racket
;; status - working as of 20220820
(require rsc3)
;; half-life (jrhb)
(define half-life
(let* ((t-half 3.92)
(n-atoms 1e+5)
(n (u:max 0 (sub n-atoms (pulse-count (local-in 2 ar) 0))))
(activity (dust ar (mul n (fdiv (log 2) t-half)))))
(mrg2 activity (local-out activity))))
(audition (out 0 half-life))
;; (with-sc3 reset)