Self-Adaptive Sieve Convolution — User Guide
Granular convolution in which modular sieve rules route each source grain to one of two source-derived impulse responses or to a dry path, with optional adaptive IR harvesting and crossfading.
What this does
Self-Adaptive Sieve Convolution divides the source into overlapping grains and classifies each grain using two modular sieve rules. A grain that matches Sieve A is convolved with IR_A; a grain that matches Sieve B is convolved with IR_B; all other grains pass through the dry route. Both impulse responses are harvested from the source itself, so the processor continually reuses the sound's own material as convolution kernels.
When Adaptive updates is enabled, new source-derived IRs are harvested during the run and crossfaded against the previous IRs. The result is a deterministic, source-dependent granular convolution texture whose routing pattern is controlled by modular arithmetic rather than random choice.
What is a sieve?
Here, a sieve is a periodic selection rule on the grain number n:
For example, n mod 3 = 0 selects grain indices 0, 3, 6, 9... . A remainder outside the legal range is automatically folded modulo its modulus, so a remainder of 5 with modulus 3 becomes 2.
The two rules create interlocking periodic routes through the grain stream. The script uses these elementary congruence classes directly; it does not implement the full Boolean union/intersection/complement algebra of Xenakis's general sieve theory.
Quick start
- Select exactly one Sound.
- Run
Self_Adaptive_Sieve_Convolution.praat. - Start with Subtle Shimmer or Dense Reverb.
- Listen to the relation between Segment_ms, Hop_fraction and the two sieve patterns.
- Use Adaptive_updates when you want the source-derived IR colour to evolve through the file.
- Read the visualization: top/bottom ticks mark A/B routes; full vertical lines mark IR updates.
Presets
| Preset | Grain / hop | IR / HP | A sieve | B sieve | Adaptive schedule |
|---|---|---|---|---|---|
| Custom | 50 ms / 0.50 | 300 ms / 500 Hz | 3 / 0 | 5 / 2 | 100 grains / 10-grain crossfade |
| Subtle Shimmer | 25 ms / 0.50 | 150 ms / 500 Hz | 3 / 0 | 5 / 2 | 200 / 20 |
| Dense Reverb | 80 ms / 0.50 | 500 ms / 300 Hz | 2 / 0 | 3 / 1 | 50 / 5 |
| Micro Pulse | 10 ms / 0.25 | 80 ms / 600 Hz | 3 / 0 | 4 / 1 | 150 / 15 |
| Slow Morph | 150 ms / 0.75 | 600 ms / 200 Hz | 4 / 0 | 7 / 3 | 300 / 30 |
| Prime Sieve | 50 ms / 0.50 | 300 ms / 500 Hz | 2 / 0 | 3 / 1 | 100 / 10 |
| Sparse Scatter | 60 ms / 0.50 | 350 ms / 500 Hz | 7 / 0 | 11 / 3 | 120 / 12 |
| Dissolve | 100 ms / 0.60 | 400 ms / 400 Hz | 3 / 1 | 5 / 0 | 250 / 40 |
Presets also set Tail_ms and Dry_gain. Slow Morph and Dissolve deliberately use non-COLA hop placements; the resulting inter-grain pulsation is part of their preset character.
Controls
| Control | Default | Meaning |
|---|---|---|
| Segment_ms | 50 | Source grain length. Grains are extracted with a Hanning window. |
| Hop_fraction | 0.5 | Hop = segment duration × this fraction. Must be greater than zero. |
| Tail_ms | 100 | Maximum retained convolution tail per wet grain; final buffer is source duration + this tail. |
| Ir_ms | 300 | Duration of each source-harvested impulse response. |
| Ir_hp_hz | 500 | Optional high-pass applied to harvested IRs. 0 Hz bypasses the filter. |
| Dry_gain | 0.8 | Gain for grains that hit neither sieve. |
| Sieve_a_mod / rem | 3 / 0 | Elementary congruence selecting A grains. |
| Sieve_b_mod / rem | 5 / 2 | Elementary congruence selecting B grains. |
| Adaptive_updates | On | Periodically harvest fresh A/B IRs from later source positions. |
| Update_interval | 100 grains | How often the script attempts a new adaptive harvest. |
| Crossfade_grains | 10 | Number of routed grains over which old and new IRs are blended. |
Processing pipeline
- Read source duration, sample rate, channels and original start time.
- Find valid sieve-consistent locations for the initial IR_A and IR_B.
- Harvest each IR from the source, optionally high-pass it, apply short edge fades and an internal conditioning level.
- Create a silent multichannel output buffer of
source duration + Tail_ms. - Walk the source on the grain-hop grid; an end-anchored final grain is added when needed so the source suffix is covered.
- Route each grain to A, B or dry. Wet grains are convolved with the active IR and trimmed to
segment + tail. - RMS-match each wet grain to its corresponding dry grain. This is why the internal scalar IR conditioning level does not act like a user-visible wet-level control.
- Apply local fades and overlap-add the processed grain into the output buffer.
- When adaptive updating is active, harvest new sieve-consistent IRs and crossfade old→new across routed grains.
- Target-normalize the complete output to 0.9 and apply 10 ms / 20 ms edge fades.
Adaptive IR behaviour
Adaptive updates are not random. At each update interval, the script searches forward to the next grain index compatible with the relevant sieve and harvests a new source segment there. Old and new IRs are then linearly blended across the requested number of A- or B-routed grains.
Because the IRs are harvested from the source rather than synthesized, timbral changes in the source can become changes in the convolution colour. The same source and the same settings therefore produce the same routing and IR schedule.
Channels, duration and level
- Channels: preserved. IR harvesting uses all source channels, and convolution is performed with matching channel structure.
- Sample rate: preserved.
- Time origin: shifted-time Sounds are handled correctly; musical grain/IR positions are relative to the source while extraction is offset by the Sound's actual x-min.
- Duration: output buffer = source duration +
Tail_ms. - Level: wet grains are RMS-matched locally, but the complete result is finally target-normalized to peak 0.9.
- Randomness: none in the routing or adaptive schedule.
Output name: SieveConv_<source>.
Visualization
- Source waveform: includes the actual initial and adaptive IR-harvest positions.
- Output waveform: thin edge ticks mark Sieve A/B hits; full vertical lines mark A/B IR updates.
- Output spectrogram: Nyquist-safe frequency range.
- Summary: colour key, A/B/dry grain counts, adaptive-update statistics and source/output information.
Historical and compositional context
The word sieve has a specific history in twentieth-century composition. Iannis Xenakis developed a sieve theory based on modular arithmetic and logical combinations of congruence classes, using it to generate pitch collections, rhythms and other parameter sequences. In that tradition, a condition such as n mod m = r is an elementary periodic selector.
This script uses that same modular-selection idea as a routing device for grains, but in a deliberately simpler form: two elementary residue classes decide whether each grain enters convolution path A, convolution path B, or the dry path. The number theory therefore becomes an audible orchestration mechanism rather than a pitch-scale generator.
Further reading: Christopher Ariza, “The Xenakis Sieve as Object: A New Model and a Complete Implementation,” Computer Music Journal 29(2), 2005, 40–60. doi:10.1162/0148926054094396.