[−][src]Struct twang::Signal
A signed digital audio signal that can be routed through processing
components. This differs from Mono64
in that the values are not clamped
between -1 and 1.
Implementations
impl Signal
[src]
pub fn sine(self) -> Self
[src]
Sine wave generator component - takes a sawtooth (Fc
) wave.
pub fn triangle(self) -> Self
[src]
Triangle wave generator component - takes a sawtooth (Fc
) wave.
pub fn pulse<S: Into<Self>>(self, half_duty: S) -> Self
[src]
Pulse wave generator component - takes a sawtooth (Fc
) wave.
half_duty
: ½ Duty cycle - range: 0~1 (1.0 for square wave)
pub fn shift<S: Into<Self>>(self, amount: S) -> Self
[src]
Shift signal. Takes a signal and adds an amount to it, wrapping to -1 if it goes over 1, and to 1 if it goes under -1.
pub fn gain<S: Into<Self>>(self, volume: S) -> Self
[src]
Increase (amplify) or decrease the gain of the signal.
pub fn invert(self) -> Self
[src]
Invert (negate) signal.
pub fn abs(self) -> Self
[src]
Absolute value of signal.
pub fn min<S: Into<Self>>(self, limit: S) -> Self
[src]
The minimum of two signals.
pub fn max<S: Into<Self>>(self, limit: S) -> Self
[src]
The maximum of two signals.
pub fn gate<S: Into<Self>>(self, limit: S) -> Self
[src]
Apply noise gate by side-chaining a the cutoff signal level
pub fn pow<S: Into<Self>>(self, exp: S) -> Self
[src]
Raise a signal to a power. This can be used to get the x
root of a
signal as well with 1 / x
.
pub fn clip_soft<S: Into<Self>>(self, volume: S) -> Self
[src]
Amplify a signal with soft clipping.
pub fn clamp(self) -> Self
[src]
Clamp a signal -1 to 1 (hard clipping)
pub fn to_mono(self) -> Mono<Ch64>
[src]
Convert signal into Mono channel.
Trait Implementations
impl Clone for Signal
[src]
impl Copy for Signal
[src]
impl Debug for Signal
[src]
impl From<Signal> for f64
[src]
impl From<f64> for Signal
[src]
Auto Trait Implementations
impl RefUnwindSafe for Signal
[src]
impl Send for Signal
[src]
impl Sync for Signal
[src]
impl Unpin for Signal
[src]
impl UnwindSafe for Signal
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,