OM Rhythm Tree Slicer — v0.4 User Guide

Realises a flat OpenMusic-style proportion vector as an exact sample-domain metric grid over a Sound, with notes, rests, six rhythm transformations, three source-material mappings, discontinuity-aware fades, and explicit output-level policies.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

OM Rhythm Tree Slicer reads one flat, measure-level proportion vector such as 1 1 2 -1 1. Positive values are sounding leaves and negative values are rests. The vector fills one measure, and Repetitions repeats that measure after applying the selected transformation.

Metric timing

measure_duration = (60 / Tempo_BPM) × Numerator × (4 / Denominator) leaf_duration_i = measure_duration × |p_i| / Σ|p| measure_samples = round(measure_duration × sample_rate)

The actual render is planned in integer samples. Boundaries are obtained by cumulative rounding and the final boundary of every measure is forced to measure_samples, so the planned measure length is exact.

OpenMusic relationship: OpenMusic rhythm trees are recursive proportional structures. This script deliberately implements a flat measure-level AudioTools subset, plus subst-rhythm for one level of nested subdivision. It is not a general parser for parenthesised recursive OpenMusic RT syntax.
Proportion convention: only ratios matter. 1 1 2 and 2 2 4 create the same grid. A value of 0 is rejected because the slicer does not implement zero-time grace events. Real-valued proportions are accepted as an AudioTools extension; in OpenMusic RT notation, floating-point leaves have tie semantics, whereas this script treats them numerically and reports the difference.

Quick start

  1. Select exactly one Sound in Praat.
  2. Run OM_Rhythm_Tree_Slicer.praat.
  3. Choose Manual or one of the six presets.
  4. Set tempo, metre and the flat Proportions list.
  5. Choose a transformation and, where relevant, rotation or substitution settings.
  6. Choose how source material is assigned with Material_mapping and Material_follows_transform.
  7. Choose fade and normalization policy, then run the script.

The output is named <source>_OM_RT. It is assembled by concatenating the generated sounding slices, rests and any required zero-padding in final temporal order.

Praat version: the modern colon-form syntax used by this script requires Praat 6.3 or newer. The processing body itself is compatible across a wider range, but the interactive form is not recognised correctly by older 6.1/6.2 versions.

Six presets (+ Manual)

Presets overwrite the score-related fields shown below: metre, proportions, transformation, rotation/substitution values, repetitions and material mapping. They do not change tempo, Material_follows_transform, fade settings, normalization/peak, visualization, or playback settings.

PresetMetreProportionsTransformRepsMapping
4/4 quarters - None4/41 1 1 1None2Sequential
5/4 additive - reverse-tree5/42 1 1 -1 2 1reverse-tree2Sequential
7/8 additive - rotate-tree (progressive)7/82 -1 2 1 1rotate-tree, N=2, progressive4Sequential
4/4 mask - rotate-props4/41 1 -1 1 1 -1 1 1rotate-props, N=3, progressive4Proportional
4/4 nested quintuplet - subst-rhythm4/41 1 -1 1leaf 2 → 1 1 1 1 12Sequential
4/4 mask - invert-rhythm4/41 -1 1 1 -1 1 -1 1invert-rhythm2Sequential

Transformations

None

Leaves remain in their original order.

reverse-tree

Leaf-order retrograde: p'[k] = p[n+1-k]. Each extracted audio slice itself still plays forward; only leaf order and, when enabled, source-window identity are rearranged.

rotate-tree

Circularly shifts complete leaves by Rotation_steps. Magnitude, sign and material identity travel together, so the onset grid changes.

rotate-props

Keeps each output slot's magnitude, so the onset grid is identical to None, while the sign pattern and material identity rotate.

subst-rhythm

Replaces one parent leaf with the proportions in Subst_proportions. Child magnitudes sum to the parent magnitude, so all other measure boundaries remain unchanged. Child signs come from the substitution list.

invert-rhythm

p'[k] = -p[k]. Sounding leaves become rests and rests become sounding leaves; durations stay unchanged.

