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).
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.
- 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_msfrom 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_grainsgrains, ensuring smooth transitions. - Stereo support – convolution is performed per channel, so stereo sources remain stereo throughout.
Quick start
- In Praat, select exactly one Sound object (mono or stereo).
- Run script… →
Self_Adaptive_Sieve_Convolution.praat. - Choose a Preset:
- Subtle Shimmer, Dense Reverb, Micro Pulse, Slow Morph, Prime Sieve, Sparse Scatter, Dissolve
- 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.
- Click OK. The script processes the source, creates an output buffer, and imports the result as
SieveConv_originalname.
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)
| Preset | Grain (ms) | Hop frac | Tail (ms) | IR (ms) | Sieve A | Sieve B | Update | Description | |||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Subtle Shimmer | 25 | 0.5 | 60 | 150 | mod3=0 | mod5=2 | 200 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Dense Reverb | 80 | 0.5 | 150 | 500 | mod2=0 | mod3=1 | 50 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Micro Pulse | 10 | 0.25 | 40 | 80 | mod3=0 | mod4=1 | 150 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Slow Morph | 150 | 0.75 | 200 | 600 | mod4=0 | mod7=3 | 300 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Prime Sieve | 50 | 0.5 | 100 | 300 | mod2=0 | mod3=1 | 100 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Sparse Scatter | 60 | 0.5 | 120 | 350 | mod7=0 | mod11=3 | 120 | 。||||||||||||||||||||||||||||||||||||||||||||||||
| Dissolve | 100 | 。<0.6 | 150 | 400 | mod3=1 | mod5=0 | 250 | 。
Sieve routing – modular arithmetic conditions
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:
- m=2, r=0 – hits every even grain (0, 2, 4, 6, …).
- m=3, r=1 – hits grains 1, 4, 7, 10, …
- m=7, r=3 – sparse, hits grains 3, 10, 17, 24, …
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
- At the initial harvest (or at an update), the script finds the next grain index that satisfies the sieve condition.
- It extracts a segment of length
ir_msfrom that grain’s start time. - The segment is high‑pass filtered (
ir_hp_hz) to remove tonal content, leaving only noise/transient character. - RMS is normalised to
ir_rms_db(e.g., -18 dBFS) to keep IR levels consistent. - 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
| Parameter | Range | Default | Description | |||||
|---|---|---|---|---|---|---|---|---|
| Segment_ms | 10–500 | 50 | 。||||||
| Hop_fraction | 0.1–1.0 | 0.5 | 。||||||
| Tail_ms | 0–1000 | 100 | 。
IR parameters
Sieve parameters
Adaptive IR updates
Output
Visualization (Praat picture)
When Draw_visualization = 1, the script draws a 4‑panel figure on an 8‑inch canvas:
- Source waveform (grey).
- Output waveform (blue) with:
- Red ticks at the top/bottom edges = Sieve A hits.
- Green ticks = Sieve B hits.
- Full‑height red vertical lines = IR_A adaptive updates.
- Full‑height green vertical lines = IR_B adaptive updates.
- Output spectrogram (0–5 kHz).
- Summary panel – colour key, grain counts, sieve hit statistics, IR parameters, adaptive update settings.
FAQ / troubleshooting
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.
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.
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.
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.
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.
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.