![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.