Spectral Hysteresis

One sound, two spectral memories. Praat detects melodic stability, pitch changes and silence; CDP Super Accumulate (tempered) retains and reshapes spectral energy under constant control on the left, and analysis-driven control on the right.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Library: Praat AudioTools Category: CDP Version: 0.2 (2026) Script license: MIT CDP programs: LGPL-2.1-or-later

The musical idea: a sound that remembers differently

A recorded phrase leaves a spectral history. Spectral Hysteresis explores what happens when that history is allowed to persist, change or dissipate according to the behavior of the source itself. Rather than selecting notes for a separate frozen canon, this instrument processes the entire phrase through CDP Super Accumulate (tempered). The spectral accumulation unfolds as the recording progresses.

The constant-memory version uses one unchanging Decay setting; the adaptive-memory version receives a sequence of Decay values generated from Praat's pitch and intensity analysis. Stable notes encourage persistence; melodic changes and voiced restarts temporarily reduce it; silence or unvoiced regions use their own retention value.

The source melody is heard in both ears, but the spectral memory surrounding it follows two different laws.

The name hysteresis refers to the compositional importance of accumulated history. It does not denote a physically modeled hysteresis system. The tempered spectral organization comes from CDP; Praat's pitch estimates control the Decay parameter, not the pitches or notes of a separate harmonizer.

How the instrument works

One selected Sound is sufficient. Praat makes a temporary zero-based mono copy, computes Pitch and Intensity, builds an internal IntensityTier, and classifies the source at regular time steps. The result becomes a text-based CDP breakpoint file controlling spectral Decay in one of two otherwise identical Super Accumulate passes.

No additional synthesis engine: the script invokes the bundled CDP processor sp_superaccu_2. Praat handles analysis, control-file generation, the stereo mix and visualization. No Python, separate CDP installation or SoundLoom is required when the compatible bundled CDP engine is available.
1 SoundRequired user input
2 passesSame CDP processor, different Decay control
2 channelsOne final stereo Sound

Stereo memory composition

The finished output is not a left/right pan of one processed signal. It is a juxtaposition of two independently rendered spectral histories, with the same dry source in both channels.

Channel 1 · Left

Original + Constant Memory

Unaltered mono working source at its natural timeline plus CDP Super Accumulate with a fixed Decay (default 0.40). The spectral retention rule does not respond to the analyzed melodic changes.

Channel 2 · Right

Original + Adaptive Memory

Exactly the same mono source mixed with a Super Accumulate pass whose Decay varies from Praat analysis. Stable pitches, changes, restarts and unvoiced frames can evoke different spectral histories.

Left(t) = Original_level × Source(t) + Processed_level × Constant(t)
Right(t) = Original_level × Source(t) + Processed_level × Adaptive(t)
Default gains: Original_level = 0.70; Processed_level = 0.60.
Schematic stereo routing (not a measured audio render) One Sound (mono work copy) CDP: Constant Super Accumulate Decay = 0.40 (default) CDP: Adaptive Super Accumulate Decay = Praat breakpoint curve Mix with original Mix with original LEFT RIGHT
Both branches use the same source material and CDP process. Their intended difference is the Decay control: constant on the left, derived from melodic analysis on the right. The actual output is a stereo Praat Sound, not two separate results.

The final Sound lasts as long as the longest among the source, the constant CDP output and the adaptive CDP output. A shorter signal is padded with silence, not looped or time-stretched. The original ends at its natural duration; any longer spectral tails belong to CDP. The script uses the same dry/wet gains in both channels and applies a single common attenuation only if the stereo peak exceeds 0.95.

From melodic behavior to spectral memory

Praat evaluates the source at a configurable analysis step (default 50 ms). A pitch estimate must be valid and the corresponding intensity must exceed the selected threshold relative to the recording's peak intensity. The controller then updates the CDP Decay value according to its current state.

Analysis stateDefault DecayHow it is determinedCompositional meaning
Stable pitch0.65Valid pitch, frame-to-frame movement at or below 0.30 semitones (outside reset intervals).Encourage resonance and persistence.
Melodic change0.12A jump of at least 1.5 semitones, followed by a four-frame reset window.Temporarily reduce the retention of the previous spectral state.
Voiced restart0.12A new voiced frame follows an unvoiced or silent region; it uses the same reset Decay.Mark a renewed melodic entrance with temporary forgetting.
Transitional motionBetween 0.12 and 0.65A pitch change between the stable and jump thresholds is mapped continuously between the two values.Intermediate degrees of memory retention.
Silence / unvoiced0.60Undefined/out-of-range F0 or intensity more than 25 dB below the measured peak.Allow previously accumulated spectral material to remain present through gaps.

