Hydra LFO

Control utilities for Hydra visual synthesizer


Project maintained by oscons Hosted on GitHub Pages — Theme by mattgraham

Intro

Hydra LFO is a collection of functions that make creating control functions for Hydra parameters easier.

tl;dr

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)

What is Hydra?

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.

Why would you need Hydra LFO?

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.

Usage

Set up

Hydra

H = hydralfo

Examples

Evaluate an LFO expression

console.log(L.sin().run())
console.log(L.sin().run({time: 3}))

More

More examples can be found on the examples page

List of functions

All functions reference on one page

Asynchronous functions

async -

General Hydra LFO utility functions

get - noop - set - use - used -

Generator functions

choose - rand - range - rnd - sin -

add - div - floor - mod - mul - rad - sub -

Modifier functions

clip - map - sah - slew -

Time functions

fast - slow - speed - time -

Other