Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

harmonics

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harmonics - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

212

gen/chordMaps.json
{
"5th": "1000000100000",
"M7#5sus4": "1000010000000",
"7#5sus4": "1000010000000",
"sus4": "1000010100000",
"M7sus4": "1000010100010",
"7sus4": "1000010100100",
"7no5": "1000100000100",
"aug": "1000100000000",
"M7b6": "1000100010010",
"maj7#5": "1000100000000",
"7#5": "1000100000000",
"7b13": "1000100000100",
"M": "1000100100000",
"maj7": "1000100100010",
"7th": "1000100100100",
"6th": "1000100101000",
"7add6": "1000100100100",
"7b6": "1000100110100",
"Mb5": "1000101000000",
"M7b5": "1000101000010",
"7b5": "1000101000100",
"maj#4": "1000100100010",
"7#11": "1000100100100",
"M6#11": "1000100101000",
"7#11b13": "1000100100100",
"m#5": "1001000000000",
"mb6M7": "1001000010010",
"m7#5": "1001000010100",
"m": "1001000100000",
"m/ma7": "1001000100010",
"m7": "1001000100100",
"m6": "1001000101000",
"mMaj7b6": "1001000110010",
"dim": "1001001000000",
"oM7": "1001001000010",
"m7b5": "1001001000100",
"dim7": "1001001000000",
"o7M7": "1001001001010",
"4th": "1000010000100",
"madd4": "1001010100000",
"m7add11": "1001000100100",
"+add#9": "1000100000000",
"7#5#9": "1000100000000",
"7#9": "1000100100100",
"13#9": "1000100100100",
"7#9b13": "1000100100100",
"maj7#9#11": "1000100100010",
"7#9#11": "1000100100100",
"13#9#11": "1000100100100",
"7#9#11b13": "1000100100100",
"sus2": "1010000100000",
"M9#5sus4": "1000010000000",
"sus24": "1010010100000",
"M9sus4": "1000010100010",
"11th": "1000000100100",
"9sus4": "1000010100100",
"13sus4": "1000010100100",
"9no5": "1000100000100",
"13no5": "1000100000100",
"M#5add9": "1000100000000",
"maj9#5": "1000100000000",
"9#5": "1000100000000",
"9b13": "1000100000100",
"Madd9": "1000100100000",
"maj9": "1000100100010",
"9th": "1000100100100",
"6/9": "1000100101000",
"maj13": "1000100100010",
"M7add13": "1000100101010",
"13th": "1000100100100",
"M9b5": "1000101000010",
"9b5": "1000101000100",
"13b5": "1000101001100",
"9#5#11": "1000100000000",
"maj9#11": "1000100100010",
"9#11": "1000100100100",
"69#11": "1000100101000",
"M13#11": "1000100100010",
"13#11": "1000100100100",
"9#11b13": "1000100100100",
"m9#5": "1001000010100",
"madd9": "1001000100000",
"mM9": "1001000100010",
"m9": "1001000100100",
"m69": "1001000101000",
"m13": "1001000100100",
"mMaj9b6": "1001000110010",
"m9b5": "1011001000100",
"m11A": "1001000000000",
"m11": "1001000100100",
"b9sus": "1000010100100",
"11b9": "1000000100100",
"7sus4b9b13": "1000010100100",
"alt7": "1000100000100",
"7#5b9": "1000100000000",
"Maddb9": "1000100100000",
"M7b9": "1000100100010",
"7b9": "1000100100100",
"13b9": "1000100100100",
"7b9b13": "1000100100100",
"7#5b9#11": "1000100000000",
"7b9#11": "1000100100100",
"13b9#11": "1000100100100",
"7b9b13#11": "1000100100100",
"mb6b9": "1001000010000",
"7b9#9": "1000100100100"
"5th": "100000010000",
"M7#5sus4": "100001001001",
"7#5sus4": "100001001010",
"sus4": "100001010000",
"M7sus4": "100001010001",
"7sus4": "100001010010",
"7no5": "100010000010",
"aug": "100010001000",
"M7b6": "100010001001",
"maj7#5": "100010001001",
"7#5": "100010001010",
"7b13": "100010001010",
"M": "100010010000",
"maj7": "100010010001",
"7th": "100010010010",
"6th": "100010010100",
"7add6": "100010010110",
"7b6": "100010011010",
"Mb5": "100010100000",
"M7b5": "100010100001",
"7b5": "100010100010",
"maj#4": "100010110001",
"7#11": "100010110010",
"M6#11": "100010110100",
"7#11b13": "100010111010",
"m#5": "100100001000",
"mb6M7": "100100001001",
"m7#5": "100100001010",
"m": "100100010000",
"m/ma7": "100100010001",
"m7": "100100010010",
"m6": "100100010100",
"mMaj7b6": "100100011001",
"dim": "100100100000",
"oM7": "100100100001",
"m7b5": "100100100010",
"dim7": "100100100100",
"o7M7": "100100100101",
"4th": "100101000010",
"madd4": "100101010000",
"m7add11": "100101010010",
"+add#9": "100110001000",
"7#5#9": "100110001010",
"7#9": "100110010010",
"13#9": "100110010110",
"7#9b13": "100110011010",
"maj7#9#11": "100110110001",
"7#9#11": "100110110010",
"13#9#11": "100110110110",
"7#9#11b13": "100110111010",
"sus2": "101000010000",
"M9#5sus4": "101001001001",
"sus24": "101001010000",
"M9sus4": "101001010001",
"11th": "101001010010",
"9sus4": "101001010010",
"13sus4": "101001010110",
"9no5": "101010000010",
"13no5": "101010000110",
"M#5add9": "101010001000",
"maj9#5": "101010001001",
"9#5": "101010001010",
"9b13": "101010001010",
"Madd9": "101010010000",
"maj9": "101010010001",
"9th": "101010010010",
"6/9": "101010010100",
"maj13": "101010010101",
"M7add13": "101010010101",
"13th": "101010010110",
"M9b5": "101010100001",
"9b5": "101010100010",
"13b5": "101010100110",
"9#5#11": "101010101010",
"maj9#11": "101010110001",
"9#11": "101010110010",
"69#11": "101010110100",
"M13#11": "101010110101",
"13#11": "101010110110",
"9#11b13": "101010111010",
"m9#5": "101100001010",
"madd9": "101100010000",
"mM9": "101100010001",
"m9": "101100010010",
"m69": "101100010100",
"m13": "101100010110",
"mMaj9b6": "101100011001",
"m9b5": "101100100010",
"m11A": "101101001010",
"m11": "101101010010",
"b9sus": "110001010010",
"11b9": "110001010010",
"7sus4b9b13": "110001011010",
"alt7": "110010000010",
"7#5b9": "110010001010",
"Maddb9": "110010010000",
"M7b9": "110010010001",
"7b9": "110010010010",
"13b9": "110010010110",
"7b9b13": "110010011010",
"7#5b9#11": "110010101010",
"7b9#11": "110010110010",
"13b9#11": "110010110110",
"7b9b13#11": "110010111010",
"mb6b9": "110100001000",
"7b9#9": "110110010010"
}
/**
* Tooling to generate simplified scale and chord map JSON files from tonal
* Tooling to generate simplified scale and chord map JSON files from tonal's chroma prop
* These are to be consumed by the exported Node module

@@ -17,26 +17,9 @@ */

