;; ASCII art effect - render as text characters (music reactive) ;; Usage: python3 plan.py effects/ascii_art.sexp | python3 execute.py - -d . -o - | mpv --fs - ;; ;; Parameters: ;; color_mode: coloring mode ("color", "green", "white", default: "color") ;; char_size is bound to energy (wobbles with overall loudness) (recipe "ascii_art" :version "1.0" :encoding (:codec "libx264" :crf 20 :preset "medium" :audio-codec "aac" :fps 30) (effect ascii_art :path "sexp_effects/effects/ascii_art.sexp") (analyzer energy :path "../artdag-analyzers/energy/analyzer.py") ;; Default parameter (def color_mode "color") (def video (source :path "monday.webm")) (def audio (source :path "dizzy.mp3")) (def clip (-> video (segment :start 0 :duration 10))) ;; Audio from 60s where it's louder (def audio-clip (-> audio (segment :start 60 :duration 10))) ;; Analyze just the audio clip - times are 0-10s relative to clip (def energy-data (-> audio-clip (analyze energy))) ;; char_size bound to energy - no offset needed since analysis is on clip (def result (-> clip (effect ascii_art :char_size (bind energy-data values :range [2 32]) :color_mode color_mode))) (mux result audio-clip))