Important distinction: the Decay curve is a parameter transmitted to CDP, not a measured envelope of the resulting sound. The amount and duration of actual residual resonance depend on CDP's internal spectral accumulation and on the input material. No extra decay envelope is applied to the wet output.

Illustrative control sequence, not extracted from a recording 0.80.60.40.20.0 StableChangeStableUnvoicedRestart Decay
Constant Decay, 0.40Adaptive Decay
This is a schematic representation of the control law. The actual Praat Picture plots the breakpoint points calculated from the selected source and the real CDP control sent during the processing run.

Breakpoints use time coordinates relative to the start of the zero-based audio. The script avoids duplicate timestamps, validates the CDP Decay range 0.00001–0.9, and keeps the control arrays for the visualization. Glissando is fixed at zero; Reassign gliss remains off.

Getting started

Installation: Save Spectral_Hysteresis.praat as an independent script in plugin_AudioTools/CDP/. It uses internal/cdp_engine.praat, the CDP registries and compatible bundled CDP executables. No separate CDP installation or Python is required when the bundled engine is available.
  1. Select exactly one Sound in the Praat Objects window. Supported input duration is 1–25 seconds.
  2. Run Spectral_Hysteresis.praat. Start with Custom or Balanced Memory for the reference behavior heard in the original POC.
  3. Listen to the stereo relationship. The left ear hears original + constant spectral memory; the right ear hears original + adaptive spectral memory. Listen to each channel separately to understand the control difference.
  4. Try the other presets with the same phrase. They alter the persistence and forgetting rules, not the CDP synthesis process.
  5. Inspect the optional Picture. It shows the source and measured pitch, the two control trajectories, classification states, and the actual stereo output.
Multichannel source input: for analysis and both processing branches, the script averages the input channels to mono. The resulting stereo output is two alternate versions of that mono source; the original stereo placement is not preserved. The selected input Sound object remains unchanged.

Compositional presets

The script offers Custom plus six named memory behaviors. The preset changes only the adaptive control's Stable, Change and Silence Decay values, the Pitch Jump threshold, and the number of Reset frames. It does not change the Constant reference Decay, mix gains, Pitch floor/ceiling, analysis step or fixed CDP Glissando settings.

PresetStable DecayChange DecaySilence DecayJump thresholdReset frames
Custom (defaults)0.650.120.601.5 st4
Balanced Memory0.650.120.601.5 st4
Deep Resonance0.820.180.781.5 st3
Melodic Erasure0.750.030.681.2 st6
Fragile Memory0.430.060.381.3 st5
Suspended Silence0.720.090.871.5 st4
Slow Recollection0.800.220.701.8 st2

Balanced Memory

The approved baseline behavior: stable notes retain more energy; noticeable pitch changes briefly reduce retention.

Deep Resonance

Higher retention during stable notes and silence favors longer-lived spectral material.

Melodic Erasure

A lower Change Decay and longer reset emphasize forgetting when melodic motion is pronounced.

Fragile Memory

Lower Decay values generally reduce spectral persistence, yielding a less lasting resonance.

Suspended Silence

High Silence Decay encourages the accumulated spectral memory to linger through gaps in the source.

Slow Recollection

High Stable Decay with a shorter reset allows the system to regain retention relatively quickly after changes.

Custom

Uses the editable form values. The initial defaults are identical to the Balanced Memory values and to the POC's core analysis settings.

These are intended musical tendencies, not guarantees for every recording. The source must support reliable pitch and intensity analysis for the adaptive control to distinguish stable and changing regions.

Controls and output

ControlFunction and constraints
PresetCustom plus six adaptive memory presets.
Pitch_floor_Hz / Pitch_ceiling_HzPraat Pitch range, initially 140–1500 Hz. Ceiling must exceed floor; floor at least 30 Hz.
Analysis_step_sController sampling interval; default 0.05 s, allowed 0.01–0.2 s. Pitch and Intensity analysis each use a 0.01 s step internally.
Stable_threshold_stAt or below this frame-to-frame change, fully stable memory is used. Default 0.30 semitones, must stay below Jump threshold.
Jump_threshold_stPitch change triggering a reset. Default 1.5 semitones.
Silence_below_peak_dBIntensity cutoff measured relative to the recording's peak Intensity; default 25 dB, maximum 100 dB.
Reset_framesNumber of analysis steps for which a voiced restart or melodic jump imposes Change Decay. Default 4.
Constant_decayFixed left-channel CDP Decay reference. Default 0.40.
Stable_decayRight-channel retention on stable pitches; default 0.65.
Change_decayRight-channel retention during reset intervals; default 0.12.
Silence_decayRight-channel retention in silent/unvoiced regions; default 0.60.
Original_level / Processed_levelShared dry and wet gains for both channels, defaults 0.70 / 0.60. Original is allowed 0–1; Processed must be positive and no greater than 1.
Draw_visualizationDraw the measured eight-inch Praat Picture after rendering, without altering audio. Enabled by default.
Play_resultPlay the result after completion. Enabled by default.

