pub struct Synth {
pub channel_count: usize,
pub next_synth: usize,
/* private fields */
}
Fields§
§channel_count: usize
§next_synth: usize
Implementations§
Source§impl Synth
impl Synth
Sourcepub fn new() -> Synth
pub fn new() -> Synth
Examples found in repository?
More examples
examples/smooth_pitch.rs (line 6)
5fn main() {
6 let mut syn = Synth::new();
7 let v = syn.new_synth(0.5, 440.0);
8 std::thread::sleep(Duration::from_secs(1));
9 syn.set_pitch_lerp(v, 220.0, 10.0);
10 std::thread::sleep(Duration::from_secs(10));
11 let mut f = 440.0f32;
12 for _i in 0..1000 {
13 f -= 0.1;
14 syn.set_pitch(v, f);
15 std::thread::sleep(Duration::from_millis(10));
16 }
17}
pub fn get_sinks() -> SinkList
pub fn new_on_sink(audio_sink: impl Into<Device>) -> Synth
Sourcepub fn new_synth(&mut self, volume: f32, pitch: f32) -> SynthId
pub fn new_synth(&mut self, volume: f32, pitch: f32) -> SynthId
Examples found in repository?
More examples
examples/smooth_pitch.rs (line 7)
5fn main() {
6 let mut syn = Synth::new();
7 let v = syn.new_synth(0.5, 440.0);
8 std::thread::sleep(Duration::from_secs(1));
9 syn.set_pitch_lerp(v, 220.0, 10.0);
10 std::thread::sleep(Duration::from_secs(10));
11 let mut f = 440.0f32;
12 for _i in 0..1000 {
13 f -= 0.1;
14 syn.set_pitch(v, f);
15 std::thread::sleep(Duration::from_millis(10));
16 }
17}
Sourcepub fn set_volume(&mut self, synth: SynthId, volume: f32)
pub fn set_volume(&mut self, synth: SynthId, volume: f32)
pub fn set_volume_lerp(&mut self, synth: SynthId, volume: f32, lerp_time: f32)
Sourcepub fn set_pitch(&mut self, synth: SynthId, pitch: f32)
pub fn set_pitch(&mut self, synth: SynthId, pitch: f32)
Examples found in repository?
More examples
examples/smooth_pitch.rs (line 14)
5fn main() {
6 let mut syn = Synth::new();
7 let v = syn.new_synth(0.5, 440.0);
8 std::thread::sleep(Duration::from_secs(1));
9 syn.set_pitch_lerp(v, 220.0, 10.0);
10 std::thread::sleep(Duration::from_secs(10));
11 let mut f = 440.0f32;
12 for _i in 0..1000 {
13 f -= 0.1;
14 syn.set_pitch(v, f);
15 std::thread::sleep(Duration::from_millis(10));
16 }
17}
Sourcepub fn set_pitch_lerp(&mut self, synth: SynthId, pitch: f32, lerp_time: f32)
pub fn set_pitch_lerp(&mut self, synth: SynthId, pitch: f32, lerp_time: f32)
Examples found in repository?
examples/smooth_pitch.rs (line 9)
5fn main() {
6 let mut syn = Synth::new();
7 let v = syn.new_synth(0.5, 440.0);
8 std::thread::sleep(Duration::from_secs(1));
9 syn.set_pitch_lerp(v, 220.0, 10.0);
10 std::thread::sleep(Duration::from_secs(10));
11 let mut f = 440.0f32;
12 for _i in 0..1000 {
13 f -= 0.1;
14 syn.set_pitch(v, f);
15 std::thread::sleep(Duration::from_millis(10));
16 }
17}
pub fn set_channel_mask(&mut self, synth: SynthId, channel_mask: ChannelMask)
pub fn set_channel_mask_lerp( &mut self, synth: SynthId, channel_mask: ChannelMask, lerp_time: f32, )
Auto Trait Implementations§
impl Freeze for Synth
impl !RefUnwindSafe for Synth
impl !Send for Synth
impl !Sync for Synth
impl Unpin for Synth
impl !UnwindSafe for Synth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more