pub struct BasicOscillator<T: Transcendental> { /* private fields */ }Expand description
Базовый осциллятор
Генерирует различные формы волн с возможностью:
- Изменения частоты в реальном времени
- Модуляции частоты (FM)
- Анти-алиасинга для пилообразной волны
- Синхронизации фазы
Implementations§
Source§impl<T: Transcendental> BasicOscillator<T>
impl<T: Transcendental> BasicOscillator<T>
Sourcepub fn new(waveform: Waveform, frequency: f32, amplitude: T) -> Self
pub fn new(waveform: Waveform, frequency: f32, amplitude: T) -> Self
Создать новый осциллятор
§Arguments
waveform- форма волныfrequency- частота в Hzamplitude- амплитуда (0.0 - 1.0)
Sourcepub fn reset_phase(&mut self)
pub fn reset_phase(&mut self)
Сбросить фазу в 0
Sourcepub fn current_phase(&self) -> T
pub fn current_phase(&self) -> T
Получить текущую фазу (0..1)
Sourcepub fn period_count(&self) -> u32
pub fn period_count(&self) -> u32
Получить количество завершённых периодов
Sourcepub fn set_pulse_width(&mut self, width: f32)
pub fn set_pulse_width(&mut self, width: f32)
Установить ширину импульса (для Pulse волны)
Trait Implementations§
Source§impl<T: Transcendental> Algorithm<T> for BasicOscillator<T>
impl<T: Transcendental> Algorithm<T> for BasicOscillator<T>
Source§fn process(
&mut self,
input: Option<&[T]>,
output: &mut [T],
_ctx: &ActionContext<'_>,
) -> ProcessResult<()>
fn process( &mut self, input: Option<&[T]>, output: &mut [T], _ctx: &ActionContext<'_>, ) -> ProcessResult<()>
Process one block of audio. Read more
Source§fn metadata(&self) -> AlgorithmMetadata
fn metadata(&self) -> AlgorithmMetadata
Descriptive metadata (defaults to empty).
Source§fn apply_command(&mut self, _value: T)
fn apply_command(&mut self, _value: T)
Receive a real-time command value from the control path. Read more
Source§impl<T: Clone + Transcendental> Clone for BasicOscillator<T>
impl<T: Clone + Transcendental> Clone for BasicOscillator<T>
Source§fn clone(&self) -> BasicOscillator<T>
fn clone(&self) -> BasicOscillator<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Transcendental> Generator<T> for BasicOscillator<T>
impl<T: Transcendental> Generator<T> for BasicOscillator<T>
Source§fn set_frequency(&mut self, freq: f32)
fn set_frequency(&mut self, freq: f32)
Установить частоту
Source§fn set_amplitude(&mut self, amp: T)
fn set_amplitude(&mut self, amp: T)
Установить амплитуду
Source§fn reset_phase(&mut self)
fn reset_phase(&mut self)
Сбросить фазу в 0
Source§impl<T: Transcendental> ModulatableGenerator<T> for BasicOscillator<T>
impl<T: Transcendental> ModulatableGenerator<T> for BasicOscillator<T>
Source§fn modulate_frequency(&mut self, amount: T)
fn modulate_frequency(&mut self, amount: T)
Применить модуляцию частоты Read more
Source§fn modulation_index(&self) -> T
fn modulation_index(&self) -> T
Индекс модуляции (текущая величина FM)
Source§fn set_modulation_index(&mut self, index: T)
fn set_modulation_index(&mut self, index: T)
Установить индекс модуляции
Source§impl<T: Transcendental> SyncableGenerator<T> for BasicOscillator<T>
impl<T: Transcendental> SyncableGenerator<T> for BasicOscillator<T>
impl<T: Copy + Transcendental> Copy for BasicOscillator<T>
Auto Trait Implementations§
impl<T> Freeze for BasicOscillator<T>where
T: Freeze,
impl<T> RefUnwindSafe for BasicOscillator<T>where
T: RefUnwindSafe,
impl<T> Send for BasicOscillator<T>
impl<T> Sync for BasicOscillator<T>
impl<T> Unpin for BasicOscillator<T>where
T: Unpin,
impl<T> UnsafeUnpin for BasicOscillator<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for BasicOscillator<T>where
T: UnwindSafe,
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