Files
test/constructs/beat-alternate.sexp
gilesb 406cc7c0c7 Initial commit: video effects processing system
Add S-expression based video effects pipeline with modular effect
definitions, constructs, and recipe files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 12:34:45 +00:00

22 lines
706 B
Common Lisp

;; beat-alternate construct
;; Alternates between sources on each beat
;;
;; Usage in recipe:
;; (construct beat-alternate :path "constructs/beat-alternate.sexp")
;; (def segments (beat-alternate beats-data (list video-a video-b)))
(define-construct beat-alternate
"Alternate between sources on each beat"
(analysis sources)
;; Body: map over time pairs, return segment descriptors
(let [times (get analysis :times)
pairs (zip-pairs (cons 0 times))
n-sources (len sources)]
(map-indexed
(fn [i pair]
(dict :source (nth sources (mod i n-sources))
:start (first pair)
:end (nth pair 1)
:effects (list)))
pairs)))