pyFDN.td.GranularPitchShift#

class pyFDN.td.GranularPitchShift(channels, max_delay_samps, grain_dur_samps, transpose_cents, active_channels, fade_ratio=0.25, seed=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, on reaching grain_dur_samps, restarts at a new random position inside the buffer – trading the continuous read-head wraparound of PitchShift for grain-boundary clicks disguised by the envelope. Only active_channels are shifted; the rest pass through unchanged.

__init__(channels, max_delay_samps, grain_dur_samps, transpose_cents, active_channels, fade_ratio=0.25, seed=None)[source]#

Methods

__init__(channels, max_delay_samps, ...[, ...])

filter(block)

Filter one block and advance internal state.

process(signal, *[, squeeze])

Filter 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

filter(block)[source]#

Filter 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