Band-Based Concatenative Synthesis — User Guide

Reconstructs the timing of a target sound with fragments selected from a source sound by multi-band spectral similarity.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.7 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

The script takes two selected sounds. The Source supplies the audio fragments. The Target supplies the sequence of spectral shapes to follow. For each target frame, the script searches the source for a fragment with a similar distribution of energy across frequency bands, then reconstructs the result from those source fragments.

In one line: Target frame → find a spectrally similar Source fragment → place that Source fragment at the corresponding Target time.

The match is calculated from mono analysis copies, but synthesis is performed per source channel using the same match path. Fragments are combined with a Hann window and weighted overlap-add: the accumulated window weights are divided out before the result is trimmed to the target duration.

Quick start

  1. Select exactly two Sound objects. The script treats selected Sound #1 as Source and selected Sound #2 as Target.
  2. The two sounds must have the same sample rate.
  3. Run Run script… → Band-Based_Concatenative_Synthesis.praat.
  4. Choose a preset or Manual.
  5. Choose the spectral Band_configuration.
  6. Use Continuity_weight and Locality_window to control how strongly the source path tends to continue near its expected next position.
  7. Set Dry_wet_mix and the desired Output_level_mode.
  8. Click OK.
Useful starting point: Spectral Match gives 50 ms windows, 25 ms hops, continuity 0.35, and a 0.4 s locality window. The default band choice is the 4-band layout; at common high sample rates the script may add one extra top band so frequencies above the nominal layout also participate in matching.

Source and target

SoundRoleWhat is used
SourceFragment libraryShort source snippets are analyzed and later copied into the synthesized result.
TargetMatching guideIts frame-by-frame band-energy pattern determines which source fragments are preferred.

The result follows the Target duration and time domain, but its wet audio is assembled from the Source. A dry/wet setting below 1 blends the synthesized result with the Target.

Presets

Presets change only four matching/time controls: Window_length, Hop_size, Continuity_weight, and Locality_window. They do not change Band_configuration, Dry_wet_mix, Output_level_mode, Ceiling_peak, playback, or visualization.

PresetWindowHopContinuityLocality
Manual60 ms default30 ms default0.30 default0.4 s default
Subtle Morph80 ms40 ms0.500.6 s
Granular Texture40 ms20 ms0.150.3 s
Spectral Match50 ms25 ms0.350.4 s
Rhythmic Mosaic100 ms50 ms0.700.8 s
Smooth Blend120 ms60 ms0.601.0 s

Controls

Timing and matching

ControlDefaultWhat it does
Window_length0.060 sLength of each target analysis frame and each source grain.
Hop_size0.030 sDistance between target frames. The script enforces an integer window/hop ratio of at least 2; a Manual value may therefore be adjusted.
Continuity_weight0.3Scales the soft penalty for moving away from the source position expected from the previous match. Higher positive values favor a more continuous source trajectory.
Locality_window0.4 sSets how far around the expected source position the local search can look. It remains active even when Continuity_weight is 0.
Dry_wet_mix1.0Linear wet/dry mix: 1 = synthesized Source fragments only, 0 = Target only. Use the 0–1 range; the script does not clamp the field.

Band configuration

Band energies are the features used for matching. The layouts below are the nominal bands before sample-rate adaptation:

ChoiceNominal bands (Hz)
2 bands0–1000, 1000–10000
4 bands0–500, 500–1500, 1500–4000, 4000–10000
6 bands0–300, 300–800, 800–1500, 1500–3000, 3000–6000, 6000–12000
8 bands0–200, 200–400, 400–800, 800–1500, 1500–2500, 2500–4000, 4000–7000, 7000–12000
Nyquist adaptation: bands that cannot exist at the current sample rate are dropped. If at least 1 kHz remains above the highest retained nominal band, the script adds one additional band from that edge to Nyquist. The effective number of bands can therefore differ from the menu label.

How matching works

Source + Target ↓ mono analysis copies ↓ Hann band-pass filter bank ↓ log RMS energy per band and frame ↓ source-based z-score normalization ↓ Euclidean spectral distance + bounded continuity preference inside Locality_window ↓ source fragment selected for each target frame ↓ per-channel weighted overlap-add

1. Analysis

Source and Target are folded to mono for matching. For each active band the script applies a Hann band-pass filter, measures RMS in each time region, converts positive RMS values with the natural logarithm, and z-score normalizes both sounds using the Source mean and standard deviation for that band.

2. Candidate spacing

Target frames are spaced by Hop_size. Source candidates are denser: snippet hop = Hop_size / 2. With the usual 2× overlap, continuing straight through the source therefore advances by approximately two source snippets per target frame.

3. Spectral match and continuity

The spectral part of the cost is Euclidean distance between normalized band-energy vectors. The script also computes a deterministic scale factor from a sample of source/target distances. Continuity_weight multiplies that scale.

After the first frame, the search is centered on the source position expected from the previous match. The continuity penalty grows with distance from that expected position but is bounded by the locality search range. If the expected path runs beyond the end of the source, the script performs a global spectral re-search for that frame and then continues from the new position.

Match cost in the visualization: after the first/global-restart frames, this value contains both spectral distance and the continuity term. It is not a pure spectral-distance curve.

4. Reconstruction

Each selected source grain is multiplied by a Hann synthesis window. Grains overlap in a padded buffer. A second buffer accumulates the same Hann weights, and the synthesized audio is divided by that weight sum before the exact Target span is extracted. This is normalized weighted overlap-add, rather than simple concatenation or a separate user-set crossfade.

Channels, sample rate, and duration

Output level

ModeBehavior
NoneLeaves the synthesized/mixed level unchanged.
Safety ceilingIf the absolute peak is above Ceiling_peak, attenuates to that peak. Quieter results are left unchanged.
Peak normalizeFor a non-silent result, always scales the absolute peak to Ceiling_peak, upward or downward.

Ceiling_peak defaults to 0.95. The default output-level mode is Safety ceiling.

Visualization

When Draw_visualization is enabled, v0.7 draws three diagnostic panels plus a summary strip:

PanelWhat it shows
Match trajectoryX = Target time; Y = selected Source time. The grey diagonal is the identity-time reference, the blue path is the selected source trajectory, and red crosses mark individual matches.
Match costFrame cost over Target time; the dotted horizontal line is the mean cost.
Output waveformA display-only mono fold-down of the final result. Its vertical amplitude range is derived from the output itself.
SummaryPreset, effective bands, window/hop, continuity/locality, frame and snippet counts, restarts, source-snippet utilization, average cost, and dry/wet mix.
Source-snippet utilization is the percentage of available source snippets that appeared at least once in the match path. It is a usage statistic, not a quality score.

Outputs