![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
tonal-notation
Advanced tools
tonal-notation
is a collection of functions to create and manipulate strings with music information.
This is part of tonal music theory library.
You can install via npm: npm i --save tonal-notation
Integer
Given a letter, return step
Boolean
Test if a number is a valid step number (a number from 0 to 6)
String
Given a step, return a letter
Boolean
Test if a string are all flats (b
) chars
Boolean
Test if a string are all sharps (#
) chars
Integer
Given an accidentals string return its alteration, the number of semitones (positive for sharps, negative for flats, 0 for none)
String
Given an alteration number, returns the accidentals string
Integer
Given a letter, return step
Returns: Integer
- the step number (from 0 to 6)
Param | Type | Description |
---|---|---|
letter | String | the letter |
Boolean
Test if a number is a valid step number (a number from 0 to 6)
Returns: Boolean
- true if it's a valid step number, false otherwise
Param | Type | Description |
---|---|---|
step | Integer | the step number |
String
Given a step, return a letter
Returns: String
- the note letter or null if not valid step number
Param | Type | Description |
---|---|---|
step | Integer | the step number |
Boolean
Test if a string are all flats (b
) chars
Returns: Boolean
- true if all charaters are b
, false otherwise
Param | Type | Description |
---|---|---|
str | String | the string to test |
Boolean
Test if a string are all sharps (#
) chars
Returns: Boolean
- true if all charaters are #
, false otherwise
Param | Type | Description |
---|---|---|
str | String | the string to test |
Integer
Given an accidentals string return its alteration, the number of semitones (positive for sharps, negative for flats, 0 for none)
Returns: Integer
- the alteration number of null if not a valid accidental strings
Param | Type | Description |
---|---|---|
accidentals | String | the string to parse |
Example
toAlt('###') // => 3
toAlt('bbb') // => -3
String
Given an alteration number, returns the accidentals string
Returns: String
- the accidental string
Param | Type | Description |
---|---|---|
alteration | Integer | the number of semitones (positive and negative values are accepted for sharps and flats) |
Example
toAcc(3) // => '###'
toAcc(-3) // => 'bbb'
FAQs
Music notation utilities
The npm package tonal-notation receives a total of 16 weekly downloads. As such, tonal-notation popularity was classified as not popular.
We found that tonal-notation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.