Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Scale = require('music-scale/all')
var Chromatic = require('chromatic')
var types = ['one note', 'interval', 'triad', 'cuatriad', 'pentatonic',
'hexatonic', 'heptatonic', 'octatonic', '9 notes', '10 notes', '11 notes', '12 notes']
var NAMES = Scale.Names.names()
var all = [].concat(NAMES)
function isValidPattern (pattern) {
return pattern && // present
!/^\s*$/.test(pattern) && // not empty
!/^\d$/.test(pattern) // if number, at least 2 digits
}
function notes (root, binary, len) {
var x, i
return Chromatic(root, 4, len).map(function (chroma) {
var notes = []
for (x = 0; x < len; x++) {
i = x % 12
if (binary[i] === '1') notes.push(chroma[x])
}
},{"music-scale/all":13,"riot":16}],6:[function(require,module,exports){
var Scale = require('music-scale/all')
var Chromatic = require('chromatic')
var types = ['one note', 'interval', 'triad', 'cuatriad', 'pentatonic',
'hexatonic', 'heptatonic', 'octatonic', '9 notes', '10 notes', '11 notes', '12 notes']
var NAMES = Scale.Names.names()
var all = [].concat(NAMES)
function isValidPattern (pattern) {
return pattern && // present
!/^\s*$/.test(pattern) && // not empty
!/^\d$/.test(pattern) // if number, at least 2 digits
}
function notes (root, binary, len) {
var x, i
return Chromatic(root, 4, len).map(function (chroma) {
var notes = []
for (x = 0; x < len; x++) {
i = x % 12
if (binary[i] === '1') notes.push(chroma[x])
}
riot.route(function (decimal, name) {
var scale = /^\d{4}$/.test(decimal) ? Scale.get(+decimal) : null
if (scale) {
if (!/^\s*$/.test(name)) {
name = (name in scale.names()) ? name : scale.name()
app.select(name || scale.decimal)
} else {
route(scale.decimal, scale.name() || scale.binary)
}
} else {
var clean = decodeURIComponent(name)
scale = Scale.get(clean)
if (scale) route(scale.decimal, name)
}
})
riot.route(function (decimal, name) {
var scale = /^\d{4}$/.test(decimal) ? Scale.get(+decimal) : null
if (scale) {
if (!/^\s*$/.test(name)) {
name = (name in scale.names()) ? name : scale.name()
app.select(name || scale.decimal)
} else {
route(scale.decimal, scale.name() || scale.binary)
}
} else {
var clean = decodeURIComponent(name)
scale = Scale.get(clean)
if (scale) route(scale.decimal, name)
}
})
riot.route(function (decimal, name) {
var scale = /^\d{4}$/.test(decimal) ? Scale.get(+decimal) : null
if (scale) {
if (!/^\s*$/.test(name)) {
name = (name in scale.names()) ? name : scale.name()
app.select(name || scale.decimal)
} else {
route(scale.decimal, scale.name() || scale.binary)
}
} else {
var clean = decodeURIComponent(name)
scale = Scale.get(clean)
if (scale) route(scale.decimal, name)
}
})
riot.route(function (decimal, name) {
var scale = /^\d{4}$/.test(decimal) ? Scale.get(+decimal) : null
if (scale) {
if (!/^\s*$/.test(name)) {
name = (name in scale.names()) ? name : scale.name()
app.select(name || scale.decimal)
} else {
route(scale.decimal, scale.name() || scale.binary)
}
} else {
var clean = decodeURIComponent(name)
scale = Scale.get(clean)
if (scale) route(scale.decimal, name)
}
})
get: function (name, root) {
return scaleData(name, root, Scale.get(name))
},
build: function () {
get: function (name, root) {
return scaleData(name, root, Scale.get(name))
},
build: function () {
},{}],13:[function(require,module,exports){
'use strict'
var Scale = require('./')
Scale.Names({
'2217': ['lydian #5 pentatonic'],
'2218': ['whole tone pentatonic'],
'2225': ['lydian pentatonic', 'chinese'],
'2226': ['lydian dominant pentatonic'],
'2257': ['ionian pentatonic'],
'2258': ['mixolydian pentatonic', 'indian'],
'2274': ['neopolitan major pentatonic'],
'2378': ['malkos raga'],
'2385': ['minor #7 pentatonic'],
'2386': ['minor pentatonic', 'vietnamese 2'],
'2388': ['minor six pentatonic'],
'2392': ['vietnamese 1'],
'2402': ['locrian pentatonic', 'minor seven flat five pentatonic'],
'2418': ['minor blues', 'blues'],
'2457': ['augmented'],
'2466': ['super locrian pentatonic'],
build: function () {
Scale.all().forEach(function (scale) {
if (scale.name()) return
all.push('' + scale.decimal + ' [' + scale.binary + '] ' + types[scale.length - 1])
})
}
}