1.2.0 • Published 7 years ago

r-audio v1.2.0

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
7 years ago

r-audio

A library of React components for building Web Audio graphs.

Objectives

šŸ‘‰ make Web Audio graph code more readable and representative of the graph shape

šŸ‘‰ make it easier to create reusable graphs

šŸ‘‰ make state management easier with React's one-way data bindings and single source of state

šŸ‘‰ represent any arbitrary directed graphs in JSX

šŸ‘‰ support all non-deprecated audio nodes including AudioWorklet

šŸ‘‰ allow interspersed HTML components in audio components

Installation

npm install r-audio

Usage example

Stereo waveshaper + amplitude modulation on a WAV loop

<RAudioContext debug={true} onInit={ctx => this.audioContext = ctx}>
  <RPipeline>
    <RBufferSource buffer={this.state.buffer} loop/>
    <RSplitChannels channelCount={2}>
      <RPipeline>
        <RWaveShaper curve={this.makeDistortionCurve(200)} />
        <RConvolver buffer={this.state.buffer} />
        <RDynamicsCompressor threshold={-50} knee={40}/>
        <RGain gain={.5} />
      </RPipeline>
      <RPipeline>
        <ROscillator frequency={1} type="sine" detune={0} connectToParam="gain" />
        <RGain gain={1} />
      </RPipeline>
    </RSplitChannels>
  </RPipeline>
</RAudioContext>

Useful links

Development setup

npm install
npm run dev

The demo page will be served at localhost:8080. Use a recent version of Chrome or Firefox for the best experience.

Firefox Web Audio developer tool is especially handy (bear in mind Firefox does not support AudioWorklet as of 17 April 2018).

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago