music-instrument-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Music Instrument JS

Play any musical instrument from the browser

Install

  yarn add music-instrument-js

Usage

import { getInstrument, startNote, stopNote, instrumentNames } from "music-instrument-js";
 
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
 
async function main() {
  await startNote('acoustic_grand_piano', 'A3', {})
  await delay(500)
  stopNote('acoustic_grand_piano', 'A3')
  
  instrumentNames // list of supported instruments
 
  await getInstrument('banjo') // Loads banjo instrument
  startNote('banjo', 'A3', {})
  await delay(500)
  stopNote('banjo', 'A3')
  
}
 

Readme

Keywords

none

Package Sidebar

Install

npm i music-instrument-js

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

21.2 kB

Total Files

6

Last publish

Collaborators

  • rakannimer