# interval-notation

> Parse and build music intervals in shorthand notation

Latest version **1.0.1** (published 2017-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install interval-notation
pnpm add interval-notation
yarn add interval-notation
bun add interval-notation
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-05 |
| First published | 2016-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | danigb |
| Maintainers | danigb |
| Keywords | interval, parse, parser, string, shorthand, notation, music, theory |

## Links

- npm: https://www.npmjs.com/package/interval-notation
- Repository: https://github.com/danigb/interval-notation
- Homepage: https://github.com/danigb/interval-notation#readme
- Issues: https://github.com/danigb/interval-notation/issues
- npm.io page: https://npm.io/package/interval-notation

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-05-05
- 1.0.0 — 2016-11-16
- 0.1.0 — 2016-04-23

## README

# interval-notation [![npm](https://img.shields.io/npm/v/interval-notation.svg)](https://www.npmjs.com/package/interval-notation)

[![Build Status](https://travis-ci.org/danigb/interval-notation.svg?branch=master)](https://travis-ci.org/danigb/interval-notation) [![Code Climate](https://codeclimate.com/github/danigb/interval-notation/badges/gpa.svg)](https://codeclimate.com/github/danigb/interval-notation)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

Parse music intervals in shorthand notation (https://en.wikipedia.org/wiki/Interval_(music)#Shorthand_notation) with javascript. Given a string, obtain an object
with interval properties (including interval size in semitones). It provides function to build string from its properties.

## Install

yarn: `yarn add interval-notation`

npm: `npm i --save interval-notation`

## Usage

ES6 modules:

```js
import { parse, shorthand } from 'interval-notation'
parse('M3') // => { num: 3, q: 'M', dir: 1, simple: 3,
            //      type: 'M', alt: 0, oct: 0, size: 4 }
shorthand(3, 0, 0, 1) // => 'M3'
```

ES5 node import:

```js
var interval = require('interval-notation')
interval.parse('M3') // => { num: 3, q: 'M', dir: 1, simple: 3,
                     //      type: 'M', alt: 0, oct: 0, size: 4 }
interval.shorthand(3, 0, 0, 1) // => 'M3'
```

## Documentation

You can read the [generated API documentation here](https://github.com/danigb/interval-notation/blob/master/API.md)

## Test and development

To run the test clone this repo and:

```
npm i
npm test
```

## License

MIT License

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