Layered Markov Texture — User Guide
A coupled multi-layer Markov event generator. Each layer has its own Poisson event clock, finite-state transition behavior, frequency anchor, and event stream; optional cross-layer coupling biases future state transitions toward the current ensemble state.
What this does
Layered Markov Texture generates a texture from up to eight independent-but-optionally-coupled event layers. It is one synthesis engine, not a collection of unrelated synthesis modes.
Each layer has:
- its own finite-state chain;
- its own number of states;
- its own transition mobility, jump probability, and directional bias;
- its own Poisson event clock;
- its own moving or stationary frequency anchor.
All layers are scheduled together in chronological order. When a layer's next Poisson event becomes due, that layer emits an event using its current state, then chooses its next state.
Quick start
- Run
Layered_Markov_Texture.praat. No input Sound is required. - Choose Custom or one of the six texture presets.
- For Custom, set Duration, Sample rate, Base frequency, layer count/layout/motion, Event rate per layer, Complexity, coupling, and Spatial mode.
- Open Edit Markov texture details for state pitch span, event-duration behavior, jitter, coupling strength, layer-motion depth, rotation rate, edge fade, and Random seed.
- Run the script. The complete stochastic realization is scheduled first, then rendered into a mono or stereo Sound.
Non-Custom presets override the controls listed in the preset section. To hand-set all synthesis parameters, use Custom.
The layer-specific Markov process
Number of states
Layers deliberately do not all use the same state count:
Layer 1 therefore has 5 states, layer 2 has 6, and so on up to 12 states for layer 8.
Normalized state position
The current discrete state is converted to a normalized position from 0 to 1:
This one value influences pitch, duration, level, and second-harmonic weight.
Mobility and jumps
Complexity affects only the transition process. Higher values increase the probability of leaving the current state and modestly increase the probability of a long-distance state jump. Higher-numbered layers also receive slightly more mobility.
Every transition decision has four possible outcomes:
- stay in the current state;
- move to the previous neighboring state;
- move to the next neighboring state;
- jump to a non-current state chosen from the full state set.
At the lower and upper state boundaries, an outward neighbor move is reflected inward so the chain remains inside its state range.
Directional bias
Without coupling, lower layers have a mild downward tendency and higher layers a mild upward tendency. The base upward bias runs from approximately .35 in the lowest layer to .65 in the highest.
Cross-layer coupling
When Cross-layer influence is enabled, the active layer compares its current normalized state with the mean normalized state of all other layers:
The resulting bias is limited to .08–.92. If the other layers are collectively above the active layer, upward moves become more probable; if they are below it, downward moves become more probable. Coupling changes transition direction, not the layer's basic mobility.
Event timing and overlap
Poisson event clocks
Each layer has an independent Poisson clock. Inter-onset intervals follow an exponential distribution:
Event rate per layer is therefore an expected statistical rate, not an exact number of events per second. A particular realization can contain more or fewer events.
The scheduler repeatedly finds whichever layer has the earliest next event, renders that event into the global realization list, advances only that layer's Poisson clock, and continues until the requested Duration is reached.
Event duration is independent of IOI
Event duration does not determine the next onset. It is derived from Mean event duration, state position, and the event-duration spread:
The random factor lies between 1 - spread and 1 + spread. Because duration and inter-onset interval are independent, events can overlap within one layer and between layers.
Event-count safety
The form rejects settings whose expected count exceeds 7000 events. Because a Poisson process can exceed its expectation, an additional runtime guard stops a realization if it grows beyond 10000 events rather than continuing without a bound.
Overlap compensation
After scheduling, the script measures:
This is an energy-management heuristic for overlapping events. It is not final normalization.
State → pitch and timbre
Pitch around a layer anchor
The layer's current anchor is interpolated in log-frequency between its start and end values. The Markov state then places the event symmetrically around that anchor:
Because statePosition - 0.5 runs from -0.5 to +0.5, State pitch span is the complete low-to-high span in octaves. The anchor lies at the logarithmic center of that state range.
Frequency jitter
Jitter is a direct percentage multiplier around the state-derived fundamental, not a cents value. For example, 1.5% permits a factor from .985 to 1.015.
State-dependent event sound
Each event is a Hann-windowed sinusoidal source. The state also controls a second-harmonic weight:
The fundamental + second-harmonic pair receives an approximate RMS compensation before event gain is applied. Phase is randomized per event.
Higher states also have somewhat longer nominal durations and greater nominal event amplitudes. There is no separate “synthesis mode” menu in v0.4; state behavior, layer organization, and event scheduling together form the texture.
Layer layout and motion
Geometric layout
Layer spacing is used only in Geometric layout.
Harmonic layout
Harmonic layout ignores Layer spacing and places the layer anchors on integer multiples of the Base frequency.
Stationary
Start and end anchors are identical.
Converging
The geometric mean of all starting anchors is treated as the ensemble frequency center. Each layer's end anchor moves toward that center in log-frequency according to Layer motion depth. At depth 1, all layer anchors end at the common center.
Diverging
Each layer's log-frequency distance from the common center is enlarged. At depth 1, that initial log-distance is doubled by the end of the Sound.
Common frequency scaling
Before events are scheduled, the script estimates the complete possible fundamental range, including layer motion, state span, and frequency jitter. It reserves room for the optional second harmonic and applies one common scale to every layer if required:
Using one scale preserves the relative geometry between all layer anchors. If the resulting lowest possible fundamental would fall below 20 Hz, the script stops instead of distorting the layout independently layer by layer.
Controls
| Control | Default / range | Behavior |
|---|---|---|
| Duration | 10 s; max 180 s | Exact final Sound duration. |
| Sample rate | 44.1 kHz; 8–192 kHz | Direct synthesis and final output rate. |
| Base frequency | 80 Hz | Reference anchor for the layer layout. |
| Number of layers | 3; 1–8 | Number of independent Poisson/Markov processes. |
| Layer layout | Geometric | Geometric spacing or harmonic multiples. |
| Layer spacing | 1.5; 1–6 | Ratio between adjacent anchors in Geometric layout; ignored in Harmonic layout. |
| Layer motion | Stationary | Stationary, Converging, or Diverging anchor trajectory. |
| Event rate per layer | 3 events/s; max 60 | Expected rate of each independent Poisson clock. |
| Complexity | 1; 0–3 | Raises state mobility and long-distance jump probability only. |
| Cross-layer influence | on | Enables ensemble-state bias inside the transition decision. |
| Spatial mode | Mono | Mono, fixed Layer Spread, or time-varying Rotating Layers. |
Advanced details
| Control | Default | Behavior |
|---|---|---|
| State pitch span | .72 octaves | Total state-controlled pitch span around each layer anchor. |
| Mean event duration | .18 s | Base event duration before state and random variation. |
| Event duration spread | .35 | Symmetric random duration factor; allowed range 0–.9. |
| Frequency jitter | 1.5% | Per-event multiplicative pitch jitter; allowed range 0–50%. |
| Cross-layer coupling strength | .35 | Strength of the ensemble-state term added to transition direction bias. |
| Layer motion depth | .70 | Amount of convergence/divergence in log-frequency. |
| Rotation rate | .08 Hz | Pan-motion rate in Rotating Layers; not used by the other spatial modes. |
| Edge fade | .06 s | Common linear fade at both ends, capped at 20% of total Duration. |
| Random seed | 0 | 0 = unpredictable; a positive seed reproduces the stochastic schedule, state paths, event parameters, phases, and spatial realization. |
Presets
| Preset | Main structure | Advanced overrides |
|---|---|---|
| Sparse Independent Layers | 14 s; 2 layers; Geometric spacing 2.0; Stationary; 1.5 events/s/layer; Complexity .45; coupling off | Pitch span .55 oct; mean duration .22 s; coupling strength 0 |
| Dense Coupled Weave | 12 s; 4 layers; Geometric 1.34; Stationary; 5 events/s/layer; Complexity 1.55; coupling on | Pitch span .82 oct; mean duration .20 s; coupling .48 |
| Harmonic Layer Stack | 14 s; base 55 Hz; 5 layers; Harmonic; Stationary; 3 events/s/layer; Complexity .80; coupling on | Pitch span .42 oct; mean duration .20 s; coupling .28 |
| Wide Geometric Spread | 12 s; 3 layers; Geometric spacing 3.0; Stationary; 2.5 events/s/layer; Complexity 1.0; coupling off | Pitch span .62 oct; mean duration .17 s |
| Converging Layer Field | 14 s; base 100 Hz; 4 layers; Geometric 1.75; Converging; 4 events/s/layer; Complexity 1.20; coupling on | Pitch span .58 oct; mean duration .18 s; coupling .42; motion depth .82 |
| Diverging Layer Field | 14 s; base 95 Hz; 4 layers; Geometric 1.48; Diverging; 2.8 events/s/layer; Complexity .85; coupling on | Pitch span .68 oct; mean duration .19 s; coupling .30; motion depth .75 |
The presets do not redefine every advanced field. Unlisted advanced settings keep their common defaults. Sample rate, Spatial mode, Peak protection, Draw visualization, Play result, and Random seed remain user-controlled.
Spatial modes
Mono
One-channel output. Every event is mixed into the mono master.
Layer Spread
Stereo output. Each layer has a fixed pan position distributed from .05 at the first layer to .95 at the last. With one layer the position is center.
Rotating Layers
Stereo output. Each layer receives a different phase offset around a shared sinusoidal pan trajectory:
Panning is evaluated once per event, so this mode creates event-by-event spatial motion. It does not continuously move one sounding event across the stereo field after that event has begun.
Both stereo modes use equal-power gains sqrt(1-pan) and sqrt(pan). There is no binaural/HRTF processing.
Output and level
| Property | Behavior |
|---|---|
| Input | No selected Sound is required. |
| Duration | Exactly the requested Duration. |
| Sample rate | Exactly the selected 8–192 kHz rate. |
| Channels | Mono for Mono mode; stereo for Layer Spread and Rotating Layers. |
| Edge fade | One common linear fade-in and fade-out. The requested fade is capped at 20% of Duration. |
| Overlap compensation | Event gain is reduced only when summed event-duration load exceeds one complete Duration. |
| Peak protection | If enabled and the mixed peak exceeds .92, the complete output is scaled down once to .92. |
| Normalization | No upward normalization. If peak ≤ .92, the generated level is preserved. |
| Object name | Layered_Markov_<preset name>, with spaces replaced by underscores. |
Visualization and QC
The current visualization is a mechanism-oriented four-panel analysis of the actual realization.
| Panel | What it shows |
|---|---|
| A — Realized Markov States | Normalized emitted state position inside a separate lane for each layer. For very large realizations, events are sampled for display density rather than drawing every point. |
| B — Actual Event Field | Event onset, rendered duration, and fundamental frequency on a logarithmic frequency axis. Color identifies the layer. |
| C — Layer Transitions | Expected mobility for each layer versus the empirical fraction of transitions that actually changed state. |
| D — Model → Measurement | Measured spectrogram of a representative output channel with sampled realized event-fundamental guides. |
For stereo output, Panel D analyzes whichever complete output channel has the higher RMS. Its frequency range extends far enough to include the event second harmonic where sampling headroom permits.
The bottom QC block reports expected versus actual event count, realized event rate, overlap load, Complexity, whether coupling is active, mean normalized state disagreement, actual fundamental-frequency range, layer layout and motion, common frequency scale, pre-protection peak/RMS, final peak, and whether down-only protection was applied.