settings & state

synth settings #

Functions, variables, and settings that affect overall hydra behavior and rendering.

Global output #

render #

Chooses which output to show. If you don’t specify one, it will show all 4 outputs.

render( texture = all )

hush #

Empties all outputs.

hush()

time #

Tells you the amount of time that has passed since the synth started working. Usually called inside arrow functions.

time

speed #

Makes time run faster or slower inside Hydra.

speed = 1

bpm #

Changes the rate at which Hydra goes through lists.

bpm = 30

Resolution #

setResolution #

Sets the working resolution for the synth.

setResolution( width, height )

// make the canvas small (100 pixel x 100 pixel)
setResolution(100,100)
osc().out(o0)

width #

Gets the current working width.

width

height #

Gets the current working height.

height

Interactivity #

mouse #

Gets the position of the mouse on the webpage.

mouse = { x, y }

See the interactivity area for more information.

Transform definition #

setFunction #

Allows you to declare your own GLSL function for usage within Hydra.

setFunction( options )

See the custom GLSL page for more information.

Frame rendering #

update #

update is a function that runs every time a frame is rendered. A bit like p5’s draw, only that this one isn’t crutial at all. It can also take in an argument, generally called dt, which contains the amount of time that passed between the previous and current frame.

update( dt )