Struct utils::signal::Signal
[−]
[src]
pub struct Signal<F> { pub val: F, pub bez_depth: F, pub freq: F, pub amp: F, // some fields omitted }
Signal generic struct for simplifying dsp signal generation. Signal should be able to handle any floating point primitive.
Fields
val: F
The main value. If Signal were to be plotted on a cartesian plane, this value would be 'x' for which we will solve 'y'.
bez_depth: F
Depth of the bezier curve.
freq: F
Frequency of the signal.
amp: F
Amplitude of the signal.
Methods
impl<F: Float + Rand> Signal<F>
[src]
fn new(val: F) -> Signal<F>
Constructor for Signal
fn set_val(&mut self, val: F)
Set value for which you will return signal (get_sin/cos/sqr/saw) etc...
fn set_gradient(&mut self, x: F, y: F)
If you woudl like to return the signal value on a slope, set gradient here.
fn set_freq(&mut self, freq: F)
Set frequency of signal.
fn set_amp(&mut self, amp: F)
Set amplitude of signal.
fn set_bez_depth(&mut self, bez_depth: F)
Set depth of bezier curve. Defaults to 0.
fn get_bezier(&self) -> F
Get signal with bezier curve.
fn get_result(&self, val: F) -> F
Get oscillator with amplitude and bezier.
fn get_sin(&self) -> F
Get sine wave signal result at val.
fn get_cos(&self) -> F
Get cosine wave signal result at val.
fn get_saw(&self) -> F
Get saw wave signal result at val.
fn get_sqr(&self) -> F
Get square wave signal result at val.
fn get_noise(&self) -> F
Get noise signal result at val.
fn get_noise_walk(&self) -> F
Ported implementation of _slang_library_noise1()
for our generic noise walk!
Trait Implementations
impl<F: Decodable> Decodable for Signal<F>
[src]
impl<F: Encodable> Encodable for Signal<F>
[src]
impl<F: Debug> Debug for Signal<F>
[src]
impl<F: Clone> Clone for Signal<F>
[src]
fn clone(&self) -> Signal<F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more