New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

chordplayer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chordplayer

WebAudio musical audio chord player

latest
Source
npmnpm
Version
1.1.6
Version published
Maintainers
1
Created
Source

CHORDPLAYER.JS

Installation:

You may import the code into an existing node.js project or import it directly into your HTML code

  • Node module import
# local install to your project
npm install --save-dev chordplayer
// import module into your js code
var cp = require('chordplayer') 
  • plain JS import
<!-- minified version, not human friendly, 56kb-->
<script type="text/javascript" src="chordPlayer.min.js"></script>
<!-- uncompressed version, human friendly, 418kb -->
<script type="text/javascript" src="chordPlayer.js"></script>

The module is instanciated in the object cp, which you can use right away

cp.buildChordPlayer("Cmin7b5").play()

Constructors

There are several ways to instanciate the class:

  • buildChordPlayer(chordName,[audioContext])

Builds a chordPlayer from a specific name. audioContext is created if not provided.

c = cp.buildChordPlayer("Cmin7b5");     //will return a chord with 4 notes ("C", "D#", "F#", "A#")
c = cp.buildChordPlayer("Cdim");        //will return a chord with 3 notes ("C", "D#", "F#")
c = cp.buildChordPlayer("A#maj");       //will return a chord with 3 notes ("A#", "D", "F")
c = cp.buildChordPlayer("Bbmaj");       //will return a chord with 3 notes ("A#", "D", "F")

Methods

  • play([callback])

    Plays the chord

c = cp.buildChordPlayer("Amaj")
c.play(function(){
  console.log("end play")
})
  • getChordInfo()

    Returns the notes present in the chord

cp.buildChordPlayer("Bbmaj").getChordInfo()

Setters:

  • setAudioContext(audioContext)
  • setDestinationNode(node)
  • setDuration(duration)
  • setOctave(octaveNb)
  • setVolume(volume)

Keywords

audio

FAQs

Package last updated on 08 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts