pub struct BandLimited<T, O = BandLimWide> { /* private fields */ }
Expand description

Bandwidth-Limited Pulse Buffer implementation with high-pass and low-pass filtering, for an efficient band-limited synthesis.

T specifies pulse step amplitude unit types. Currently, implementations are provided for: f32, i16, and i32.

Implementations§

Clears buffered data and resets frame start to default.

Shrinks the excessive capacity of the buffer as much as possible.

Ensures the frame buffer length is large enough to fit data for the specified frame_time with additional margin_time.

Sets the duration of the average frame to frame_time which should be specified with as much precision as possible.

margin_time specifies a frame duration fluctuation margin and should be significantly smaller than frame_time.

Both frame_time and margin_time are specified in the sample time units (1.0 = 1 audio sample).

Returns true if BandLimited::end_frame has been called before the call to BandLimited::next_frame.

It indicates if audio samples can be digitized from the last frame data.

Finalizes audio frame.

Returns the number of audio samples, single channel-wise, which are ready to be produced from the frame.

time_end is specified in the sample time units (1.0 = 1 audio sample).

Returns a new instance of BandLimited buffer.

  • channels - specifies the maximum number of audio channels that the sound can be rendered for.

Before any pulse steps are added to the buffer the method BandLimited::set_frame_time or Blep::ensure_frame_time must be called first.

Panics

Panics if channels equals to 0.

Prepares the buffer for the next audio frame.

This method must be called after the call to BandLimited::end_frame or to Blep::end_frame and optionally after audio data has been produced with BandLimited::sum_iter.

Returns an iterator that produces audio samples in the specified sample format S from the specified channel.

This method must be called after the call to BandLimited::end_frame or Blep::end_frame and before BandLimited::next_frame.

Trait Implementations§

A type for sample ∆ amplitudes (pulse height).
This method allows the Blep implementation to reserve enough memory for the audio frame with an additional margin and to set up a sample time rate and other internals. Read more
Finalizes audio frame. Read more
This method is being used to add square-wave pulse steps within a boundary of a single frame. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert to S a sample type from self.
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.