Self-Adaptive Sieve Convolution — User Guide

Number‑theoretic sieve convolution. Each grain of the source is routed through one of two impulse responses (IR_A or IR_B) based on modular arithmetic conditions, or passed through dry. IRs are harvested live from the source material and crossfaded on an adaptive schedule, so the convolution character evolves continuously with the source. Supports stereo/multi‑channel inputs (per‑channel convolution).

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: 5.1 (2026) License: MIT License Repo: GitHub
Contents:

What this does

Self-Adaptive Sieve Convolution is a granular convolution processor that uses number‑theoretic sieve conditions to route grains through two impulse responses (IRs) or directly to output (dry). The IRs are harvested live from the source material – the algorithm extracts short segments (IRs) from the source at positions determined by the same sieve conditions, then convolves subsequent grains with those IRs. Adaptive re‑harvesting occurs periodically, and new IRs are crossfaded into the active ones, creating a slowly evolving convolution texture that remains tightly coupled to the source’s spectral character.

Key concepts:
  • Sieve A and Sieve B – two independent modular arithmetic conditions: grain_index mod m = r. Grains that satisfy the condition are routed to the corresponding IR (A or B). Grains that satisfy neither are dry (directly mixed).
  • IR harvesting – when the adaptive update interval is reached, the script finds the next grain index that satisfies the sieve condition, extracts a segment of length ir_ms from that position, high‑pass filters it (to remove tonal content), RMS‑normalises, and applies fades.
  • Crossfade blending – new IRs are blended with the previous ones over crossfade_grains grains, ensuring smooth transitions.
  • Stereo support – convolution is performed per channel, so stereo sources remain stereo throughout.

Quick start

  1. In Praat, select exactly one Sound object (mono or stereo).
  2. Run script…Self_Adaptive_Sieve_Convolution.praat.
  3. Choose a Preset:
    • Subtle Shimmer, Dense Reverb, Micro Pulse, Slow Morph, Prime Sieve, Sparse Scatter, Dissolve
  4. For custom mode (preset = Custom), adjust parameters as desired:
    • Segment_ms – grain length.
    • Hop_fraction – overlap between grains (0–1).
    • Tail_ms – extra reverb tail after each grain.
    • Ir_ms – length of harvested impulse responses.
    • Ir_rms_db – target RMS level for IRs (‑18 dB typical).
    • Ir_hp_hz – high‑pass cutoff for IRs (removes tonal content).
    • Sieve_a_mod / Sieve_a_rem – modulus and remainder for Sieve A.
    • Sieve_b_mod / Sieve_b_rem – for Sieve B.
    • Adaptive_updates – enable periodic IR re‑harvesting.
    • Update_interval – how many grains between updates.
    • Crossfade_grains – blending length for new IRs.
  5. Click OK. The script processes the source, creates an output buffer, and imports the result as SieveConv_originalname.
Tip: Start with Prime Sieve (mod 2 and 3) for a classic 2‑voice texture. Dissolve (mod 3/5 with slow adaptive updates) creates a gradual spectral morph. For dense, reverb‑like textures, try Dense Reverb (large IR, short hop).
Important: This effect is implemented entirely in Praat – no Python required. Convolution is performed with Praat’s Convolve command. Processing time depends on the number of grains and IR length; for long sources (e.g., 60 s, 50 ms grains ≈ 1200 grains), processing may take 1–2 minutes.

The 7 presets (+ Custom)

PresetGrain (ms)Hop fracTail (ms)IR (ms)Sieve ASieve BUpdateDescription
Subtle Shimmer250.560150mod3=0mod5=2200
Dense Reverb800.5150500mod2=0mod3=150
Micro Pulse100.254080mod3=0mod4=1150
Slow Morph1500.75200600mod4=0mod7=3300
Prime Sieve500.5100300mod2=0mod3=1100
Sparse Scatter600.5120350mod7=0mod11=3120
Dissolve100。<0.6150400mod3=1mod5=0250

Sieve routing – modular arithmetic conditions

