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.
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.
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
- Select exactly two Sound objects. The script treats selected Sound #1 as Source and selected Sound #2 as Target.
- The two sounds must have the same sample rate.
- Run Run script… →
Band-Based_Concatenative_Synthesis.praat. - Choose a preset or Manual.
- Choose the spectral Band_configuration.
- Use Continuity_weight and Locality_window to control how strongly the source path tends to continue near its expected next position.
- Set Dry_wet_mix and the desired Output_level_mode.
- Click OK.
Source and target
| Sound | Role | What is used |
|---|---|---|
| Source | Fragment library | Short source snippets are analyzed and later copied into the synthesized result. |
| Target | Matching guide | Its 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.
| Preset | Window | Hop | Continuity | Locality |
|---|---|---|---|---|
| Manual | 60 ms default | 30 ms default | 0.30 default | 0.4 s default |
| Subtle Morph | 80 ms | 40 ms | 0.50 | 0.6 s |
| Granular Texture | 40 ms | 20 ms | 0.15 | 0.3 s |
| Spectral Match | 50 ms | 25 ms | 0.35 | 0.4 s |
| Rhythmic Mosaic | 100 ms | 50 ms | 0.70 | 0.8 s |
| Smooth Blend | 120 ms | 60 ms | 0.60 | 1.0 s |
Controls
Timing and matching
| Control | Default | What it does |
|---|---|---|
| Window_length | 0.060 s | Length of each target analysis frame and each source grain. |
| Hop_size | 0.030 s | Distance between target frames. The script enforces an integer window/hop ratio of at least 2; a Manual value may therefore be adjusted. |
| Continuity_weight | 0.3 | Scales 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_window | 0.4 s | Sets how far around the expected source position the local search can look. It remains active even when Continuity_weight is 0. |
| Dry_wet_mix | 1.0 | Linear 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:
| Choice | Nominal bands (Hz) |
|---|---|
| 2 bands | 0–1000, 1000–10000 |
| 4 bands | 0–500, 500–1500, 1500–4000, 4000–10000 |
| 6 bands | 0–300, 300–800, 800–1500, 1500–3000, 3000–6000, 6000–12000 |
| 8 bands | 0–200, 200–400, 400–800, 800–1500, 1500–2500, 2500–4000, 4000–7000, 7000–12000 |
How matching works
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.
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
- Analysis: Source and Target are converted to mono copies for spectral matching.
- Synthesis: the same match path is applied independently to the Source channels, so corresponding source-channel relationships are retained.
- Output channel count:
max(Source channels, Target channels). - If the Source has fewer channels than the output requires, its last channel is reused for the additional wet channels.
- If the Target has fewer channels than the output requires and Dry_wet_mix < 1, its last channel is reused for the additional dry channels.
- Sample rate: Source and Target must match; the script does not resample them.
- Duration: the final result is trimmed to the Target duration.
- Time domain: internal copies are shifted to start at 0 for processing, then the result is shifted back to the Target start time.
Output level
| Mode | Behavior |
|---|---|
| None | Leaves the synthesized/mixed level unchanged. |
| Safety ceiling | If the absolute peak is above Ceiling_peak, attenuates to that peak. Quieter results are left unchanged. |
| Peak normalize | For 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:
| Panel | What it shows |
|---|---|
| Match trajectory | X = 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 cost | Frame cost over Target time; the dotted horizontal line is the mean cost. |
| Output waveform | A display-only mono fold-down of the final result. Its vertical amplitude range is derived from the output itself. |
| Summary | Preset, effective bands, window/hop, continuity/locality, frame and snippet counts, restarts, source-snippet utilization, average cost, and dry/wet mix. |
Outputs
- Name:
<Source>_concat_<Target>_<Preset>. - Duration: Target duration.
- Start time: Target start time.
- Sample rate: unchanged common Source/Target sample rate.
- Channels: maximum of Source and Target channel counts, with last-channel reuse where necessary.
- The original Source and Target objects remain in the Objects window; temporary analysis and synthesis objects are removed.