0.1.11 • Published 8 years ago

h-audio v0.1.11

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Library for playing notes in the browser using webaudio.

Build Status

##Example http://rsk7.github.io/h/

##Usage

Require:

var h = require("h-audio");

To play notes:

// if octaves are not specified, the default is 4
h.play("C,E,G");
h.play("D2,F#3,A4");
h.play("G1,B,D4");

To stop notes:

h.stop("E");
h.stop("D2,F#3,A4");

To stop all notes:

h.stop();

To get notes that are currently playing:

h.getActiveNotes();
h.getActiveNoteIds();

##Configuration

The configure method takes an object of the following type. Allowing changes to gain, attack, release and wave parameters. Configuration changes effect all notes immediately.

To set the configuration object:

h.configure({
  gain: 0.15,
  attack: 0.1,
  release: 0.1,
  wave: {
    type: "sine",
    data: null
  }
});

To get the current configuration:

var currentConfiguration = h.configuration;
0.1.11

8 years ago

0.1.10

8 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago