hydra_crossfade
Fade live visuals from current code to new code over a set number of seconds, using spare outputs to blend and switch without a hard cut.
Instructions
Like hydra_block, but fade from what is on screen to the new code over seconds
(0.5–30) instead of cutting — the move for a big change mid-set.
How: the new code is dry-run, then a copy runs into a spare output while the old chain keeps playing; a third output blends old into new and is shown; at the end the visible output switches to the new code and both borrowed outputs are blanked.
Needs: one visible output (not the 4-up grid), and two outputs that no other block
draws into or reads — otherwise it refuses with no_spare_outputs and says which are in
use. The new code should draw into the visible output (.out() / .out(o0) when o0 is
shown). The call returns when the fade has finished; mirrors cut instead of fading.
Example (o0 on screen, o2 and o3 free): hydra_crossfade("base", "voronoi(8, 0.3, 0.2).color(1, 0.4, 0.8).out(o0)", seconds=6)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| name | Yes | ||
| take | No | ||
| seconds | No | ||
| validate | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |