Rhythmatist
A rhythmic composition system that cuts a recording according to mathematical time-series, reorganizes its events, and changes their playback speeds. Speed affects both duration and pitch, so the resulting timeline becomes a new temporal composition, not simply a shuffled copy of the source.
The compositional idea
Rhythmatist treats a recording as material for a composition built from three independent but interacting decisions: where to divide the recording, in what order to place the resulting events, and how fast to play each one. A rhythmic structure can therefore emerge from the interplay of mathematical durations, event order, and changes in playback speed.
Segmentation
Choose one of five mathematical series to establish event boundaries in the source recording.
Organization
Keep, reverse, rotate, sort, alternate, or shuffle the extracted events.
Speed
Apply a trajectory of tape-style playback speeds to events in their new output order.
Selected Sound
→ mathematical boundaries (Su / Sc / Sy / Sd / SRC)
→ optional BPM grid and safe cuts
→ organization of source segments
→ speed trajectory + duration relationship
→ natural varispeed (or optional fixed-slot playback)
→ optional gaps, edge fades and stereo placement
→ newly assembled Sound + timeline visualization
Quick start
- Select exactly one Sound object in Praat.
- Run
Rhythmatist.praat. - Choose a compositional Preset, or choose Custom to control the three stages independently.
- For Custom, select a
Series_typeand enter five values intoParams_a_b_c_d_e, separated by spaces. - Select an
OrganizationandSpeed_trajectory. SetSpeed_min,Speed_maxand, optionally,Duration_link. - Keep
Playback = Natural varispeedto allow the composition to change duration organically. UseTarget_duration = 0for a freely determined output length. - Optionally set gaps, fades, safe cuts, BPM snapping, stereo placement and a random seed. Run the script and listen to the created
<source>_rhythmatistSound.
A useful first comparison: Run Original Pulse as a reference, then run Accelerando, Rhythmic Arch, and Long-Short Dialogue on the same source. These examples explore different connections between event structure and speed.
Eight compositional presets + Custom
The presets are intended to represent different ideas of rhythmic form, rather than minor variations in numerical settings. They can be used as finished procedures or as points of departure for listening and further experimentation.
| Preset | Segmentation & organization | Speed behavior | Musical character |
|---|---|---|---|
| Original Pulse | Su 8; original order | Constant 1×; no gap | Eight equal source divisions without speed transformation. A reference against which to hear changes. |
| Accelerando | Su 16; original order | Acceleration, 0.6–2.2× | Increasing playback speed and shorter resulting events toward the end. |
| Ritardando | Su 12; original order | Deceleration, 0.45–1.6×; 15% proportional gap | Progressive temporal expansion, with space between events. |
| Rhythmic Arch | Sc 3+5; original order | Arch, 0.6–2.4× | A speed climax near the middle, followed by relaxation. |
| Long-Short Dialogue | Sd 10; long-short alternation | Alternating, 0.6–1.8×; duration link −0.4; 40 ms gap | Contrasting event lengths and speed responses, structured as a dialogue. |
| Fractured Time | Sy 14; random shuffle | Random controlled, 0.4–2.5×; duration link −0.6 | Irregular divisions and strong local temporal contrasts. |
| Controlled Chaos | SRC (4,3,5,6,5); grouped shuffle | Wave, 0.5–2×; duration link +0.3; 10% gap | Dense yet locally organized irregularity, shaped by a cyclic speed pattern. |
| Dense Strata | SRC (6,4,7,8,6); random shuffle | Constant speed trajectory, 1.4–2.4×; duration link +0.4 | Many relatively short events, shaped further by duration-dependent speed. |
The speed ranges above describe each preset before any optional target-duration adjustment. Speed choices may be restricted by the allowed range when Duration_link is active.
Five mathematical segmentation systems
Each series creates internal split points on a normalized time axis from 0 to 1. The points are mapped onto the source Sound and converted to event boundaries. The resulting segment count may change after deduplication, BPM snapping, safe cuts or sample-level sanitation.
Su — Uniform Regular
Param_a = n. Divides the source into n equal durations.
Sc — Regular Compound
Param_a = a, Param_b = b. Combines two regular grids and removes duplicate points.
Sy — Irregular Cumulative
Param_a = n. Generates and sorts n−1 independent random internal split positions, yielding up to n segments.
Sd — Irregular Individual
Param_a = n. Generates n random positive duration weights, normalizes them to sum to 1 and accumulates them into split points.
SRC — Combined series
Merges and deduplicates boundaries from Su, Sc, Sy and Sd. This creates a richer single segmentation grid, not simultaneous layers. The five parameter values are mapped as follows:
Position in Params_a_b_c_d_e | Meaning for SRC |
|---|---|
| a | Su segment count |
| b | Sc first grid |
| c | Sc second grid |
| d | Sy segment count |
| e | Sd segment count |
For Su, Sy and Sd only a is used. For Sc, a and b are used. The script accepts at most 2,000 requested internal points before deduplication.
Temporal organization
Once the source is divided, the organization stage maps output position → original segment. Speed is calculated afterward, using the new positions.
| Mode | What happens |
|---|---|
| Original order | Maintains the sequence of source segments. |
| Random shuffle | Fisher–Yates permutation of all segments. |
| Reverse | Reverses event order (not the audio samples inside each event). |
| Rotation | Cyclically shifts the order by approximately one-third of the segment count. |
| Long-short alternation | Uses longest, shortest, second-longest, second-shortest, and so on. |
| Short to long | Arranges events in ascending original duration. |
| Long to short | Arranges events in descending original duration. |
| Grouped shuffle | Shuffles within neighboring groups of roughly √N segments; group order is retained. |
Sorting modes use original source-segment durations. Speed processing can subsequently change the audible lengths, so the final event-duration pattern may differ.
Speed composition
Natural Varispeed: speed changes time and pitch
Rhythmatist uses tape-style varispeed. It reinterprets the segment's sampling frequency and resamples at the source rate. Thus a higher speed produces a shorter, higher-pitched event; a lower speed produces a longer, lower-pitched event. It is not pitch-preserving time-stretching.
Illustration based on a one-second source segment. Actual durations are sample-quantized.
Seven speed trajectories
Speed_trajectory | Playback-speed pattern across output events |
|---|---|
| Constant | The geometric center of the allowed speed range for every event, before Duration_link. Equal minimum and maximum give an exact constant speed. |
| Acceleration | Progressively increases speed from minimum toward maximum. |
| Deceleration | Progressively decreases speed from maximum toward minimum. |
| Arch | Starts slowly, reaches a speed maximum near the center, and returns toward the minimum. |
| Alternating | Alternates slow and fast speed ratios between successive events. |
| Wave | Uses two cyclic waves across the output sequence. |
| Random controlled | Uses a bounded random walk, creating related neighboring speeds rather than unrelated random values. |
Speed is interpolated on a logarithmic scale, creating balanced multiplicative changes in playback rate. A trajectory is assigned by output position, even when the source events have been reordered.
Duration_link: connect source length to speed
This parameter ranges from −1 to +1 and modifies the speed trajectory according to each event's original length relative to a geometric reference duration.
| Value | Meaning |
|---|---|
| 0 | Speed is independent of the original event duration. |
| Positive | Longer source events tend to play faster. |
| Negative | Longer source events tend to play slower, reinforcing differences in duration. |
| Close to +1 | Can strongly equalize resulting event lengths, particularly with a constant trajectory and without speed limiting. |
Final speed ratios are limited to Speed_min…Speed_max. The script warns when the magnitude of Duration_link is at least 0.8. The allowed speed range is 0.1× to 8×, with Speed_min ≤ Speed_max.
Playback modes
Natural varispeed (default)
The timeline follows the actual processed durations. Faster events become shorter; slower events become longer. No silence is inserted merely to restore a source event's original duration.
Fixed-slot varispeed
Each event occupies its original duration as a slot. Shorter playback leaves silence in the slot; longer playback is cut at the slot boundary. Choose this when a fixed temporal grid is part of the intended composition.
Composition duration
Target_duration_(s,_0_=_free) controls the length of a result made with Natural Varispeed.
- 0 (Free Duration): the sum of actual processed-event lengths plus any intentionally inserted gaps determines the output duration.
- Positive target: the script attempts to shift the speed curve globally to meet the target while respecting the specified speed limits. If necessary, it reduces the depth of the speed differences.
- Unreachable target: the script reports that the request cannot be met, including a reachable interval, and keeps the free-duration result instead.
- Fixed-slot mode: Target_duration is ignored, as the event slots retain their source lengths (gaps can still add time).
Gaps, fades and safe cuts
| Control | Choices | Purpose |
|---|---|---|
| Gap | None / Fixed (ms) / Proportional (% of event) | Places intentional silence between events, never after the last event. The proportional mode uses each processed event's audible length. |
| Gap_value | Non-negative number; default 50 | Milliseconds in Fixed mode, percent in Proportional mode; ignored for None. |
| Edge_fade | 0–50 ms; default 2 ms | Applies raised-cosine fades at the beginning and end of each event inside its duration. 0 retains hard, sharp boundaries. |
| Safe_cuts | Off / On; default Off | Adjusts proposed mathematical boundaries toward a locally quiet point and, when nearby, a zero crossing. |
Safe Cuts: the search is within at most ±15 ms of the mathematical boundary (at most ±5 ms when BPM snapping is enabled), further limited by neighboring boundaries. This reduces the likelihood of clicks but can shift exact mathematical positions slightly.
The script uses contiguous placement without crossfades between events. Fades occur within events and do not lengthen the composition. In fixed-slot mode, silence inserted inside a slot is distinct from any additional inter-event gap.
Optional BPM grid
With Bpm_value = 0, mathematical boundaries are used without tempo quantization. With a positive value, Rhythmatist snaps boundaries to a grid defined by BPM and Grid_division. This is not beat or onset detection.
| Grid division | Units per beat |
|---|---|
| Quarter notes | 1 |
| Eighth notes | 2 |
| Triplet eighths | 3 |
| Sixteenth notes (default) | 4 |
| Triplet sixteenths | 6 |
The private processing copy may be shortened to fit an exact whole number of grid units; the original Sound remains unchanged. Duplicate or out-of-range snapped points are removed, so enabling a coarse grid can reduce the number of segments. Safe Cuts, if enabled, may subsequently move boundaries a few milliseconds away from exact grid locations.
Stereo placement and source identity
Stereo_placement = Off (keep source channels) leaves the source's original channel count intact. When stereo placement is selected, the output is two-channel and its pan behavior follows either the source segment's identity or its new output position, depending on the chosen mode.
| Placement mode | Rule |
|---|---|
| Off (keep source channels) | No new pan assignment. The source channel count is retained through the varispeed process. |
| Alternate L-R by source segment | Alternates according to source-segment index; the spatial identity follows the original event. |
| Alternate L-R by output position | Alternates across the new assembled sequence. |
| Sweep L to R by source segment | Pan position is based on the original segment index. |
| Sweep L to R by output position | Creates a progression across the actual output order. |
| Cycle 4 positions by output position | Cycles through four pan positions across output events. |
| Random positions | Assigns reproducibly randomized pan positions when a seed is set. |
Stereo_width is clamped to 0…1 (default 0.8). A width of 0 centers the pan, but does not turn stereo processing off: use the Off placement mode for that.
Mono input is panned using equal-power gains. For stereo input, the script applies left/right balance to the two original channels rather than folding them to mono. If an input has more than two channels, selecting stereo placement produces a two-channel result based on the first two channels; use Off to keep all source channels.
Parameters and initial defaults
The table describes the initial form values. A named preset changes only the fields specified in the preset description.
| Praat form field | Default | Function |
|---|---|---|
Preset | Custom | Custom settings or one of eight named presets. |
Series_type | Su | Mathematical boundary system. |
Params_a_b_c_d_e | 8 4 5 4 3 | Five space-separated positive integers mapped according to the series. |
Organization | Random shuffle | How source events are ordered in the result. |
Speed_trajectory | Acceleration | Speed pattern over output positions. |
Speed_min / Speed_max | 0.5× / 2× | Allowed playback-speed range; must be within 0.1×–8×. |
Duration_link | 0 | Correlation between original segment duration and speed; −1…+1. |
Playback | Natural varispeed | Natural event durations or fixed-slot placement. |
Target_duration | 0 s | 0 = free; positive = attempt a global duration target in Natural mode. |
Gap / Gap_value | None / 50 | Gap mode and numerical gap size (ms or % depending on mode). |
Edge_fade | 2 ms | Boundary fade inside each event; 0–50 ms. |
Safe_cuts | Off | Optional local boundary refinement. |
Bpm_value | 0 | 0 = no grid; positive = quantized boundary positions. |
Grid_division | Sixteenth notes | Grid resolution when BPM is active. |
Stereo_placement | Off | Preserve channels or place events in stereo. |
Stereo_width | 0.8 | Maximum pan displacement if placement is enabled. |
Random_seed | 0 | 0 = new seed every run; positive integer = reproducible random choices. |
Draw_visualization | On | Draw the source, segment map, speed trajectory, result and summary. |
Play_result | On | Play the completed output Sound. |
Reading the visualization and Info report
The Praat Picture window is organized as a compositional score of what the script actually assembled.
- Source waveform: the processing-source waveform with final split boundaries in red and, when active, the BPM grid.
- Segment map: the blue upper row represents source events at their original locations; the orange lower row shows their actual lengths and order in the output. Numbers identify source segments; grey denotes inserted silence, including gaps and fixed-slot padding.
- Speed plot: the actual playback speed assigned to each event along the output timeline, displayed on a logarithmic vertical scale.
- Result waveform: the completed composition, with left and right channels drawn in different colors when the result has more than one channel.
- Summary: preset, segmentation and organization, speed range and duration link, source/output length, gaps, seed, and other processing information.
The Info window provides a separate event-by-event table with output position, source-segment number, original duration, actual speed, processed duration, output start time, pan, gap, and any fixed-slot note.
Output behavior and practical notes
| Item | Behavior |
|---|---|
| Result name | <source>_rhythmatist. |
| Original Sound | Unchanged. Processing uses a private copy; its start time is reset to zero. |
| Sample rate | The result is resampled to the source sampling frequency. |
| Duration | Actual event lengths plus any gaps in Natural mode; source-length slots plus gaps in Fixed-slot mode. |
| Randomness | Supply a positive Random_seed to repeat random segmentation, ordering, speeds and pan choices. With 0, the generated seed is printed in Info for reuse. |
| Peak protection | If the measured absolute peak exceeds 0.99, the final Sound is peak-scaled to 0.99; otherwise its gain is unchanged. |
| Playback | Optional, controlled by Play_result. |
| Dependencies | Pure Praat; no external Python process or audio files are required by the script. |