Comparing version 0.65.0 to 0.66.0
@@ -5,3 +5,2 @@ 'use strict'; | ||
var tonalPitch = require('tonal-pitch'); | ||
var tonalNotation = require('tonal-notation'); | ||
@@ -58,4 +57,3 @@ var tonalTranspose = require('tonal-transpose'); | ||
if (!k || !hasTonic(k)) return null | ||
var i = tonalPitch.pitch(modeNum(r) - modeNum(k), 0, 1) | ||
var tonic = tonalTranspose.transpose(k[1], i) | ||
var tonic = tonalTranspose.trFifths(k[1], modeNum(r) - modeNum(k)) | ||
return build(tonic, rel) | ||
@@ -166,4 +164,3 @@ } | ||
switch (p.length) { | ||
case 1: return tonalPitch.parseNote(p[0]) ? build(p[0], 'major') | ||
: isKeyMode(p[0]) ? build(false, p[0]) : null | ||
case 1: return tonalNote.pc(p[0]) ? build(p[0], 'major') : build(false, p[0]) | ||
case 2: return build(p[0], p[1]) | ||
@@ -200,3 +197,3 @@ default: return null | ||
var toMajor = modeNum(k) | ||
var toC = tonalPitch.fifths(tonalPitch.parseNote(k[1])) | ||
var toC = tonalNote.pcFifths(k[1]) | ||
return toC - toMajor | ||
@@ -203,0 +200,0 @@ } |
13
index.js
@@ -12,6 +12,5 @@ /** | ||
import { parseNote, pitch, fifths } from 'tonal-pitch' | ||
import { areFlats, areSharps, toAcc } from 'tonal-notation' | ||
import { transpose, trFifths } from 'tonal-transpose' | ||
import { pc } from 'tonal-note' | ||
import { trFifths } from 'tonal-transpose' | ||
import { pc, pcFifths } from 'tonal-note' | ||
import { numeric } from 'tonal-range' | ||
@@ -65,4 +64,3 @@ import { rotate } from 'tonal-array' | ||
if (!k || !hasTonic(k)) return null | ||
var i = pitch(modeNum(r) - modeNum(k), 0, 1) | ||
var tonic = transpose(k[1], i) | ||
var tonic = trFifths(k[1], modeNum(r) - modeNum(k)) | ||
return build(tonic, rel) | ||
@@ -173,4 +171,3 @@ } | ||
switch (p.length) { | ||
case 1: return parseNote(p[0]) ? build(p[0], 'major') | ||
: isKeyMode(p[0]) ? build(false, p[0]) : null | ||
case 1: return pc(p[0]) ? build(p[0], 'major') : build(false, p[0]) | ||
case 2: return build(p[0], p[1]) | ||
@@ -207,3 +204,3 @@ default: return null | ||
var toMajor = modeNum(k) | ||
var toC = fifths(parseNote(k[1])) | ||
var toC = pcFifths(k[1]) | ||
return toC - toMajor | ||
@@ -210,0 +207,0 @@ } |
{ | ||
"name": "tonal-key", | ||
"version": "0.65.0", | ||
"version": "0.66.0", | ||
"description": "Conversion between key numbers and note names", | ||
"repository": "https://github.com/danigb/tonal/packages/key", | ||
"keywords": [ | ||
@@ -21,9 +22,8 @@ "note", | ||
"tonal-notation": "^0.64.0", | ||
"tonal-transpose": "^0.65.0", | ||
"tonal-note": "^0.65.0", | ||
"tonal-array": "^0.65.0", | ||
"tonal-harmonizer": "^0.65.0", | ||
"tonal-range": "^0.65.0", | ||
"tonal-pitch": "^0.65.0" | ||
"tonal-transpose": "^0.66.0", | ||
"tonal-note": "^0.66.0", | ||
"tonal-array": "^0.66.0", | ||
"tonal-harmonizer": "^0.66.0", | ||
"tonal-range": "^0.66.0" | ||
} | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6
24432
495
+ Addedtonal-array@0.66.0(transitive)
+ Addedtonal-distance@0.66.0(transitive)
+ Addedtonal-encoding@0.66.0(transitive)
+ Addedtonal-harmonizer@0.66.0(transitive)
+ Addedtonal-midi@0.66.0(transitive)
+ Addedtonal-note@0.66.0(transitive)
+ Addedtonal-pitch@0.66.0(transitive)
+ Addedtonal-pitchset@0.66.0(transitive)
+ Addedtonal-range@0.66.0(transitive)
+ Addedtonal-transpose@0.66.0(transitive)
- Removedtonal-pitch@^0.65.0
- Removedtonal-array@0.65.0(transitive)
- Removedtonal-distance@0.65.0(transitive)
- Removedtonal-encoding@0.64.0(transitive)
- Removedtonal-harmonizer@0.65.0(transitive)
- Removedtonal-midi@0.62.0(transitive)
- Removedtonal-note@0.65.0(transitive)
- Removedtonal-pitch@0.65.0(transitive)
- Removedtonal-pitchset@0.65.0(transitive)
- Removedtonal-range@0.65.0(transitive)
- Removedtonal-transpose@0.65.0(transitive)
Updatedtonal-array@^0.66.0
Updatedtonal-harmonizer@^0.66.0
Updatedtonal-note@^0.66.0
Updatedtonal-range@^0.66.0
Updatedtonal-transpose@^0.66.0