Skip to content

Synthesizers

Structs

struct PAF

Phase-Aligned Formant generator using a single phasor to synthesize multiple windows. From Miller Puckette's "Theory and Technique of Electronic Music," page 170.

Traits: AnyType, Copyable, ImplicitlyDeletable, Movable

PAF Parameters

Name Type Default Description
num_chans Int 1 Number of channels.
interp Interp Interp.linear Interpolation method. See Interp struct for options.
ov_samp TimesOversampling TimesOversampling.none A TimesOversampling struct to indicate times oversampling.
wrap_gaussian Bool False Whether to wrap indices that go out of bounds in the gaussian window. Puckette's design only uses half of the table, but enabling wrap_gaussian uses the entire table, resulting in a wider pallette of timbres.

PAF Functions

struct PAF . fn init

Initialize the phase-aligned formant synthesizer.

fn init Signature

def __init__(out self, world: UnsafePointer[MMMWorld, MutUntrackedOrigin])

fn init Arguments

Name Type Default Description
world UnsafePointer[MMMWorld, MutUntrackedOrigin] Pointer to the MMMWorld instance.

fn init Returns : Self

Static Method

This is a static method.

struct PAF . fn next

Generate the next synthesized sample.

fn next Signature

def next(mut self, fundamental: SIMD[DType.float64, num_chans] = 100, center_freq: SIMD[DType.float64, num_chans] = 440, bandwidth: SIMD[DType.float64, num_chans] = 1) -> SIMD[DType.float64, num_chans]

fn next Arguments

Name Type Default Description
fundamental SIMD[DType.float64, num_chans] 100 Fundamental frequency of the phasor.
center_freq SIMD[DType.float64, num_chans] 440 Center frequency of the formant.
bandwidth SIMD[DType.float64, num_chans] 1 Bandwidth.

fn next Returns : SIMD[DType.float64, num_chans] The next sample of the synthesizer output.


Documentation generated with mojo doc from Mojo version 1.0.0b2