gra

granular

Granular Synthesis in React

Showing:

Popularity

Downloads/wk

0

GitHub Stars

11

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

2.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

granular

React granular synthesis engine

example

https://ruebel.github.io/granular/

installation

npm install granular

usage

import Granular from 'granular';

class MyComponent extends React.Component {
  state = {
    buffer: null,
    context: null
  };

  componentWillMount() {
    const context = getContext();
    this.setState({
      context
    });
  }

  render() {
    return (
      <Granular
        // Audio File Buffer
        buffer={this.state.buffer}
        // Audio Context
        context={this.state.context}
        // (Optional) if you want to output to a Gain node
        // rather than to the AudioContext
        output={null}
        // Output gain amount (0 - 1)
        gain={0.6},

        // Grain attack (ms)
        attack={20}
        // Grain sustain (ms)
        sustain={100}
        // Grain release (ms)
        release={20}

        // Grain density (grains / sec)
        density={0.1},
        // Pan spread amount (0 - 1)
        pan={1}
        // Grain playback rate
        playbackRate={1}
        // Grain start position in file(0 - 1)
        position={0.5}
        // Random +/- offset that will be applied to position
        spread={0.2}

        // On (true) - Off (false)
        run={false}
      />
    );
  }
}

export default MyComponent;

license

MIT © Randy Uebel

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100