![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 1 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.