Control utilities for Hydra visual synthesizer
Hydra LFO is a collection of functions that make creating control functions for Hydra parameters easier.
Hydra LFO allows you to write something like this:
L = hydralfo.init()
shape(3)
// frequency = 1/4, scale=0.5 [0 .. 0.5), offset=0.2
.scale(L.sin(1/4, 0.5, 0.2))
.out(o0)
Instead of this:
shape(3)
.scale(({time}) => ((Math.sin(time*1/4*2*Math.PI)/2+0.5)*0.5)+0.2)
.out(o0)
Hydra is an amazing visual synthesizer that runs in your browser. It supports live coding of the visuals and is a nice addition for live coded audio, e.g. with Tidalcycles.
Check out Hydra’s GitHub page for more information on Hydra and links to videos.
Hydra allows controlling parameters with functions instead of hard coded values. This is akin to the Low Frequency Oscillators (LFO) used in modular audio synthesizers.
While writing control functions in plain JavaScript is not difficult, it tends to be pretty verbose and one starts re-implementing functions for every performance.
The idea of Hydra LFO is to provide a common tool set of LFOs and related functions in a way that’s also (somewhat) intelligible for the audience by naming things after what they do. Combining the simple tools is possible in a streamlined manner which also conveys the flow of data through the functions.
In the end, the main goal is to stop worrying about writing infrastructure and boilerplate code and focus on working with Hydra instead of JavaScript.
H = hydralfo
console.log(L.sin().run())
console.log(L.sin().run({time: 3}))
More examples can be found on the examples page
All functions reference on one page
async -
get - noop - set - use - used -
choose - rand - range - rnd - sin -
add - div - floor - mod - mul - rad - sub -