IMP: normize kick deteciton for visualiser
This commit is contained in:
parent
3307dfecb5
commit
37f9a3ebb2
2 changed files with 3 additions and 2 deletions
|
|
@ -145,7 +145,8 @@ export class Visualizer {
|
|||
this.analyser.getByteFrequencyData(this.dataArray);
|
||||
|
||||
// Bass (first bins only — cheap)
|
||||
let bass = (this.dataArray[0] + this.dataArray[1] + this.dataArray[2] + this.dataArray[3]) * 0.000980392; // 1 / (4 * 255)
|
||||
const volume = 10*Math.max(this.audio.volume, 0.1);
|
||||
let bass = ((this.dataArray[0] + this.dataArray[1] + this.dataArray[2] + this.dataArray[3]) * 0.000980392) / volume;
|
||||
|
||||
const intensity = bass * bass;
|
||||
const stats = this.stats;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ export class LCDPreset {
|
|||
|
||||
// Shake on kick
|
||||
if (!this.disableShake && kick > 0.3) {
|
||||
const shake = kick * 40;
|
||||
const shake = kick * 15;
|
||||
ctx.translate((Math.random() - 0.5) * 2 * shake, (Math.random() - 0.5) * shake);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue