Hydra's a.onBeat() callback fires whenever a.vol crosses a configurable threshold
Hydra includes a simple beat detection algorithm. It compares the overall input volume a.vol against a threshold stored at a.beat.threshold; when a.vol crosses it, the function assigned to a.onBeat runs, allowing any discrete action — e.g. switching colour, advancing a counter, or toggling a function. The a.beat object also exposes a.beat.decay, which sets the decay after a beat. The algorithm is volume-based, not tempo-locked: it fires on loud transients regardless of whether they align to a grid, so it works on live audio but can misfire on sustained loud sounds or miss quiet on-grid hits.
Examples
a.beat.threshold = 0.18
a.onBeat = () => hush()
osc(10,0.1,2).out()
Every detected beat clears the output. Adjust threshold so it fires on kick drums but not on continuous pads.
Assessment
Describe two situations where the volume-threshold beat detector would misfire (false positive and false negative) and explain what parameter adjustment would reduce each.