Files
rose-ash/artdag/l1/templates/scan-oscillating-spin.sexp
giles 1a74d811f7
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m33s
Incorporate art-dag-mono repo into artdag/ subfolder
Merges full history from art-dag/mono.git into the monorepo
under the artdag/ directory. Contains: core (DAG engine),
l1 (Celery rendering server), l2 (ActivityPub registry),
common (shared templates/middleware), client (CLI), test (e2e).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

git-subtree-dir: artdag
git-subtree-mainline: 1a179de547
git-subtree-split: 4c2e716558
2026-02-27 09:07:23 +00:00

29 lines
935 B
Common Lisp

;; Oscillating Spin Scan
;;
;; Accumulates rotation angle on each beat, reversing direction
;; periodically for an oscillating effect.
;;
;; Required context:
;; - music: audio analyzer from (streaming:make-audio-analyzer ...)
;;
;; Provides scan: spin
;; Bind with: (bind spin :angle) ;; cumulative rotation angle
;;
;; Behavior:
;; - Rotates 14.4 degrees per beat (completes 360 in 25 beats)
;; - After 20-30 beats, reverses direction
;; - Creates a swinging/oscillating rotation effect
;;
;; Usage:
;; (include :path "../templates/scan-oscillating-spin.sexp")
;;
;; In frame:
;; (rotate frame :angle (bind spin :angle))
(scan spin (streaming:audio-beat music t)
:init {:angle 0 :dir 1 :left 25}
:step (if (> left 0)
(dict :angle (+ angle (* dir 14.4)) :dir dir :left (- left 1))
(dict :angle angle :dir (* dir -1)
:left (+ 20 (mod (streaming:audio-beat-count music t) 11)))))