Skip to content

Commit

Permalink
increase echo density a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
russellmcc committed Nov 27, 2024
1 parent 81d8565 commit 17dc25d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions rust/reverb/component/src/reverb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Reverb {
let input = input.channel(0);
let output = output.channel_mut(0);
for (input, output) in input.iter().zip(output.iter_mut()) {
let mc_input = core::array::from_fn(|i| if i == 0 { *input } else { 0.0 });
let mc_input = [*input; CHANNELS];
*output = self
.feedback_loop
.process(self.diffuser.process(&mc_input), feedback)[0];
Expand All @@ -60,15 +60,8 @@ impl Reverb {
let input_r = input.channel(1);
for (i, (input_l, input_r)) in input_l.iter().zip(input_r.iter()).enumerate() {
{
let mc_input = core::array::from_fn(|i| {
if i == 0 {
*input_l
} else if i == 1 {
*input_r
} else {
0.0
}
});
let mc_input =
core::array::from_fn(|i| if i & 1 == 0 { *input_l } else { *input_r });
let x = self
.feedback_loop
.process(self.diffuser.process(&mc_input), feedback);
Expand Down
Git LFS file not shown
2 changes: 1 addition & 1 deletion rust/reverb/component/src/reverb/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ fn impulse_response() {
let mut impulse_vec = vec![0.0; SNAPSHOT_LENGTH];
impulse_vec[0] = 1.0;
let mut output = BufferData::new_mono(vec![0.0; SNAPSHOT_LENGTH]);
reverb.process(0.85, &BufferData::new_mono(impulse_vec), &mut output);
reverb.process(0.6, &BufferData::new_mono(impulse_vec), &mut output);
assert_snapshot!("impulse_response", 48000, output.channel(0).iter().copied());
}

0 comments on commit 17dc25d

Please sign in to comment.