Eighty-seven classes that compute what a physical object would do rather than replaying a recording of one. Ready-made instruments at the top, and the waveguide primitives to build your own underneath.

1. The idea

A physical model computes a mathematical description of a sound source — the stiffness of a bar, the length of a tube, the pressure of a breath — and lets the sound emerge from that simulation. Nothing is sampled and nothing is pre-baked.

The payoff is expressiveness. Because the parameters are physical, they behave the way physical things behave: strike a modelled drum harder and the timbre changes, not just the level; shorten a modelled string and the harmonics shift as they would on a real one. This is very difficult to achieve with sampling and effortless here.

The cost is that a physical model, like a physical instrument, usually needs to be excited before it does anything. This is the single most common reason a physical model appears to be silent.

"A West African goblet drum, computed from first principles"
perc := Djembe new.
dsp  := perc asDsp.
dsp init.
dsp start.
dsp displayUI.   "press DjembeTrigger to strike it"
dsp stop.

2. Modal percussion

ModalPercussion covers struck objects, modelled as a bank of resonant modes. Four of the eight are bells, tuned to the different national traditions of bell founding — which is exactly the kind of thing a physical model can express and a sample library cannot generalise.

ClassInstrument
DjembeWest African goblet drum
DjembeMIDIDjembe with MIDI note input
MarimbaSub-Saharan idiophone with tuned bars
MarimbaMIDIMarimba with MIDI note input
EnglishBellEnglish bell tuning
FrenchBellFrench bell tuning
GermanBellGerman bell tuning
RussianBellRussian bell tuning

Underneath them are PhModalModel and PhModeFilter, which let you specify your own set of modes — frequency, gain and decay time each — and so build an object that has never existed. See Synthesis §4.

Swap and listen Every one of these takes the same messages. Substituting Marimba for Djembe in a working patch requires changing exactly one word, which makes them ideal for learning what modal parameters actually do.

3. String instruments

3.1 Ready-made instruments

ClassInstrument
ElecGuitarElectric guitar, plucked string model
ElecGuitarMIDIElectric guitar with MIDI note input
GuitarAcoustic guitar
GuitarMIDIAcoustic guitar with MIDI note input
NylonGuitarMIDINylon-string guitar
ViolinModelBowed violin
ViolinMIDIViolin with MIDI note input
KarplusStrongMIDIKarplus–Strong plucked string
"Guitar into a reverb — the example from MasterLu lesson 6"
synth := ElecGuitar new => GreyHole new.
dsp := synth asDsp.
dsp init.
dsp start.
dsp displayUI.   "press ElecGuitarTrigger to pluck"
dsp stop.

The bowed models are the ones that reward experimentation most: bowPressure: and bowVelocity: interact the way a real bow does, including the ability to produce a scratchy, unstable tone if you get the combination wrong.

3.2 String parts

The instruments above are assemblies. The components are available separately, which is how you build an instrument that does not exist yet:

ClassRole
PhIdealStringA lossless ideal string
PhSteelString, PhNylonStringStrings with material-appropriate damping
PhOpenStringString open at both ends
PhOpenStringPickup, PhOpenStringPickdownOpen string with pickup direction
PhNylonGuitar, PhNylonGuitarModelAssembled nylon guitar body
PhStringSegmentA length of string, for building composites
PhGuitarBridge, PhGuitarNutsTerminations at each end of the string
PhLStringRigidTermination, PhRStringRigidTerminationRigid terminations, left and right
PhKarplusStrongThe Karplus–Strong algorithm itself
PhKsReflexionFilterReflection filter for Karplus–Strong
PhBridgeFilterBridge filtering

4. Wind instruments

ClassInstrument
FluteModelFlute — a jet driving an open tube
FluteMIDIFlute with MIDI note input
ClarinetMIDIClarinet, single reed
BrassMIDIBrass instrument, lip-driven

4.1 Wind parts

Wind models are built from an excitation mechanism plus a resonating tube, and both halves are separately available:

ClassRole
PhTube, PhOpenTubeThe resonating air column
PhReedTableReed nonlinearity table
PhClarinetReed, PhClarinetMouthPieceClarinet excitation
PhClarinetModel, PhClarinetUIAssembled clarinet, with and without interface
PhFluteJetTableFlute jet nonlinearity
PhFluteModelUI, PhFluteUIAssembled flute with interface
PhBrassLipsTableBrass lip-reed nonlinearity
PhBrassModelUI, PhBrassUIAssembled brass model with interface
The nonlinear table is the instrument A tube on its own is just a filter. What makes a clarinet sound like a clarinet is the reed's nonlinear response coupling back into the tube. That coupling is what the …Table classes provide, and swapping one for another turns one instrument into another.

