From a112a9ac9751717e453d4caf6000889dd113be9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 15 Jun 2019 01:38:23 +0200 Subject: [PATCH] Last changes --- src/circles.js | 2 +- src/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/circles.js b/src/circles.js index 22722b2..e0c05c8 100644 --- a/src/circles.js +++ b/src/circles.js @@ -89,7 +89,7 @@ export default class CirclesAnimation { const circle = this.circles[c]; sketch.beginShape(); for (let i = 0; i < circle.spectrum.length; i++) { - const p = circle.spectrum[i]; + const p = Math.max(circle.spectrum[i] - (this.averageSpectrum[i] * 0.6), 0); sketch.curveVertex( Math.cos((i / this.CIRCLE_POINTS) * 2 * Math.PI) * (this.CIRCLE_RADIUS + c * 15) + this.baseWidth + (this.maxVolume / 2 - circle.volume) + p, Math.sin((i / this.CIRCLE_POINTS) * 2 * Math.PI) * (this.CIRCLE_RADIUS + c * 15) + this.baseHeight + (this.maxPitch / 2 - circle.pitch) - p, diff --git a/src/index.js b/src/index.js index 0546b62..280580c 100644 --- a/src/index.js +++ b/src/index.js @@ -5,8 +5,8 @@ import HorizontalLinesAnimation from './horizontal-lines.js'; import SquaresAnimation from './squares.js'; import CirclesAnimation from './circles.js'; -const ANIMATION_TIME = 10 * 60 * 1000; -// const ANIMATION_TIME = 10 * 1000; +// const ANIMATION_TIME = 10 * 60 * 1000; +const ANIMATION_TIME = 20 * 1000; async function main() { const audioCtx = new AudioContext();