Progressive rotation: when enabled, repetition r uses Rotation_steps × r. Repetition 1 is therefore already rotated by N, repetition 2 by 2N, and so on. Negative rotation values are supported.

Material mapping

The rhythm transformation decides when a leaf occurs. Material mapping decides which part of the source fills a sounding leaf.

Sequential (advance playhead)

The source playhead advances only for sounding leaves; rests do not consume source material. With Material_follows_transform = Off, source consumption follows output order. With it On, source windows are first assigned by each leaf's original identity, then the transformed output rearranges those windows.

Proportional (map to position)

With Material_follows_transform = Off, output position maps proportionally to source position. With it On, each transformed leaf maps to the relative source position of its original pre-transform identity; substitution children subdivide their parent's window.

Fixed start (stutter)

Every sounding leaf starts reading at the beginning of the source. The transform-follow flag has no effect in this mapping.

Retrograde qualification: Material_follows_transform = On can reverse the order of source chunks under reverse-tree, but it does not reverse sample order inside an individual slice. This is rhythmic/material retrograde, not reverse-audio processing.

Timing, extraction and fades

Sample-exact metric plan

Every measure is converted to an integer measureSamples. Leaf boundaries use cumulative rounding, with the final boundary forced to the exact measure length. Every leaf therefore receives an integer target length, and all repetitions remain aligned to the same measure grid.

The script reports requested and achieved sample counts plus drift. Under normal operation drift should be 0; a non-zero value is a diagnostic sign of unexpected behaviour, not an expected cumulative-rounding error.

Source-end policy

Edge fades

Fade_ms applies a raised-cosine fade with a butt join, not an overlap crossfade. The fade is clamped to half the extracted slice length. With Fade_only_discontinuities = On (default), contiguous reads from the source remain untouched; fades are used at rests, non-contiguous edits, zero-padding boundaries and outer file edges.

Concatenation

Praat concatenates selected Sounds in object-list/creation order. The script therefore creates every temporary piece directly in final temporal order and checks that object IDs are ascending before calling Concatenate. All temporary pieces are removed afterward.

Parameters & defaults

ParameterDefaultMeaning
PresetManualManual settings or one of six complete score recipes.
Tempo_BPM120Quarter-note BPM. The denominator scales the measure duration.
Numerator / Denominator4 / 4Time signature. Non-power-of-two denominators are accepted but reported as unconventional notation.
Repetitions2Number of measure repetitions.
Proportions1 1 2 -1 1Flat signed proportion list; negative = rest; zero rejected.
TransformationNoneOne of the six transformations described above.
Rotation_steps1Circular shift for rotate-tree / rotate-props; may be negative.
Progressive_rotationOffUses N×r on repetition r.
Subst_target_leaf3Parent leaf replaced by subst-rhythm; if above the leaf count it is clamped to the last leaf and reported.
Subst_proportions1 1 1Child proportions for subst-rhythm.
Material_mappingSequentialSequential, Proportional, or Fixed start.
Material_follows_transformOnAssociates source-window identity with transformed leaves where the mapping supports it.
Fade_ms8 msRaised-cosine edge guard.
Fade_only_discontinuitiesOnLeaves truly contiguous source joins unfaded.
NormalizationPeak ceiling (attenuate only)Attenuate-only ceiling, Normalize to peak, or Off.
Peak_dB-1.0 dBFSTarget used by the two peak-level policies. Values above 0 dBFS are rejected.
Draw_visualizationOnDraws the v0.4 four-panel diagnostic page.
Play_resultOnPlays the final Sound.
Normalization modes:
  • Peak ceiling (attenuate only): reduces level only when the raw peak exceeds Peak_dB; quieter material is left unchanged.
  • Normalize to peak: scales any non-silent result so its peak equals Peak_dB.
  • Off: applies no final level scaling.

Visualization — v0.4

v0.4 standardizes the page layout but preserves the script-specific transformation display. The figure contains four information regions:

The visualization represents the actual planned/rendered structure; it is not a generic explanatory diagram.

Limits and interpretation