Comparing version 1.0.8 to 1.1.0
{ | ||
"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" | ||
"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" | ||
} |
@@ -8,2 +8,4 @@ /** | ||
const { Scale, Chord, ChordType } = require('@tonaljs/tonal'); | ||
const svara = require('./svara.json'); | ||
const melakarta = require('./melakarta.json'); | ||
@@ -36,2 +38,26 @@ /** | ||
// Append the melakarta ragas to scaleMaps | ||
Object.keys(melakarta).forEach(m => { | ||
// console.log(m); // top level category of the ragas (for eg Indu) | ||
Object.keys(melakarta[m]).forEach(r => { | ||
// r is the actual raga (for eg Kanakangi) | ||
const nums = melakarta[m][r].split(' ').map(n => svara[n]); | ||
let bitmap = ''; | ||
let pointer = 0; | ||
// walk over 12 semitones to derive bitmap | ||
for (let i = 0; i < 12; i++) { | ||
if (i === nums[pointer]) { | ||
bitmap = bitmap + '1'; | ||
pointer++; | ||
} else { | ||
bitmap = bitmap + '0'; | ||
} | ||
} | ||
scaleMaps[r] = bitmap; | ||
}) | ||
}); | ||
fs.writeFile('./gen/scaleMaps.json', JSON.stringify(scaleMaps), function (err) { | ||
@@ -38,0 +64,0 @@ if (err) return console.log(err); |
{ | ||
"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" | ||
"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", | ||
"Kanakangi": "111001011100", | ||
"Ratnangi": "111001011010", | ||
"Ganamurti": "111001011001", | ||
"Vanaspati": "111001010110", | ||
"Manavati ": "111001010101", | ||
"Tanarupi ": "111001010011", | ||
"Senavati": "110101011100", | ||
"Hanumatodi": "110101011010", | ||
"Dhenuka": "110101011001", | ||
"Natakapriya": "110101010110", | ||
"Kokilapriya": "110101010101", | ||
"Rupavati": "110101010011", | ||
"Gayakapriya": "110011011100", | ||
"Vakulabharanam": "110011011010", | ||
"Mayamalavagowla": "110011011001", | ||
"Chakravakam": "110011010110", | ||
"Suryakantam": "110011010101", | ||
"Hatakambari": "110011010011", | ||
"Jhankaradhwani": "101101011100", | ||
"Natabhairavi": "101101011010", | ||
"Keeravani": "101101011001", | ||
"Kharaharapriya": "101101010110", | ||
"Gourimanohari": "101101010101", | ||
"Varunapriya": "101101010011", | ||
"Mararanjani": "101011011100", | ||
"Charukesi": "101011011010", | ||
"Sarasangi": "101011011001", | ||
"Harikambhoji": "101011010110", | ||
"Dheerasankarabaranam": "101011010101", | ||
"Naganandini": "101011010011", | ||
"Yagapriya": "100111011100", | ||
"Ragavardhini": "100111011010", | ||
"Gangeyabhushani": "100111011001", | ||
"Vagadheeswari": "100111010110", | ||
"Shulini": "100111010101", | ||
"Chalanata": "100111010011", | ||
"Salagam": "111000111100", | ||
"Jalarnavam": "111000111010", | ||
"Jhalavarali": "111000111001", | ||
"Navaneetam": "111000110110", | ||
"Pavani": "111000110101", | ||
"Raghupriya": "111000110011", | ||
"Gavambhodi": "110100111100", | ||
"Bhavapriya": "110100111010", | ||
"Shubhapantuvarali": "110100111001", | ||
"Shadvidamargini": "110100110110", | ||
"Suvarnangi": "110100110101", | ||
"Divyamani": "110100110011", | ||
"Dhavalambari": "110010111100", | ||
"Namanarayani": "110010111010", | ||
"Kamavardhini": "110010111001", | ||
"Ramapriya": "110010110110", | ||
"Gamanashrama": "110010110101", | ||
"Vishwambari": "110010110011", | ||
"Shamalangi": "101100111100", | ||
"Shanmukhapriya": "101100111010", | ||
"Simhendramadhyamam": "101100111001", | ||
"Hemavati": "101100110110", | ||
"Dharmavati": "101100110101", | ||
"Neetimati": "101100110011", | ||
"Kantamani": "101010111100", | ||
"Rishabhapriya": "101010111010", | ||
"Latangi": "101010111001", | ||
"Vachaspati": "101010110110", | ||
"Mechakalyani": "101010110101", | ||
"Chitrambari": "101010110011", | ||
"Sucharitra": "100110111100", | ||
"Jyoti swarupini": "100110111010", | ||
"Dhatuvardani": "100110111001", | ||
"Nasikabhushini": "100110110110", | ||
"Kosalam": "100110110101", | ||
"Rasikapriya": "100110110011" | ||
} |
@@ -1,2 +0,2 @@ | ||
(()=>{"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 r=e[a]={exports:{}};return n[a](r,r.exports,o),r.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:()=>t,inlineChord:()=>r,scale:()=>c,scales:()=>s});var n=o(722),e=o(413),i=function(o){var a=o.scale,i=o.chord,r=a||i,t=a?"scale":"chord";if("string"!=typeof r)throw new Error("".concat(r," is not a valid input for ").concat(t));var s,m,c=r.indexOf(" ");-1===c?(s=r.slice(1),m=r[0],"b"!==r[1]&&"#"!==r[1]||(s=r.slice(2),m+=r[1])):(s=r.slice(-1===c?1:c+1),m=r.slice(0,c));var d=function(n){return{"C#":"Db","D#":"Eb","F#":"Gb","G#":"Ab","A#":"Bb"}[n.toUpperCase()]||n.charAt(0).toUpperCase()+n.slice(1)}(m.replace(/\d/g,"")),l=""!==m.replace(/\D/g,"")?+m.replace(/\D/g,""):4;if(isNaN(l))throw new Error("".concat(m[0]," does not have a valid octave"));if(!n[s]&&!e[s])throw new Error("".concat(r," is not a valid ").concat(t));for(var b=function(n,e){var o=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],a=o.map((function(n){return n+e})),i=o.map((function(n){return n+(e+1)})),r=a.concat(i);return r.slice(r.indexOf(n+e))}(d,l),u=[],p=0,h=0,f=a?n:e;p<f[s].length;)"1"===f[s][p]&&u.push(b[h]),p++,h++;return u},r=function(n){var e,o,a="b9sus",r=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("_")&&(r=+n.split("_")[1],o=o.slice(0,o.indexOf("_"))),i({chord:e+r+" "+o})},t=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 r in a)i[r]=a[r];a.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var a={413:a=>{a.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:a=>{a.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","Kanakangi":"111001011100","Ratnangi":"111001011010","Ganamurti":"111001011001","Vanaspati":"111001010110","Manavati ":"111001010101","Tanarupi ":"111001010011","Senavati":"110101011100","Hanumatodi":"110101011010","Dhenuka":"110101011001","Natakapriya":"110101010110","Kokilapriya":"110101010101","Rupavati":"110101010011","Gayakapriya":"110011011100","Vakulabharanam":"110011011010","Mayamalavagowla":"110011011001","Chakravakam":"110011010110","Suryakantam":"110011010101","Hatakambari":"110011010011","Jhankaradhwani":"101101011100","Natabhairavi":"101101011010","Keeravani":"101101011001","Kharaharapriya":"101101010110","Gourimanohari":"101101010101","Varunapriya":"101101010011","Mararanjani":"101011011100","Charukesi":"101011011010","Sarasangi":"101011011001","Harikambhoji":"101011010110","Dheerasankarabaranam":"101011010101","Naganandini":"101011010011","Yagapriya":"100111011100","Ragavardhini":"100111011010","Gangeyabhushani":"100111011001","Vagadheeswari":"100111010110","Shulini":"100111010101","Chalanata":"100111010011","Salagam":"111000111100","Jalarnavam":"111000111010","Jhalavarali":"111000111001","Navaneetam":"111000110110","Pavani":"111000110101","Raghupriya":"111000110011","Gavambhodi":"110100111100","Bhavapriya":"110100111010","Shubhapantuvarali":"110100111001","Shadvidamargini":"110100110110","Suvarnangi":"110100110101","Divyamani":"110100110011","Dhavalambari":"110010111100","Namanarayani":"110010111010","Kamavardhini":"110010111001","Ramapriya":"110010110110","Gamanashrama":"110010110101","Vishwambari":"110010110011","Shamalangi":"101100111100","Shanmukhapriya":"101100111010","Simhendramadhyamam":"101100111001","Hemavati":"101100110110","Dharmavati":"101100110101","Neetimati":"101100110011","Kantamani":"101010111100","Rishabhapriya":"101010111010","Latangi":"101010111001","Vachaspati":"101010110110","Mechakalyani":"101010110101","Chitrambari":"101010110011","Sucharitra":"100110111100","Jyoti swarupini":"100110111010","Dhatuvardani":"100110111001","Nasikabhushini":"100110110110","Kosalam":"100110110101","Rasikapriya":"100110110011"}')}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return a[e](o,o.exports,n),o.exports}n.d=(a,i)=>{for(var e in i)n.o(i,e)&&!n.o(a,e)&&Object.defineProperty(a,e,{enumerable:!0,get:i[e]})},n.o=(a,i)=>Object.prototype.hasOwnProperty.call(a,i),n.r=a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var e={};(()=>{n.r(e),n.d(e,{chord:()=>s,chords:()=>t,getIndicesFromScale:()=>d,inlineChord:()=>o,scale:()=>c,scales:()=>m});var a=n(722),i=n(413),r=function(n){var e=n.scale,r=n.chord,o=e||r,t=e?"scale":"chord";if("string"!=typeof o)throw new Error("".concat(o," is not a valid input for ").concat(t));var m,s,c=o.indexOf(" ");-1===c?(m=o.slice(1),s=o[0],"b"!==o[1]&&"#"!==o[1]||(m=o.slice(2),s+=o[1])):(m=o.slice(-1===c?1:c+1),s=o.slice(0,c));var d=function(a){return{"C#":"Db","D#":"Eb","F#":"Gb","G#":"Ab","A#":"Bb"}[a.toUpperCase()]||a.charAt(0).toUpperCase()+a.slice(1)}(s.replace(/\d/g,"")),l=""!==s.replace(/\D/g,"")?+s.replace(/\D/g,""):4;if(isNaN(l))throw new Error("".concat(s[0]," does not have a valid octave"));if(!a[m]&&!i[m])throw new Error("".concat(o," is not a valid ").concat(t));for(var h=function(a,i){var n=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],e=n.map((function(a){return a+i})),r=n.map((function(a){return a+(i+1)})),o=e.concat(r);return o.slice(o.indexOf(a+i))}(d,l),u=[],b=0,p=0,y=e?a:i;b<y[m].length;)"1"===y[m][b]&&u.push(h[p]),b++,p++;return u},o=function(a){var i,n,e="b9sus",o=4;return a.includes(e)?(n=e,i=a.slice(0,a.indexOf(e))):(i=a[0],n=a.slice(1),"b"!==a[1]&&"#"!==a[1]||(i+=a[1],n=a.slice(2))),a.includes("_")&&(o=+a.split("_")[1],n=n.slice(0,n.indexOf("_"))),r({chord:i+o+" "+n})},t=function(){return Object.keys(i)},m=function(){return Object.keys(a)},s=function(a){return r({chord:a})},c=function(a){return r({scale:a})},d=function(i){for(var n=a[i]||i,e=[],r=0;r<n.length;r++)"1"===n[r]&&e.push(r);return e.push(12),e}})();var r=exports;for(var o in e)r[o]=e[o];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "harmonics", | ||
"version": "1.0.8", | ||
"version": "1.1.0", | ||
"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.", | ||
@@ -10,3 +10,6 @@ "main": "main.js", | ||
"build": "webpack --mode=production", | ||
"watch:browser": "webpack --watch --mode=development" | ||
"watch:browser": "webpack --watch --mode=development", | ||
"bump-major": "npm version major --no-git-tag-version", | ||
"bump-minor": "npm version minor --no-git-tag-version", | ||
"bump-patch": "npm version patch --no-git-tag-version" | ||
}, | ||
@@ -13,0 +16,0 @@ "dependencies": {}, |
@@ -1,3 +0,3 @@ | ||
import { chords, scales, chord, inlineChord, scale } from './scalesAndChords'; | ||
import { chords, scales, chord, inlineChord, scale, getIndicesFromScale } from './scalesAndChords'; | ||
export { chords, scales, chord, inlineChord, scale }; | ||
export { chords, scales, chord, inlineChord, scale, getIndicesFromScale }; |
@@ -130,1 +130,19 @@ const scaleMaps = require('../gen/scaleMaps.json'); | ||
export const scale = (scale) => _getNotesForScaleOrChord({ scale }); | ||
/** | ||
* | ||
* @param {String} scaleOrBitmap e.g '110010110011' or 'phrygian' | ||
* @returns {Array} e.g. [0, 1, 3, 5, 7, 8, 10, 12] | ||
*/ | ||
export const getIndicesFromScale = (scaleOrBitmap) => { | ||
let str = scaleMaps[scaleOrBitmap] || scaleOrBitmap; | ||
const intervals = []; | ||
for (let i = 0; i < str.length; i++) { | ||
if (str[i] === '1') { | ||
intervals.push(i); | ||
} | ||
} | ||
intervals.push(12); // Add the next octave | ||
return intervals; | ||
}; |
@@ -133,1 +133,6 @@ const scalesAndChords = require('./scalesAndChords'); | ||
}); | ||
test('returns the indices of the given scale by it s name or it s bitmap', () => { | ||
expect(scalesAndChords.getIndicesFromScale('phrygian')).toStrictEqual([0, 1, 3, 5, 7, 8, 10, 12]); | ||
expect(scalesAndChords.getIndicesFromScale('110101011010')).toStrictEqual([0, 1, 3, 5, 7, 8, 10, 12]); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37307
14
775