- Change :hash to :cid throughout - Update cat asset: QmXrj6tSSn1vQXxxEY2Tyoudvt4CeeqR9gGQwSt7WFrhMZ - Update dog effect: QmT99H4MC5p18MGuxAeKGeXD71cGCzMNRxFfvt4FuCwpn6 - Update invert effect: QmPWaW5E5WFrmDjT6w8enqvtJhM8c5jvQu7XN1doHA3Z7J Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
129 lines
3.5 KiB
YAML
129 lines
3.5 KiB
YAML
# energy-reactive recipe
|
|
# Analyzes audio energy over time, applies visual effects driven by loudness
|
|
# Demonstrates: ANALYZE → BIND → TRANSFORM
|
|
|
|
name: energy-reactive
|
|
version: "1.0"
|
|
description: "Video effects that pulse with the music's energy"
|
|
|
|
dag:
|
|
nodes:
|
|
# === INPUTS ===
|
|
|
|
- id: music
|
|
type: SOURCE
|
|
config:
|
|
input: true
|
|
name: "Music"
|
|
description: "Audio file to analyze"
|
|
|
|
- id: video
|
|
type: SOURCE
|
|
config:
|
|
input: true
|
|
name: "Video"
|
|
description: "Video to apply reactive effects to"
|
|
|
|
# === ANALYSIS ===
|
|
|
|
# Extract energy envelope from audio
|
|
- id: energy
|
|
type: ANALYZE # NOT IMPLEMENTED
|
|
config:
|
|
feature: energy
|
|
window_ms: 50 # Analysis window size
|
|
normalize: true # 0.0 to 1.0
|
|
# Output: { envelope: [{time: 0.0, value: 0.3}, {time: 0.05, value: 0.7}, ...] }
|
|
inputs:
|
|
- music
|
|
|
|
# Extract frequency bands for more control
|
|
- id: spectrum
|
|
type: ANALYZE # NOT IMPLEMENTED
|
|
config:
|
|
feature: spectrum
|
|
bands:
|
|
bass: [20, 200] # Hz ranges
|
|
mid: [200, 2000]
|
|
high: [2000, 20000]
|
|
# Output: { bass: [...], mid: [...], high: [...] }
|
|
inputs:
|
|
- music
|
|
|
|
# === EFFECT BINDING ===
|
|
|
|
# Bind analysis data to effect parameters
|
|
# This creates a time-varying parameter stream
|
|
- id: effects_bound
|
|
type: BIND # NOT IMPLEMENTED: connects data → parameters
|
|
config:
|
|
mappings:
|
|
# energy 0→1 maps to saturation 1.0→2.0
|
|
- source: energy.envelope
|
|
target: saturation
|
|
range: [1.0, 2.0]
|
|
|
|
# energy maps to brightness pulse
|
|
- source: energy.envelope
|
|
target: brightness
|
|
range: [0.0, 0.3]
|
|
|
|
# bass hits → zoom pulse
|
|
- source: spectrum.bass
|
|
target: scale
|
|
range: [1.0, 1.1]
|
|
attack_ms: 10 # Fast attack
|
|
release_ms: 100 # Slower release
|
|
|
|
# high frequencies → blur reduction (clarity on highs)
|
|
- source: spectrum.high
|
|
target: blur
|
|
range: [3, 0] # Inverse: more highs = less blur
|
|
inputs:
|
|
- energy
|
|
- spectrum
|
|
|
|
# === VIDEO PROCESSING ===
|
|
|
|
# Apply time-varying effects to video
|
|
- id: reactive_video
|
|
type: TRANSFORM_DYNAMIC # NOT IMPLEMENTED: TRANSFORM with time-varying params
|
|
config:
|
|
effects_source: effects_bound
|
|
# Effects applied per-frame based on bound parameters
|
|
inputs:
|
|
- video
|
|
- effects_bound
|
|
|
|
# === COMPOSITION ===
|
|
|
|
- id: final
|
|
type: MUX
|
|
config:
|
|
shortest: true
|
|
inputs:
|
|
- reactive_video
|
|
- music
|
|
|
|
output: final
|
|
|
|
owner: "@giles@artdag.rose-ash.com"
|
|
|
|
# === NOTES ===
|
|
#
|
|
# New primitives needed:
|
|
# ANALYZE(feature: energy) - extract loudness envelope over time
|
|
# ANALYZE(feature: spectrum) - extract frequency band envelopes
|
|
# BIND - map analysis data to effect parameter ranges
|
|
# TRANSFORM_DYNAMIC - apply effects with time-varying parameters
|
|
#
|
|
# This pattern:
|
|
# audio → ANALYZE → data streams → BIND → parameter streams → TRANSFORM_DYNAMIC → video
|
|
#
|
|
# The BIND primitive is key: it's a declarative way to say
|
|
# "when bass is loud, zoom in" without writing code
|
|
#
|
|
# Attack/release in BIND smooths the response:
|
|
# - attack_ms: how fast to respond to increases
|
|
# - release_ms: how fast to return to baseline
|