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.
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 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.
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.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.
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.
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.
Right(t) = Original_level × Source(t) + Processed_level × Adaptive(t)
Default gains: Original_level = 0.70; Processed_level = 0.60.
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 state | Default Decay | How it is determined | Compositional meaning |
|---|---|---|---|
| Stable pitch | 0.65 | Valid pitch, frame-to-frame movement at or below 0.30 semitones (outside reset intervals). | Encourage resonance and persistence. |
| Melodic change | 0.12 | A jump of at least 1.5 semitones, followed by a four-frame reset window. | Temporarily reduce the retention of the previous spectral state. |
| Voiced restart | 0.12 | A new voiced frame follows an unvoiced or silent region; it uses the same reset Decay. | Mark a renewed melodic entrance with temporary forgetting. |
| Transitional motion | Between 0.12 and 0.65 | A pitch change between the stable and jump thresholds is mapped continuously between the two values. | Intermediate degrees of memory retention. |
| Silence / unvoiced | 0.60 | Undefined/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.
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
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.- Select exactly one Sound in the Praat Objects window. Supported input duration is 1–25 seconds.
- Run
Spectral_Hysteresis.praat. Start with Custom or Balanced Memory for the reference behavior heard in the original POC. - 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.
- Try the other presets with the same phrase. They alter the persistence and forgetting rules, not the CDP synthesis process.
- Inspect the optional Picture. It shows the source and measured pitch, the two control trajectories, classification states, and the actual stereo output.
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.
| Preset | Stable Decay | Change Decay | Silence Decay | Jump threshold | Reset frames |
|---|---|---|---|---|---|
| Custom (defaults) | 0.65 | 0.12 | 0.60 | 1.5 st | 4 |
| Balanced Memory | 0.65 | 0.12 | 0.60 | 1.5 st | 4 |
| Deep Resonance | 0.82 | 0.18 | 0.78 | 1.5 st | 3 |
| Melodic Erasure | 0.75 | 0.03 | 0.68 | 1.2 st | 6 |
| Fragile Memory | 0.43 | 0.06 | 0.38 | 1.3 st | 5 |
| Suspended Silence | 0.72 | 0.09 | 0.87 | 1.5 st | 4 |
| Slow Recollection | 0.80 | 0.22 | 0.70 | 1.8 st | 2 |
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
| Control | Function and constraints |
|---|---|
Preset | Custom plus six adaptive memory presets. |
Pitch_floor_Hz / Pitch_ceiling_Hz | Praat Pitch range, initially 140–1500 Hz. Ceiling must exceed floor; floor at least 30 Hz. |
Analysis_step_s | Controller 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_st | At or below this frame-to-frame change, fully stable memory is used. Default 0.30 semitones, must stay below Jump threshold. |
Jump_threshold_st | Pitch change triggering a reset. Default 1.5 semitones. |
Silence_below_peak_dB | Intensity cutoff measured relative to the recording's peak Intensity; default 25 dB, maximum 100 dB. |
Reset_frames | Number of analysis steps for which a voiced restart or melodic jump imposes Change Decay. Default 4. |
Constant_decay | Fixed left-channel CDP Decay reference. Default 0.40. |
Stable_decay | Right-channel retention on stable pitches; default 0.65. |
Change_decay | Right-channel retention during reset intervals; default 0.12. |
Silence_decay | Right-channel retention in silent/unvoiced regions; default 0.60. |
Original_level / Processed_level | Shared 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_visualization | Draw the measured eight-inch Praat Picture after rendering, without altering audio. Enabled by default. |
Play_result | Play 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_StereoOne 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.
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.
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.
Controller state timeline
A color-coded strip identifies stable, transitional, change, voiced-restart and silence/unvoiced states at each analysis frame.
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.
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.
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.