Delays
struct Delay¶
A variable delay line with interpolation.
Traits: AnyType, Copyable, Movable, Representable, UnknownDestructibility
Delay Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Size of the SIMD vector - defaults to 1. |
| interp | Int |
1 |
The interpolation method to use. See the struct Interp for interpolation options. |
Delay Functions¶
struct Delay . fn init¶
Initialize the Delay line.
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | A pointer to the MMMWorld. |
| max_delay_time | Float64 |
1 |
The maximum delay time in seconds. The internal buffer will be allocated to accommodate this delay. |
fn init Returns
: Self
Static Method
This is a static method.
struct Delay . fn read¶
Reads into the delay line.
fn read Signature
fn read Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| delay_time | SIMD |
— | The amount of delay to apply (in seconds). |
fn read Returns
: SIMD
A single sample read from the delay buffer.
struct Delay . fn write¶
Writes a single sampleinto the delay line.
fn write Signature
fn write Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | — |
struct Delay . fn next¶
Process one sample through the delay line, first reading from the delay then writing into it.
fn next Signature
next(mut self, input: SIMD[DType.float64, num_chans], var delay_time: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
— | The amount of delay to apply (in seconds). |
fn next Returns
: SIMD
The processed output sample.
struct Delay . fn get_f_idx¶
Calculate the fractional index in the delay buffer for the given delay time.
fn get_f_idx Signature
fn get_f_idx Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| delay_time | Float64 |
— | The delay time in seconds. |
fn get_f_idx Returns
: Float64
The fractional index in the delay buffer.
struct Comb¶
A simple comb filter using a delay line with feedback.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
Comb Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Size of the SIMD vector. |
| interp | Int |
2 |
The interpolation method to use. See the struct Interp for interpolation options. |
Comb Functions¶
struct Comb . fn init¶
Initialize the Comb filter.
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | A pointer to the MMMWorld. |
| max_delay | Float64 |
1 |
The maximum delay time in seconds. The internal buffer will be allocated to accommodate this delay. |
fn init Returns
: Self
Static Method
This is a static method.
struct Comb . fn next¶
Process one sample through the comb filter.
fn next Signature
next(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans] = 0, feedback: SIMD[DType.float64, num_chans] = 0) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
0 |
The amount of delay to apply (in seconds). |
| feedback | SIMD |
0 |
The amount of feedback to apply (-1.0 to 1.0). |
fn next Returns
: SIMD
The delayed output sample.
struct Comb . fn next_decaytime¶
Process one sample through the comb filter with decay time calculation.
fn next_decaytime Signature
next_decaytime(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans], decay_time: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
fn next_decaytime Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
— | The amount of delay to apply (in seconds). |
| decay_time | SIMD |
— | The desired decay time (time to -60dB). Feedback is calculated internally. |
fn next_decaytime Returns
: SIMD
The delayed output sample.
struct LP_Comb¶
A simple comb filter with an integrated one-pole low-pass filter.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
LP_Comb Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Size of the SIMD vector - defaults to 1. |
| interp | Int |
1 |
The interpolation method to use. See the struct Interp for interpolation options. |
LP_Comb Functions¶
struct LP_Comb . fn init¶
Initialize the LP_Comb filter.
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | A pointer to the MMMWorld. |
| max_delay | Float64 |
1 |
The maximum delay time in seconds. The internal buffer will be allocated to accommodate this delay. |
fn init Returns
: Self
Static Method
This is a static method.
struct LP_Comb . fn next¶
Process one sample through the comb filter.
fn next Signature
next(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans] = 0, feedback: SIMD[DType.float64, num_chans] = 0, lp_freq: SIMD[DType.float64, num_chans] = 0) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
0 |
The amount of delay to apply (in seconds). |
| feedback | SIMD |
0 |
The amount of feedback to apply (-1.0 to 1.0). |
| lp_freq | SIMD |
0 |
The cutoff frequency of the OnePole filter in the feedback loop. |
fn next Returns
: SIMD
The processed output sample.
struct Allpass_Comb¶
A simple allpass comb filter using a delay line with feedback.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
Allpass_Comb Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Size of the SIMD vector. |
| interp | Int |
1 |
The interpolation method to use. See the struct Interp for interpolation options. |
Allpass_Comb Functions¶
struct Allpass_Comb . fn init¶
Initialize the Allpass Comb filter.
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | A pointer to the MMMWorld. |
| max_delay | Float64 |
1 |
The maximum delay time in seconds. The internal buffer will be allocated to accommodate this delay. |
fn init Returns
: Self
Static Method
This is a static method.
struct Allpass_Comb . fn next¶
Process one sample through the allpass comb filter.
fn next Signature
next(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans] = 0, feedback_coef: SIMD[DType.float64, num_chans] = 0) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
0 |
The amount of delay to apply (in seconds). |
| feedback_coef | SIMD |
0 |
The feedback coefficient (-1.0 to 1.0). |
fn next Returns
: SIMD
The delayed/filtered output sample.
struct Allpass_Comb . fn next_decaytime¶
Process one sample through the allpass comb filter with decay time calculation.
fn next_decaytime Signature
next_decaytime(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans], decay_time: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
fn next_decaytime Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
— | The amount of delay to apply (in seconds). |
| decay_time | SIMD |
— | The desired decay time (time to -60dB). |
fn next_decaytime Returns
: SIMD
struct FB_Delay¶
A feedback delay structured like a Comb filter, but with possible feedback coefficient above 1 due to an integrated tanh function.
By default, Anti-aliasing is disabled and no oversampling is applied, but this can be changed by setting the ADAA_dist and os_index template parameters.
Traits: AnyType, Copyable, Movable, Representable, UnknownDestructibility
FB_Delay Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| num_chans | Int |
1 |
Size of the SIMD vector. |
| interp | Int |
4 |
The interpolation method to use. See the struct Interp for interpolation options. |
| ADAA_dist | Bool |
False |
Whether to apply ADAA distortion to the feedback signal instead of standard tanh. |
| os_index | Int |
0 |
The oversampling index for ADAA distortion. 0 = no oversampling, 1 = 2x, 2 = 4x, 3 = 8x, 4 = 16x. |
FB_Delay Functions¶
struct FB_Delay . fn init¶
Initialize the FB_Delay.
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | A pointer to the MMMWorld. |
| max_delay | Float64 |
1 |
The maximum delay time in seconds. The internal buffer will be allocated to accommodate this delay. |
fn init Returns
: Self
Static Method
This is a static method.
struct FB_Delay . fn next¶
Process one sample or SIMD vector through the feedback delay.
fn next Signature
next(mut self, input: SIMD[DType.float64, num_chans], delay_time: SIMD[DType.float64, num_chans], feedback: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | The input sample to process. |
| delay_time | SIMD |
— | The amount of delay to apply (in seconds). |
| feedback | SIMD |
— | The amount of feedback to apply (0.0 to 1.0). |
fn next Returns
: SIMD
The processed output sample or SIMD vector.
(Functions that are not associated with a Struct)
fn calc_feedback¶
Calculate the feedback coefficient for a Comb filter or Allpass line based on desired delay time and decay time.
Signature
calc_feedback[num_chans: Int = 1](delaytime: SIMD[DType.float64, num_chans], decaytime: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
Size of the SIMD vector - defaults to 1. |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| delaytime | SIMD |
— | The delay time in seconds. |
| decaytime | SIMD |
— | The decay time in seconds (time to -60dB). |
Returns
Type: SIMD
Documentation generated with mojo doc from Mojo version 0.25.6.1