Skip to content

Commit

Permalink
go down a little faster
Browse files Browse the repository at this point in the history
  • Loading branch information
BlinkyStitt committed Apr 27, 2024
1 parent 86cf2c7 commit 2e97cfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions musical-leptos/src/components/dancing_lights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn DancingLights() -> impl IntoView {

let mut peak_scaled_builder = PeakScaledBuilder::new(0.99);

let mut down_resistance_builder = DownResistanceBuilder::<NUM_CHANNELS>::new(0.004);
let mut down_resistance_builder = DownResistanceBuilder::<NUM_CHANNELS>::new(0.005);

let media_stream = load_media_stream()
.await
Expand Down Expand Up @@ -151,11 +151,11 @@ pub fn DancingLights() -> impl IntoView {

let mut visual_loudness = scale_builder.build(amplitudes).0 .0;

// loudness is now set to go from 0.0 to 1.0
// the quietest bins are pushed to 0 and the loudest to 1
// TODO: use log somehow here?

// peak_scaled_builder pushes the quietest bins to 0 and the loudest to 1
peak_scaled_builder.scale(&mut visual_loudness);

// as usual, i don't love the name of the name of this variable
down_resistance_builder.update(&mut visual_loudness);

set_audio(visual_loudness);
Expand Down

0 comments on commit 2e97cfe

Please sign in to comment.