Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/createbits/playnote

Play your favorite instrument in the browser, with complex note intervals and scales
https://github.com/createbits/playnote

audio music-theory webaudio

Last synced: 24 days ago
JSON representation

Play your favorite instrument in the browser, with complex note intervals and scales

Awesome Lists containing this project

README

        

# Playnote

Play your favorite instrument in the browser with support for scales and complex intervals.

```js
import { init, scale, play, note, wait } from 'playnote'

init('/mp3/soundSprite.mp3').then(async () => {
play(note('dSharp', 4))
await wait(2000)
play(scale('d', 'major').base(4).note(1))
await wait(2000)
play(scale('c', 'minor').base(4).notes([1, 3, 5]))
})
```

It uses [howler.js](https://github.com/goldfire/howler.js) to play the notes. If you need a sound sprite check out the [piano sprite](./assets/pianoSprite.mp3) in the assets folder.