Skip to content

Commit

Permalink
spectrum doc
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Dec 16, 2024
1 parent 8a33c17 commit eb02997
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/webaudio/spectrum.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ import { analysers, getAnalyzerData } from 'superdough';
* Renders a spectrum analyzer for the incoming audio signal.
* @name spectrum
* @param {object} config optional config with options:
* @param {integer} thickness line thickness in px (default 3)
* @param {integer} speed scroll speed (default 1)
* @param {integer} min min db (default -80)
* @param {integer} max max db (default 0)
* @example
* n("<0 4 <2 3> 1>*3")
* .off(1/8, add(n(5)))
* .off(1/5, add(n(7)))
* .scale("d3:minor:pentatonic")
* .s('sine')
* .dec(.3).room(.5)
* ._spectrum()
*/
let latestColor = {};
Pattern.prototype.spectrum = function (config = {}) {
Expand Down
4 changes: 4 additions & 0 deletions website/src/pages/learn/visual-feedback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ What follows is the API doc of all the options you can pass:

<JsDoc client:idle name="pitchwheel" h={0} />

## Spectrum

<JsDoc client:idle name="spectrum" h={0} />

## markcss

<JsDoc client:idle name="markcss" h={0} />

0 comments on commit eb02997

Please sign in to comment.