const getBitmap = ({ scale, chord }) => {
const chromatic = Scale.get('C4 chromatic').notes.concat(
Scale.get('C5 chromatic')
);
let mode;
let tonalObject;
if (scale) mode = Scale.get(`C4 ${scale}`).notes;
else if (chord) mode = Chord.getChord(chord, 'C4').notes;
if (scale) tonalObject = Scale.get(`C4 ${scale}`);
else if (chord) tonalObject = Chord.getChord(chord, 'C4');
else throw 'No scale or chord provided';
let i = 0,
j = 0;
let bitmap = '';
while (i < chromatic.length) {
if (chromatic[i] === mode[j]) {
bitmap += '1';
j++;
} else {
bitmap += '0';
}
i++;
}
return bitmap;
return tonalObject.chroma;
};

@@ -43,0 +26,0 @@

{
"major pentatonic": "1010100101000",
"ionian pentatonic": "1000110100010",
"mixolydian pentatonic": "1000110100100",
"ritusen": "1010010101000",
"egyptian": "1010010100100",
"neopolitan major pentatonic": "1000111000100",
"vietnamese 1": "1001010110000",
"pelog": "1101000110000",
"kumoijoshi": "1100010110000",
"hirajoshi": "1011000110000",
"iwato": "1100011000100",
"in-sen": "1100010100100",
"lydian pentatonic": "1000100000000",
"malkos raga": "1001010010100",
"locrian pentatonic": "1001011000100",
"minor pentatonic": "1001010100100",
"minor six pentatonic": "1001010101000",
"flat three pentatonic": "1011000101000",
"flat six pentatonic": "1010100110000",
"scriabin": "1100100101000",
"whole tone pentatonic": "1000101010100",
"lydian #5P pentatonic": "1000100000000",
"lydian dominant pentatonic": "1000100000000",
"minor #7M pentatonic": "1001010100010",
"super locrian pentatonic": "1001000000000",
"minor hexatonic": "1011010100010",
"augmented": "1000000000000",
"major blues": "1011100101000",
"piongio": "1010010101100",
"prometheus neopolitan": "1100100000000",
"prometheus": "1010100000000",
"mystery #1": "1100101010100",
"six tone symmetric": "1100110000000",
"whole tone": "1010100000000",
"messiaen's mode #5": "1100010000000",
"minor blues": "1001011100100",
"locrian major": "1010111010100",
"double harmonic lydian": "1100100000000",
"harmonic minor": "1011010110010",
"altered": "1101000000000",
"locrian #2": "1011011010100",
"mixolydian b6": "1010110110100",
"lydian dominant": "1010100000000",
"lydian": "1010100000000",
"lydian augmented": "1010100000000",
"dorian b2": "1101010101100",
"melodic minor": "1011010101010",
"locrian": "1101011010100",
"ultralocrian": "1101000000000",
"locrian 6": "1101011001100",
"augmented heptatonic": "1000000000000",
"romanian minor": "1011001101100",
"dorian #4": "1011000000000",
"lydian diminished": "1011000000000",
"phrygian": "1101010110100",
"leading whole tone": "1010100000000",
"lydian minor": "1010100000000",
"phrygian dominant": "1100110110100",
"balinese": "1101010110010",
"neopolitan major": "1101010101010",
"aeolian": "1011010110100",
"harmonic major": "1010110110010",
"double harmonic major": "1100110110010",
"dorian": "1011010101100",
"hungarian minor": "1011000000000",
"hungarian major": "1000000000000",
"oriental": "1100111001100",
"flamenco": "1101100000000",
"todi raga": "1101000000000",
"mixolydian": "1010110101100",
"persian": "1100111010010",
"major": "1010110101010",
"enigmatic": "1100101010110",
"major augmented": "1010110000000",
"lydian #9": "1000000000000",
"messiaen's mode #4": "1110010000000",
"purvi raga": "1100110000000",
"spanish heptatonic": "1101110110100",
"bebop": "1010110101110",
"bebop minor": "1011110101100",
"bebop major": "1010110100000",
"bebop locrian": "1101011110100",
"minor bebop": "1011010110110",
"diminished": "1011011011010",
"ichikosucho": "1010111101010",
"minor six diminished": "1011010111010",
"half-whole diminished": "1101100000000",
"kafi raga": "1001110101110",
"messiaen's mode #6": "1010110000000",
"composite blues": "1011111101100",
"messiaen's mode #3": "1011100000000",
"messiaen's mode #7": "1111010000000",
"chromatic": "1111111111110",
"ionian": "1010110101010",
"minor": "1011010110100"
"major pentatonic": "101010010100",
"ionian pentatonic": "100011010001",
"mixolydian pentatonic": "100011010010",
"ritusen": "101001010100",
"egyptian": "101001010010",
"neopolitan major pentatonic": "100011100010",
"vietnamese 1": "100101011000",
"pelog": "110100011000",
"kumoijoshi": "110001011000",
"hirajoshi": "101100011000",
"iwato": "110001100010",
"in-sen": "110001010010",
"lydian pentatonic": "100010110001",
"malkos raga": "100101001010",
"locrian pentatonic": "100101100010",
"minor pentatonic": "100101010010",
"minor six pentatonic": "100101010100",
"flat three pentatonic": "101100010100",
"flat six pentatonic": "101010011000",
"scriabin": "110010010100",
"whole tone pentatonic": "100010101010",
"lydian #5P pentatonic": "100010101001",
"lydian dominant pentatonic": "100010110010",
"minor #7M pentatonic": "100101010001",
"super locrian pentatonic": "100110100010",
"minor hexatonic": "101101010001",
"augmented": "100110011001",
"major blues": "101110010100",
"piongio": "101001010110",
"prometheus neopolitan": "110010100110",
"prometheus": "101010100110",
"mystery #1": "110010101010",
"six tone symmetric": "110011001100",
"whole tone": "101010101010",
"messiaen's mode #5": "110001110001",
"minor blues": "100101110010",
"locrian major": "101011101010",
"double harmonic lydian": "110010111001",
"harmonic minor": "101101011001",
"altered": "110110101010",
"locrian #2": "101101101010",
"mixolydian b6": "101011011010",
"lydian dominant": "101010110110",
"lydian": "101010110101",
"lydian augmented": "101010101101",
"dorian b2": "110101010110",
"melodic minor": "101101010101",
"locrian": "110101101010",
"ultralocrian": "110110101100",
"locrian 6": "110101100110",
"augmented heptatonic": "100111011001",
"romanian minor": "101100110110",
"dorian #4": "101100110110",
"lydian diminished": "101100110101",
"phrygian": "110101011010",
"leading whole tone": "101010101011",
"lydian minor": "101010111010",
"phrygian dominant": "110011011010",
"balinese": "110101011001",
"neopolitan major": "110101010101",
"aeolian": "101101011010",
"harmonic major": "101011011001",
"double harmonic major": "110011011001",
"dorian": "101101010110",
"hungarian minor": "101100111001",
"hungarian major": "100110110110",
"oriental": "110011100110",
"flamenco": "110110110010",
"todi raga": "110100111001",
"mixolydian": "101011010110",
"persian": "110011101001",
"major": "101011010101",
"enigmatic": "110010101011",
"major augmented": "101011001101",
"lydian #9": "100110110101",
"messiaen's mode #4": "111001111001",
"purvi raga": "110011111001",
"spanish heptatonic": "110111011010",
"bebop": "101011010111",
"bebop minor": "101111010110",
"bebop major": "101011011101",
"bebop locrian": "110101111010",
"minor bebop": "101101011011",
"diminished": "101101101101",
"ichikosucho": "101011110101",
"minor six diminished": "101101011101",
"half-whole diminished": "110110110110",
"kafi raga": "100111010111",
"messiaen's mode #6": "101011101011",
"composite blues": "101111110110",
"messiaen's mode #3": "101110111011",
"messiaen's mode #7": "111101111101",
"chromatic": "111111111111",
"ionian": "101011010101",
"minor": "101101011010"
}

