Skip to content

Commit 6779a0b

Browse files
committed
Simplify basic oscillographics demo
1 parent 6551f63 commit 6779a0b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

interactive/examples/basic_stereo_oscillographics.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@ use caw_modules::*;
77
use rgb_int::Rgb24;
88

99
fn signal_left(input: Input) -> Sig<impl SigT<Item = f32>> {
10-
let freq = 30.0
11-
+ (input.mouse.y_01() * 500.0)
12-
+ (oscillator(waveform::Triangle, 0.002)
13-
.reset_offset_01(0.25)
14-
.build());
15-
oscillator(waveform::Pulse, freq).build()
10+
let freq = 200.0 * input.mouse().y_01();
11+
oscillator(waveform::Sine, freq).build()
1612
}
1713

1814
fn signal_right(input: Input) -> Sig<impl SigT<Item = f32>> {
19-
let freq = 30.0
20-
+ (input.mouse.x_01() * 500.0)
21-
+ (oscillator(waveform::Triangle, -0.0013)
22-
.reset_offset_01(0.25)
23-
.build());
24-
oscillator(waveform::Pulse, freq).build()
15+
let freq = 300.0 * input.mouse().x_01();
16+
oscillator(waveform::Sine, freq)
17+
.reset_offset_01(0.25)
18+
.build()
2519
}
2620

2721
fn run() -> anyhow::Result<()> {

0 commit comments

Comments
 (0)