# custom-audio-node

> Create your own AudioNodes with AudioParams for using with the Web Audio API.

Latest version **0.3.1** (published 2014-11-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install custom-audio-node
pnpm add custom-audio-node
yarn add custom-audio-node
bun add custom-audio-node
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2014-11-18 |
| First published | 2014-01-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Matt McKegg |
| Maintainers | mmckegg |
| Keywords | web, audio, api, waapi, AudioNode, AudioParam, wrap |

## Links

- npm: https://www.npmjs.com/package/custom-audio-node
- Repository: https://github.com/mmckegg/custom-audio-node
- Issues: https://github.com/mmckegg/custom-audio-node/issues
- npm.io page: https://npm.io/package/custom-audio-node

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2014-11-18
- 0.3.0 — 2014-07-13
- 0.2.0 — 2014-04-19
- 0.1.1 — 2014-02-04
- 0.1.0 — 2014-02-03
- 0.0.1 — 2014-01-31

## README

custom-audio-node
===

Create your own AudioNodes with AudioParams for using with the Web Audio API. 

## Install

```bash
$ npm install custom-audio-node
```

## API

```js
var createAudioNode = require('custom-audio-node')
```

### createAudioNode(input, output, params)

Specify the **input** and **output** nodes to wrap into a single audio node. 

**params**: automatable AudioParams

```js
var extendTransform = require('audio-param-transform')

var audioContext = new AudioContext()
var input = audioContext.createBiquadFilter()
var output = audioContext.createGain()

// add the transform method
extendTransform(input.frequency, audioContext)

var decimalFrequencyParam = input.frequency.transform(valueToFreq)

input.connect(output)

function mapValueToFreq(defaultValue, value){
  var min = Math.log(100)/Math.log(10)
  var max = Math.log(20000)/Math.log(10)
  var range = max-min
  return Math.pow(10, value * range + min)
}

var customNode = createAudioNode(input, output, {
  amount: {
    min: 0, max: 1, defaultValue: 0.5,
    targets: [ decimalFrequencyParam ]
  }
})

customNode.connect(audioContext.destination)
```

## TODO

- param.value should return the curve value at current time not the final value
- params currently cannot be connected to from another audioNode (modulate) e.g. `node.connect(otherNode.frequency)`

---
_Source: https://npm.io/package/custom-audio-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
