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)
5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
let mut syn = Synth::new();
let v = syn.new_synth(0.5, 440.0);
std::thread::sleep(Duration::from_secs(1));
syn.set_pitch_lerp(v, 220.0, 10.0);
std::thread::sleep(Duration::from_secs(10));
let mut f = 440.0f32;
for _i in 0..1000 {
f -= 0.1;
syn.set_pitch(v, f);
std::thread::sleep(Duration::from_millis(10));
}
}
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)
5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
let mut syn = Synth::new();
let v = syn.new_synth(0.5, 440.0);
std::thread::sleep(Duration::from_secs(1));
syn.set_pitch_lerp(v, 220.0, 10.0);
std::thread::sleep(Duration::from_secs(10));
let mut f = 440.0f32;
for _i in 0..1000 {
f -= 0.1;
syn.set_pitch(v, f);
std::thread::sleep(Duration::from_millis(10));
}
}
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)
5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
let mut syn = Synth::new();
let v = syn.new_synth(0.5, 440.0);
std::thread::sleep(Duration::from_secs(1));
syn.set_pitch_lerp(v, 220.0, 10.0);
std::thread::sleep(Duration::from_secs(10));
let mut f = 440.0f32;
for _i in 0..1000 {
f -= 0.1;
syn.set_pitch(v, f);
std::thread::sleep(Duration::from_millis(10));
}
}
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)
5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
let mut syn = Synth::new();
let v = syn.new_synth(0.5, 440.0);
std::thread::sleep(Duration::from_secs(1));
syn.set_pitch_lerp(v, 220.0, 10.0);
std::thread::sleep(Duration::from_secs(10));
let mut f = 440.0f32;
for _i in 0..1000 {
f -= 0.1;
syn.set_pitch(v, f);
std::thread::sleep(Duration::from_millis(10));
}
}
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