Wallpaper Engine

Wallpaper Engine

Not enough ratings
Zoom Audio Responsive
   
Award
Favorite
Favorited
Unfavorite
Age Rating: Everyone
Category: Asset
Asset Type: Script
Asset Genre: Audio Visualizer
Script Type: Number
File Size
Posted
934.233 KB
Apr 10, 2023 @ 12:06pm
1 Change Note ( view )

Subscribe to download
Zoom Audio Responsive

Description
'use strict';//Script made by TheJacksonGamer ( https://steamcommunity.com/id/TheJacksonGamer ), for help thanks to Gariam ( https://steamcommunity.com/id/capitan-willy-1 ), who helped write script to disable the feature for users.

import * as WEMath from 'WEMath';

export var scriptProperties = createScriptProperties()
.addCheckbox({
name: 'zoom',
label: 'Zoom Audio Responsive',
value: false
})
.addSlider({
name: 'frequency',
label: 'Frequency',
value: 0,
min: 0,
max: 16, // Must be 16, 32 or 64.
integer: true
})
.addSlider({
name: 'amount',
label: 'Amount',
value: 0.1,
min: -1,
max: 1,
integer: false
})
.addSlider({
name: 'threshold',
label: 'Threshold',
value: 0.1,
min: 0,
max: 1,
integer: false
})
.addSlider({
name: 'smoothingRate',
label: 'Smoothing rate',
value: 1.5, // Must be greater or equal to 1.
min: 1,
max: 5,
integer: false
})
.finish();

let frequencyResolution = 16; // Must be 16, 32 or 64 per channel.
let audioBuffer = engine.registerAudioBuffers(frequencyResolution);
let audioDelta, initValue;

export function update(value) {
if (!scriptProperties.zoom) audioDelta = 0; //Add (without []) [ || !engine.userProperties.key] after [if (!scriptProperties.zoom], to be able to disable function by subscribers yours wallpaper. Where [key] is user key from an empty user property.
else audioDelta = Math.max(0, audioBuffer.average[scriptProperties.frequency] - scriptProperties.threshold);

audioDelta = smoothStep(initValue, scriptProperties.amount, audioDelta);
return WEMath.mix(value, audioDelta, (1 + engine.frametime) / (scriptProperties.smoothingRate - engine.frametime));
}

export function init(value) {
initValue = value;
}

// Specifically made for this.
function smoothStep(a, b, x){
return x * x * (3.0 - x + x) * b * 0.1 + a;
}
5 Comments
Jaxxxon  [author] Jan 21, 2024 @ 9:29am 
Hmm... It really stopped working.
Unfortunately, I don't have time to deal with the code right now. Therefore, write to the coder listed second in the code comment!

If he knows how to fix this, then write in the comments (I will update the script), or create your own script based on mine (don’t forget to let me know so that I can delete the non-working script)!
<:) Jan 19, 2024 @ 12:23am 
I bind this to the 'camera zoom' in scene settings and nothing happens. I tried both editor preview and loading it as a wallpaper and neither changes when music is played.
AKASHIDRIFTER SKINS Dec 30, 2023 @ 6:28pm 
Could you explain to me how I put this on my wallpaper please?
Jaxxxon  [author] Apr 28, 2023 @ 6:01am 
This script works with the Zoom setting in the Scene Options. Once entered, it immediately works! To be able to enable / disable the script, you need to follow my comment in the script!
Vojokyo Apr 28, 2023 @ 3:27am 
What should I attach this to to make it work?