Beat-Synced ZigZag - User Guide
Reverses alternating tempo-grid segments in place: segment 1 backward, segment 2 forward, segment 3 backward, and so on. The grid can use bars, quarter-note beats, eighths, sixteenths, or thirty-seconds.
What this does
Beat-Synced ZigZag divides a selected Sound into complete, tempo-synchronized segments and reverses every odd-numbered segment while leaving every even-numbered segment forward. Segment order is not changed: each segment stays in its original time position, but its playback direction alternates.
The script can process the whole Sound or only a quantized tail region. It does not analyze beats from the audio signal, does not time-stretch segments, and does not change pitch deliberately. Segments are extracted with a rectangular window, reversed when required, and concatenated back in chronological order.
What is ZigZag?
Here, zigzag means alternating playback direction across adjacent musical-grid segments. It is not a back-and-forth read pointer inside one continuous buffer and it is not a reordering of segments.
Segment 2: forward
Segment 3: reversed in place
Segment 4: forward
etc.
Changing the subdivision changes the scale of the transformation. Bars create large phrase-level reversals; sixteenths or thirty-seconds create rapid local reversals and a more fragmented texture.
Quick start
- Select exactly one Sound object in Praat.
- Run
Beat-Synced_ZigZag.praat. - Choose a preset or keep Custom.
- Choose Whole sound or Tail only (quantized from midpoint).
- Choose Fit bars to duration if the Sound contains a known number of complete bars, or use Manual BPM.
- Select the time signature and subdivision.
- Keep Keep_trailing_audio enabled if a final incomplete subdivision should remain in the result.
- Click OK. The result is named
<source>_zigzag_<subdivision>.
Presets
The six named presets change only Mode and/or Subdivision. They do not replace the current BPM mode, bar count, manual BPM, time signature, trailing-audio setting, visualization setting, or playback setting.
| Preset | Mode | Subdivision |
|---|---|---|
| Beat Stutter (quarter notes) | Whole sound | Beats (quarter notes) |
| Fast Glitch (16ths) | Whole sound | Sixteenth notes |
| Ultra Glitch (32nds) | Whole sound | Thirty-second notes |
| Bar Flip (whole bars) | Whole sound | Bars |
| Eighth Note Bounce | Whole sound | Eighth notes |
| Tail Only (from midpoint) | Tail only | Beats (quarter notes) |
Tempo, meter & subdivision
BPM convention
BPM always means quarter-note BPM in this script, for every time signature. This is especially important in 6/8: one 6/8 bar is treated as six eighth notes = three quarter-note units.
| Time signature | Quarter-note units per bar |
|---|---|
| 4/4 | 4 |
| 3/4 | 3 |
| 6/8 | 3 |
| 5/4 | 5 |
Fit bars to duration
This mode is a calculation from declared musical structure; it is not automatic tempo detection from audio content.
For example, a Sound declared as four bars of 4/4 is treated as 16 quarter-note units spread across the full Sound duration.
Subdivision duration
Processing modes
Whole sound
The tempo grid is anchored at the Sound start. The script processes as many complete subdivisions as fit. Odd segments are reversed and even segments remain forward.
Tail only (quantized from midpoint)
The first part remains untouched. The script finds the first subdivision boundary at or after the exact midpoint and begins the alternating reversal there. This keeps the processed tail on the same grid that is anchored at the Sound start.
If the midpoint already lies on a subdivision boundary, processing starts there.
Parameters
| Parameter | Default | Description |
|---|---|---|
| Preset | Custom | Custom or one of six mode/subdivision presets. |
| Mode | Whole sound | Process the whole Sound or a grid-quantized tail beginning at or after the midpoint. |
| Bpm_mode | Fit bars to duration | Derive quarter-note BPM from Sound duration and declared bar count, or use Manual BPM. |
| Number_of_bars | 4 | Positive bar count used only by Fit bars to duration. |
| Manual_bpm | 120 | Positive quarter-note BPM used in Manual BPM mode. |
| Time_signature | 4/4 | 4/4, 3/4, 6/8, or 5/4. Determines bar length and affects fit-to-duration BPM. |
| Subdivision | Beats | Bars, quarter-note beats, eighths, sixteenths, or thirty-seconds. |
| Keep_trailing_audio | On | Keeps an incomplete final subdivision unchanged. If Off, that remainder is omitted. |
| Draw_visualization | On | Draws Source, direction map, Output, and Summary. |
| Play_result | On | Plays the new Sound after processing. |
Safety limits
- The derived subdivision must be at least two samples long.
- At least one complete subdivision must fit in the selected processing range.
- A setting that would create more than 10,000 complete segments is rejected.
Output & visualization
Audio behavior
- Segments are extracted with a rectangular window.
- Odd-numbered complete segments are reversed; even-numbered segments are unchanged.
- The optional final partial subdivision is passed through forward and unchanged.
- Mono and multichannel Sounds remain multichannel; the same time reversal is applied to every channel in each reversed segment.
- There is no peak normalization, makeup gain, fade, or crossfade after assembly.
- The output name is
<source>_zigzag_bars,_beats,_8ths,_16ths, or_32nds.
Visualization
The visualization uses four levels:
- Source: original waveform.
- Segment direction map: red blocks with left arrows are reversed; green blocks with right arrows remain forward; gray regions are untouched head/tail or a dropped tail.
- Output: assembled ZigZag result.
- Summary: BPM source, meter, subdivision duration, mode, number of complete segments, reversed count, trailing-remainder policy, and input/output duration.
Source and Output waveforms are displayed with the same fixed amplitude range, allowing a direct visual comparison of waveform magnitude.