fix: bugs catched by linter
This commit is contained in:
parent
f4032dad22
commit
ef284e9d13
2 changed files with 3 additions and 3 deletions
|
|
@ -236,7 +236,7 @@ export function getAnalyserById(id, fftSize = 1024) {
|
||||||
export function getAnalyzerData(type = 'time', id = 1) {
|
export function getAnalyzerData(type = 'time', id = 1) {
|
||||||
const getter = {
|
const getter = {
|
||||||
time: () => analysers[id]?.getFloatTimeDomainData(analysersData[id]),
|
time: () => analysers[id]?.getFloatTimeDomainData(analysersData[id]),
|
||||||
frequency: () => analyser[id]?.getFloatFrequencyData(analysersData[id]),
|
frequency: () => analysers[id]?.getFloatFrequencyData(analysersData[id]),
|
||||||
}[type];
|
}[type];
|
||||||
if (!getter) {
|
if (!getter) {
|
||||||
throw new Error(`getAnalyzerData: ${type} not supported. use one of ${Object.keys(getter).join(', ')}`);
|
throw new Error(`getAnalyzerData: ${type} not supported. use one of ${Object.keys(getter).join(', ')}`);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Pattern, clamp } from '@strudel/core';
|
import { Pattern, clamp } from '@strudel/core';
|
||||||
import { getDrawContext } from '../draw/index.mjs';
|
import { getDrawContext } from '../draw/index.mjs';
|
||||||
import { getAnalyzerData } from 'superdough';
|
import { analysers, getAnalyzerData } from 'superdough';
|
||||||
|
|
||||||
export function drawTimeScope(
|
export function drawTimeScope(
|
||||||
analyser,
|
analyser,
|
||||||
|
|
@ -93,7 +93,7 @@ Pattern.prototype.fscope = function (config = {}) {
|
||||||
let id = config.id ?? 1;
|
let id = config.id ?? 1;
|
||||||
return this.analyze(id).draw(() => {
|
return this.analyze(id).draw(() => {
|
||||||
clearScreen(config.smear, '0,0,0', config.ctx);
|
clearScreen(config.smear, '0,0,0', config.ctx);
|
||||||
analysers[id] && drawFrequencyScope(analyser, config);
|
analysers[id] && drawFrequencyScope(analysers[id], config);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue