Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
tonal-scale
Advanced tools
tonal-scale
is a collection of functions to create and manipulate music scales.
This is part of tonal music theory library.
You can install via npm: npm i --save tonal-scale
Array
Create scales by scale type or intervals and tonic. The returned scale is an
array of notes (or intervals if you specify false
as tonic)
This function is currified
Array
Return the available scale names
Array
Get scale notes from scale name
Array
Create scales by scale type or intervals and tonic. The returned scale is an
array of notes (or intervals if you specify false
as tonic)
This function is currified
Kind: global function
Returns: Array
- the scale notes
Param | Type | Description |
---|---|---|
source | String | the scale type, intervals or notes |
tonic | String | the scale tonic (or false to get intervals) |
Example
var scale = require('tonal.scale')
// get scale notes using type and tonic
scale.create('maj7', 'C2') // => ['C2', 'E2', 'G2', 'B2']
// get scale intervals (tonic false)
scale.create('maj7', false) // => ['1P', '3M', '5P', '7M']
// partially applied
const maj7 = scale.create('maj7')
maj7('C') // => ['C', 'E', 'G', 'B']
// create scale from intervals
scale.create('1 3 5 m7 m9', 'C') // => ['C', 'E', 'G', 'Bb', 'Db']
Array
Return the available scale names
Kind: global function
Returns: Array
- the scale names
Param | Type | Description |
---|---|---|
aliases | boolean | true to include aliases |
Example
scaleNames() // => ['maj7', ...]
Array
Get scale notes from scale name
Kind: global function
Returns: Array
- the scale notes
Param | Type | Description |
---|---|---|
name | String | the scale name |
Example
var scale = require('tonal-scale')
scale.get('C7') // => ['C', 'E', 'G', 'Bb']
scale.get('CMaj7') // => ['C', 'E', 'G', 'B']
FAQs
Music scales creation and manipulation
The npm package tonal-scale receives a total of 844 weekly downloads. As such, tonal-scale popularity was classified as not popular.
We found that tonal-scale 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.