New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tonal-scale

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonal-scale

Music scales creation and manipulation

  • 0.50.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-3%
Maintainers
1
Weekly downloads
 
Created
Source

tonal-scale npm version

tonal

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

API Reference

build(source, tonic)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

names(aliases)Array

Return the available scale names

get(name)Array

Get scale notes from scale name

build(source, tonic) ⇒ 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

ParamTypeDescription
sourceStringthe scale type, intervals or notes
tonicStringthe 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']

names(aliases) ⇒ Array

Return the available scale names

Kind: global function
Returns: Array - the scale names

ParamTypeDescription
aliasesbooleantrue to include aliases

Example

scaleNames() // => ['maj7', ...]

get(name) ⇒ Array

Get scale notes from scale name

Kind: global function
Returns: Array - the scale notes

ParamTypeDescription
nameStringthe scale name

Example

var scale = require('tonal-scale')
scale.get('C7') // => ['C', 'E', 'G', 'Bb']
scale.get('CMaj7') // => ['C', 'E', 'G', 'B']

Keywords

FAQs

Package last updated on 08 May 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc