struct Latch¶
Traits: AnyType, Copyable, Movable, Representable, UnknownDestructibility
Latch Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Latch Functions¶
struct Latch . fn init¶
fn init Signature
fn init Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| world | UnsafePointer |
— | — |
fn init Returns
: Self
Static Method
This is a static method.
struct Latch . fn next¶
fn next Signature
next(mut self, in_samp: SIMD[DType.float64, num_chans], trig: SIMD[DType.bool, num_chans]) -> SIMD[DType.float64, num_chans]
fn next Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| in_samp | SIMD |
— | — |
| trig | SIMD |
— | — |
fn next Returns
: SIMD
struct HardClipAD¶
Anti-Derivative Anti-Aliasing hard-clipping function.
This struct provides first and second order anti-aliased versions of the hard_clip function using the Anti-Derivative Anti-Aliasing (ADAA)
Params:
num_chans: The number of channels for SIMD operations.
Methods:
next1(x: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]:
Computes the first order anti-aliased `hard_clip` of `x`.
next2(x: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]:
Computes the second order anti-aliased `hard_clip` of `x`.
Traits: AnyType, Copyable, Movable, UnknownDestructibility
HardClipAD Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
HardClipAD Functions¶
struct HardClipAD . fn init¶
struct HardClipAD . fn next1¶
Computes the first-order anti-aliased hard_clip of x.
fn next1 Signature
fn next1 Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| x | SIMD |
— | The input sample. |
fn next1 Returns
: SIMD
The anti-aliased hard_clip of x.
struct HardClipAD . fn next2¶
Computes the second-order anti-aliased hard_clip of x.
fn next2 Signature
fn next2 Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| x | SIMD |
— | The input sample. |
fn next2 Returns
: SIMD
The anti-aliased hard_clip of x.
struct TanhAD¶
Anti-Derivative Anti-Aliasing first order tanh function. This struct provides anti-aliased versions of the tanh function using the Anti-Derivative Anti-Aliasing (ADAA) method. It currently implements the first-order ADAA function next1.
Methods:
init(): Initializes the TanhAD struct.
next1(x: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]:
Computes the first-order anti-aliased `tanh` of `x`.
This method should be called iteratively for each sample.
Example: var tanhad = TanhAD1 var output = tanhad.next1(input_sample)
tanhad.next1(x: SIMD[DType.float64, num_chans]).
Traits: AnyType, Copyable, Movable, UnknownDestructibility
TanhAD Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
The number of channels for SIMD operations. |
TanhAD Functions¶
struct TanhAD . fn init¶
struct TanhAD . fn next1¶
Computes the first-order anti-aliased tanh of x. This method should be called iteratively for each sample.
fn next1 Signature
fn next1 Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| x | SIMD |
— | The input sample. |
fn next1 Returns
: SIMD
The anti-aliased tanh of x.
(Functions that are not associated with a Struct)
fn bitcrusher¶
Signature
bitcrusher[num_chans: Int](in_samp: SIMD[DType.float64, num_chans], bits: Int64) -> SIMD[DType.float64, num_chans]
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| in_samp | SIMD |
— | — |
| bits | Int64 |
— | — |
Returns
Type: SIMD
fn buchla_cell¶
Implements the Buchla cell function
Signature
buchla_cell[num_chans: Int](sig: SIMD[DType.float64, num_chans], sign: SIMD[DType.float64, num_chans], thresh: SIMD[DType.float64, num_chans], sig_mul1: SIMD[DType.float64, num_chans], sign_mul: SIMD[DType.float64, num_chans], sig_mul2: SIMD[DType.float64, num_chans]) -> SIMD[DType.float64, num_chans]
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| sig | SIMD |
— | — |
| sign | SIMD |
— | — |
| thresh | SIMD |
— | — |
| sig_mul1 | SIMD |
— | — |
| sign_mul | SIMD |
— | — |
| sig_mul2 | SIMD |
— | — |
Returns
Type: SIMD
fn sign¶
Returns the sign of x: -1, 0, or 1
Signature
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| x | SIMD |
— | — |
Returns
Type: SIMD
fn buchla_wavefolder¶
Buchla waveshaper implementation
Signature
buchla_wavefolder[num_chans: Int](input: SIMD[DType.float64, num_chans], var amp: Float64) -> SIMD[DType.float64, num_chans]
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | SIMD |
— | signal in - between 0 and +/-40. |
| amp | Float64 |
— | Amplitude/gain control (0.001 to 20 in original) |
Returns
Type: SIMD
Waveshaped output signal
fn hard_clip¶
Signature
Parameters
| Name | Type | Description |
|---|---|---|
| num_chans | Int |
— |
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| x | SIMD |
— | — |
Returns
Type: SIMD
Documentation generated with mojo doc from Mojo version 0.25.6.1