adding more docstrings

This commit is contained in:
2023-08-05 18:36:31 +02:00
parent 2a0ac626d0
commit 9085088948
3 changed files with 34 additions and 8 deletions

View File

@ -54,6 +54,13 @@ const SCALES: Record<string, number[]> = {
};
export function scale(n: number, scaleName: string = 'major', octave: number = 4): number {
/**
* Returns the MIDI note number for the given scale degree in the given scale.
* @param {number} n - The scale degree, where 0 is the tonic.
* @param {string} scaleName - The name of the scale.
* @param {number} octave - The octave number.
* @returns {number} The MIDI note number.
*/
const scale = SCALES[scaleName];
if (!scale) {