Vector Synthesis — User Guide
Four-source vector synthesis using a 2-D control path and bilinear interpolation between SAW, SQR, TRI, and SIN corner sources. Single-note mode follows one path over one note; Melody demo keeps the vector path continuous across an eight-note sequence.
What this does
The script generates sound from four phase-related oscillator families placed at the corners of a unit square. A point (X(t), Y(t)) moves through that square according to the selected path. Its position becomes four interpolation weights, and the weighted oscillator sum becomes the output.
2-D path → bilinear weights → SAW / SQR / TRI / SIN → weighted mono sum → note-edge fades → mean removal → target peak normalization
No input Sound is required. The vector controls timbre, not pitch: within each note all four corner sources use the same fundamental frequency.
Quick start
- Choose Single note or Melody demo.
- Select one of the twelve Path types.
- Set Path speed in cycles per second.
- For Single note, set Duration and Frequency.
- Enable Edit details if you need to change Sample rate, Output peak, or Show trail.
- Run the script. A mono Sound named
VectorSynthorVectorSynth_Melodyis created.
Vector space and bilinear weights
The four sources occupy the four corners of the interpolation square:
| Corner | Coordinate | Source |
|---|---|---|
| A | (0, 0) | SAW |
| B | (1, 0) | SQR |
| C | (0, 1) | TRI |
| D | (1, 1) | SIN |
At each sample the weights are:
wB = X(1-Y)
wC = (1-X)Y
wD = XY
and the synthesized sample is:
For coordinates inside the unit square, the four weights are non-negative and always sum to 1. At a corner one source has weight 1; at the center all four weights are 0.25.
Corner sources
| Source | Current implementation |
|---|---|
| A — SAW | Rising sawtooth with a polyBLEP correction at the wrap discontinuity. |
| B — SQR | 50% square wave with polyBLEP corrections at both discontinuities. |
| C — TRI | Direct triangle formula 4·abs((phase mod 1)-0.5)-1. Its harmonics fall much faster than the saw/square spectrum, but it is not generated with a polyBLEP correction. |
| D — SIN | Pure sine oscillator. |
All four sources inside a note use the same fundamental frequency and local note time. Their phases are therefore deterministically related while they are blended.
Path types
Path speed is measured in cycles per second. The periodic paths use global path phase:
| Path | Actual v0.5 behavior |
|---|---|
| Circle | X=.5+.4 cos(2πp), Y=.5+.4 sin(2πp). |
| Ellipse | Circle-like path with horizontal radius .45 and vertical radius .30. |
| Lissajous (3:2) | X=.5+.4 sin(3·2πp), Y=.5+.4 sin(2·2πp). Because 3:2 is rational, the curve is periodic. |
| Figure-8 | X=.5+.4 sin(2πp), Y=.5+.4 sin(2·2πp). |
| Spiral In | Radius decreases linearly from .45 to 0 over the complete piece duration. |
| Spiral Out | Radius increases linearly from 0 to .45 over the complete piece duration. |
| Square Path | Continuous motion along the four edges of the inner square from .1 to .9. It no longer jumps from corner to corner. |
| Star | Angular rotation with a radial factor .5+.5 cos(10πp). |
| Infinity Loop | Rational lemniscate-like curve using denominator 1+sin²(2πp). |
| Butterfly | Deterministic butterfly-like trigonometric/exponential curve, scaled to remain near the center of the square. |
| Rose Curve | Polar-style radius cos(5·2πp), producing a five-fold rose trajectory. |
| Quasi-Chaotic Curve | Deterministic incommensurate-looking trigonometric product using factors 3.7 and 2.3. It is not a dynamical-system attractor. |
Path speed = 0
Zero is allowed. In that case the path remains at its analytical starting point for the complete note or melody, creating a static blend rather than motion.
Melody demo
Melody demo renders this fixed eight-note sequence:
G2 98.00 Hz 0.5 s
A2 110.00 Hz 0.5 s
C3 130.81 Hz 0.7 s
A2 110.00 Hz 0.5 s
G2 98.00 Hz 0.5 s
E2 82.41 Hz 0.5 s
D2 73.42 Hz 0.9 s
Total duration is exactly 4.6 seconds.
Continuous vector motion
Version 0.5 passes each note's global offset into the path equations. Therefore the vector path does not restart at note boundaries. A circle, Lissajous path, Square Path, or other trajectory continues from the position reached by the previous note.
Local oscillator phase
The oscillator sources themselves use local note time, so oscillator phase restarts for each new note. Each note also receives a short fade-in and fade-out:
fade-out = min(10 ms, duration/4)
The fades are articulation fades; they do not alter the underlying global vector trajectory.
Controls
Main page
| Control | Default | Meaning |
|---|---|---|
| Synthesis mode | Single note | Single user-defined note or fixed eight-note Melody demo. |
| Path type | Circle | Selects one of twelve analytical 2-D trajectories. |
| Path speed | .5 cycles/s | Global vector-motion rate; zero is allowed. |
| Duration | 6.0 s | Single-note duration; ignored by Melody demo. |
| Frequency | 110 Hz | Single-note fundamental; ignored by Melody demo. |
| Edit details | off | Opens Sample rate, Output peak, and Show trail. |
| Draw visualization | on | Draws the mechanism-first four-panel display. |
| Play result | on | Plays the generated Sound. |
Details page
| Control | Default | Meaning |
|---|---|---|
| Sample rate | 44100 Hz | Direct synthesis and final output rate; minimum accepted value is 2000 Hz. |
| Output peak | .95 | Final target peak normalization; valid range >0…1. |
| Show trail | on | Uses a time-gradient trajectory in Panel A; off uses one neutral trajectory color. |
Sampling and safety
The script requires Sample rate ≥ 2000 Hz.
For Single note, and independently for every Melody-demo note, the fundamental must satisfy:
This protects the oscillator fundamental from approaching Nyquist. It is not a guarantee that every harmonic of the non-sinusoidal sources remains below Nyquist.
Saw and Square use polyBLEP to reduce discontinuity aliasing. Triangle has a faster-decaying harmonic series and is less alias-prone, but the generator has no oversampling or full harmonic truncation stage.
Output and level
| Property | Behavior |
|---|---|
| Input | No input Sound required. |
| Channels | Mono. |
| Duration | Single note: exactly Duration. Melody demo: exactly 4.6 s. |
| Sample rate | Exactly the Details-page Sample rate. |
| Note boundaries | Short local fades; Melody demo concatenates the eight rendered notes directly. |
| DC handling | Subtract mean is applied to the complete final Sound before normalization. |
| Normalization | Every non-silent final result is peak-scaled to Output peak. This is target normalization, not a down-only ceiling. |
| Object names | VectorSynth or VectorSynth_Melody. |
Visualization and QC
| Panel | What it shows |
|---|---|
| A — Vector trajectory | The selected path in the unit-square oscillator space, with A SAW, B SQR, C TRI, and D SIN at the four corners. Show trail optionally gives the trajectory a time gradient. |
| B — Bilinear source weights | The four actual weight trajectories wA…wD over the complete output duration. In Melody demo, dotted vertical lines mark note boundaries and make the continuous global path explicit. |
| C — Corner source waveforms | One normalized period of the same four oscillator definitions used by the engine. Melody demo uses E2 (82.41 Hz) as the display frequency. |
| D — Measured output | The complete final normalized waveform: either the single note or the full 4.6-second melody. |
The QC strip reports path and speed, measured X/Y ranges, maximum error in the identity wA+wB+wC+wD=1, mean contribution of each corner source, and final peak/RMS.