5. Exciters

An exciter is what sets a model in motion: a strike, a pluck, a puff of air. Because they are separate objects, any exciter can drive any resonator.

ClassExcitation
PhStrike, PhStrikeModelA struck impulse, with contact modelling
PhPluckStringA plucked displacement
PhImpulseExcitationA bare impulse
PhBlower, PhBlower_UIBreath pressure for wind models
Mix and match Driving a string model with PhBlower instead of PhPluckString, or a modal bar with a noise burst, produces instruments that do not exist physically but remain entirely coherent — because the resonator still behaves like an object.

6. Formant and vocal synthesis

Formant synthesis models the resonances of the vocal tract — the fixed frequency bands that make a vowel recognisable regardless of pitch.

ClassMethod
SFFormantModelBPBand-pass filter bank formant model
SFFormantModelBP_uiBand-pass model with interface
SFFormantModelFofCycleFOF granular formant synthesis
SFFormantModelFofCycle_UIFOF model with interface
PhVoiceGenderVocal tract gender parameter

7. Building your own: bidirectional waveguides

The deepest layer is a set of bidirectional waveguide primitives — where signals travel in two directions along a medium and reflect at its ends, exactly as waves do in a real string or tube. These are the pieces the instruments above are assembled from.

ClassRole
PhWaveguideThe waveguide itself
PhPmElementSuperclass of bidirectional elements
PhPmOutElementSuperclass of output-side elements
PhChain, PhEndChainAssemble elements into a chain and terminate it
PhBasicBlockA generic block within a chain
PhTerminationsTermination behaviour at the chain ends
InLeftWave, InRightWave, InLeftRightWaveInject a signal travelling in a given direction
OutLeftWave, OutRightWave, OutLeftRightWaveTap a signal travelling in a given direction
CloseIns, CloseOutsClose the unused ends of a chain
PhAllpassNLNonlinear allpass — adds the character of a driven medium
PhF2l, PhL2f, PhL2sConversions between frequency, length and samples
This is the deep end Building a waveguide instrument by hand means thinking about wave propagation, impedance and reflection, and about where in the chain you inject and tap. Start by reading the assembled models — PhNylonGuitarModel, PhClarinetModel — as worked examples rather than starting from primitives.

PhF2l and its siblings are worth knowing about even if you never build a waveguide: they convert between a pitch and the physical length that produces it, which is how a model knows how long to make its string when you ask for a note.

8. The physical setters

Physical models take physical parameters, supplied by two dedicated traits. These are what make the family expressive:

SetterControls
pressure:Breath or bow pressure
breathGain:Amount of breath noise in a wind model
bowPressure:How hard the bow presses
bowVelocity:How fast the bow moves
bowPosition:Where along the string the bow contacts
pluckPosition:Where along the string it is plucked
strikePosition:Where the object is struck
strikeSHarpness:How sharp the strike is — mallet hardness
stringLength:Physical string length
tubeLength:Physical tube length
bellOpening:How open the bell of a brass instrument is
stiffness:Material stiffness — affects inharmonicity
excitation:The excitation signal itself
length:Generic length parameter
Position parameters are the expressive ones pluckPosition: and strikePosition: change timbre without changing pitch or loudness, because they change which modes get energy. Sweeping one under an LFO or an envelope is a very cheap way to make a model sound played rather than triggered.

9. Where to go next

DocumentWhat it covers
Synthesis TechniquesModal synthesis built by hand from mode filters.
MIDI & Playing NotesThe …MIDI variants and how to play them.
Sequencing & SamplingTriggering models from pulses and patterns.
UGen LibraryThe full class list for this family.

10. Troubleshooting

The model is completely silent

It has not been excited. Open dsp displayUI and press the trigger, or send dsp trig: 'DjembeTrigger' — §1.

A wind model makes a continuous tone I cannot stop

Breath pressure is a sustained parameter, not a trigger. Set pressure: or breathGain: back to zero — §8.

The bowed string sounds scratchy and unstable

That is physically accurate: the bow pressure and velocity combination is outside the range that sustains a stable Helmholtz motion. Adjust both together — §3.1.

Changing the frequency changes the timbre too

Expected. In a physical model, pitch comes from the size of the object, and size affects which modes ring. This is the behaviour you are paying for.

playNote:prefix:dur: does nothing on a model

Its frequency and gate are not labelled to match the prefix. Set them with symbols first — see Parameters §2.

My hand-built waveguide is silent, or explodes

Almost always the terminations: an unterminated chain leaks, and a chain terminated with too much reflection gain runs away. Check CloseIns/CloseOuts and the reflection coefficients — §7.