react-guitar-sound
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

React-Guitar-Sound · npm version

A React Hook to play sound with react-guitar.

See https://react-guitar.com for a live demo.

For the full documentation go to the root README.

Edit quizzical-dawn-0hzuq

Usage

npm i react-guitar react-guitar-sound react-guitar-tunings
import React, { useMemo } from 'react'
import { render } from 'react-dom'
import Guitar from 'react-guitar'
import { standard } from 'react-guitar-tunings'
import useSound from 'react-guitar-sound'

function SampleGuitarWithSound() {
  const strings = useMemo(() => [0, 1, 2, 2, 0, -1], [])
  const { play, strum } = useSound({ fretting: strings, tuning: standard })

  return <Guitar strings={strings} onPlay={play} />
}

render(<SampleGuitarWithSound />, document.getElementById('root'))

Developing

  • yarn start will watch and rebuild.
  • yarn build will generate the production scripts under the dist folder.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.218latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.218
1.1.00
1.0.31
1.0.20
1.0.10
1.0.00
0.12.00
0.11.20
0.11.10
0.11.00

Package Sidebar

Install

npm i react-guitar-sound

Weekly Downloads

19

Version

1.1.2

License

MIT

Unpacked Size

245 kB

Total Files

19

Last publish

Collaborators

  • 4lejandrito