Grain index n (0‑based):
Sieve A hit: n mod m₁ = r₁
Sieve B hit: n mod m₂ = r₂
Priority: If both conditions are true for a grain, Sieve A takes precedence (A > B). If neither is true, the grain passes dry (no convolution).
IR harvesting positions: When adaptive updates are enabled, the script finds the next grain index that satisfies each sieve condition, then extracts the IR from that grain’s start position. This ensures that IRs are always taken from source material that will later be convolved with that same sieve – a self‑referential loop.

Examples:

The visualisation shows red ticks for Sieve A hits and green ticks for Sieve B hits at the bottom and top edges of the output waveform. IR updates are marked as full‑height vertical lines (red for IR_A, green for IR_B).

IR harvesting & adaptive updates

🎛️ How IRs are created

  1. At the initial harvest (or at an update), the script finds the next grain index that satisfies the sieve condition.
  2. It extracts a segment of length ir_ms from that grain’s start time.
  3. The segment is high‑pass filtered (ir_hp_hz) to remove tonal content, leaving only noise/transient character.
  4. RMS is normalised to ir_rms_db (e.g., -18 dBFS) to keep IR levels consistent.
  5. Short fades (5 ms in, 10 ms out) are applied to avoid clicks.

When Adaptive_updates is on, every update_interval grains the script repeats this process. The new IR is crossfaded with the old one over crossfade_grains grains, creating a smooth spectral evolution.

The harvested IRs are not tonal – they capture the noise, transients, and resonance of the source at that moment. Convolving a grain with these IRs imparts the source’s own spectral character back onto itself, creating a self‑similar, evolving texture.

Parameters & defaults

Grain parameters

ParameterRangeDefaultDescription
Segment_ms10–50050
Hop_fraction0.1–1.00.5
Tail_ms0–1000100

IR parameters

ParameterRangeDefaultDescription Ir_ms20–2000300。 Ir_rms_db-30–0-18。 Ir_hp_hz50–2000500。 Dry_gain0–10.8。

Sieve parameters

ParameterRangeDefaultDescription Sieve_a_mod / Sieve_a_rem1–20 / 0..mod‑13 / 0。 Sieve_b_mod / Sieve_b_rem1–20 / 0..mod‑15 / 2。

Adaptive IR updates

ParameterRangeDefaultDescription Adaptive_updatesyes/noyes。 Update_interval10–1000100。 Crossfade_grains1–10010。

Output

ParameterDefaultDescription Draw_visualizationyes。 Play_resultyes。

Visualization (Praat picture)

When Draw_visualization = 1, the script draws a 4‑panel figure on an 8‑inch canvas:

Tip: The vertical IR update lines show exactly where the convolution character changes. If you see many updates, the texture will evolve rapidly; few updates produce a more stable texture.

FAQ / troubleshooting

“Could not find a valid IR harvest location”

The script requires that the sieve conditions eventually land on a grain position that leaves enough room for the IR (at least 25 % of ir_ms). If the source is very short, increase ir_ms or adjust the sieve parameters to hit earlier positions. The error message includes the sieve being searched – you may need to increase the source duration or use a larger hop.

Output is silent / very quiet

Check the Dry_gain – if it’s set to 0 and few grains hit the sieves, output may be near‑silent. Also ensure that the harvested IRs have non‑zero energy – if the source is very quiet at the harvest positions, increase ir_rms_db (e.g., to -12 dB) to boost the IR level.

Processing is very slow

Convolution is the main cost. Reduce Ir_ms (shorter IRs), increase Segment_ms (fewer grains), or increase Hop_fraction (larger hop, fewer grains). The preset Micro Pulse uses very short grains and IRs for fast preview.

Why high‑pass filter the IRs?

If the IRs contained strong tonal content (e.g., a sustained pitch), convolution would impart that pitch onto every grain, creating a ringing, organ‑like effect. High‑pass filtering removes the tonal foundation, leaving only the noise/transient envelope – the convolution then sounds like the source’s own texture reflected back.

Sieve precedence

If a grain satisfies both sieve conditions, Sieve A takes priority. This is a design choice – you can swap the mod/rem values to change which sieve dominates when they collide.

Stereo handling

Convolution is performed per channel using Praat’s Convolve on multi‑channel sounds. The IRs are harvested as multi‑channel (if the source is stereo), preserving the original channel relationships. The output buffer matches the source’s channel count.