https://github.com/pirtleshell/string-tunings
:guitar: API for the tunings of string instruments
https://github.com/pirtleshell/string-tunings
Last synced: over 1 year ago
JSON representation
:guitar: API for the tunings of string instruments
- Host: GitHub
- URL: https://github.com/pirtleshell/string-tunings
- Owner: pirtleshell
- License: mit
- Created: 2016-12-19T00:34:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-19T00:37:53.000Z (over 9 years ago)
- Last Synced: 2025-04-28T14:09:18.198Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# string-tunings
> :guitar: API for the tunings of string instruments
Standard and common tunings for:
* Guitar
* Bass
* Ukulele
* Banjo
* Mandolin
* Cello
* Viola
* Violin
## Install
The tunings are simply a [JSON file](https://github.com/PirtleShell/string-tunings/blob/master/tunings.json) that can be used anywhere.
```sh
$ npm install --save string-tunings
```
## Usage
All instruments have a `standard` key. Many have more. The tunings are `String`s on note letters, generally from low notes to high notes (_ie._ top to bottom string for guitar-like instruments, outermost to innermost for violin-like instruments).
```js
var tunings = require('string-tunings');
tunings.guitar.standard
//=> "EADGBE"
tunings.guitar.open.G
//=> "DGDGBD"
tunings.banjo.sawmill
//=> "GDGBE"
tunings.toArray(tunings.ukulele.soprano)
//=> [ 'A', 'D', 'F#', 'B' ]
```
## Contributing
**Contributions are welcome.** Keep the instruments alphabetically ordered for easy reading. Stay practical.
## API
### toArray
Convert the strings in the JSON to an array of note names.
example:
```js
tunings.toArray(tunings.guitar.drop.Db)
//=> [ 'Db', 'Ab', 'Db', 'Gb', 'Bb', 'Eb' ]
tunings.toArray(tunings.violin.cajun)
//=> [ 'F', 'C', 'G', 'D' ]
```
## License
MIT © 2016 [Robert Pirtle](https://pirtle.xyz/)