Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict'
var gamut = require('music-gamut')
var transpose = gamut.asNotes(gamut.add)
function find (pitchNum, array) {
for (var i = 0, len = array.length; i < len; i++) {
if (array[i][0] === pitchNum) return array[i]
}
return null
}
/**
* Get the degrees of a scale
*
* The resulting array will contain the notes in the same order as degrees.
* If a given degree is not present in the scale, the result will contain a
* null in that position.
*
* @name degrees
'use strict'
var curry = require('curry')
var gamut = require('music-gamut')
var transpose = gamut.asNotes(gamut.add)
/**
* Build a scale from a source and a tonic. A scale is an array of notes (or
* intervals if tonic is null) ordered by frequency
*
* A source can be a list of intervals or notes. The tonic must be
* a pitch (with or without octave) or null to get the scale intervals
*
* This function is currified, so you can partially apply the function passing
* one parameter instead of two (see example)
*
* @param {Array} source - the list of intervals or notes
* @param {String} tonic - the tonic of the scale
* @return {Array} the list of notes
*
* @example