Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/createbits/playnote
- Owner: createbits
- License: agpl-3.0
- Created: 2017-05-03T06:27:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-06T13:14:27.000Z (over 7 years ago)
- Last Synced: 2024-08-04T01:04:39.251Z (4 months ago)
- Topics: audio, music-theory, webaudio
- Language: JavaScript
- Homepage:
- Size: 2.55 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-webaudio - playnote - Play your favorite instrument in the browser, with complex note intervals and scales. (Obsolete / Community)
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.