# openmusic-dcbias

> A DCBias node for introducing a fixed-value signal in your audio graph

Latest version **1.1.0** (published 2015-09-14) · Apache 2 license · 0 weekly downloads

## Install

```sh
npm install openmusic-dcbias
pnpm add openmusic-dcbias
yarn add openmusic-dcbias
bun add openmusic-dcbias
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-09-14 |
| First published | 2014-10-05 |
| Weekly downloads | 0 |
| License | Apache 2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | sole |
| Maintainers | sole |
| Keywords | dc, dc, bias, web, audio, audio |

## Links

- npm: https://www.npmjs.com/package/openmusic-dcbias
- Repository: https://github.com/openmusic/dcbias
- Issues: https://github.com/openmusic/dcbias/issues
- npm.io page: https://npm.io/package/openmusic-dcbias

## 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

- 1.1.0 (latest) — 2015-09-14
- 1.0.0 — 2014-10-05

## README

# openmusic-dcbias

> A node for introducing a fixed-value signal in your audio graph

[![Install with NPM](https://nodei.co/npm/openmusic-dcbias.png?downloads=true&stars=true)](https://nodei.co/npm/openmusic-dcbias/)

You can use it for things such as: 

* shifting the signal upwards/downwards when connected to a gain node (the demo)
* modifying the value of an AudioParam by a fixed-value. E.g. adding -100. by setting the `gain.value` to -100.

## Using it

Create an audio context.

```javascript
var audioContext = new AudioContext();
```

Require the code somehow:

```javascript
var DCBias = require('openmusic-dcbias');
```

or

```javascript
<script src="DCBias.js"></script>
```

Then create instances by passing the context to the function:

```javascript
var bias = DCBias(audioContext);
```

And it's ready to be used!

```
// Raise the frequency by 100
var oscillator = audioContext.createOscillator();
bias.gain.value = 100;
bias.connect(oscillator.frequency);
```

```
// Saturate/clip a "mixer"
var mixer = audioContext.createGain();
oscillator.connect(mixer);
bias.gain.value = 1;
bias.connect(mixer);
// the output of mixer is now half of the usual oscillator output as we've shifted it upwards by 1
```
## Demo

Run `npm install` first to have all the dependencies (i.e. the oscilloscope component) installed.

Then open `index.html`. Code is in `demo.js`.

** YOU NEED SUPPORT FOR WEB COMPONENTS IN YOUR BROWSER BECAUSE WE'RE NOT SHIMMING ANYTHING IN **

Firefox: go to `about:config`, find `dom.webcomponents.enabled` and set it to true.

Chrome: maybe nothing to do?

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