Controls & Shortcuts
The Webtar is designed for expressive performance using a combination of mouse, keyboard, and device sensors.
Keyboard Shortcuts
| Key | Function | Description |
|---|---|---|
| Arrow Left / Right | Whammy Bar | Bends pitch down or up (±3 semitones). Physics-based return. |
| 0 - 9 | Whammy Sensitivity | Sets the inertia of the whammy bar. 1 = Fast (100ms), 0 = Slow (1000ms). |
| Shift (Hold) | Harmonics Mode | Snaps excitation to natural harmonic nodes (1/2, 1/3, 1/4…). Visualizes nodes. |
| H / J / K / V / B / N / M | Recall Chord Slot (1-7) | Recalls one of the 7 stored chord/string snapshots. |
| Shift + H / J / K / V / B / N / M | Save Chord Slot (1-7) | Saves the current setup into the selected slot. |
| Alt (Hold) | Mute Hover | Temporarily disables hover strumming, allowing silent cursor movement. |
| F | Fullscreen | Toggles fullscreen mode. |
| U | Toggle HUD | Hides or shows the Heads-Up Display details. |
Chord slots persist the full playable state: string quantity, base/fundamental frequency, and each string’s tuning + geometry (frequency, angle, length, x, y). This lets you build a 7-step performance pipeline and jump between saved configurations instantly.
Mouse & Touch Interaction
- Hover / Strum: Move the cursor across strings to excite them. The velocity and acceleration of your movement determine the volume and spectral brightness (timbre).
- Click / Tap: Plucks a string at a specific point.
- Double Click: Toggles fullscreen (if clicked on empty space).
Mobile / Sensors
- Gyroscope: Tilt your device left or right to control the Whammy Bar pitch bend.
HUD Controls
- Strings: Drag up/down or click arrows to change string count (1-24).
- Freq: Drag up/down or click arrows to change the fundamental tuning frequency.
- Toggles: Enable/Disable Hover or Click interactions.
- Whammy Visual: Shows the current bend angle and sensitivity setting.
Theoretical Basis
The Webtar combines two distinct simulation approaches to achieve both visual realism and audio fidelity.
1. Visual Physics: 1D Wave Equation
The visual representation solves the 1D Wave Equation using an Explicit Finite Difference Time Domain (FDTD) method.
This simulates traveling waves, reflections at boundaries, and interference patterns (standing waves) in real-time at 60fps. It allows the strings to visually “wobble” and react to the whammy bar’s tension changes.
2. Audio Synthesis: Modal Synthesis
For audio, FDTD can be unstable at high frequencies in a browser environment. Instead, we use Modal Synthesis. A string is modeled as a sum of damped sinusoidal modes.
- Excitation: The pluck position determines the initial amplitude of each mode (Comb Filtering / Missing Fundamental).
- Damping: High-frequency modes decay faster (), simulating internal friction and air resistance.
- Embellished Harmonics: When “Shift” is held, the engine applies a “Virtual Finger” constraint. It suppresses modes that don’t match the harmonic series of the touched node, but intentionally leaks a “Shadow Fundamental” and sub-harmonics to add body and low-end weight to the sound.
3. Whammy Physics: Hybrid Ghost Model
The whammy bar uses a novel Hybrid Physics Engine to handle the return-to-zero behavior:
- Ghost Linear: Simulates a perfect linear return based on the selected sensitivity (ms).
- Ghost Spring: Simulates a mass-spring-damper system tuned to the same duration.
- Blending: The actual output blends these two simulations based on a “bounciness” factor, allowing for a return that is both precise in timing and organic in feel.
Software Architecture
The application is structured using several classic software design patterns to manage complexity.
Design Patterns
- AudioWorklet Pattern: All synthesis logic runs on a separate high-priority audio thread to prevent UI jank (garbage collection, layout thrashing) from causing audio glitches.
- Command Pattern: Excitations (plucks, strums) are encapsulated as commands passed from the
InteractionManagerto theVirtualString, and then to theAudioWorklet. - Observer Pattern: The
InteractionManagerobserves DOM events and notifies strings. The strings observe their own physical state to update visuals. - Facade Pattern: The
InstrumentAppclass provides a unified interface to the subsystems (StringComposer,InteractionManager,AudioGraph), hiding the initialization complexity. - Factory Pattern: The
StringComposergenerates string ensembles based on tuning systems (Equal Temperament, Just Intonation) and layout algorithms (Fan, Parallel, Random).
Audio Signal Graph
The signal chain is designed for “Mastering-grade” loudness and clarity within the browser:
- Sources: Polyphonic String Synthesizers (AudioWorklet).
- Bus: Strings sum into a
StringBus. - Dynamic EQ: Active harmonics trigger a bass boost (+15dB @ 200Hz) and high-cut to warm up the tone.
- Reverb: Convolution Reverb (Impulse Response) on a send/return path.
- Dynamics Chain:
- Pre-Gain: Drives the signal.
- Upward Expander: Increases perceived density.
- Bus Compressor: Glues the mix together (Ratio 3.2:1).
- Limiter: Prevents digital clipping (Ceiling -1.0 dB).
Physics Model
The core simulation solves the wave equation:
Where:
- is the displacement of the string.
- is the wave speed.
- is the damping coefficient.
Discretization
The string is discretized into segments. The update equation for each point at time step is:
Where is the Courant number ().
This method accurately reproduces physical phenomena such as:
- Traveling Waves: Excitation creates two pulses traveling in opposite directions.
- Reflections: Waves invert upon reflection at fixed boundaries (bridge/nut).
- Interference: Standing waves emerge from the superposition of traveling waves.
References
- Julius O. Smith III, Physical Audio Signal Processing. (Digital Waveguides, FDTD).
- Karjalainen, M., Välimäki, V., & Järveläinen, H., Acoustic Guitar Synthesis. (Body resonance modeling, excitation shaping).
- J. Woodhouse, On the synthesis of guitar plucks. (Transient analysis).
- J.M. Adrien, Modal Synthesis. (The basis for the audio engine).
- Francisco Esquembre, Fremont Teng, Loo Kang Wee, The Vibrating String. (Basis for the visual FDTD model).
- Falstad, Paul. StringWave. (https://www.falstad.com/loadedstring/, accessed feb 2026)