Skip to content

Commit 8991643

Browse files
committed
Modules has a top-level reverb function
1 parent 771f054 commit 8991643

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn main() {
7878
.resonance(input.mouse.y_01()),
7979
)
8080
.filter(chorus())
81-
.filter(reverb::default());
81+
.filter(reverb());
8282

8383
// Play the audio signal, visualizing its waveform in the window.
8484
window.play_mono(sig, Default::default()).unwrap();

caw/examples/simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() {
1919
.resonance(input.mouse.y_01()),
2020
)
2121
.filter(chorus())
22-
.filter(reverb::default());
22+
.filter(reverb());
2323

2424
// Play the audio signal, visualizing its waveform in the window.
2525
window.play_mono(sig, Default::default()).unwrap();

modules/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ pub mod reverb {
8282
pub use freeverb as default;
8383
}
8484

85+
// Rust doesn't seem to allow functions to be renamed to names that would conflict with module
86+
// names in the same scope, so this wrapper function appears ot be necessary.
87+
pub fn reverb() -> reverb_freeverb::Props<f32, f32, f32> {
88+
reverb_freeverb()
89+
}
90+
8591
pub mod sample_playback;
8692
pub use sample_playback::sample_playback;
8793

0 commit comments

Comments
 (0)