Fixed CDP settings

Both branches use Super Accumulate (tempered), process ID sp_superaccu_2 (superaccu superaccu 2). Glissando = 0 and Reassign gliss = Off are not exposed as controls. CDP's permitted Decay values are in the interval 0.00001–0.9.

Result object

<sourceName>_SpectralHysteresis_Stereo

One stereo Praat Sound starting at zero, containing the original + Constant CDP output on the left and the original + Adaptive CDP output on the right. The result duration preserves whichever CDP tail is longer, and the original Sound remains available and unchanged.

Reading the Praat Picture visualization

When Draw_visualization is enabled, Praat draws an approximately 8 × 8-inch analysis-and-composition Picture. Its values come from the actual Sound and the controller arrays recorded during processing; the conceptual diagrams on this page are illustrative only.

Panel A

Source and melodic analysis

The mono source waveform and a measured F0 contour appear in aligned strips; voiced restarts and melodic changes are marked in different colors, and unvoiced frames are shaded. The pitch axis is logarithmic.

Panel B

Spectral memory control

The constant Decay reference appears as a blue horizontal line; the adaptive control submitted to CDP is shown in orange. Values are CDP Decay parameters, not measured resonance amplitude.

Panel C

Controller state timeline

A color-coded strip identifies stable, transitional, change, voiced-restart and silence/unvoiced states at each analysis frame.

Panel D

Rendered stereo output

The two waveforms are measured from the finished stereo Sound using a common amplitude reference. The display marks the end of the source and the actual end time of each CDP result.

The summary strip gives source duration, input channel count, analyzed-frame and event counts, preset, Decay settings, breakpoint count, mix balance, output duration, individual CDP durations and final peak. The display is optional and does not change the rendered samples.

Technical implementation

Praat analysis drives one CDP parameter

Pitch and Intensity are analyzed internally. Frames are classified into stable, transitional, change, restart and unvoiced conditions. Those labels produce a breakpoint file in which each line contains a relative time and a Decay value. The acoustic material itself is processed by the original CDP Super Accumulate engine.

One fixed pass, one breakpoint-controlled pass

The constant channel uses the shared CDP engine's normal parameter workflow. For the adaptive channel, the script checks the exact CDP_Processes.tsv argument template and substitutes the generated breakpoint-file path for the -d argument. The program and all other CDP parameters remain the same.

The engine performs its standard PVOC analysis and resynthesis for this spectral process. The script checks that both CDP outputs are mono and use the input sampling frequency, then assembles a stereo Sound with zero-padding for any shorter signals. No per-channel normalization is applied, and the final output is attenuated jointly only when needed.

Source, Pitch, Intensity and IntensityTier objects created for processing are not left as intermediate results. The script uses a uniquely named temporary breakpoint file, normally deletes it after success and preserves it on adaptive execution failure for troubleshooting.

A state label is not a spectrum measurement. The classification and Decay values report the commands supplied to CDP. CDP itself decides which spectral energy is sustained or replaced as the input evolves. An adaptive state transition should not be interpreted as an instantaneous reset of every existing partial.

Listening and limitations

Listen to channels separately

Solo the left channel to hear constant retention; solo the right to hear the analysis-driven version. Together they create a stereo texture built from contrasting spectral histories plus the same original phrase.

Source-dependent control

Sudden pitch changes, vibrato, unstable tracking and silence thresholds affect classification. Near-monophonic, clearly pitched input may expose the intended memory behavior most directly.

Tempered is a CDP property

The tempered mode organizes resonances according to CDP's pitch-tempering mechanism; it does not necessarily follow a scale chosen or inferred from Praat.

Preserved tails

Any residual resonance after the original phrase comes from CDP. The script keeps the longer processed result and does not impose a separate artificial decay.

Scope of verification: This page documents the supplied Spectral_Hysteresis.praat v0.2 source and its parameter logic. It does not claim a new listening test or independently measured CDP performance. Results and tail length depend on the recording and compatible bundled CDP binaries.