Skip to content

rsk7/h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

h

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors