tweaking defaults

This commit is contained in:
2023-10-22 23:38:57 +02:00
parent b2f77b3b38
commit aaffacb265
3 changed files with 9 additions and 5 deletions

View File

@ -26,7 +26,11 @@ import {
} from "superdough";
import { Speaker } from "./StringExtensions";
import { getScaleNotes } from "zifferjs";
import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation";
import {
OscilloscopeConfig,
blinkScript,
runOscilloscope,
} from "./AudioVisualisation";
interface ControlChange {
channel: number;

View File

@ -141,6 +141,7 @@ export const runOscilloscope = (
const HEIGHT = canvas.height;
function draw() {
requestAnimationFrame(draw);
if (!app.osc.enabled) {
canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);
return;
@ -152,7 +153,6 @@ export const runOscilloscope = (
dataArray = new Float32Array(analyzer.frequencyBinCount);
}
requestAnimationFrame(draw);
analyzer.getFloatTimeDomainData(dataArray);
canvasCtx.fillStyle = "rgba(0, 0, 0, 0)";

View File

@ -62,10 +62,10 @@ export class Editor {
osc: OscilloscopeConfig = {
enabled: true,
color: "#fdba74",
thickness: 2,
fftSize: 2048,
thickness: 4,
fftSize: 256,
orientation: "horizontal",
is3D: true,
is3D: false,
size: 1,
};