corrected useless shift/push/return / delete ambiguous import in API.ts + scale = scale;

This commit is contained in:
JulienH2000
2023-09-21 19:41:28 +02:00
parent e67f5abb7b
commit a86d0c923a
2 changed files with 4 additions and 6 deletions

View File

@ -2,12 +2,10 @@ import { seededRandom } from "zifferjs";
import { MidiConnection } from "./IO/MidiConnection";
import { tryEvaluate, evaluateOnce } from "./Evaluator";
import { DrunkWalk } from "./Utils/Drunk";
import { scale } from "./Scales";
import { Editor } from "./main";
import { SoundEvent } from "./classes/SoundEvent";
import { MidiEvent } from "./classes/MidiEvent";
import { LRUCache } from "lru-cache";
import { SCALES } from "./Scales"
import { InputOptions, Player } from "./classes/ZPlayer";
import {
samples,
@ -1514,7 +1512,6 @@ export class UserAPI {
this._logMessage(message);
};
scale = scale;
rate = (rate: number): void => {
rate = rate;

View File

@ -348,6 +348,7 @@ Array.prototype.scale = function <T>(this: T[], scaleName: string = "major") {
const scale = SCALES[scaleName];
//input protect from unknow scale
if (!scale) {
throw new Error(`Unknown scale ${scaleName}`);
}
@ -363,7 +364,7 @@ Array.prototype.scale = function <T>(this: T[], scaleName: string = "major") {
}
}
this.shift()
this.push(...result);
return this;
//this.shift()
//this = [...result];
return result;
};