Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adriano-di-giovanni/twelvetet-spn

Scientific pitch notation parser/formatter for Node.js and the browser.
https://github.com/adriano-di-giovanni/twelvetet-spn

Last synced: 1 day ago
JSON representation

Scientific pitch notation parser/formatter for Node.js and the browser.

Awesome Lists containing this project

README

        

# twelvetet-spn

> Scientific pitch notation parser/formatter for Node.js and the browser.

## Installation

Install the latest stable version of `twelvetet-spn` using [npm](https://www.npmjs.com/):

```bash
npm install twelvetet-spn
```

You can also [access the files on unpkg.com](https://unpkg.com/twelvetet-spn/).

You can use `twelvetet-spn` with module bundlers.

The `twelvetet-spn` [npm package](https://www.npmjs.com/package/twelvetet-spn) includes precompiled production and development [UMD](https://github.com/umdjs/umd) builds in the `dist/` folder. They can be used without a bundler.

The UMD builds make `twelvetet-spn` available as `window.TwelveTetSPN` global variable.

`twelvetet-spn` works in [any modern browser](http://caniuse.com/#feat=es5) and Node.js.

## Usage

```javascript
import { format, parse } from 'twelvetet-spn'

parse('A4') // [9, 4]

// NOTE: `format()` always returns an array of five elements
// ordered as follows: `[, , , , ]`.
// An element is `null` when there is no corresponding enharmonic equivalent.
format([9, 4]) // ['Gx4', null, 'A4', null, 'Bbb4']

```

## API

{{#module name="twelvetet-spn"}}
{{>body~}}
{{>member-index~}}
{{>separator~}}
{{>members~}}
{{/module}}

## License

This project is [MIT-licensed](LICENSE)