Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bhollis/flash-piano
A web component that adds a playable piano to your website.
https://github.com/bhollis/flash-piano
custom-elements piano piano-keyboard web-audio web-components web-midi
Last synced: about 17 hours ago
JSON representation
A web component that adds a playable piano to your website.
- Host: GitHub
- URL: https://github.com/bhollis/flash-piano
- Owner: bhollis
- License: mit
- Created: 2023-08-07T22:45:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-15T08:22:02.000Z (over 1 year ago)
- Last Synced: 2024-11-08T08:07:08.493Z (about 2 months ago)
- Topics: custom-elements, piano, piano-keyboard, web-audio, web-components, web-midi
- Language: TypeScript
- Homepage:
- Size: 532 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flash Piano
[](https://method-behind-the-music.com/piano/)
[Play the piano!](https://method-behind-the-music.com/piano/)
The "Flash Piano" is the modern successor to a Macromedia Flash-based piano I built in 1999. Now that Flash is gone, I've rebuilt it on top of modern browser technology, making use of Web Components, the Web Audio API, and Web MIDI.
The Flash Piano is a web component, meaning you can use it in any website from any framework - it works just like a normal HTML component:
```html
```
There are no attributes to configure. There are two CSS variables you can use to customize the piano:
```css
flash-piano {
--piano-key-width: 50px;
--piano-keybed-color: blue;
}
```Setting `--piano-key-width` will scale the entire piano up or down.
If you have a MIDI keyboard connected, you can play the piano with it while the piano is focused (click on it first).