pyFDN.td.GranularPitchShift#

class pyFDN.td.GranularPitchShift(channels, *, max_delay, grain_length, transpose_cents, fade_ratio=0.25, active_channels=None, rng=None)[source]#

Stateful, controllable granular pitch shifter.

Two grains, triggered half a grain apart, read a shared per-channel circular buffer at a rate set by transpose_cents. Each grain is windowed by a raised-cosine envelope and, after grain_length samples, restarts at a new random position inside the max_delay-sample buffer – trading the continuous read-head wraparound of PitchShift for grain-boundary clicks disguised by the envelope. Only active_channels (default all) are shifted; the rest pass through unchanged.

__init__(channels, *, max_delay, grain_length, transpose_cents, fade_ratio=0.25, active_channels=None, rng=None)[source]#

Methods

__init__(channels, *, max_delay, ...[, ...])

impulse_response(ir_len)

Impulse response from zero state, one Dirac per input channel.

process_block(block)

Process one block and advance internal state.

process_signal(signal, *[, squeeze])

Process a whole signal in one call, from the current state.

reset()

Clear internal state (no-op for stateless operators).

set_transpose_cents(cents)

Attributes

in_channels

out_channels

process_block(block)[source]#

Process one block and advance internal state.

Return type:

ndarray

reset()[source]#

Clear internal state (no-op for stateless operators).

Return type:

None

set_transpose_cents(cents)[source]#
Return type:

None