A physics-based audio synthesis plugin that simulates the acoustic behavior of a harmonium using numerical modeling of aeroacoustic principles.
This project implements a real-time digital harmonium synthesizer as a VST3 and standalone application using the JUCE framework. The synthesis engine is based on physical modeling of reed oscillation, air flow dynamics, and pressure propagation within the instrument's acoustic chambers.
PhysicsEngine (Source/PhysicsEngine.h)
- Implements the fundamental coupled differential equations equations governing reed oscillation and air flow
- Models pressure dynamics across three chambers: bellows (p0), reed chamber (p1), and narrow jet (p2)
HarmoniumState (Source/HarmoniumState.h)
- Contains dynamic state variables: pressures, flow rates, reed displacement and velocity
Voice (Source/Voice.h)
- Manages polyphonic voice allocation and stealing and supports three reed configurations
Bellows (Source/Bellows.h)
- Simulates bellows pumping mechanism through MIDI modulation wheel input
- Models air mass accumulation and consumption
Harmonium (Source/Harmonium.h)
- Main orchestration class managing six concurrent voices, integrates bellows simulation with voice processing
Convolution (Source/Convolution.h)
- Implements FFT-based convolution for acoustic space simulation
- Supports loading custom impulse response files
HarmoniumPhysicsEngineAudioProcessor (Source/PluginProcessor.h, Source/PluginProcessor.cpp)
- JUCE AudioProcessor implementation for DAW integration
- Handles MIDI note-on/off events and continuous controller messages
- Per-sample processing loop calling the physics simulation
PluginEditor (Source/PluginEditor.h)
- Graphical user interface for real-time parameter control
The synthesis model is based on the following coupled equations derived from Puranik and Scavone (2023) [1]:
V₁/c₀² × d(p₁-p_atm)/dt = ρ₀(u₀ - u)
Where bellows flow (u₀) minus total volume flow (u) determines pressure rate of change.
p₁ = p₂ + ρ₀L₂/S₂ × du/dt
Relates reed chamber pressure to jet pressure via inertial effects.
p₂ = p_atm + ½ρ₀vⱼ²
Determines jet velocity from pressure differential.
d²ζ/dt² = μp₂ - ω₀²ζ - (ω₀/Q)(dζ/dt)
Driven oscillator with pressure forcing, spring restoring force, and damping.
u = Sr·(dζ/dt) + αSu·vj
Combines reed pumping action with jet flow through aperture.
An adaptive quality factor mechanism artificially extends decay time when air pressure is present, simulating sustained excitation.
Harmonic content is generated by applying amplitude-frequency weighting to the fundamental flow signal, calibrated to match spectral analysis of recorded harmonium tones.
- Sample Rate: Configurable (default 44.1 kHz)
- Integration Method: Forward Euler with time step dt = 1/sampleRate
- Voice Count: 6 polyphonic voices with voice stealing
- Numerical Stability: Clamping applied to state variables to prevent divergence
- Physical Parameters: Reed dimensions, air density, sound speed, chamber volumes
- JUCE 7.x or later
- C++17 compatible compiler
- Xcode (macOS), Visual Studio (Windows), or Makefile (Linux)
- Open
Harmonium.jucerin Projucer - Configure JUCE module paths
- Export to your IDE (Xcode, Visual Studio, etc.)
- Build the generated project
Alternatively, use the pre-generated Xcode project:
cd Builds/MacOSX
open Harmonium.xcodeproj- Load Harmonium in your DAW as a VST3 instrument
- Route MIDI input to the track
- Use MIDI Modulation Wheel (CC1) to pump the bellows
- Play notes on your MIDI keyboard
- Air Capacity: Maximum air mass in bellows chamber
- Reed Chamber Capacity: Maximum air mass in reed chamber
- Narrow Jet Capacity: Maximum air mass in jet region
- Air Consumption: Rate at which oscillating reeds consume air
- Master Gain: Output amplitude scaling
- Reed Mode: Single, Double, or Triple reed configuration
- Amplitude Scaling: Spectral content intensity
- Note On/Off: Trigger reed oscillation at corresponding frequency
- Modulation Wheel (CC1): Bellows pumping (higher movement speed increases air mass faster)
Harmonium/
├── Source/
│ ├── Bellows.h - Bellows air management
│ ├── Convolution.h - Impulse response convolution
│ ├── Harmonium.h - Main synthesis coordinator
│ ├── HarmoniumState.h - State and configuration structures
│ ├── PhysicsEngine.h - Core physics equations
│ ├── PluginEditor.h - GUI implementation
│ ├── PluginProcessor.cpp - Audio/MIDI processing
│ ├── PluginProcessor.h - Processor interface
│ └── Voice.h - Polyphonic voice management
├── Builds/
│ └── MacOSX/ - Xcode project files
├── JuceLibraryCode/ - Auto-generated JUCE wrappers
├── Harmonium.jucer - JUCE project configuration
└── README.md - This file
This plugin serves as a prototyping platform for investigating physics-based synthesis techniques applied to free-reed instruments. The model parameters are derived from literature on aeroacoustic musical instruments and empirical spectral analysis of harmonium recordings.
- Euler integration may exhibit numerical artifacts at very low frequencies
- Reed collision dynamics not fully modeled (soft clamping used)
- Spectral profile is static (frequency-dependent parameters not yet implemented)
- No modeling of reed manufacturing variations beyond detuning
- Convolution is not optimised for sample-based processing
- Lacking timbral diversity of different styles of Harmonium (Delhi, Kolkata)
- Block-based processing instead of sample-based processing
- Implementation of higher-order integration schemes (RK4)
- Frequency-dependent chamber characteristics
- Reed-to-reed coupling effects
- More sophisticated bellows mechanics (pressure-volume relationship)
- Real-time visualisation of state space trajectories
Academic research project - contact for usage permissions.
Developed by me as part of dissertation research at the University of St Andrews.
[1] Puranik, N. V., & Scavone, G. P. (2023). Physical modelling synthesis of a harmonium. Proceedings of Meetings on Acoustics, 49(1), 035015. https://doi.org/10.1121/2.0001679