tonal-abc-notation
Version:
Conversion between notes in ABC and scientific notation
59 lines (44 loc) • 1.7 kB
Markdown
<a name="module_Abc"></a>
[](https://www.npmjs.com/package/tonal-abc-notation)
Convert note strings between ABC and scientific notation
This is part of [tonal](https://www.npmjs.com/package/tonal) music theory library.
**Example**
```js
const Abc = require("tonal-abc-notation")
Abc.toNote("c") // => "C5"
Abc.toAbc("Db2") // => "_D,,"
```
**Example**
```js
import Tonal from "tonal"
import { toAbc } from "tonal-abc-notation"
Tonal.Scale.notes("C major").map(toAbc);
```
* [Abc](
* [`.toNote(abcNote)`](
* [`.toAbc(note)`](
<a name="module_Abc.toNote"></a>
Convert a (string) note in ABC notation into a (string) note in scientific notation
**Kind**: static method of [<code>Abc</code>](#module_Abc)
**Returns**: <code>string</code> - the note in scientific notation of null if not valid
| Param | Type | Description |
| --- | --- | --- |
| abcNote | <code>string</code> | the note in ABC notation |
**Example**
```js
Abc.toNote("c") // => "C5"
```
<a name="module_Abc.toAbc"></a>
Convert a (string) note in scientific notation into a (string) note in ABC notation
**Kind**: static method of [<code>Abc</code>](#module_Abc)
**Returns**: <code>string</code> - the note in ABC notation or null if not valid note
| Param | Type | Description |
| --- | --- | --- |
| note | <code>string</code> | a note in scientific notation |
**Example**
```js
abc.toAbc("C#4") // => "^C"
```