wtf is happening

This commit is contained in:
2023-09-21 22:55:06 +02:00
parent e84244dd4a
commit 89d1e76758

View File

@ -346,26 +346,6 @@ export const makeArrayExtensions = (api: UserAPI) => {
Array.prototype.rand = Array.prototype.random;
};
Array.prototype.scale = function (
scale: string = "major",
base_note: number = 0
) {
/**
* @param scale - the scale name
* @param base_note - the base note to start at (MIDI note number)
*/
const selected_scale = SCALES[scale];
return this.map((value) => {
const octaveShift =
Math.floor(value / selected_scale.length) * 12 * Math.sign(value);
return (
selected_scale[Math.abs(value) % selected_scale.length] +
base_note +
octaveShift
);
});
};
Array.prototype.scale = function (
scale: string = "major",
base_note: number = 0