# vue-piano-keyboard

> A piano keyboard component for Vue.js 2+

Latest version **1.0.10** (published 2020-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-piano-keyboard
pnpm add vue-piano-keyboard
yarn add vue-piano-keyboard
bun add vue-piano-keyboard
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-11-05 |
| First published | 2020-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | emicu |
| Maintainers | emicu |
| Keywords | vue, piano, keyboard, js, vue.js, music |

## Links

- npm: https://www.npmjs.com/package/vue-piano-keyboard
- Repository: https://github.com/MicuEmerson/vue-piano
- Homepage: https://github.com/MicuEmerson/vue-piano#readme
- Issues: https://github.com/MicuEmerson/vue-piano/issues
- npm.io page: https://npm.io/package/vue-piano-keyboard

## Dependencies (3)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [tone](https://npm.io/package/tone.md) ^14.7.58
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.10 (latest) — 2020-11-05
- 1.0.9 — 2020-11-01
- 1.0.8 — 2020-11-01
- 1.0.7 — 2020-11-01
- 1.0.6 — 2020-11-01
- 1.0.5 — 2020-10-31
- 1.0.4 — 2020-10-31
- 1.0.3 — 2020-10-31
- 1.0.2 — 2020-10-31
- 1.0.1 — 2020-10-18
- 1.0.0 — 2020-10-18

## README

# vue-piano

[![npm version](https://img.shields.io/npm/v/vue-piano-keyboard.svg)](https://www.npmjs.com/package/vue-piano-keyboard)
[![bundle size](https://img.shields.io/bundlephobia/min/vue-piano-keyboard.svg)](https://bundlephobia.com/result?p=vue-piano-keyboard)

An interactive piano keyboard for Vue. Supports click/keyboard events and some configurations. [**Try it out**](https://micuemerson.github.io/vue-piano/).

## Installing

```
npm i vue-piano-keyboard
```

Alternatively, you can download the UMD build from [unpkg](https://unpkg.com/vue-piano-keyboard).


## Usage

Import and use the compoment:

```js
<template>
  <div id="app">
    <PianoKeyboard/>
  </div>
</template>

<script>
import PianoKeyboard  from 'vue-piano-keyboard'

export default {
  name: 'App',
  components: {
    PianoKeyboard
  }
}
</script>
```

## Audio

vue-piano component uses Tone.js library for audio playback of each note, more specifically it uses Tone.Synth (that's why the size of the component it's pretty big).

## Props

| Name | Type | Default Value | Description |
| ---- | -----| ------------- | ----------- |
| `allKeys` | Array | (all the keyboard numbers/signs/letters) `['a', 's', 'd', ..]` |  An array of keyboard keys which corresponds to musical notes, from left to right the values will be assigned to the piano tiles. |
| `whiteNoteColor` | String | "#1eb7eb" | Color for white notes when they are pressed |
| `blackNoteColor` | String | "#f9bb2d" | Color for black notes when they are pressed |
| `showKeys` | Boolean | false | It will show the key corresponding to each note |
| `showNotes` | Boolean | false | It will show the notes corresponding to each tile |
| `startOctave` | Number | 2 | The notes will start from startOctave |
| `endOctave` | Number | 4 | The notes will end at endOctave |
| `sustain` | Boolean | false | It will sustain the note (some more seconds) after you release the key/click |

## Style

The width (100%) and the height (100%) are adjusted base on the first parent width and height


## License

MIT

---
_Source: https://npm.io/package/vue-piano-keyboard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
