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.

Author: Shai CohenAffiliation: Department of Music, Bar-Ilan University, IsraelVersion: 1.3 (2026)Category: AILicense: MIT LicenseRepo: Praat AudioTools
Contents:

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.

Compositional idea: the source determines where the processing acts. A sustained tone may gradually destabilise, while a sharp attack can emerge with less interference.

Key Features:

Quick start

  1. Select exactly one Sound object in Praat (mono or stereo).
  2. Run Anti_Similarity_Spectral_Resistance.praat.
  3. Choose one of the six presets, or Custom for detailed editing.
  4. Keep Processing mode at From preset, or override it with mode A, B, C, or D.
  5. Adjust Effect intensity (%) and Wet dry mix (%). A fixed Random seed lets you reproduce randomised behaviour.
  6. Enable Show details to edit analysis and processing parameters. Custom opens these dialogs automatically.
  7. Leave Draw visualisation and Play result enabled to inspect and audition the newly generated Sound.
First comparison: try Stasis Fracture on a repeated vocal phrase and Anti-Drone on a held instrumental tone. For a stronger effect on rapidly changing material, try Radical Difference.

Core concept

Selected Sound → shared spectral analysis ↓ frame-to-frame spectral distance ↓ stability + adaptive control ↓ A carving / B grains / C band drift ↓ D = B → A → C ↓ dry/wet mix + peak protection ↓ newly rendered Sound

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.

Preset editing: selecting Show details opens the parameter dialogs pre-filled with the chosen preset. You can also change the processing mode without switching to Custom.

Processing modes

ModeWhat happensBest starting material
A · Stability-weighted spectral carvingA 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 fragmentationCrossfaded grains repeat, displace, or sometimes reverse recent fragments. Optional memory interference incorporates bounded, earlier audio.Speech, repeating motifs, short phrases.
C · Spectral instabilitySix complementary frequency bands undergo independently seeded, slowly changing gain modulation controlled by stability.Voices, resonant and evolving textures.
D · Hybrid resistanceApplies temporal fragmentation, followed by spectral carving and six-band instability, all guided by the same control curve.Experimental transformation and dense textures.
Important distinction: “Spectral instability” is time-varying band weighting; this tool does not implement a true phase-vocoder spectral freeze.

Controls

Main dialog

ControlFunction
PresetSix sound-design starting points plus Custom.
Processing modeUse 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 seedControls reproducibility of seeded grain and band-modulation decisions.
Show detailsOpens additional analysis and processing dialogs.
Draw visualisationCreates the analysis/rendering figure in Praat Picture.
Play resultPlays the rendered Sound.

Analysis and adaptive behaviour

ControlMusical 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 methodChoose log-spectral difference, normalised Euclidean, or spectral flux.
Stability sensitivityAmplifies how strongly stability activates processing.
Stability threshold (0–1)Sets the stability level needed before intervention begins.
Response contrastMakes 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

ControlMusical 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 methodInterpretation
Log-spectral differenceCompares relative spectral shapes in approximately 1/6-octave bands, reducing the impact of overall level changes and very weak spectral components.
Normalised EuclideanMeasures the distance between amplitude spectra normalised to unit L2 length.
Spectral fluxMeasures 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

Greater frame-to-frame spectral distance → less stability More stability above the selected threshold → stronger control Control × effect intensity → intervention amount

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.

When the effect sounds too subtle: check the Info window for LOW INTERVENTION. Try a lower Stability threshold, higher Sensitivity, shorter Persistence, or a more active preset. High control activity does not always imply a large audible change: the effect also depends on the source and selected processing mode.

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

ComponentRequirement
PraatPraat 6.3+ (reported tested with Praat 6.4.27).
InputExactly one selected, non-silent mono or stereo Sound.
ProcessingOffline rendering, not real-time.

Limitations & performance

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.