@@ -1,1 +0,1 @@

(()=>{"use strict";var n={413:n=>{n.exports=JSON.parse('{"5th":"1000000100000","M7#5sus4":"1000010000000","7#5sus4":"1000010000000","sus4":"1000010100000","M7sus4":"1000010100010","7sus4":"1000010100100","7no5":"1000100000100","aug":"1000100000000","M7b6":"1000100010010","maj7#5":"1000100000000","7#5":"1000100000000","7b13":"1000100000100","M":"1000100100000","maj7":"1000100100010","7th":"1000100100100","6th":"1000100101000","7add6":"1000100100100","7b6":"1000100110100","Mb5":"1000101000000","M7b5":"1000101000010","7b5":"1000101000100","maj#4":"1000100100010","7#11":"1000100100100","M6#11":"1000100101000","7#11b13":"1000100100100","m#5":"1001000000000","mb6M7":"1001000010010","m7#5":"1001000010100","m":"1001000100000","m/ma7":"1001000100010","m7":"1001000100100","m6":"1001000101000","mMaj7b6":"1001000110010","dim":"1001001000000","oM7":"1001001000010","m7b5":"1001001000100","dim7":"1001001000000","o7M7":"1001001001010","4th":"1000010000100","madd4":"1001010100000","m7add11":"1001000100100","+add#9":"1000100000000","7#5#9":"1000100000000","7#9":"1000100100100","13#9":"1000100100100","7#9b13":"1000100100100","maj7#9#11":"1000100100010","7#9#11":"1000100100100","13#9#11":"1000100100100","7#9#11b13":"1000100100100","sus2":"1010000100000","M9#5sus4":"1000010000000","sus24":"1010010100000","M9sus4":"1000010100010","11th":"1000000100100","9sus4":"1000010100100","13sus4":"1000010100100","9no5":"1000100000100","13no5":"1000100000100","M#5add9":"1000100000000","maj9#5":"1000100000000","9#5":"1000100000000","9b13":"1000100000100","Madd9":"1000100100000","maj9":"1000100100010","9th":"1000100100100","6/9":"1000100101000","maj13":"1000100100010","M7add13":"1000100101010","13th":"1000100100100","M9b5":"1000101000010","9b5":"1000101000100","13b5":"1000101001100","9#5#11":"1000100000000","maj9#11":"1000100100010","9#11":"1000100100100","69#11":"1000100101000","M13#11":"1000100100010","13#11":"1000100100100","9#11b13":"1000100100100","m9#5":"1001000010100","madd9":"1001000100000","mM9":"1001000100010","m9":"1001000100100","m69":"1001000101000","m13":"1001000100100","mMaj9b6":"1001000110010","m9b5":"1011001000100","m11A":"1001000000000","m11":"1001000100100","b9sus":"1000010100100","11b9":"1000000100100","7sus4b9b13":"1000010100100","alt7":"1000100000100","7#5b9":"1000100000000","Maddb9":"1000100100000","M7b9":"1000100100010","7b9":"1000100100100","13b9":"1000100100100","7b9b13":"1000100100100","7#5b9#11":"1000100000000","7b9#11":"1000100100100","13b9#11":"1000100100100","7b9b13#11":"1000100100100","mb6b9":"1001000010000","7b9#9":"1000100100100"}')},722:n=>{n.exports=JSON.parse('{"major pentatonic":"1010100101000","ionian pentatonic":"1000110100010","mixolydian pentatonic":"1000110100100","ritusen":"1010010101000","egyptian":"1010010100100","neopolitan major pentatonic":"1000111000100","vietnamese 1":"1001010110000","pelog":"1101000110000","kumoijoshi":"1100010110000","hirajoshi":"1011000110000","iwato":"1100011000100","in-sen":"1100010100100","lydian pentatonic":"1000100000000","malkos raga":"1001010010100","locrian pentatonic":"1001011000100","minor pentatonic":"1001010100100","minor six pentatonic":"1001010101000","flat three pentatonic":"1011000101000","flat six pentatonic":"1010100110000","scriabin":"1100100101000","whole tone pentatonic":"1000101010100","lydian #5P pentatonic":"1000100000000","lydian dominant pentatonic":"1000100000000","minor #7M pentatonic":"1001010100010","super locrian pentatonic":"1001000000000","minor hexatonic":"1011010100010","augmented":"1000000000000","major blues":"1011100101000","piongio":"1010010101100","prometheus neopolitan":"1100100000000","prometheus":"1010100000000","mystery #1":"1100101010100","six tone symmetric":"1100110000000","whole tone":"1010100000000","messiaen\'s mode #5":"1100010000000","minor blues":"1001011100100","locrian major":"1010111010100","double harmonic lydian":"1100100000000","harmonic minor":"1011010110010","altered":"1101000000000","locrian #2":"1011011010100","mixolydian b6":"1010110110100","lydian dominant":"1010100000000","lydian":"1010100000000","lydian augmented":"1010100000000","dorian b2":"1101010101100","melodic minor":"1011010101010","locrian":"1101011010100","ultralocrian":"1101000000000","locrian 6":"1101011001100","augmented heptatonic":"1000000000000","romanian minor":"1011001101100","dorian #4":"1011000000000","lydian diminished":"1011000000000","phrygian":"1101010110100","leading whole tone":"1010100000000","lydian minor":"1010100000000","phrygian dominant":"1100110110100","balinese":"1101010110010","neopolitan major":"1101010101010","aeolian":"1011010110100","harmonic major":"1010110110010","double harmonic major":"1100110110010","dorian":"1011010101100","hungarian minor":"1011000000000","hungarian major":"1000000000000","oriental":"1100111001100","flamenco":"1101100000000","todi raga":"1101000000000","mixolydian":"1010110101100","persian":"1100111010010","major":"1010110101010","enigmatic":"1100101010110","major augmented":"1010110000000","lydian #9":"1000000000000","messiaen\'s mode #4":"1110010000000","purvi raga":"1100110000000","spanish heptatonic":"1101110110100","bebop":"1010110101110","bebop minor":"1011110101100","bebop major":"1010110100000","bebop locrian":"1101011110100","minor bebop":"1011010110110","diminished":"1011011011010","ichikosucho":"1010111101010","minor six diminished":"1011010111010","half-whole diminished":"1101100000000","kafi raga":"1001110101110","messiaen\'s mode #6":"1010110000000","composite blues":"1011111101100","messiaen\'s mode #3":"1011100000000","messiaen\'s mode #7":"1111010000000","chromatic":"1111111111110","ionian":"1010110101010","minor":"1011010110100"}')}},e={};function o(a){var i=e[a];if(void 0!==i)return i.exports;var t=e[a]={exports:{}};return n[a](t,t.exports,o),t.exports}o.d=(n,e)=>{for(var a in e)o.o(e,a)&&!o.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},o.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),o.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var a={};(()=>{o.r(a),o.d(a,{chord:()=>m,chords:()=>r,inlineChord:()=>t,scale:()=>c,scales:()=>s});var n=o(722),e=o(413),i=function(o){var a=o.scale,i=o.chord,t=a||i,r=a?"scale":"chord";if("string"!=typeof t)throw"".concat(t," is not a valid input for ").concat(r);var s=t.indexOf(" "),m=t.slice(s+1),c=t.slice(0,s),d=c.replace(/\d/g,""),l=+c.replace(/\D/g,"");if(isNaN(l))throw"".concat(c[0]," does not have a valid octave");if(!n[m]&&!e[m])throw"".concat(t," is not a valid ").concat(r);for(var b=function(n,e){var o=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"].map((function(n){return n+e})),a=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"].map((function(n){return n+(e+1)})),i=o.concat(a);return i.slice(i.indexOf(n+e))}(d,l),u=[],p=0,h=0,f=a?n:e;p<f[m].length;)"1"===f[m][p]&&u.push(b[h]),p++,h++;return u},t=function(n){var e,o,a="b9sus",t=4;return n.includes(a)?(o=a,e=n.slice(0,n.indexOf(a))):(e=n[0],o=n.slice(1),"b"!==n[1]&&"#"!==n[1]||(e+=n[1],o=n.slice(2))),n.includes("_")&&(t=+n.split("_")[1],o=o.slice(0,o.indexOf("_"))),i({chord:e+t+" "+o})},r=function(){return Object.keys(e)},s=function(){return Object.keys(n)},m=function(n){return i({chord:n})},c=function(n){return i({scale:n})}})();var i=exports;for(var t in a)i[t]=a[t];a.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
(()=>{"use strict";var n={413:n=>{n.exports=JSON.parse('{"5th":"100000010000","M7#5sus4":"100001001001","7#5sus4":"100001001010","sus4":"100001010000","M7sus4":"100001010001","7sus4":"100001010010","7no5":"100010000010","aug":"100010001000","M7b6":"100010001001","maj7#5":"100010001001","7#5":"100010001010","7b13":"100010001010","M":"100010010000","maj7":"100010010001","7th":"100010010010","6th":"100010010100","7add6":"100010010110","7b6":"100010011010","Mb5":"100010100000","M7b5":"100010100001","7b5":"100010100010","maj#4":"100010110001","7#11":"100010110010","M6#11":"100010110100","7#11b13":"100010111010","m#5":"100100001000","mb6M7":"100100001001","m7#5":"100100001010","m":"100100010000","m/ma7":"100100010001","m7":"100100010010","m6":"100100010100","mMaj7b6":"100100011001","dim":"100100100000","oM7":"100100100001","m7b5":"100100100010","dim7":"100100100100","o7M7":"100100100101","4th":"100101000010","madd4":"100101010000","m7add11":"100101010010","+add#9":"100110001000","7#5#9":"100110001010","7#9":"100110010010","13#9":"100110010110","7#9b13":"100110011010","maj7#9#11":"100110110001","7#9#11":"100110110010","13#9#11":"100110110110","7#9#11b13":"100110111010","sus2":"101000010000","M9#5sus4":"101001001001","sus24":"101001010000","M9sus4":"101001010001","11th":"101001010010","9sus4":"101001010010","13sus4":"101001010110","9no5":"101010000010","13no5":"101010000110","M#5add9":"101010001000","maj9#5":"101010001001","9#5":"101010001010","9b13":"101010001010","Madd9":"101010010000","maj9":"101010010001","9th":"101010010010","6/9":"101010010100","maj13":"101010010101","M7add13":"101010010101","13th":"101010010110","M9b5":"101010100001","9b5":"101010100010","13b5":"101010100110","9#5#11":"101010101010","maj9#11":"101010110001","9#11":"101010110010","69#11":"101010110100","M13#11":"101010110101","13#11":"101010110110","9#11b13":"101010111010","m9#5":"101100001010","madd9":"101100010000","mM9":"101100010001","m9":"101100010010","m69":"101100010100","m13":"101100010110","mMaj9b6":"101100011001","m9b5":"101100100010","m11A":"101101001010","m11":"101101010010","b9sus":"110001010010","11b9":"110001010010","7sus4b9b13":"110001011010","alt7":"110010000010","7#5b9":"110010001010","Maddb9":"110010010000","M7b9":"110010010001","7b9":"110010010010","13b9":"110010010110","7b9b13":"110010011010","7#5b9#11":"110010101010","7b9#11":"110010110010","13b9#11":"110010110110","7b9b13#11":"110010111010","mb6b9":"110100001000","7b9#9":"110110010010"}')},722:n=>{n.exports=JSON.parse('{"major pentatonic":"101010010100","ionian pentatonic":"100011010001","mixolydian pentatonic":"100011010010","ritusen":"101001010100","egyptian":"101001010010","neopolitan major pentatonic":"100011100010","vietnamese 1":"100101011000","pelog":"110100011000","kumoijoshi":"110001011000","hirajoshi":"101100011000","iwato":"110001100010","in-sen":"110001010010","lydian pentatonic":"100010110001","malkos raga":"100101001010","locrian pentatonic":"100101100010","minor pentatonic":"100101010010","minor six pentatonic":"100101010100","flat three pentatonic":"101100010100","flat six pentatonic":"101010011000","scriabin":"110010010100","whole tone pentatonic":"100010101010","lydian #5P pentatonic":"100010101001","lydian dominant pentatonic":"100010110010","minor #7M pentatonic":"100101010001","super locrian pentatonic":"100110100010","minor hexatonic":"101101010001","augmented":"100110011001","major blues":"101110010100","piongio":"101001010110","prometheus neopolitan":"110010100110","prometheus":"101010100110","mystery #1":"110010101010","six tone symmetric":"110011001100","whole tone":"101010101010","messiaen\'s mode #5":"110001110001","minor blues":"100101110010","locrian major":"101011101010","double harmonic lydian":"110010111001","harmonic minor":"101101011001","altered":"110110101010","locrian #2":"101101101010","mixolydian b6":"101011011010","lydian dominant":"101010110110","lydian":"101010110101","lydian augmented":"101010101101","dorian b2":"110101010110","melodic minor":"101101010101","locrian":"110101101010","ultralocrian":"110110101100","locrian 6":"110101100110","augmented heptatonic":"100111011001","romanian minor":"101100110110","dorian #4":"101100110110","lydian diminished":"101100110101","phrygian":"110101011010","leading whole tone":"101010101011","lydian minor":"101010111010","phrygian dominant":"110011011010","balinese":"110101011001","neopolitan major":"110101010101","aeolian":"101101011010","harmonic major":"101011011001","double harmonic major":"110011011001","dorian":"101101010110","hungarian minor":"101100111001","hungarian major":"100110110110","oriental":"110011100110","flamenco":"110110110010","todi raga":"110100111001","mixolydian":"101011010110","persian":"110011101001","major":"101011010101","enigmatic":"110010101011","major augmented":"101011001101","lydian #9":"100110110101","messiaen\'s mode #4":"111001111001","purvi raga":"110011111001","spanish heptatonic":"110111011010","bebop":"101011010111","bebop minor":"101111010110","bebop major":"101011011101","bebop locrian":"110101111010","minor bebop":"101101011011","diminished":"101101101101","ichikosucho":"101011110101","minor six diminished":"101101011101","half-whole diminished":"110110110110","kafi raga":"100111010111","messiaen\'s mode #6":"101011101011","composite blues":"101111110110","messiaen\'s mode #3":"101110111011","messiaen\'s mode #7":"111101111101","chromatic":"111111111111","ionian":"101011010101","minor":"101101011010"}')}},e={};function o(a){var i=e[a];if(void 0!==i)return i.exports;var t=e[a]={exports:{}};return n[a](t,t.exports,o),t.exports}o.d=(n,e)=>{for(var a in e)o.o(e,a)&&!o.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},o.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),o.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var a={};(()=>{o.r(a),o.d(a,{chord:()=>m,chords:()=>r,inlineChord:()=>t,scale:()=>c,scales:()=>s});var n=o(722),e=o(413),i=function(o){var a=o.scale,i=o.chord,t=a||i,r=a?"scale":"chord";if("string"!=typeof t)throw"".concat(t," is not a valid input for ").concat(r);var s=t.indexOf(" "),m=t.slice(s+1),c=t.slice(0,s),d=c.replace(/\d/g,""),l=+c.replace(/\D/g,"");if(isNaN(l))throw"".concat(c[0]," does not have a valid octave");if(!n[m]&&!e[m])throw"".concat(t," is not a valid ").concat(r);for(var b=function(n,e){var o=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"].map((function(n){return n+e})),a=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"].map((function(n){return n+(e+1)})),i=o.concat(a);return i.slice(i.indexOf(n+e))}(d,l),u=[],p=0,h=0,f=a?n:e;p<f[m].length;)"1"===f[m][p]&&u.push(b[h]),p++,h++;return u},t=function(n){var e,o,a="b9sus",t=4;return n.includes(a)?(o=a,e=n.slice(0,n.indexOf(a))):(e=n[0],o=n.slice(1),"b"!==n[1]&&"#"!==n[1]||(e+=n[1],o=n.slice(2))),n.includes("_")&&(t=+n.split("_")[1],o=o.slice(0,o.indexOf("_"))),i({chord:e+t+" "+o})},r=function(){return Object.keys(e)},s=function(){return Object.keys(n)},m=function(n){return i({chord:n})},c=function(n){return i({scale:n})}})();var i=exports;for(var t in a)i[t]=a[t];a.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
{
"name": "harmonics",
"version": "1.0.4",
"version": "1.0.5",
"description": "Tools and utilities for a generic representation of scales, chords, progressions etc. for use in music software, music related web & mobile apps, VST/VCV plugins and Max for Live devices.",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -32,2 +32,12 @@ const scalesAndChords = require('./scalesAndChords');

expect(scalesAndChords.scale('C4 lydian')).toStrictEqual([
'C4',
'D4',
'E4',
'Gb4',
'G4',
'A4',
'B4',
]);
expect(scalesAndChords.scale('C5 minor')).toStrictEqual([

@@ -34,0 +44,0 @@ 'C5',

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