Anti-Similarity — Spectral Resistance Engine
Turn spectral stability into a compositional force. This offline, adaptive processor intervenes most strongly when a sound becomes spectrally stable, while allowing rapid changes and transients to remain more recognisable.
What this does
Anti-Similarity — Spectral Resistance Engine analyses how much the spectrum changes from moment to moment, then uses the resulting stability curve to control temporal fragmentation, spectral carving, slowly drifting frequency-band levels, or combinations of these. Stable material invites transformation; rapid spectral changes reduce the intervention.
Key Features:
- Three spectral-distance measures: log-spectral difference, normalised Euclidean distance, and spectral flux.
- Four processing modes: spectral carving, temporal fragmentation, six-band instability, and a hybrid chain.
- Six experimental presets + Custom: gentle drift, short-loop fracture, memory interference, gradual anti-drone processing, and more.
- Adaptive control: sensitivity, threshold, contrast, smoothing, persistence build-up and release, plus silence protection.
- Source-preserving output: new mono or stereo Sound at the source duration and sample rate.
- Diagnostic reporting: control activity, output waveform difference, memory activity, peak protection, and rendering time.
- Praat Picture visualisation: compare analysis, control, input and output.
Quick start
- Select exactly one Sound object in Praat (mono or stereo).
- Run
Anti_Similarity_Spectral_Resistance.praat. - Choose one of the six presets, or Custom for detailed editing.
- Keep Processing mode at From preset, or override it with mode A, B, C, or D.
- Adjust Effect intensity (%) and Wet dry mix (%). A fixed Random seed lets you reproduce randomised behaviour.
- Enable Show details to edit analysis and processing parameters. Custom opens these dialogs automatically.
- Leave Draw visualisation and Play result enabled to inspect and audition the newly generated Sound.
Core concept
The system reacts to local spectral stability, not to musical repetition or meaning as such. A repeated motif can remain spectrally active because each note or syllable changes between adjacent analysis frames.
Six presets + Custom
Fragile Continuity
Gentle, slow six-band timbral drift in stable passages. A starting point for subtle modification of voices and sustained instruments. Uses mode C.
Stasis Fracture
Stable passages break into short overlapping loops, with occasional reversed fragments. Uses mode B.
Spectral Rebellion
Strong spectral carving and band instability, with a lighter dose of temporal fracture. Uses hybrid mode D.
Memory Corruption
Earlier material, selected from a bounded temporal history, interferes with the present. Blends memory fragments and micro-repetitions in mode B.
Anti-Drone
Intervention builds up during sustained stability and recedes at transients. Combines spectral and temporal processes in hybrid mode D.
Radical Difference
A forceful hybrid treatment with short fragments, reversal, temporal memory, spectral carving, and active band modulation.
Custom
Starts from moderate hybrid settings and opens both detailed parameter dialogs for direct editing.
Processing modes
| Mode | What happens | Best starting material |
|---|---|---|
| A · Stability-weighted spectral carving | A source-derived, static spectral filter attenuates persistent spectral features and emphasises less represented regions. The amount of filtering follows stability over time; the filter itself is not recalculated for each frame. | Harmonic drones, sustained tones. |
| B · Temporal fragmentation | Crossfaded grains repeat, displace, or sometimes reverse recent fragments. Optional memory interference incorporates bounded, earlier audio. | Speech, repeating motifs, short phrases. |
| C · Spectral instability | Six complementary frequency bands undergo independently seeded, slowly changing gain modulation controlled by stability. | Voices, resonant and evolving textures. |
| D · Hybrid resistance | Applies temporal fragmentation, followed by spectral carving and six-band instability, all guided by the same control curve. | Experimental transformation and dense textures. |
Controls
Main dialog
| Control | Function |
|---|---|
| Preset | Six sound-design starting points plus Custom. |
| Processing mode | Use the preset’s mode or override it with A, B, C, or D. |
| Effect intensity (%) | Scales the adaptive intervention (0–200%). At zero, the output reproduces the input to numerical precision. |
| Wet dry mix (%) | Blend between source and processed output (0–100%); zero is a dry bypass. |
| Random seed | Controls reproducibility of seeded grain and band-modulation decisions. |
| Show details | Opens additional analysis and processing dialogs. |
| Draw visualisation | Creates the analysis/rendering figure in Praat Picture. |
| Play result | Plays the rendered Sound. |
Analysis and adaptive behaviour
| Control | Musical effect |
|---|---|
| Analysis window / step (ms) | Sets temporal detail in spectral analysis; defaults are 30 ms and 10 ms. |
| Maximum frequency / Frequency step (Hz) | Defines the analysed frequency range and resolution, subject to the input’s Nyquist frequency and memory guards. |
| Distance method | Choose log-spectral difference, normalised Euclidean, or spectral flux. |
| Stability sensitivity | Amplifies how strongly stability activates processing. |
| Stability threshold (0–1) | Sets the stability level needed before intervention begins. |
| Response contrast | Makes the adaptive response more gradual or more decisive. |
| Control smoothing (ms) | Smooths the response in time. |
| Persistence build up (s) | Requires sustained stability before full intervention develops. |
| Persistence release (ms) | Retains the build-up memory across short interruptions, while instantaneous changes can still suppress the output. |
| Silence threshold (dB) | Prevents very quiet regions from automatically counting as stable. |
Temporal and spectral processing
| Control | Musical effect |
|---|---|
| Minimum / Maximum fragment (ms) | Bounds the fragments used for micro-repetition. |
| Fragment repetition (0–1) | Controls the tendency to repeat rather than read forward. |
| Reverse probability (0–1) | Probability of reversed fragment playback. |
| Temporal displacement (ms) | Limits how far back the memory stream can read. |
| Memory interference (0–1) | Controls the amount of earlier material blended with current audio. |
| Crossfade (ms) | Sets overlap/crossfade timing for the grain engine. |
| Carving depth (dB) | Depth of stability-weighted spectral shaping in modes A and D. |
| Instability depth (dB) | Strength of band-level drift in modes C and D. |
| Instability rate (Hz) | Speed of the seeded, independent band changes. |
Spectral analysis
The engine analyses a mono sum of the source and shares the resulting control curve between stereo channels. A Gaussian-window Spectrogram supplies power spectral density, which is converted to spectral-distance measurements between neighbouring frames.
| Distance method | Interpretation |
|---|---|
| Log-spectral difference | Compares relative spectral shapes in approximately 1/6-octave bands, reducing the impact of overall level changes and very weak spectral components. |
| Normalised Euclidean | Measures the distance between amplitude spectra normalised to unit L2 length. |
| Spectral flux | Measures positive spectral increases between successive L1-normalised frames. |
For valid frames, the distance is normalised with the 10th and 90th percentiles; a fallback scale is used when the distance curve is nearly constant. Low-energy frames are protected so silence does not trigger strong processing.
Adaptive response
Sensitivity, threshold and contrast shape the response. Control smoothing softens rapid changes; persistence can make intervention accumulate during long, stable stretches. The resulting control curve drives every selected processing stage.
Visualisation
With Draw visualisation enabled, Praat Picture displays an analysis and rendering overview derived from the actual control and output data.
Input and output spectrograms
Compare the source spectrum with the rendered result using a consistent colour scale.
Spectral distance
Inspect the changes measured between successive analysis frames.
Adaptive control
See where the system engages and how strongly the stability trajectory drives processing.
Summary
Find the distance metric, control activity, active processing stages, output measurements, and peak protection report.
The Info window adds more detailed statistics, including the mean control, share of frames above 0.5, and waveform difference between the final output and the input. Memory diagnostics are reported when relevant.
Outputs
The script creates a new Sound named after the selected input:
Source_antisimilar
The original Sound remains unchanged. The result retains its duration, sample rate and mono/stereo channel configuration. Temporary analysis and processing objects are cleaned up.
Change reporting: the measured RMS waveform difference includes any final peak protection. It is a diagnostic rather than a perceptual similarity score: a short temporal displacement can measure as a large waveform difference even when the sound remains recognisable. The report also distinguishes peak-limit overs from samples reshaped by the soft knee.
Requirements
| Component | Requirement |
|---|---|
| Praat | Praat 6.3+ (reported tested with Praat 6.4.27). |
| Input | Exactly one selected, non-silent mono or stereo Sound. |
| Processing | Offline rendering, not real-time. |
Limitations & performance
- Local similarity: frame-to-frame spectral distance does not identify semantic changes, phrases, or repeated musical patterns.
- Static carving profile: the spectral filter is derived across the recording; only its application varies over time.
- Bounded memory: memory fragments are drawn from a limited span of earlier source material.
- Offline processing: long files, dense analysis grids and hybrid modes can require substantial computation. The script includes analysis-size guards.
- Source-dependent results: some material may remain largely unchanged when the detected stability is low. Consult the control diagnostics before interpreting a subtle output as failure.
- Mono/stereo only: multichannel surround input is not supported.
Musical applications
Vocal fragmentation
Use Stasis Fracture to interrupt repeated syllables and sustained vowels with small, crossfaded loops while allowing sharper consonants to retain more of their shape.
Memory-based transformation
Try Memory Corruption on spoken phrases or an instrumental improvisation. Earlier fragments emerge within current material, creating a relationship between recent past and present.
Sustained-tone resistance
Apply Anti-Drone to a long cello, flute, electronic or vocal drone so timbral intervention intensifies as spectral stability persists.
Subtle timbral motion
Start with Fragile Continuity when the goal is to introduce a faint changing spectral colour rather than overt fragmentation.
Radical electroacoustic textures
Use Spectral Rebellion or Radical Difference on mixed material to combine spectral change with temporal displacement and fragmentation.
Compositional idea
Render the same phrase with Fragile Continuity, Memory Corruption and Radical Difference, keeping the random seed fixed. Compare how each strategy responds to the same stable passages and transitions, then layer selected versions into a new texture.