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

tonal-pitchset

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonal-pitchset - npm Package Compare versions

Comparing version 0.67.0 to 0.68.0

21

build/index.js

@@ -35,4 +35,7 @@ 'use strict';

* the rotations that starts with '0'
* @return {Array<String>} an array with all the modes of the chroma
*
* @example
*/
function rotations (set, normalize) {
function chromaModes (set, normalize) {
normalize = normalize !== false

@@ -81,15 +84,2 @@ var binary = chroma(set).split('')

/**
* Get a pitch set with different tonic
* @param {String|Pitch} tonic - the desired tonic
* @param {Array|String} set - the list of notes or the binary representation
* @param {Array} a list of notes or intervals (depending the root)
* @example
* pitchset.withTonic('c d e f g a b', 'D')
*/
function withTonic (tonic, set) {
if (arguments.length === 1) return function (s) { return withTonic(tonic, s) }
return fromChroma(chroma(set), tonic)
}
var IVLS = '1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M'.split(' ')

@@ -189,6 +179,5 @@ /**

exports.notes = notes;
exports.rotations = rotations;
exports.chromaModes = chromaModes;
exports.isChroma = isChroma;
exports.chroma = chroma;
exports.withTonic = withTonic;
exports.fromChroma = fromChroma;

@@ -195,0 +184,0 @@ exports.equal = equal;

@@ -40,4 +40,8 @@ /**

* the rotations that starts with '0'
* @return {Array<String>} an array with all the modes of the chroma
*
* @example
* pitchset.chromaModes('C E G')
*/
export function rotations (set, normalize) {
export function chromaModes (set, normalize) {
normalize = normalize !== false

@@ -86,15 +90,2 @@ var binary = chroma(set).split('')

/**
* Get a pitch set with different tonic
* @param {String|Pitch} tonic - the desired tonic
* @param {Array|String} set - the list of notes or the binary representation
* @param {Array} a list of notes or intervals (depending the root)
* @example
* pitchset.withTonic('c d e f g a b', 'D')
*/
export function withTonic (tonic, set) {
if (arguments.length === 1) return function (s) { return withTonic(tonic, s) }
return fromChroma(chroma(set), tonic)
}
var IVLS = '1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M'.split(' ')

@@ -101,0 +92,0 @@ /**

{
"name": "tonal-pitchset",
"version": "0.67.0",
"version": "0.68.0",
"description": "Pitch set utilities",

@@ -17,5 +17,6 @@ "keywords": [],

"tonal-pitch": "^0.66.0",
"tonal-note": "^0.66.0",
"tonal-transpose": "^0.66.0",
"tonal-array": "^0.66.0"
"tonal-array": "^0.68.0"
}
}

@@ -29,4 +29,5 @@ var test = require('tape')

// TODO: fixme, the 4th mode should have F# instead of Gb
t.deepEqual(pitchset.rotations('c d e f g a b').map(pitchset.withTonic('C')),
[ [ 'C', 'D', 'E', 'F', 'G', 'A', 'B' ],
t.deepEqual(pitchset.chromaModes('c d e f g a b').map(function (chroma, i) {
return pitchset.fromChroma(chroma, 'C')
}), [ [ 'C', 'D', 'E', 'F', 'G', 'A', 'B' ],
[ 'C', 'D', 'Eb', 'F', 'G', 'A', 'Bb' ],

@@ -81,12 +82,12 @@ [ 'C', 'Db', 'Eb', 'F', 'G', 'Ab', 'Bb' ],

test('pitchset: rotations', function (t) {
t.deepEqual(pitchset.rotations('c d e f g a b'),
test('pitchset: chromaModes', function (t) {
t.deepEqual(pitchset.chromaModes('c d e f g a b'),
[ '101011010101', '101101010110', '110101011010', '101010110101',
'101011010110', '101101011010', '110101101010' ])
t.deepEqual(pitchset.rotations('c d e f g a b', false),
t.deepEqual(pitchset.chromaModes('c d e f g a b', false),
[ '101011010101', '010110101011', '101101010110', '011010101101',
'110101011010', '101010110101', '010101101011', '101011010110',
'010110101101', '101101011010', '011010110101', '110101101010' ])
t.deepEqual(pitchset.rotations('blah bleh'), [])
t.deepEqual(pitchset.chromaModes('blah bleh'), [])
t.end()
})
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