Desktop application Experimental
Interactive Video
Modal2D · recorded performance · 1 min 49 s · a complete ensemble performance

Hear the instruments. Watch the score become motion.

Play with sound ♫
Video Two manually tuned instruments share the score, with either octave assigned to one of the two bodies. Note pads connect each played pitch to its physical contact while the waterfall follows the output.

A complete two-instrument performance, synthesized from modal mechanics. Play with sound, then explore how the instruments are built.

The sound comes from the simulated object

First hear the engine play music. Now inspect the mechanics behind it: a meshed body, its vibration modes and a visible acoustic response. The sound is synthesized from the model, without recorded instrument samples.

Ring · vibration and medium

Video The foundational annular body vibrates beside a GPU-computed exterior-medium view. Its structural modes drive the synthesized sound; the surrounding field is a reduced acoustic visualization. In the current engine, that field uses OpenGL compute; CUDA accelerates dense eigensolving and modal audio synthesis.

Compound resonator · vibration and sound

Video With the right shapes and materials, the engine can produce resonant bodies with rich detail in their sound profiles. The next step is the difficult one: tuning those bodies into actual musical instruments.

One physical pipeline, different instruments and performances

Compare the same score on the custom auto-tuned set, then listen to the other instrument voices. Every recording keeps its sound; press Play to listen.

Manually tuned strings · a full performance

Video A full string-instrument performance, with the score, contact links and output spectrum visible together.

The same score · a custom auto-tuned set

Video Part of the opening score, played by a custom auto-tuned instrument set. Compare how the solved shapes change its timbre; missing-note transposition remains a separate playback convenience.

Yume Nikki · custom instruments

Video A simple Yume Nikki score played by an auto-tuned instrument set. Its long tails and fine spectral detail are well preserved—without relying on a recorded sample to provide them.

Three instruments · a shared performance

Video Three instruments share one score: note-to-contact links, visible medium response and the output spectrum keep the performance connected to the model.

Modal2D

Create a fully physically based virtual musical instrument, starting with a shape, its mass and stiffness. FEM gives its vibration modes; a strike, bow or rub excites those modes to reconstruct the sound. Each shape has its own sound profile. Turn it into an instrument through careful manual tuning or an algorithm that adjusts the geometry to reach musical notes, then assemble the instruments into choirs.

Explore connections Brochure · 10 chapters ↓
Geometry → modes → sound → music
ShapeModesSoundMusic
An implemented pipeline

A shape becomes a playable instrument

Manually tuned instruments make the physics playable immediately. The instrument creation lab uses the same pipeline to ask whether a shape of your own can become a useful musical instrument.

  1. 01

    Build the geometry

    Mesh the object and assign materials, supports and structural formulation.

  2. 02

    Solve the modes

    Assemble K and M, then recover spatial vibration patterns and their frequencies.

  3. 03

    Excite and hear

    Project strikes into the modal basis and synthesize their damped response.

  4. 04

    Study the medium

    Inspect exterior radiation separately from reduced enclosed-air coupling.

  5. 05

    Tune the shape

    Use new forward solves to reduce pitch error and save the resulting design.

  6. 06

    Perform the set

    Schedule scores or MIDI on tuned instruments, with explicit transposition where needed.

Forward model

A consistent geometry-to-audio model

Finite-element modes connect the visible object, its excitation and the synthesized sound.

Optimization

What if we could turn an arbitrary shape into an instrument?

The instrument creation lab explores that inverse problem through geometry search, mode tracking and excitation. Finding a frequency is only part of finding a playable note.

Capstone

Solved shapes become an instrument library

Range tuning, saved materials and strikes, MIDI import and ensemble persistence carry the experiment into performance.

Capabilities / connected systems

Read the system by what it makes possible

Related techniques belong to one family. Follow a family into the interface, recorded results and mathematical detail.

01 / 05

Geometry, discretization & mode inspection

Describe an object’s allowed motion, solve its spectrum and inspect the basis before it becomes sound.

Geometry and meshingElement familiesStiffness and massDense and sparse eigensolversMode inspector
Feature set · 5 capabilities
  • Geometry and meshingOutlines, holes and connectivity define the domain; resolution determines which spatial detail the numerical basis can represent.
  • Element familiesPlanar elasticity, bending plates, curved shells, tensioned connectors and volume elements encode different mechanical degrees of freedom.
  • Stiffness and massLocal element contributions assemble into a constrained generalized eigenproblem, with both matrix structure and mode shapes available for inspection.
  • Dense and sparse eigensolversA small dense GPU path and CPU shift–invert path serve different solve sizes; retained low modes become a reusable synthesis basis.
  • Mode inspectorSelect an individual elastic mode, inspect its deformation and frequency, and compare the stiffness/mass sparsity patterns.
02 / 05

Excitation, decay & the playable voice

Separate changes to the physical spectrum from changes to how that spectrum is driven and heard.

Strike and spatial projectionRepeated and sustained interactionMaterial and dampingNonlinear voice experimentsAudio and signal inspection
Feature set · 5 capabilities
  • Strike and spatial projectionPoint, directional and distributed forces project into the current mode basis; moving a strike can suppress whole partials.
  • Repeated and sustained interactionRapid hits, region excitation, pluck, bow and driven-response controls explore different ways of exciting one resonator.
  • Material and dampingElastic constants and density affect the solve; per-mode damping shapes decay, while the editor separates physical controls from musical transposition.
  • Nonlinear voice experimentsAmplitude-dependent pitch and modal-energy redistribution enrich the reduced audio voice without replacing the structural solver with nonlinear FEM.
  • Audio and signal inspectionModal synthesis feeds the output processing chain; analysis views distinguish the modal state from downstream processed PCM.
03 / 05

Inverse design, tuning & mode identity

A tuner repeatedly calls the forward model, then checks whether the intended audible mode actually reached the target.

Pitch searchBayesian proposalsMAC mode trackingEigenvalue sensitivityRange tuning and verification
Feature set · 5 capabilities
  • Pitch searchBrackets, local refinement and parameter scans solve different versions of the geometry-to-pitch problem.
  • Bayesian proposalsSurrogate-guided candidates explore expensive parameter spaces while full solves supply the actual pitch evaluations.
  • MAC mode trackingSpatial mode similarity helps follow a physical mode through reorderings and avoided crossings.
  • Eigenvalue sensitivityAn existing eigenvector supports local derivative estimates, subject to branch identity and conditioning.
  • Range tuning and verificationMeasured candidates seed a note library; refinement and final pitch checks distinguish solved results from target metadata.
04 / 05

Instrument libraries, scores & reproducible work

Turn solved objects into a playable collection while retaining the evidence behind each note.

Physical instrument libraryScore and ensemble workflowSave, import and exportInspection as evidence
Feature set · 4 capabilities
  • Physical instrument libraryReady solved instruments and borrowed, pitch-shifted spectra remain visibly distinct as the library covers a score.
  • Score and ensemble workflowMusic maps note requests to instruments and preserves the physical and musical context of a performance.
  • Save, import and exportInstrument and ensemble states preserve geometry, tuning choices and playback configuration for continued work.
  • Inspection as evidenceMesh, eigenmodes, strike response and spectrum provide a connected account of what the system computed.
05 / 05

Radiation, fields & coupled resonators

Use the modal basis to investigate how structural motion connects to a reduced acoustic explanation.

Radiation weightingComplex field observablesCavity modesReduced structural–air couplingSpace–time inspection
Feature set · 5 capabilities
  • Radiation weightingMode-dependent source contributions shape the relative audible mix and expose coherent cancellation.
  • Complex field observablesPressure, magnitude, phase and derived visual diagnostics offer different readings of the same harmonic field.
  • Cavity modesA sealed pressure eigenproblem gives trapped air its own modal basis and frequency scale.
  • Reduced structural–air couplingCoupled bases produce split resonances and mixed responses; the current reduced interface remains an experimental approximation.
  • Space–time inspectionSampling analytic harmonic fields over time reveals nodes and propagation in a static diagram as well as an animation.
Technical brochure · 10 chapters

Inside Modal2D

Give a shape mass, stiffness and supports. Solve its natural vibration patterns, or eigenmodes, then excite them with a strike, bow or rub to produce sound. The harder inverse problem is tuning that response into an instrument. Modal2D begins with carefully authored instrument families and continues into a creation lab that asks whether a shape chosen first can become musical.

Description · what it doesExplanation · how it worksTheory · equations & assumptions

Scan the descriptions and figures, or open a layer for the implementation and mathematical detail.

Capability family

Geometry, discretization & mode inspection

Describe an object’s allowed motion, solve its spectrum and inspect the basis before it becomes sound.

01 · Motivation

From mechanical response to a playable instrument

Description · at a glance

The manually tuned collection begins with deliberately designed families: harps, drums, glass and coupled resonant bodies. Authoring them is substantial work: geometry, supports, material, playable regions and coupled components must produce useful modes together. These polished, versatile instruments can share resonators and cover larger ranges. Optional score fitting remains a separate playback convenience.

The instrument creation lab is a parallel experiment: what if the shape came first? Start with an object we want to hear, solve its response to an excitation, then investigate which modes could become useful notes, where to excite them and how to alter the geometry. Its auto-tuned results are usually simpler independent instruments. Arbitrary-shape design is the motivating problem, not a promise that every outline can be tuned automatically.

A procedural tone can be assigned any pitch, but a physical instrument has a more constrained relationship between its shape and its sound. Making a bar wider, changing its density or moving a strike changes more than one number. Modal2D exposes that relationship by deriving a finite set of vibration modes from a discretized object, then using those modes as the basis of its sound.

The workflow is shape, material and supports → finite-element matrices → eigenmodes → response to a chosen excitation → synthesized sound → instrument tuning → score performance. Intermediate results remain available: the mesh explains the discretization, mode shapes explain spatial motion, frequencies explain the spectrum, and excitation projection explains which modes are audible.

Image Annular finite-element mesh with colored displacement, strike target and a reduced exterior acoustic field.
Image The Music instrument library, range controls and physical instrument parameters. Authored instruments stay physical; lightly used spectrum borrowing fills unavailable pitches for convenient score playback.
ExplanationOne forward model, two kinds of experimentPlay a manually tuned design, or use the creation lab to search for one.

The forward question starts with an object: choose its outline, element formulation, support, material and excitation, then compute its response. The inverse question starts with a musical requirement: find a geometry whose relevant partial reaches a target pitch while retaining a useful decay and strike response. The second task repeatedly calls the first; it does not replace the mechanics with a table of recorded sounds.

A mode frequency alone is an incomplete instrument specification. The mode also has a spatial shape, a damping rate and an excitation weight. Two objects can share a fundamental yet have different upper partials. Two strikes on one object can select very different mixtures of the same modes. Modal2D makes these quantities editable and inspectable before assembling them into a performance.

This separates three meaningful experiments: geometry changes alter the solved spectrum; strike changes alter the mixture of an existing spectrum; playback transposition scales that spectrum as a musical operation. The first two explore the mechanical model, while the third makes a finite instrument library cover a larger score.

ExplanationSeparate the expensive solve from the running instrumentGeometry and modal state cross an explicit engine–viewer boundary.

The native system has two main layers. libmodal owns geometry, assembly, eigenmodes, excitation and modal synthesis behind opaque object/result handles. The viewer owns the interactive editor, OpenGL displays, tuning orchestration, score playback and the surrounding audio-processing chain. Read-only queries expose meshes, frequencies, mode shapes and amplitudes without making the interface duplicate the eigensolver.

A structural edit invalidates the relevant solve. The solve worker can assemble and compute a replacement result while the viewer remains available; the application installs that result when it is ready. A strike on an unchanged object instead updates modal excitation. Those two actions have very different costs, so responsive playback does not imply that every mesh rebuild finishes within one frame.

CUDA is used for the small dense eigensolve path and for evaluating audio samples. OpenGL serves a different role: geometry rendering, overlays and the exterior-field compute passes. The sparse eigensolver and the geometry-search logic run on the CPU. This division makes the data flow more informative than a single GPU-enabled label.

The workspace includes sandbox experimentation, instrument editing, testing, instrument sets, refinement, Music and import/export. Strike, repeated excitation, pluck, bow, sweep, region and sustained-interaction tools explore different driving conditions. Some later excitation and nonlinear voice options are synthesis or control extensions around the modal model; they are not automatically a nonlinear finite-element simulation.

  • Build: outline and physical parameters → mesh → stiffness/mass → retained modal basis.
  • Play: event location, direction and strength → modal weights → sound and displacement.
  • Inspect: mesh, spectrum, mode envelopes and field diagnostics read the current result.
  • Revise: a new geometry or material starts another solve; score and instrument metadata preserve the design context.
Source evidenceArchitecture and computation ↗Engine APIoffline_projs/Modal2D/libmodal/include/modal/modal.hSolve worker ownershipoffline_projs/Modal2D/modal_viewer/src/app/solve_worker.cpp
Interactive schematic

The forward pipeline in motion

The forward pipeline in motion

Replay a coordinated schematic of geometry, mode shapes, excitation and the resulting signal. Follow how one event propagates through the representations.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of The forward pipeline in motion

A synchronized explanatory animation using solved discrete-string modes and schematic assembly/propagation panels. The native application assembles and solves its own meshes; this overview does not run that full pipeline.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

02 · Geometry and discretization

Different objects need different mechanical models

Description · at a glance

The core planar formulation uses constant-strain triangles with two displacement degrees of freedom per node. Material density enters the mass matrix, while elastic parameters and element geometry enter stiffness. Boundary constraints remove or restrict degrees of freedom, so changing a support changes the physical problem as well as the resulting pitch.

A free object can have nearly zero-frequency rigid-body modes. Those modes are expected consequences of the boundary conditions, not automatically a failed eigensolve. Conversely, a plausible-looking mesh does not establish convergence. The retained element type, mesh resolution and support configuration remain part of the instrument definition.

Image A triangulated displacement field with experimental shell curvature and thickness controls. The mesh and deformation can be inspected together.
Theory / mathematicsFrom a continuous object to sparse stiffness and massElement interpolation converts local strain energy into the global vibration problem.

In the planar elasticity route, each mesh vertex contributes horizontal and vertical displacement. Linear shape functions interpolate displacement within each triangle. Their derivatives are constant, so the triangle has a constant strain–displacement matrix B. The constitutive matrix D converts strain to stress for the selected material. Integrating strain energy gives an element stiffness matrix; integrating kinetic energy gives its mass matrix.

Assembly adds each small element matrix into the rows and columns of its shared vertices. Neighboring elements contribute to the same degrees of freedom, which is how the discrete object transmits force. Most pairs of vertices share no element, so the matrices are sparse. Mesh connectivity determines the sparsity pattern; vertex numbering alone does not guarantee that all nonzeros lie close to the diagonal.

The CST route uses a consistent mass matrix. Supports change the admissible motion; the implementation enforces fixed degrees of freedom with symmetric row/column modification and a high stiffness penalty. A free object also supports rigid translation and rotation. These nearly zero-frequency motions must be separated from elastic modes before interpreting the audible spectrum.

ue(x)=N(x)de,ε=Bde\mathbf u_e(\mathbf x)=\mathbf N(\mathbf x)\mathbf d_e,\qquad \boldsymbol\varepsilon=\mathbf B\mathbf d_e
The vector d_e contains an element’s nodal displacements; N interpolates them and B differentiates them into strain.
Ke=h∫ΩeBTDB dA,Me=ρh∫ΩeNTN dA\mathbf K_e=h\int_{\Omega_e}\mathbf B^{T}\mathbf D\mathbf B\,dA,\qquad \mathbf M_e=\rho h\int_{\Omega_e}\mathbf N^{T}\mathbf N\,dA
h is thickness, ρ is density and Ω_e is the triangle. These expressions account for elastic and kinetic energy respectively.
Mu¨+Cu˙+Ku=f(t)\mathbf M\ddot{\mathbf u}+\mathbf C\dot{\mathbf u}+\mathbf K\mathbf u=\mathbf f(t)
The assembled structural equation relates inertia, damping, restoring force and applied force. The eigenstep first analyzes its undamped homogeneous part.
Source evidenceCST stiffness and consistent massoffline_projs/Modal2D/libmodal/src/fem/element_cst.cppSparse element assemblyoffline_projs/Modal2D/libmodal/src/fem/assembler.cppInteractive assembly explanation ↗
ExplanationChoose the motion before choosing the meshA membrane, a plate, a shell and a solid encode different kinematics.

Other branches extend the representation: beams include rotation, strings use tension, thin plates model bending, and thicker plate or shell formulations introduce their own kinematics. Later solid experiments use tetrahedral meshes. These are different approximations to different mechanical regimes; switching between them is not simply changing the visual style of one universal solver.

The thin-plate route builds a curvature–displacement operator from transverse displacement and nodal rotations, with lumped translational mass and rotary inertia. Its DKT-style implementation fixes Poisson’s ratio to 0.3 inside the bending constitutive block. The thick-plate route adds transverse shear. The shallow-shell route composes membrane and bending blocks and adds height-gradient coupling: bending a curved surface can require stretching it, adding resistance to motion.

These choices determine which comparisons are meaningful. A string dominated by pre-tension can approach a harmonic series; a flexural bar or plate has different overtone spacing. Selecting a richer formulation is useful when it adds the missing motion, not simply because it has more degrees of freedom.

FamilyUnknowns per nodeMechanical role
Planar CSTuₓ, uᵧIn-plane stretch and shear; optional orthotropic material
Beam / stringuₓ, uᵧ, θAxial motion and bending, with optional pre-tension
Thin platew, θₓ, θᵧDKT-style bending triangle with lumped mass
Thick platew, θₓ, θᵧMindlin shear deformation and rotary inertia
Shallow shelluₓ, uᵧ, w, θₓ, θᵧMembrane–bending coupling from a height field
Tetrahedral soliduₓ, uᵧ, u_zLinear elasticity throughout a coarse 3D volume
Source evidenceCurrent simplified plate elementoffline_projs/Modal2D/libmodal/src/fem/element_dkt.cppThick-plate formulationoffline_projs/Modal2D/libmodal/src/fem/element_mindlin.cppShallow-shell couplingoffline_projs/Modal2D/libmodal/src/fem/element_shell.cppSolid elementoffline_projs/Modal2D/libmodal/src/fem/element_tet.cpp
ExplanationHoles, components and resolution change the numerical problemThe visible mesh is part of the instrument definition.

Planar outlines use constrained triangulation with quality and area controls. Hole contours change connectivity as well as removing material: they alter the available paths for stiffness and can localize motion. Porous presets therefore affect the mode structure, not just the object’s silhouette. The solid experiments use structured tetrahedral construction and can carve straight tunnel-like voids through the volume.

Mesh refinement should be judged by a sequence of solves: compare selected frequencies, mode shapes and strike response while decreasing the element area. A stable-looking animation at one resolution cannot reveal how far a partial has moved numerically. Extremely slender geometry is especially demanding because stiffness scales in different directions can become very different.

Disconnected parts introduce another issue. A global solver can return arbitrary mixtures of equal-frequency motions on independent components. The component solve isolates each structural block, embeds its modes into the full mesh, then merges the spectra. This keeps an instrument bar’s motion associated with that bar. Coupled cavity scenes use a shared structural basis because the air explicitly links the system.

Source evidencePlanar triangulation and hole handlingoffline_projs/Modal2D/libmodal/src/mesh/triangulator.cppStructured solid meshesoffline_projs/Modal2D/libmodal/src/mesh/solid_mesh.cppPer-component solveoffline_projs/Modal2D/libmodal/src/solver/eigensolve.cppLocalization regression casesoffline_projs/Modal2D/tests/test_component_solve.cpp
Interactive schematic

Geometry, discretization and the resulting unknowns

Follow the same design question from a triangle’s connectivity to matrix assembly, curved shells and volume meshes. Switch views to compare which representation each model needs.

An element becomes entries in a global matrix

Hover the triangular elements. The companion matrix highlights the degrees of freedom touched by each element and shows how shared nodes combine contributions.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of An element becomes entries in a global matrix

Connectivity assembly uses illustrative local coefficients (2 on the diagonal and −0.85 off it). It shows sparsity and indexing, not the native BᵀDB elasticity matrix or its material-dependent values.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Recorded examples · 1Mechanical formulationsA thick body complements membrane, plate and string representations.
Image Thick-drum geometry in a triangulated displacement view, complementing the thin-body examples.
03 · Numerical core

The spectrum comes from stiffness and inertia

Description · at a glance

The generalized eigenproblem pairs each mode shape with a squared angular frequency. Mass normalization gives the shapes a consistent scale for excitation and synthesis. A truncated set of these modes is enough to build a useful instrument, but it leaves out spatial and spectral detail above the selected range.

The application also deals with localized modes and multiple components. A low eigenvalue belonging to one component may be almost inaudible when another component is struck. Frequency order alone therefore does not identify the musically relevant mode.

Mode shapes are worth viewing directly. Rotationally symmetric objects often contain equal or nearly equal frequency pairs; any rotated combination spans the same physical eigenspace, so a solver can return a visibly rotated pattern without changing the underlying resonance. A strike selects a particular combination from that pair, which changes the visible motion and directional radiation even when the shared frequency stays fixed.

Image The native eigenmode inspector: a triangular mesh, 75 elastic modes, selected mode M37 at 25.54 kHz, and stiffness/mass sparsity plots for 606 degrees of freedom.
K φᵢ = ωᵢ² M φᵢ; 2πfᵢ = ωᵢ
K and M encode the chosen discretized mechanics. A mode is a spatial vector φᵢ and a frequency fᵢ, not just a sinusoid selected by its position in a list.
Image Struck test instrument with a spectral waterfall, material controls and tuning history.
ExplanationFEM, a spring preview and a sensitivity estimate answer different questionsKeep the shape-dependent solve for pitch; use cheaper models for immediate feedback and local search guidance.

Modal2D needs the vibration frequencies of a particular object, including its supports, material and thickness. FEM turns those choices into stiffness and mass; the retained eigenmodes then make playback inexpensive. Accuracy still depends on the mesh, boundary conditions and mechanical formulation. This is a different objective from Crucible2.5D’s evolving material histories and large deformations. FEM can simulate those too, while MPM also uses a weak-form grid discretization. The distinction comes from the model and what each project needs to compute.

The live mass–spring preview is a separate approximation, not a smaller copy of the FEM mesh. It solves a small lattice with lumped nodal masses, axial springs and diagonal links for shear response. Its simplified geometry and stiffness do not preserve arbitrary outlines, holes or support conditions. Use its patterns as qualitative editing feedback; use the full FEM result to judge the instrument’s pitch. A separate adjustable cavity bandpass is likewise a one-resonance sound proxy, not a solution of the cavity’s spatial pressure modes.

The geometry-sensitivity route saves work in a different way: it retains an already solved FEM eigenvector, perturbs the mesh width, reassembles stiffness and mass, and compares Rayleigh quotients without another eigensolve. This remains a FEM-derived estimate. The current helper targets the basic planar triangle route; it does not provide a general derivative for every formulation. A small perturbation along an isolated mode branch can guide a search, but a fresh solve must check the proposed geometry. Near crossings or after large shape changes, the old mode may cease to be a useful predictor.

λ^(W+ΔW)=ϕTK(W+ΔW)ϕϕTM(W+ΔW)ϕ,dfdW≈λ^(W+ΔW)−λ^(W)4πω ΔW\widehat\lambda(W+\Delta W)=\frac{\boldsymbol\phi^T\mathbf K(W+\Delta W)\boldsymbol\phi}{\boldsymbol\phi^T\mathbf M(W+\Delta W)\boldsymbol\phi},\qquad \frac{df}{dW}\approx\frac{\widehat\lambda(W+\Delta W)-\widehat\lambda(W)}{4\pi\omega\,\Delta W}
The same existing mode φ is used in both quotients. λ = ω² and f = ω/(2π). This estimates a local width sensitivity from matrix assembly; it does not recompute the new mode shape.
Source evidenceLumped-mass lattice preview and its scopeoffline_projs/Modal2D/modal_viewer/src/app/mass_spring.hWidth perturbation and fixed-mode Rayleigh quotientsoffline_projs/Modal2D/libmodal/src/modal_api.cppAdjustable cavity bandpass proxyoffline_projs/Modal2D/modal_viewer/src/audio/audio_engine.cpp
Theory / mathematicsWhy a mesh can become a bank of oscillatorsA mass-orthonormal basis decouples the linear structural equations.

Seek a motion that preserves its spatial pattern while oscillating in time. Substitution into the undamped structural equation yields a generalized eigenproblem. Its eigenvalue is squared angular frequency, while its eigenvector gives the displacement of every degree of freedom in that mode. Mass normalization removes an arbitrary scale from the vector and gives modal force projection a consistent meaning.

Collecting retained modes into Φ and substituting u ≈ Φq changes coordinates from vertices to modal amplitudes. With independent modal damping, each retained coordinate evolves as a scalar oscillator. This is the central computational saving: playback works on the retained spectrum rather than repeatedly solving the full coupled mesh.

Truncation still matters. A sharp or spatially localized strike may need high-frequency modes that a small basis omits. Numerical rigid modes and modes above the useful frequency range should not be counted as extra audible detail. The engine stores angular frequencies in radians per second, and the user-facing pitch divides them by 2π.

Kϕi=ωi2Mϕi,ϕiTMϕj=δij\mathbf K\boldsymbol\phi_i=\omega_i^2\mathbf M\boldsymbol\phi_i,\qquad \boldsymbol\phi_i^T\mathbf M\boldsymbol\phi_j=\delta_{ij}
φ_i is a mass-normalized mode; ω_i is its angular frequency. δ_ij is one for the same mode and zero for different modes.
u≈Φq,q¨i+2ζiωiq˙i+ωi2qi=ϕiTf\mathbf u\approx\boldsymbol\Phi\mathbf q,\qquad \ddot q_i+2\zeta_i\omega_i\dot q_i+\omega_i^2q_i=\boldsymbol\phi_i^T\mathbf f
q_i is the modal coordinate and ζ_i its damping ratio. The force projected onto a mode drives that oscillator.
Source evidenceEigenproblem and modal reduction ↗Dense generalized eigenpairsoffline_projs/Modal2D/libmodal/src/solver/eigensolve_dense.cuSparse modal basisoffline_projs/Modal2D/libmodal/src/solver/eigensolve_sparse.cpp
ExplanationDense GPU solve and sparse shift–invert solveThe two numerical routes trade matrix storage, precision and basis size.

The dispatcher currently tries the float32 cuSOLVER generalized symmetric eigensolver for systems of at most 512 degrees of freedom. Larger systems use the CPU sparse route; a dense-path exception also falls back to sparse. The threshold is an implementation policy, not a measured performance law for every GPU or every mesh.

Shift–invert makes the low structural eigenvalues easier to extract. The code factors K − σM once, repeatedly solves against M times a trial vector, and builds a Krylov basis with M-inner-product reorthogonalization. It solves a small projected symmetric eigenproblem and transforms the resulting Ritz values back into frequencies.

The CPU route uses a sparse shift-invert Lanczos construction with a projected solve. Its current implementation is a fixed-subspace method; an older thick-restart description should not be read as an implemented restart mechanism. A dense cuSOLVER route provides an additional GPU path for suitable problem sizes. The available routes have different memory and problem-size tradeoffs, rather than a demonstrated universal speed hierarchy.

Aσ=(K−σM)−1M,μi=1λi−σ,λi=σ+1μi\mathbf A_\sigma=(\mathbf K-\sigma\mathbf M)^{-1}\mathbf M,\qquad \mu_i=\frac{1}{\lambda_i-\sigma},\qquad \lambda_i=\sigma+\frac{1}{\mu_i}
λ_i = ω_i². Inverse application magnifies modes close to the shift σ; factorization is reused during the Krylov iteration.
Source evidenceDispatch and fallbackoffline_projs/Modal2D/libmodal/src/solver/eigensolve.cppFixed-subspace shift–invert Lanczosoffline_projs/Modal2D/libmodal/src/solver/eigensolve_sparse.cppcuSOLVER pathoffline_projs/Modal2D/libmodal/src/solver/eigensolve_dense.cu
Theory / mathematicsFrequency accuracy and audible relevance are separate checksA low residual validates an eigenpair; it does not establish that a strike makes that mode prominent.

An eigenpair can be checked by substituting it back into the assembled equation. Mass orthogonality checks whether retained modes remain independent in the appropriate metric. Refinement and perturbation comparisons then ask whether those eigenpairs are stable under a better discretization or a tiny geometry change. These are distinct levels of evidence.

The relevant musical partial also depends on strike projection, radiation weighting and decay. A low mode localized on a different component may barely respond. A rapidly decaying fundamental may leave an upper partial perceptually dominant. This motivates the manual pin, audible-mode and decay-filtered tuning routes.

The source tests cover representative element, eigensolve and component cases. A comprehensive validation session would record residuals, orthogonality and mode correspondence across resolutions alongside the sound. The formulas below define useful checks; they do not imply that every one is already displayed in the current interface.

ηi=∥Kϕi−λiMϕi∥∥Kϕi∥+∣λi∣ ∥Mϕi∥\eta_i=\frac{\|\mathbf K\boldsymbol\phi_i-\lambda_i\mathbf M\boldsymbol\phi_i\|}{\|\mathbf K\boldsymbol\phi_i\|+|\lambda_i|\,\|\mathbf M\boldsymbol\phi_i\|}
η_i is a relative residual for a nontrivial elastic eigenpair; near-null modes require separate handling.
G=ΦTMΦ≈I\mathbf G=\boldsymbol\Phi^T\mathbf M\boldsymbol\Phi\approx\mathbf I
The Gram matrix G should be close to identity for a mass-orthonormal retained basis.
Source evidenceEigenvalue and normalization checksoffline_projs/Modal2D/tests/test_eigensolve.cppComponent isolation checksoffline_projs/Modal2D/tests/test_component_solve.cppConditioning and strike relevance ↗
Interactive schematic

From eigenmodes to nodal patterns

Explore nodal patterns and a driven response, then switch to the discrete-string eigensolver to inspect how a modal basis is computed.

Plate modes, and the sand that finds them

Choose rectangle, disc, triangle, hexagon or ring. Compare the six displayed mode patterns with the driven sand response; sweep the drive frequency or reshake the particles.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Plate modes, and the sand that finds them

The rectangle uses separable discrete-string modes; the disc uses a Bessel basis. The other shapes use a small masked-grid Laplacian eigensolve. These are scalar membrane teaching models, not native vector elasticity or bending-plate FEM. The particle display is a nodal-pattern illustration.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Capability family

Excitation, decay & the playable voice

Separate changes to the physical spectrum from changes to how that spectrum is driven and heard.

04 · From modes to sound

Where and how the object is played changes what is heard

Description · at a glance

The instrument is not a single sound. Striking it injects a short impulse; bowing or rubbing supplies sustained, motion-dependent excitation. The same body can therefore produce a sharp attack, a long evolving tone or a very different balance of partials. Playing position and direction matter as well. Compare the recorded strikes, friction-driven tones and glass rubbing below.

An impulse is projected onto the retained mode shapes. A strike near an antinode can excite a mode strongly; a strike near its nodal line can leave it almost silent. The selected location and direction therefore determine a spectrum of modal amplitudes even when the geometry and eigenfrequencies stay fixed.

The historical strike path maps the selected point to the mesh and uses a boundary-oriented direction or an interior direction according to the interaction. Modal voices then sum damped oscillations. CUDA audio kernels generate PCM blocks that are transferred and synchronized for output. This is a concrete GPU synthesis path, but it does not by itself establish an asynchronous or low-latency performance guarantee.

Visual motion can be slowed for inspection while the audio remains audible at its intended frequencies. That separation is useful because real modal oscillations are usually too fast to read visually. It should not be mistaken for a change in the physical spectrum.

The striking result is how much sound comes from a compact model: a retained bank of damped modes, projected excitation and radiation weights already produces a convincing range of instruments. Rendering has a similar lesson—a surprisingly small physically grounded core can look or sound rich, while remaining open enough to change the geometry, gesture, damping and material independently.

Image Guitar+ composite geometry above a cochleagram showing strike onsets, frequency bands and decay.
u(x,t) ≈ Σᵢ aᵢ φᵢ(x) exp(−γᵢt) sin(ωᵢt + ψᵢ)
The retained modes approximate displacement and provide the oscillators used for synthesis. Modal truncation, damping choices and excitation determine the audible result.
Theory / mathematicsA strike is a projection, not a universal volume controlLocation and direction select which parts of the modal basis receive energy.

For a mass-normalized mode, integrating a brief force over time gives a generalized impulse. Its projection determines the jump in modal velocity. A nodal line suppresses a mode only for a matching force component; direction is as important as position when a node can move along multiple axes.

The interactive point-strike path chooses a mesh location and builds directional modal weights, using boundary-normal information for boundary hits and a policy for interior hits. Other formulations and uniform strikes have their own routes. These implementation choices explain why a stored strike coordinate belongs with the instrument’s geometry.

The ideal impulse-response formula includes the conversion from modal velocity to displacement amplitude. In the renderer and synthesis state, stored amplitudes and gain conventions already package these choices. Comparing two hits should therefore keep material, spectrum, radiation weighting and gain fixed, then vary the strike position or direction.

Δq˙i=ϕiTJ,J=∫f(t) dt\Delta\dot q_i=\boldsymbol\phi_i^T\mathbf J,\qquad \mathbf J=\int\mathbf f(t)\,dt
J is the nodal impulse vector. Projection onto φ_i gives the initial modal velocity for a mass-normalized mode.
qi(t)=ϕiTJωd,ie−ζiωitsin⁡(ωd,it),ωd,i=ωi1−ζi2q_i(t)=\frac{\boldsymbol\phi_i^T\mathbf J}{\omega_{d,i}}e^{-\zeta_i\omega_i t}\sin(\omega_{d,i}t),\qquad \omega_{d,i}=\omega_i\sqrt{1-\zeta_i^2}
For an initially resting underdamped mode, this is the displacement response to an ideal instantaneous impulse.
Source evidenceInteraction projectionoffline_projs/Modal2D/modal_viewer/src/app/strike_projection.cppEngine strike routesoffline_projs/Modal2D/libmodal/src/modal_api.cppProjection testsoffline_projs/Modal2D/tests/test_strike_projection.cpp
ExplanationRepeated hits share the same resonatorA bounded event history lets new attacks overlap existing decays.

Replacing a mode’s onset whenever another hit arrives would abruptly discard its previous ring. The synthesis state instead stores multiple amplitude/onset slots per mode and sums their responses. Rapid strikes then add new attacks while earlier hits continue to decay. The ring has finite capacity, so this is a bounded playback representation rather than unlimited event history.

The CUDA audio kernel assigns one thread to an output sample. That thread evaluates every retained mode and its active strike slots, applies the modal radiation coefficient, and writes a mono sample. The viewer’s audio chain then performs the selected voice and processing stages before stereo output.

Audio and visual time have separate purposes. Slow-motion displacement makes an oscillation readable, while audible playback runs on the audio clock. The native callback is configured for 44.1 kHz and 512-frame blocks, about 11.6 ms of samples per block. That block duration is not an end-to-end latency measurement; device buffering, synchronization and processing also contribute.

y(t)=∑iαi∑kAike−ζiωi(t−tk)sin⁡ ⁣(ωd,i(t−tk)) 1t>tky(t)=\sum_i\alpha_i\sum_k A_{ik}e^{-\zeta_i\omega_i(t-t_k)}\sin\!\left(\omega_{d,i}(t-t_k)\right)\,\mathbf 1_{t>t_k}
A_ik and t_k are stored amplitude and onset for strike slot k; α_i weights mode i into the synthesized output.
Source evidencePer-sample CUDA synthesisoffline_projs/Modal2D/libmodal/src/audio/synthesis.cuStrike historyoffline_projs/Modal2D/libmodal/src/modal/strike_buffer.cppCallback and processing chainoffline_projs/Modal2D/modal_viewer/src/audio/audio_engine.cpp
ExplanationPluck, bow, sustain and driven resonanceDifferent input processes can reuse the same resonant frequencies.

A single strike starts a free decay. With continuous contact enabled, Bow and Bow+ instead apply a force that depends on the bow’s speed relative to the same modal body at the contact. The audio-rate model uses implicit midpoint integration and a regularized friction law, so the vibrating body feeds back into the excitation. Rub uses a filtered stochastic force. Releasing a contact lets the accumulated modal state decay.

Continuous contact is enabled by default. Turning it off restores the earlier repeated-impact Bow/Bow+ and noise-driven Sustain routes; the latter uses band-pass biquads centered on solved modal frequencies. The current friction model uses bounded iterations, a force limit and an aggregate-work safeguard for simultaneous contacts. It approximates stick–slip behavior in normalized mechanical units; it does not model bow width, contact heating or a fluid-coated finger.

A frequency sweep provides another experiment: the largest forced response occurs near a retained resonance, with damping setting peak width. A driven nodal pattern can be compared with a free mode, but a displayed Chladni-style field is not itself a simulated bed of moving grains.

Qi≈12ζi,Hi(Ω)=1ωi2−Ω2+2iζiωiΩQ_i\approx\frac{1}{2\zeta_i},\qquad H_i(\Omega)=\frac{1}{\omega_i^2-\Omega^2+2\mathrm i\zeta_i\omega_i\Omega}
Q relates damping to a resonance’s sharpness. H_i is the continuous oscillator response at drive frequency Ω, which motivates the resonator-bank design.
Source evidenceContinuous modal contact · friction law and implicit integrationoffline_projs/Modal2D/libmodal/include/modal/sustained_modal_voice.hCurrent Bow/Rub controls and legacy comparisonoffline_projs/Modal2D/modal_viewer/src/app/app_continuous_contact.cppSustained resonator bankoffline_projs/Modal2D/libmodal/include/modal/resonator_bank.hDriven-pattern testsoffline_projs/Modal2D/tests/test_chladni_drive.cpp
Recorded examples · 2Excitation and decayWaterfall and cochleagram views show how a chosen strike distributes energy across the spectrum.
Image Struck test instrument with a spectral waterfall, material controls and tuning history.
Image String-family instrument with its spectral waterfall, providing a contrasting decay pattern to the struck plate.
05 · Working session

The editor exposes physical and musical controls separately

Description · at a glance

A useful session begins with a known geometry and support configuration, then a solve and a few strikes. Material controls expose stiffness, density, damping and, in supported formulations, anisotropy or fiber direction. Material palettes allow different regions to retain different assignments instead of forcing a single global material.

Within an unchanged formulation, raising stiffness generally raises frequencies while raising density lowers them. Damping mainly controls decay rather than providing an independent geometry-free tuning mechanism. Geometry changes require another solve because they alter mass and stiffness together. The controls make these distinctions visible instead of reducing the instrument to a single pitch slider.

Image Glockenspiel bars labeled C5 through C6, with a selectable strike point.
Theory / mathematicsPredict which controls move pitch and which change timbreScaling laws are useful when their geometric and mechanical assumptions stay fixed.

Within the same linear formulation, uniform stiffness and density changes scale K and M without changing connectivity. The generalized eigenproblem then gives the square-root stiffness-to-density frequency scaling. Changing proportions, supports, grain direction or spatial material assignments can alter relative partial spacing as well as the overall pitch.

Thickness has different meanings in different routes. It scales both mass and stiffness linearly for the simple in-plane membrane, so those factors cancel. Thin-plate bending stiffness instead scales cubically in thickness while translational mass scales linearly. Pre-tension provides yet another route: a tension-dominated beam approaches a string spectrum, while residual bending stiffness introduces inharmonicity.

Orthotropy rotates directional stiffness with the grain angle. Element material IDs and a palette allow different regions to contribute different constitutive matrices. These are structural edits that require another solve. Playback frequency shift is inexpensive, but it cannot reproduce the changed partial ratios of a newly proportioned composite object.

fi∝E/ρf_i\propto\sqrt{E/\rho}
This scaling assumes unchanged geometry, boundary conditions and other dimensionless material parameters.
fmem∝L−1E/ρ,fplate∝hL2Eρ(1−ν2)f_{\mathrm{mem}}\propto L^{-1}\sqrt{E/\rho},\qquad f_{\mathrm{plate}}\propto\frac{h}{L^2}\sqrt{\frac{E}{\rho(1-\nu^2)}}
L is a characteristic in-plane size; h is thickness and ν is Poisson’s ratio. The plate expression uses thin-bending assumptions.
fn≈n2LT/μf_n\approx\frac{n}{2L}\sqrt{T/\mu}
For an ideal tension-dominated string, T is tension and μ is mass per unit length. Beam bending moves the model away from this harmonic limit.
Source evidenceIsotropic and orthotropic stiffnessoffline_projs/Modal2D/libmodal/src/fem/element_cst.cppBeam tensionoffline_projs/Modal2D/libmodal/src/fem/element_beam.cppMaterial and scaling discussion ↗
Theory / mathematicsDecay, pitch glide and spectral bloomThe linear damping model and nonlinear voice occupy different layers.

The core applies damping as a per-mode ratio after the eigensolve. The optional slope increases that ratio with frequency, so upper partials can disappear more quickly. Even equal damping ratios give faster amplitude decay at higher angular frequencies. The result is a changing spectral balance through the ring, not just a master fade.

The nonlinear voice consumes the solved frequencies and damping but replaces the linear struck signal while active. Each mode is a two-pole resonator. A saturating envelope-energy proxy raises effective frequencies after a strong attack, then lets them settle downward. An octave-neighbor transfer injects energy into a higher resonator to create a blooming shimmer.

This is an implemented reduced DSP extension. Its amplitude-squared bookkeeping provides a controlled design for transfer, but it is not a derivation of nonlinear shell strain energy or a guarantee of exact physical energy conservation. The useful comparison is amount zero versus active glide and shimmer, keeping the underlying solved object fixed.

ζi=clamp⁡ ⁣(ζ0+sfi1000 Hz,10−5,0.95),τi=1ζiωi\zeta_i=\operatorname{clamp}\!\left(\zeta_0+s\frac{f_i}{1000\,\mathrm{Hz}},10^{-5},0.95\right),\qquad \tau_i=\frac{1}{\zeta_i\omega_i}
ζ₀ is base damping; s is the optional slope per kilohertz. τ_i is the time for the amplitude envelope to fall by a factor e.
T60,i=ln⁡1000ζiωiT_{60,i}=\frac{\ln 1000}{\zeta_i\omega_i}
A 60 dB amplitude reduction is a factor of 1000. This is the modal envelope decay time, before room effects and other processing.
G=EE+E0,ωieff=ωi(1+gG)G=\frac{\mathcal E}{\mathcal E+\mathcal E_0},\qquad \omega_i^{\mathrm{eff}}=\omega_i(1+gG)
The nonlinear voice forms an energy proxy ℰ from its envelopes. The saturation scale ℰ₀ bounds the glide drive, and g controls its amount.
Source evidenceNonlinear resonator voiceoffline_projs/Modal2D/libmodal/include/modal/nonlinear_voice.hPer-mode dampingoffline_projs/Modal2D/libmodal/src/modal_api.cppNonlinear voice testsoffline_projs/Modal2D/tests/test_nonlinear_voice.cpp
Interactive schematic

Excitation, decay and audible modes

A handful of decaying vibrations can already suggest a struck object, without a recorded sample. Listen, then change the pitch, damping and modal mixture to hear how much character this small model can produce. The second view shows how strike position selects those ingredients.

Hear the modes add up

Press Play to hear the computed modal sum. Change pitch, damping, high-mode decay and the number of retained modes, then compare the waveform and fading envelope.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Hear the modes add up

Audio is synthesized on request from the discrete-string modal ratios and damped sinusoids. The demo rescales the fundamental and uses illustrative amplitudes; it does not solve a new physical geometry when those sliders move.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Cross-project instrument

Strike a reflective membrane. Hear its modes.

Strike a reflective membrane. Hear its modes.

The same excitation-and-decay idea becomes a Rive instrument: strike the surface or nodal diagram, then vary damping and pitch. Enable Listen inside the instrument.

Draws with Official Rive GPU Canvas + browser Web Audio

Artifact Signed visual .riv + procedural audio bridge

Export Standalone official CLI authoring; cross-project teaching study

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Strike a reflective membrane. Hear its modes.

Nine analytic square-membrane modes drive a signed Rive GPU Canvas surface and Rive vector diagram. An optional Web Audio bridge sonifies the same modal weights and decay. This is a teaching model, not a rendering of the native FEM solver.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Capability family

Inverse design, tuning & mode identity

A tuner repeatedly calls the forward model, then checks whether the intended audible mode actually reached the target.

06 · Inverse instrument design

Instrument creation lab: what if the shape came first?

Video A quick example with a suboptimal base shape. Listen to the final notes: the tone becomes tense and the vibration does not sustain well. Reaching a target frequency alone has not produced a satisfying instrument.
Video Glass strings with resonance: in this example, changing the material gives the design a more useful response. Geometry search is only one part of instrument design; stiffness, density and damping also shape the sound.
Description · at a glance

A manually tuned instrument begins with a design that already makes musical sense. Here the starting point can be a shape we simply want to hear. The task is to turn its available vibrations into a useful instrument: find a target partial, make it audible at a playable contact, and adjust the object without losing the character that made it interesting.

This is a quick example with a suboptimal base shape, rather than a finished instrument design. The last few notes sound tense and have insufficient sustained vibration. The adjacent glass-string recording shows another practical route: changing the material can improve the response without asking the geometry search to solve everything. These are observations from the examples, not a claim that one material fixes every shape.

In practice, the most reliable workflow so far is 1D search plus manual tweaking: choose a promising shape, material and contact, then restrict the automatic search to a parameter whose effect is reasonably predictable. This is a deliberate collaboration between the designer and the solver. A pitch match still needs a listening check for sustain, timbre and playability.

The lab also provides two-parameter searches and other proposal methods. Changing width and height can reorder modes or change which partial dominates, so alternating X/Y searches or naive gradient descent are not reliably sufficient. Gradients remain useful locally when a simple eigenmode is tracked consistently; mode switches, competing partials and multiple local solutions require more care. Reducing the search space manually makes these ambiguities easier to inspect.

The tuning tools search for geometry whose selected or dominant frequency matches a target. Width bracketing and bisection provide an interpretable baseline; uniform size adjustment and alternating width/height searches cover other parameterizations. Multi-bracket and dominant-audible-mode variants address cases where the first simple search follows the wrong branch.

The displayed cents error provides a musically meaningful scale for the target mismatch. A small numerical tolerance only certifies that chosen target criterion; it does not prove that the rest of the spectrum, decay or sound quality matches a desired instrument. Different geometries can have the same fundamental and very different timbres.

Not every shape reaches a clear, sustained target note through the current controls. The difficulty is not simply having many modes: harmonic partials can reinforce a pitch, while inharmonic spectra can make useful bells and percussion. The inverse problem is to shape the audible response, including excitation and decay. More freedom in mass, stiffness and physically consistent prestress could help; it is an extension of the design space, not a guarantee of success.

Δc = 1200 log₂(f / f_target)
An octave doubles frequency and spans 1200 cents; one equal-tempered semitone spans 100. Thus matching the target gives 0 cents, doubling it gives +1200, and halving it gives −1200. Positive values are sharp and negative values are flat. Matching pitch still leaves the other modes, material response and excitation-dependent timbre to judge.
Image Geometry-tuning search with width/height trials and a recorded best error of +2.9 cents.
ExplanationDefine what counts as the note before searchingTuning combines a frequency criterion, a mode-selection policy and a geometric search.

A tuner first needs a scalar observation. It may use the lowest elastic mode, a manually pinned mode, the strongest audible mode or a mode within a decay window. Those policies can return different answers on the same spectrum. Pinning and auditioning the intended partial makes the target reproducible.

The shared tuning cycle builds a candidate, waits for its solve, applies or reuses the intended strike, reads the selected response and proposes another geometry. The visible cents error is a logarithmic frequency ratio, so octave-spaced targets have comparable tolerances. The search should also preserve its best measured candidate when a later proposal worsens the result.

A small error certifies the selected pitch condition at the measured geometry. Timbre, decay, excitation and support remain separate requirements. A useful tuned note stores its shape and relative strike point together, so performance excites the same motion that was inspected during tuning.

e(s)=1200log⁡2 ⁣fk(s)(s)f∗e(\mathbf s)=1200\log_2\!\frac{f_{k(\mathbf s)}(\mathbf s)}{f_*}
s denotes geometric parameters, k(s) the mode-selection rule and f_* the target. Both geometry and selected mode affect the objective.
Source evidenceTuning state machine and recipes ↗Tuning tools and mode selection ↗Tuning verdict helperoffline_projs/Modal2D/modal_viewer/src/app/tune_verdict.h
Theory / mathematicsA clear note is an audible response, not a mode countTune what the listener hears, rather than only the nearest eigenfrequency.

A rich spectrum can still have a clear pitch. Harmonic partials can support one perceived fundamental even when that fundamental is absent from the signal. A bell can also have useful inharmonic partials. Many modes therefore do not make a shape inherently unsuitable; their organization, relative levels and decay matter more than their count.

An eigenmode contributes only through the way it is excited and heard. Strike near one of its nodes and its excitation can be weak; couple it poorly to the pickup or radiation field and visible vibration may produce little sound. A rapidly fading low partial can leave an upper partial dominant. Several similarly strong, unrelated partials may make pitch ambiguous, or be exactly the intended percussion sound.

The practical target can be one prominent partial or a useful pattern of partials, with a playable contact and suitable release. Bharaj and colleagues' metallophone design work is a relevant example of optimizing frequencies and amplitudes together through shape changes and perforations. Modal2D's current searches do not reproduce that full algorithm. A failed search can also reflect limited parameters, sampling or numerical conditioning; it does not prove that no physical design exists.

Theory / mathematicsMore freedom: distribute mass, stiffness and stressLocal changes can affect different modes differently; physical constraints still matter.

Changing one width gives only a narrow route through the possible spectra. Local mass, thickness, stiffness, holes and supports offer more control because different modes concentrate motion and strain in different places. With stiffness fixed, added mass where a mode moves strongly tends to lower its frequency; with mass fixed, added stiffness where it stores strain energy tends to raise it. A real geometry edit generally changes both, so its net effect must be checked.

Prestress can change the tangent stiffness as well: a taut string is the familiar example. The stress must belong to a physically consistent loaded state. Compression can soften modes and approach buckling, and a freely painted stress field is not automatically an equilibrium. General prestressed analysis linearizes small vibrations about the loaded configuration; prescribing beam tensions is a useful special case.

This is a promising extension, not an unrestricted spectrum editor. Positive mass, material limits, stable stiffness, supports and the desired visible shape constrain what can be realized. More parameters can improve a feasible design and also make the search harder. A useful optimizer would track several relevant modes, excitation and decay, then verify the resulting mechanics and sound.

Keff(p)ϕi=λiM(p)ϕi,λi=ωi2K_{\mathrm{eff}}(p)\phi_i=\lambda_i M(p)\phi_i,\qquad\lambda_i=\omega_i^2
The undamped small-vibration eigenproblem. Design parameters p alter the effective stiffness and mass, rather than directly assigning an independent frequency to each mode.
Keff=Kmaterial+Kgeometric(σ0)K_{\mathrm{eff}}=K_{\mathrm{material}}+K_{\mathrm{geometric}}(\sigma_0)
For a conservative model linearized about a prestressed equilibrium, the geometric stiffness depends on the initial stress. This is a physical load-state contribution, not an audio pitch shift.
ControlCurrent scopeWhat changes
Dimensions, material, contactExisting creation and tuning toolsThe supported geometry's mass/stiffness and the excitation of its modes.
Prescribed beam/string tensionsExisting beam controls and authored recipesGeometric stiffness in the supported beam model; not a general equilibrium stress solve.
Spatial mass/stiffness and prestress optimizationResearch extensionA richer constrained search over several audible modes; no general automatic solver is claimed.
Score pitch fittingExisting playback convenienceFrequency-transposed modal synthesis, with no new geometry, mass or stress design.
Source evidencePrestressed analysis — equilibrium followed by small vibrations ↗A worked example of stress stiffening and softening ↗Current beam geometric-stiffness implementationoffline_projs/Modal2D/libmodal/src/fem/element_beam.cpp
ExplanationBrackets, gradients and Bayesian proposalsEach search method addresses a different difficulty in geometry tuning.

Bisection is effective when a continuous mode branch is bracketed across the target. A preliminary sweep can find several such brackets instead of trusting one global trend. Alternating width and height handles two parameters, but can waste work on an axis to which the selected mode barely responds.

Fine-Grad measures local width and height elasticities with probe solves. It takes a damped minimum-norm step in log dimensions, bounded by the search region and a maximum change. This gives an interpretable direction: move the dimension whose local influence best reduces the measured error.

Experimental Bayesian width or width/height searches model the response and choose informative next evaluations. Calibration tools fit a local size-to-frequency relationship from actual solves, predict a useful next geometry and then refine it with the physical solver. A surrogate prediction is a proposal, not a completed instrument: the next eigensolve supplies the actual frequencies.

a=Δln⁡fΔln⁡W,b=Δln⁡fΔln⁡H,[Δln⁡WΔln⁡H]=ln⁡(f∗/f)a2+b2[ab]a=\frac{\Delta\ln f}{\Delta\ln W},\quad b=\frac{\Delta\ln f}{\Delta\ln H},\qquad \begin{bmatrix}\Delta\ln W\\\Delta\ln H\end{bmatrix}=\frac{\ln(f_*/f)}{a^2+b^2}\begin{bmatrix}a\\b\end{bmatrix}
a and b are measured local sensitivities. The expression is the minimum-norm linearized step before damping and bounds; near-zero sensitivity requires a fallback.
RouteProposal ruleUseful situation
Fine-W / Fine-SizeBracketed one-dimensional updatesA stable branch reaches the target with one parameter
Fine-WB / adaptive variantsSweep, preserve promising intervals, refineSeveral roots or audible-mode changes are plausible
Fine-WHAlternate axis searchesBoth dimensions need adjustment
Fine-GradFinite-difference log-space stepOne axis matters more, or both should move together
Bayes-W / Bayes-WHGaussian-process expected improvementSampled exploration of a more irregular response
Manual pin / decay filterChange which mode is observedThe default lowest partial is not the intended sound
Source evidenceFine-Grad stepoffline_projs/Modal2D/modal_viewer/src/app/tune_grad.hGaussian-process modeloffline_projs/Modal2D/modal_viewer/src/app/gaussian_process.hNamed tuning routes ↗
ExplanationRange tuning measures candidates before refinementThe active Music batch driver samples the shape’s response rather than assuming one global power law.

The current range driver begins from the chosen family, height, shell setting and material. It samples widths across its supported range, solves each candidate and records usable low frequencies. For each requested note it picks the nearest measured candidate in cents, then delegates to the existing refinement process. Targets far from all sampled candidates are reported as missed.

This differs from the earlier two-solve calibration design, whose power-law fitting helper remains in the source and tests. A size law can be a good local approximation, but a mixed or poorly conditioned family may change mode ordering or lose a low mode as geometry changes. A measured table avoids assuming global monotonicity; its finite sampling still cannot prove that every achievable note was found.

The polish step remains the meaningful completion path. The optional unpolished branch seeds a library entry with target metadata, so its displayed zero error should not be treated as an independently verified solve. The brochure’s demonstrated workflow uses refinement and a pitch check after material or geometry edits.

  • Choose the base geometry and material; select the score’s needed range.
  • Measure usable candidate widths and inspect the attainable frequency span.
  • Seed each target from the closest observation, then refine the actual geometry.
  • Keep missed targets visible; check a saved note’s pitch before building the ensemble.
Source evidenceActive music_auto_step_ and pitch checkoffline_projs/Modal2D/modal_viewer/src/app/app.cppScaling helpers and health checksoffline_projs/Modal2D/modal_viewer/src/app/tune_predict.h
Theory / mathematicsWhen smarter search is not the missing ingredientA reliable observation matters more than adding another optimizer.

The project’s later notes describe investigations where tiny width perturbations caused large spectral changes. Those results depend on geometry, slenderness, mesh and precision; they should not be generalized into a statement that a whole family is untunable. The practical distinction is between a difficult response surface and an unreliable numerical observation.

If the same mode changes smoothly, better bracketing, tracking or a local derivative can help. If the discretization changes abruptly or an eigensolve returns unstable modes, the next step is to inspect element quality, returned mode count and perturbation behavior. Running the search longer does not restore information lost upstream.

A separate thickness helper exploits the near-linear frequency law of thin bending plates while keeping the in-plane mesh fixed. It predicts and verifies a thickness correction, and has dedicated source tests. The inspected viewer has no call site for that helper, so it is an unintegrated prototype rather than an active Music control. The law also ceases to be the same approximation in the thick-plate regime.

hnext=h0f∗f0h_{\mathrm{next}}=h_0\frac{f_*}{f_0}
For a thin bending plate with fixed in-plane geometry, f is approximately proportional to h. A verify solve checks the proposed thickness; in-plane CST frequencies do not follow this thickness law.
Source evidenceConditioning investigation and design motivation ↗Thickness proposal and verification helpersoffline_projs/Modal2D/modal_viewer/src/app/tune_predict.hGeometry and scaling probesoffline_projs/Modal2D/tests/test_music_autotune.cpp
07 · Tuning internals

A mode can change its position in the spectrum

Description · at a glance

As geometry changes, neighboring modes can exchange frequency order. Following a list index can then tune a different physical motion halfway through a search. Modal2D compares resampled shapes using the modal assurance criterion, which measures similarity independently of a mode vector's arbitrary sign.

This comparison helps maintain a mode identity across solves, but it is still a heuristic under large shape changes, near-degeneracy or different localized motion. Confidence thresholds guide the search; they are not a proof that a unique mode exists throughout the parameter path.

dλ/dp = φᵀ(K′ − λM′)φ / (φᵀMφ)
This local eigenvalue sensitivity applies under the usual simple-mode assumptions. The implementation estimates matrix derivatives and verifies proposed geometry through another solve.
Theory / mathematicsFollow a shape, not its index in a sorted listCorrelation provides a sign-invariant correspondence between solves.

Mode vectors are arbitrary up to sign. They can also exchange frequency order as parameters change. The modal assurance criterion squares a normalized inner product, making it insensitive to sign and overall scale. The application compares resampled spatial representations to track a pinned motion between differently shaped meshes.

Near a repeated eigenvalue, several independent vectors span the same eigenspace and the solver may rotate that basis. Individual-vector correlation can then fall even when the subspace remains similar. Large geometry changes and strong localization changes create additional ambiguity. The displayed confidence is therefore useful diagnostic information rather than a guarantee of correspondence through every shape change.

The most informative comparison combines the tracked shape, its frequency, the MAC score and its strike amplitude. If the score collapses, the user can repin the intended motion instead of silently following a new index.

MAC⁡(a,b)=∣aTb∣2(aTa)(bTb)\operatorname{MAC}(\mathbf a,\mathbf b)=\frac{|\mathbf a^T\mathbf b|^2}{(\mathbf a^T\mathbf a)(\mathbf b^T\mathbf b)}
a and b are corresponding sampled displacement vectors. MAC lies between zero and one for nonzero real vectors; the implemented spatial comparison uses resampling rather than assuming identical mesh nodes.
Source evidenceTracking logicoffline_projs/Modal2D/modal_viewer/src/app/mac_track_logic.hTracking testsoffline_projs/Modal2D/tests/test_mac_track_logic.cppManual pin and MAC workflow ↗
Theory / mathematicsReuse an eigenvector to estimate a geometry derivativeA local sensitivity can accelerate a bracketed search when the mode remains isolated.

Differentiating the generalized eigenproblem cancels the derivative of a normalized eigenvector and leaves a quadratic form involving changes to stiffness and mass. This explains why one can estimate frequency sensitivity with matrix assembly around a current mode instead of performing a complete new eigensolve for every derivative term.

A sensitivity route uses the generalized eigenvalue derivative to propose a Newton-like update, guarded by bracketing and fallback. In the current implementation, matrix changes are estimated by perturbation before applying the derivative expression, and support is concentrated in the planar triangle route. Unsupported formulations fall back rather than receiving an invented derivative.

This method assumes a locally meaningful isolated mode branch. At mode crossings, under remeshing changes or with a poorly converged eigenvector, the derivative can be a poor predictor. Comparing its predicted frequency change with the next solve makes that failure visible.

dλids=ϕiT(Ks−λiMs)ϕiϕiTMϕi,dfids=14πωidλids\frac{d\lambda_i}{ds}=\frac{\boldsymbol\phi_i^T(\mathbf K_s-\lambda_i\mathbf M_s)\boldsymbol\phi_i}{\boldsymbol\phi_i^T\mathbf M\boldsymbol\phi_i},\qquad \frac{df_i}{ds}=\frac{1}{4\pi\omega_i}\frac{d\lambda_i}{ds}
s is a geometry parameter; K_s and M_s denote its matrix derivatives. The expression assumes a differentiable simple eigenpair with λ_i = ω_i².
Source evidencemodal_compute_hf_width_derivsoffline_projs/Modal2D/libmodal/src/modal_api.cppSensitivity acceleration and supported route ↗
Interactive schematic

Watch coupled modes exchange their character

Watch coupled modes exchange their character

Sweep a shape parameter, weaken the coupling, and watch five computed eigenmodes approach and exchange their basis character. Follow a sorted mode index or highlight the contribution of one fixed basis shape.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Watch coupled modes exchange their character

A symmetric five-by-five operator retains the diagonal trends and nearest-neighbour coupling of the original teaching article. A live Jacobi eigensolve supplies eigenvalues and normalized eigenvectors. The animated shape uses five illustrative sine functions; it is not a native FEM geometry. Fixed-basis weights reveal character exchange, rather than implementing the native mesh-aware MAC tracker.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Capability family

Instrument libraries, scores & reproducible work

Turn solved objects into a playable collection while retaining the evidence behind each note.

08 · Main application

From an instrument library to a performance

Video A full string-instrument performance, with the score, contact links and output spectrum visible together.
Description · at a glance

Music mode connects the mechanics to a practical outcome. Saved instruments retain geometry, material and strike choices. A score requests notes, and the mapping system looks for a suitable solved instrument for each pitch. The range auto-tuner can construct additional instruments through calibration and refinement instead of merely resampling every note from one sound.

Missing notes are filled for convenience: borrow an available instrument or contact region, then transpose its modal spectrum to play the requested pitch. Manually tuned instruments and hybrid ensembles can therefore cover a score beyond their physical note range. The recorded import grid uses blue for a note's own shape and gold for a borrowed, shifted source. This remains sample-free synthesis, but the fitting step is deliberately nonphysical: it does not construct a newly tuned geometry for every note.

Hybrid ensemble can select one source per pitch or layer overlapping instrument sets. A file of imported note bodies remains one set and selects its best contact internally; overlapping independent sets can then play together. Shared range controls specify which score pitches a set may cover, including pitches supplied by fitting. Separate MIDI tracks that share a pitch still use the same selection or layer combination; independent track routing remains an application feature to add.

Manually tuned instruments, material choices and natural sustain

The manually tuned instrument and hybrid routes now offer 19 material choices, including automatic family recipes, diamond, effective carbon fiber and rubber. A material changes the stiffness, mass and damping used by the physical model. A per-note material variant is a separately solved body and resonance bank, assigned to that note; it does not silently replace the material of one member inside the original coupled assembly.

Low-loss recipes can ring for several seconds. Rendered ring-out can retain up to 40 seconds after the last score note, while the live decay remains the model’s own response. Longer export duration captures the sustain; it does not manufacture it. These material recipes are explicit sound-design approximations: carbon fiber and wood are effective isotropic models, and the rigid-bore horn solves air pressure rather than wall vibration.

Image Music playback with 20 ready instruments and 45 borrowed notes, alongside material assignments and pitch-shift indicators.
Image Own-shape and borrowed-note mapping, a selected instrument's strike point, material palette and score controls.
ExplanationFill missing notes: borrow the contact, transpose the spectrumA playback convenience, separate from physically tuning an instrument.

The score supplies a pitch, onset, duration and velocity. The physical source supplies solved modal frequencies, damping, mode shapes and the excitation weights at a playable contact. Imported instruments, manually tuned instruments and hybrid ensembles reuse these ingredients to fill notes that were never physically tuned in the source library.

Selection comes first. Fit score pitches prefers an exact note label, then the same note name in the closest available octave, then a nearby chromatic note. Among equally distant contacts, the lower source note wins. Thus C4 is preferred over B5 for a requested C6 when octave-first fitting is enabled. Imported libraries also respect their configured shift limits; manually tuned instrument and hybrid fitting can extend a single octave across a score.

Transposition comes next. Every retained modal frequency is multiplied by the same ratio: borrowing C4 for C5 doubles the spectrum; borrowing C4 for C♯4 multiplies it by about 1.05946. Relative partial spacing survives, including inharmonicity, but this does not guarantee unchanged timbre, decay or perceived tuning. Large shifts are especially different from redesigning the instrument. An optional measured-pitch correction uses the selected contact's measured modal pole instead of trusting its nominal note label; that pole is not a guarantee of the perceptually dominant pitch.

There is no new finite-element solve for a fitted note: the mesh, material and spatial mode shapes stay as they were. In manually tuned instrument and hybrid playback, events using the same source and frequency ratio share a state and can excite its resonance. Different ratios use independent modal banks. Their combined visualization does not imply mechanical coupling between those transposed copies. Manual contact playback still excites the original, unshifted body.

Preserve fitted-note level compensates the extra amplitude scaling introduced by transposing the bank. It keeps high borrowed notes from becoming artificially faint; it does not normalize every note to the same loudness. The sound still comes from the model, with no recorded instrument sample, but the frequency and level fitting are musical playback operations. Exact-only and legacy nearest-contact options remain available for comparison.

r=2(mtarget−msource)/12,fk′=rfkr=2^{(m_{\mathrm{target}}-m_{\mathrm{source}})/12},\qquad f'_k=r f_k
MIDI note differences count semitones. The ratio r scales every retained partial k, rather than simply substituting an unshifted neighboring note. With measured-pitch correction enabled, r instead equals the requested note frequency divided by the measured source pole.
OperationWhat changesWhat it means
Physical tuningGeometry or material, followed by a new solveFind an actual body whose audible response reaches the target.
Contact selectionWhere the existing body is excitedChange the mixture of its existing modes; no new eigenfrequencies.
Playback pitch fittingModal frequencies and optional listening-level compensationCover the score for convenience, without claiming a newly tuned physical instrument.
Source evidenceManually tuned instrument fitting policiesoffline_projs/Modal2D/modal_viewer/src/app/music_suite_score.hContact selection, spectrum transposition and shared modal banksoffline_projs/Modal2D/modal_viewer/src/app/music_hybrid_render.hImported-library assignment and coverage rulesoffline_projs/Modal2D/modal_viewer/src/app/music_map.hScore syntax and timingoffline_projs/Modal2D/modal_viewer/src/app/score.hMIDI event importoffline_projs/Modal2D/modal_viewer/src/app/midi_import.h
ExplanationWhy not automatically tune a physical body for every note?That is a harder inverse problem, and it remains a separate part of the project.

A simple size law can work for a restricted shape family. Once width, height, cavities, supports or materials change independently, the audible partial need not move monotonically. Modes can exchange order or character near crossings, and a mode that reaches the target may barely respond at the chosen contact. Searching only for the nearest eigenfrequency can therefore produce the right number and the wrong instrument.

Physical auto-tuning needs repeated solves, mode tracking and a check that the target partial can actually be excited and heard. The tuning and exploration tools investigate that problem. Score fitting intentionally takes a cheaper route: reuse a solved response and transpose it so the music can play now. It is one of the clearest departures from the project's physical construction, kept for convenience rather than presented as a substitute for solving the inverse problem.

ExplanationFollow a score note back to its physical contactAudition the route, inspect the source, then adjust its mechanics or display.

In Hybrid ensemble, click a pad to hear its routed sound and contacts; Shift-click selects silently. Auditioning uses a separate buffer, keeping the rendered full score ready to play again. The live score, illuminated pads, layer colors and contact links follow whichever performance is currently heard, including every activated set when ranges are layered.

Manually tuned instruments remain visible as complete moving bodies. Selecting an imported source also opens an enlarged gallery view while keeping its source-pad thumbnail. Borrowed notes connect to the actual mesh node where that source is excited.

Instruments and coverage exposes the selected source's Body material and imported Strike X/Y controls. Material changes rebuild its physical model; moving a strike reprojects the existing modes without another eigensolve. The material selector distinguishes known recipes from imported or custom values.

Body vibration, cavity pressure and exterior medium have independent display switches. Motion magnification spans 0–8×; cavity and medium exposure each span 0.125–16×. Reset display reference clears the held visual normalization, and setup files retain the gains and visibility choices. These controls change the display, not the sound: cavity pressure comes from the coupled solve, while the exterior medium remains a radiation proxy.

Source evidenceHybrid playback, selection and display controlsoffline_projs/Modal2D/modal_viewer/src/app/app_music_hybrid.cppImported material solves and physical contact projectionoffline_projs/Modal2D/modal_viewer/src/app/music_hybrid_body.cpp
ExplanationGive instrument sets a range, then choose how overlaps playCoverage is permission; priority chooses a winner, while layering lets independent sets play together.

Each newly imported instrument file becomes one named set containing its note bodies. Copying the current custom-instrument library also creates one set. Lowest note and Highest note include both endpoints; allowed note names filter target pitches within that range. Member limits intersect the parent set's coverage, so a one-note material variant stays local. A manually tuned instrument acts as an independent set.

A set's configured range can exceed its physical notes: with pitch fitting enabled, one octave may cover MIDI 0–127. Use physical note span selects its authored endpoints; Full MIDI range permits 0–127 and all note names. Show coverage on pads highlights the configured allowed range even when another source wins some notes. Fit grid to this range changes the visible octaves, not the routing limits.

Layer overlapping instrument sets is off by default. One source then wins: exact note first; with octave-first matching enabled, the same note name precedes another pitch class; nearest pitch and source order resolve the remaining choices. Turn layering on and one best contact is selected within every eligible set, then those sets play together. Thirteen imported notes from one file therefore supply one suitable contact, rather than thirteen simultaneous copies.

For example, a harp allowed C3–C6 and a bell set allowed C4–C5 both play C4 when layering is on; only the harp plays C3. A manual override changes the contact in its own set and may bypass its range, while other eligible sets still participate. Disabled sets or members remain excluded, and muting a pitch suppresses every layer for it. Pad colors and live connections expose the selected layers and their actual contacts.

Older imports without file-group provenance remain independent. Group legacy imported notes as one set is an explicit migration that preserves their member limits. New groups, ranges, overlap policy and coverage highlights persist with the Hybrid setup. The original import mode stays unchanged. Audio layers are summed before one final normalization; the mix does not create mechanical coupling between independent sets, nor assign different timbres to MIDI tracks sharing the same pitch.

ControlEffect
Set range and note-name maskPermit target score pitches; fitting can supply notes outside the original octave.
Member limitsNarrow the parent range for an individual note body or material variant.
Show coverage on padsReveal configured coverage independently of which source currently wins.
Layer overlapping instrument setsChoose one contact per eligible set and play the selected sets together.
Manual override / muteOverride one set's contact, or mute all layers for a pitch.
Source evidenceInstrument grouping, inclusive range editing and saved coverageoffline_projs/Modal2D/modal_viewer/src/app/app_music_hybrid.cppSingle-source selection and one contact per overlapping setoffline_projs/Modal2D/modal_viewer/src/app/music_hybrid_render.h
ExplanationTreat the ensemble as a reproducible design stateGeometry, material, touch and arrangement travel together.

The Music grid displays the instruments that cover the score, with strikes linked back to their source objects. Per-instrument material assignment allows a set to mix different mechanical responses. A material change can invalidate a stored pitch: the instrument needs another solve and check before the old tuning label can be trusted.

The ensemble file carries more than note names. It retains instrument geometry, material metadata, strike coordinates and arrangement settings so a session can be reconstructed. Older files without per-instrument material fields use compatibility defaults. Importing an additional library and replacing the current one are deliberately different operations.

Offline audio rendering and WAV export turn the design into an output artifact. The visual performance remains useful for inspecting which source plays each note; an exported phrase supplies the listening comparison. A complete evidence capture pairs the note mapping with the generated audio and records whether reverb, nonlinear voice or pitch shifts are enabled.

The selected-note inspector reconnects the performance to its mechanism: geometry, material, strike location and modal information remain visible. Ensemble persistence and audio export make the result reusable. The MIDI importer handles the supported note, timing and part data, but does not claim a complete General MIDI synthesizer with every controller, program and pitch-bend behavior.

  • Inspect one saved note: geometry, actual pitch, material and strike location.
  • Build the grid and review missing or borrowed assignments before playback.
  • Change one material or contact parameter, recheck the relevant pitch, then replay the same phrase.
  • Save the ensemble and export WAV with the processing state recorded.
Source evidenceEnsemble serializationoffline_projs/Modal2D/modal_viewer/src/app/ensemble_file.hInstrument fields and compatibilityoffline_projs/Modal2D/modal_viewer/src/app/instrument_file.hOffline music rendering testsoffline_projs/Modal2D/tests/test_music_render.cppPersistence testsoffline_projs/Modal2D/tests/test_ensemble_file.cpp
ExplanationKnow which signal each analysis view representsModal-state plots and the final processed audio answer different questions.

Sound Analysis separates two sources. Solved modes builds a modeled line spectrum from modal envelopes and damping widths; it is useful for inspecting a single object's mechanics. Heard output analyzes the final stereo samples sent to playback, including rendered scores, fitted pitches and downstream effects. Auto selects heard output for Music and the continuous instrument voices, so the waterfall continues to follow the sound when playback comes from a rendered buffer.

With heard output selected, the spectrogram and waterfall use windowed FFT analysis; cochleagram and note-band views reorganize that spectrum. Stereo powers are combined without cancelling opposite-phase channels. The callback's sample clock supplies fresh data, and pause holds the spectral history. Restarting or seeking clears the old segment. The CQT-like view remains a chromatic band display rather than a separate constant-Q transform. Per-mode fields and decay diagnostics still require solved-mode data: an audio mixture alone does not identify the physical mode shapes of its instruments.

The audio chain includes optional sustained and nonlinear voices, gating, filtering, soft limiting and stereo reverb. Reverb offers a Schroeder–Moorer-style comb/all-pass route and partitioned convolution with an impulse response. Comparing a modal envelope with a post-effect waveform distinguishes what came from the object from what came from the listening-space and voice processing.

S(f)=∑ipiwi2(f−fi)2+wi2,pi=∣ai∣2S(f)=\sum_i p_i\frac{w_i^2}{(f-f_i)^2+w_i^2},\qquad p_i=|a_i|^2
The analysis forms Lorentzian lines centered at modal frequencies f_i; p_i is envelope power and w_i is a visualization width related to damping.
y[n]=(x∗h)[n]=∑kx[k]h[n−k]y[n]=(x*h)[n]=\sum_k x[k]h[n-k]
Convolution reverb applies an impulse response h to the audio x. Its output includes room-response effects beyond the object’s bare modal spectrum.
Source evidenceWindowed analysis of final stereo playbackoffline_projs/Modal2D/modal_viewer/src/app/sound_analysis_pcm.hAnalytical spectral viewsoffline_projs/Modal2D/modal_viewer/src/app/sound_analysis_compute.hHistory and perceptual layoutsoffline_projs/Modal2D/modal_viewer/src/ui/viz_sound_analysis.cppAlgorithmic and convolution reverboffline_projs/Modal2D/modal_viewer/src/audio/reverb.hProcessing orderoffline_projs/Modal2D/modal_viewer/src/audio/audio_engine.cpp
Recorded examples · 1Solved instruments become musicA family of tuned objects is assembled into playable notes.
Image Glockenspiel bars labeled C5 through C6, with a selectable strike point.
09 · Evidence and boundaries

Follow an instrument from mesh to music

Description · at a glance

Follow one object through its mesh and supports, a selected mode, a strike and its spectrum, then a target pitch and a checked geometry change. Finally, hear it in a short score. This connects the numerical method to the instrument you can play. It also makes intermediate failures useful: a mode switch, insufficient tuning range or borrowed note has a visible reason.

The current scope is reduced modal mechanics and synthesis with selected experimental extensions. Mesh convergence, listening quality, latency, open acoustic radiation and general nonlinear coupling require separate measurements. Those boundaries leave a focused achievement: editable physical instruments, inspectable spectra and a score pipeline that states exactly when it uses solved geometry and when it uses musical approximation.

ExplanationWhat is implemented, and what still needs a stronger modelThe next steps follow the numerical and acoustic boundaries of the current system.

The primary guides span several generations of the application. The technical details here follow the inspected implementation where those accounts differ: the sparse solver has one fixed Krylov build, the plate kernel’s concrete choices include lumped mass and a fixed internal Poisson ratio, and Music’s active range driver samples candidate widths. The long source notes remain available as design history and deeper mathematical context.

A useful next validation campaign would connect element convergence, eigenpair residuals, shape perturbations and audible partial selection. For acoustic coupling, the next model improvement is signed interface quadrature and explicit open-boundary treatment. For nonlinear instruments, a reduced nonlinear mechanical model would connect amplitude-dependent pitch and energy exchange to structural parameters.

The source includes focused tests for mechanics and later workflows, including tuning scale behavior, music rendering, MIDI handling, persistence and acoustic extensions. This brochure's source audit did not run a fresh native build or those tests, so their presence is reported as implementation evidence rather than a new pass claim. The screenshots are genuine desktop captures.

LayerCurrent scopeNext useful evidence or extension
Linear structure and modal synthesisImplemented FEM routes and reduced oscillatorsResolution studies, residuals and listening comparisons
Sparse eigenbasisFixed-subspace shift–invert implementationConvergence criteria and restart strategy
Nonlinear voice / sustain / reverbImplemented reduced DSP and processingSeparate output analysis and parameter-controlled listening
Exterior Field LabDominant-frequency boundary-source visualizationCalibrated source model and propagation validation
Cavity couplingSealed pressure modes with reduced interface surrogateSigned boundary quadrature and open-port radiation
Thickness tunerHelper and tests; no inspected viewer call siteIntegrate a verified thin-plate workflow
Music range tuningMeasured candidate table plus refinementVerified pitch metadata for every stored result
Capability family

Radiation, fields & coupled resonators

Use the modal basis to investigate how structural motion connects to a reduced acoustic explanation.

10 · Experimental extensions

Field views add an acoustic explanation with explicit limits

Description · at a glance

The exterior acoustic field view constructs a complex phasor field from modal sources, directional factors and softened two-dimensional spreading. Amplitude and phase views make interference and source placement inspectable. This is a reduced frequency-domain visualization, not a transient pressure-wave solve throughout the surrounding air.

The medium-feedback experiment adds a heuristic response back into excitation. Its use of displacement-based source information and simplified distance behavior should not be described as a complete reciprocal fluid–structure coupling. Likewise, the current exterior-field implementation contains assumptions about sound speed that deserve attention before comparing different media quantitatively.

The displays separate the two air regions. Interior cavity pressure belongs to the coupled cavity eigenproblem inside a closed body; exterior medium color visualizes radiation around it. When both are enabled, cavity priority keeps the enclosed field legible instead of allowing the exterior overlay to cover it. Their exposure controls affect only visualization, not the synthesized level.

Image Cross-shaped mesh and its reduced exterior acoustic-field visualization.
Video A single bar with the prototype air-cavity resonator off and on. This adjustable audio bandpass adds one resonance; the exterior field display is separate from both that audio effect and the coupled cavity-pressure solve.
Theory / mathematicsHow mechanical modes contribute to the audible signalModal radiation weights and an exterior field image are distinct observations of the object.

The engine’s planar radiation helper sums each mode’s normal displacement around the boundary, weighted by associated segment length. The signed sum captures a useful cancellation mechanism: opposite boundary motions can contribute less net radiation than motions that reinforce. The resulting coefficient weights the mode in the audio sum, alongside its excitation and damping.

The current helper then normalizes all modal coefficients by the largest absolute coefficient. This supplies relative modal weights rather than a calibrated pressure prediction. A uniform nonzero density factor cancels in that normalization, so changing the medium-density input cannot be interpreted as an absolute loudness experiment through this helper alone.

The Field Lab instead evaluates distance-dependent complex contributions over space. Its colors answer where interference and phase structure occur in the reduced exterior model. The audio coefficient, the exterior image and a coupled cavity mode therefore have different definitions and should be compared using their own observables.

α~i=ρaωi∑jℓj ϕi(xj)⋅nj,αi=α~imax⁡k∣α~k∣\widetilde\alpha_i=\rho_a\omega_i\sum_j \ell_j\,\boldsymbol\phi_i(\mathbf x_j)\cdot\mathbf n_j,\qquad \alpha_i=\frac{\widetilde\alpha_i}{\max_k|\widetilde\alpha_k|}
ρ_a is the medium-density factor; ℓ_j is the boundary length assigned to node j and n_j its averaged normal. Normalization applies when the maximum is nonzero and produces relative audio weights.
Source evidenceBoundary radiation weights and normalizationoffline_projs/Modal2D/libmodal/src/modal/radiation.cppUse of modal radiation coefficients in soundoffline_projs/Modal2D/libmodal/src/audio/synthesis.cu
Theory / mathematicsOne complex field supports nine visual questionsStore amplitude and phase, then reconstruct time and spatial diagnostics.

The current Field Lab first sums boundary-source contributions into a complex texture. Each contribution uses distance-dependent phase, softened spreading and an outward-facing weight. A second pass derives the live pressure-like view, envelope, phase, complex coloring and differential views from the same stored real and imaginary channels.

This is a monochromatic reduced exterior model. Its source weights come from the object’s modal visualization, with a dominant-frequency approximation. Reflections, occlusion, diffraction and calibrated absolute pressure are outside this field construction. The mathematical views remain useful for inspecting interference and phase structure within that chosen model. The inspected viewer supplies a fixed 343 m/s to this field shader.

Complex differences avoid directly subtracting wrapped phase angles. The implementation builds a phase-gradient-related vector from Im(conj(P)∇P), then displays its magnitude/orientation, curl and divergence as field diagnostics. Their numerical scale and sign convention belong to this visualization; they should not be read as calibrated acoustic power-flow measurements.

The spacetime view reconstructs pressure-like values at a bounded sequence of times and composites them as a sheared slab. It reveals moving phase fronts and persistent nodes without storing a full time simulation. It is a rendering of the harmonic field’s analytic time coordinate.

P(x)=∑jaj(x)e−iωrj/c,p(x,t)=Im⁡ ⁣(P(x)eiωt)P(\mathbf x)=\sum_j a_j(\mathbf x)e^{-\mathrm i\omega r_j/c},\qquad p(\mathbf x,t)=\operatorname{Im}\!\left(P(\mathbf x)e^{\mathrm i\omega t}\right)
r_j is distance to source j; c is the field’s sound-speed parameter, ω its selected angular frequency and a_j its weighted source amplitude.
∣P∣ gives envelope,arg⁡P gives phase,Im⁡(P∗∇P)=∣P∣2∇arg⁡P|P|\text{ gives envelope},\qquad \arg P\text{ gives phase},\qquad \operatorname{Im}(P^*\nabla P)=|P|^2\nabla\arg P
The complex identity is well behaved away from amplitude zeros and avoids phase-wrap subtraction. At P = 0, phase itself is undefined.
ViewsQuestion
Live / envelopeHow does the field oscillate, and where does its amplitude remain small?
Phase / complexHow do phase fronts align with strong and weak regions?
Intensity-style / curl / divergenceWhat spatial structure appears in the phase-gradient diagnostic?
Envelope LaplacianWhere does amplitude change sharply?
SpacetimeWhich nodal structures persist across the harmonic cycle?
Source evidencePhasor and field-view explanations ↗Field Lab compute passesoffline_projs/Modal2D/modal_viewer/src/app/app.cpp
Theory / mathematicsTrapped air has a modal basis of its ownA pressure discretization extends the structural eigenproblem to enclosed regions.

For small-amplitude acoustic motion in a homogeneous medium, separating time from the wave equation gives a Helmholtz eigenproblem. The cavity implementation uses scalar pressure unknowns on a triangulated interior region. Its stiffness-like matrix contains pressure gradients; its mass-like matrix contains the interpolation product scaled by sound speed.

Rigid sealed boundaries use a no-normal-flow condition, which produces a constant-pressure zero mode in the ideal Neumann problem. The implementation filters the corresponding low-frequency numerical mode. Although the matrix assembly has a port-boundary mechanism, current cavity detection does not supply localized port nodes, so the assembled chambers in this route are effectively sealed.

This is separate from both the exterior field image and the simpler audio cavity filter. A bottle-style Helmholtz neck resonance motivates what an open cavity could do, but the closed chamber eigenproblem should not be presented as a complete open sound-hole radiation model.

Enclosed cavities are a separate, more structured extension: the application detects a cavity, builds an acoustic discretization and couples reduced modal systems. The present interface coupling uses a simplified nearest-displacement construction, and detected openings are treated as sealed in that route. Cavity eigenmodes therefore do not establish a full radiating open-instrument model. Reverb and nonlinear voice processing remain additional audio stages with their own meanings.

−∇2ψj=ωj2c2ψj,∂nψj=0 on a rigid sealed wall-\nabla^2\psi_j=\frac{\omega_j^2}{c^2}\psi_j,\qquad \partial_n\psi_j=0\text{ on a rigid sealed wall}
ψ_j is a pressure mode; c is sound speed. The boundary condition describes zero normal acoustic velocity in the ideal sealed model.
(Ka)mn=∫Ω∇Nm⋅∇Nn dA,(Ma)mn=1c2∫ΩNmNn dA(K_a)_{mn}=\int_\Omega\nabla N_m\cdot\nabla N_n\,dA,\qquad (M_a)_{mn}=\frac{1}{c^2}\int_\Omega N_mN_n\,dA
Scalar interpolation functions N_m produce the acoustic generalized eigenproblem K_a ψ = ω² M_a ψ.
Source evidenceAcoustic element assemblyoffline_projs/Modal2D/libmodal/src/fem/element_acoustic.cppCavity meshing and current port handlingoffline_projs/Modal2D/libmodal/src/acoustic/cavity_mesh.cppAcoustic element testsoffline_projs/Modal2D/tests/test_acoustic_element.cpp
Theory / mathematicsCouple reduced bases, then inspect the mixed modesStructural–cavity coupling and sympathetic excitation use different operators.

The cavity route first computes structural and pressure modes, then forms a smaller symmetric block system with off-diagonal coupling. A resulting eigenvector contains both structural and cavity coefficients. Near matched uncoupled frequencies, a nonzero coupling splits the pair into two hybrid responses. Multiple chambers link through the common structural basis rather than a direct chamber-to-chamber block.

The present interface matrix is a reduced surrogate: cavity boundary nodes choose nearest structural nodes and accumulate displacement-magnitude times pressure-mode values. It does not integrate the signed normal displacement with boundary quadrature. The hybrid-mode calculation is executable and informative, while the coupling magnitude remains a qualitative model.

Sympathetic resonance is a different extension. It identifies modes localized on separate components and cross-feeds point-strike impulses through a detuning-dependent Lorentzian weight. Nearby modal frequencies interact more strongly. This modifies excitation; it does not solve a new fully reciprocal time-dependent mechanical coupling at each audio sample.

[Ωs2−L−LTΩa2][qsqa]=ω2[qsqa]\begin{bmatrix}\boldsymbol\Omega_s^2&-\mathbf L\\-\mathbf L^T&\boldsymbol\Omega_a^2\end{bmatrix}\begin{bmatrix}\mathbf q_s\\\mathbf q_a\end{bmatrix}=\omega^2\begin{bmatrix}\mathbf q_s\\\mathbf q_a\end{bmatrix}
Ω_s and Ω_a contain uncoupled angular frequencies. L is the reduced coupling used by this prototype; q_s and q_a describe the mixed mode.
ω±=ω02±g\omega_\pm=\sqrt{\omega_0^2\pm g}
For a matched two-mode example with coupling magnitude g < ω₀², the pair splits above and below its original frequency.
wij=11+Q((ωi−ωj)/ωˉ)2w_{ij}=\frac{1}{1+Q\left((\omega_i-\omega_j)/\bar\omega\right)^2}
The sympathetic strike weight depends on relative detuning. Q controls sharpness and ω̄ is the pair’s mean frequency.
Source evidenceReduced coupled eigensolveoffline_projs/Modal2D/libmodal/src/acoustic/cavity_couple.cppInterface surrogate and sympathetic strike routingoffline_projs/Modal2D/libmodal/src/modal_api.cppMode-splitting casesoffline_projs/Modal2D/tests/test_cavity_couple.cppChamber isolation casesoffline_projs/Modal2D/tests/test_cavity_isolation.cpp
Interactive schematic

From coherent sources to a field you can inspect

Change the source arrangement, reconstruct a waveform from its phasor, compare field observables, or turn time into an image axis. Each view isolates a different operation on a harmonic field.

Many surface sources become one field

Change frequency, array width and curvature to inspect reinforcement, cancellation and focusing in the spatial field surrounding the source line.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Many surface sources become one field

A coherent scalar point-source field is evaluated directly on the browser grid. Interactive and refined previews vary display resolution, not the source count used by the sum. It is a propagation teaching model, not the native radiation mesh.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Interactive schematic

Air resonance and structural coupling

Compare the resonance scales of a duct and a lumped neck-and-volume model, then see how coupling splits two interacting modes.

Structural and air resonances split when coupled

Move the coupling strength toward zero, then increase it. Compare the crossing uncoupled branches with the separated eigenvalues of the coupled pair.

Open separately ↗

Wheel over the scene may zoom; move outside it to scroll the page.

Preview of Structural and air resonances split when coupled

A live two-by-two coupled system illustrates avoided crossing and mixed mode character. It explains reduced coupling without claiming a resolved fluid–structure interface or a measured guitar-body response.

Suspended · activate to run; playback pauses after the full panel leaves the vertical viewport.

Recorded examples · 3Body and surrounding acoustic fieldDifferent geometries expose the relation between structural motion and the reduced field model.
Image Annular finite-element mesh with colored displacement, strike target and a reduced exterior acoustic field.
Image Twin-box geometry inside a wide exterior acoustic-field view; this framing emphasizes field extent rather than mesh detail.
Image Rectangular cavity geometry and the computed field shown together in the native application.
Full reading set · 10 documents

More in-depth tech documents

The complete articles are included below. Open a title for the full derivation, implementation discussion and original figures; each document loads when you reach it.

Full document · 01Capabilities and controlsFeature reference with implementation-status labels and recorded limitations.

Open this document to read its complete text, figures and examples here.

Full document · 02Workflows and mathematical basicsRecipes, shortcuts, tuning state machine, threading, troubleshooting and derivations.

Open this document to read its complete text, figures and examples here.

Full document · 03Native project and dependency structureHistorical build-structure guide; dependency/project counts describe that source snapshot.

Open this document to read its complete text, figures and examples here.

Full document · 04Technical roadmapHistorical overview mixing implemented features and future directions; read alongside current chapter scope.

Open this document to read its complete text, figures and examples here.

Full document · 05How it works — nine interactive labsInteractive teaching companion: simplified mesh, assembly, eigenmode, excitation and radiation models.

Open this document to read its complete text, figures and examples here.

Full document · 06Going deeper — nine interactive labsInteractive teaching companion for phasors, fields, cavities, coupling and higher-dimensional geometry.

Open this document to read its complete text, figures and examples here.

Full document · 07Technical overviewComprehensive architecture, formulations, solvers, synthesis, coupling, tuning and validation reference.

Open this document to read its complete text, figures and examples here.

Full document · 08The barely possible instrumentMotivation, design experiments and interpretation; figures are explicitly schematic. Optional listening comparisons are not included; a current native ensemble recording is linked.

Open this document to read its complete text, figures and examples here.

Full document · 09Tone-finder UX designHistorical proposal preserved for design rationale; not an independent claim of current implementation.

Open this document to read its complete text, figures and examples here.

Full document · 10Fine-W+ thorough tuning designHistorical experimental design specification with proposed acceptance criteria.

Open this document to read its complete text, figures and examples here.

Current scope

  • Linear modal models approximate small vibration; nonlinear glide/shimmer and reverb are separate DSP effects, not nonlinear structural FEM. The tetrahedral-solid branch uses uniform radiation weighting.
  • Cavity coupling uses a node-lumped displacement-magnitude interface proxy, and ports use sealed boundaries. The exterior field is a monochromatic visualization; cross-object medium feedback is a heuristic rather than a coupled acoustic PDE solve.
  • The sparse eigensolver has a fixed Krylov-subspace pass rather than a verified thick-restart loop. Accuracy and tuning depend on discretization, retained modes and the objective being tracked.
  • MIDI import is a note/tempo reader, not a complete synthesizer or sequencer implementation. Nearby-note fallback transposes a solved spectrum rather than redesigning geometry. Automatic physical tuning remains the largest design limitation: the most reliable workflow is still a constrained one-parameter search plus manual refinement. Bracketed binary search works only while the chosen audible mode follows a suitable branch; mode switches and nonmonotonic pitch can defeat it.
  • CUDA synthesis synchronizes per audio block. Native performances and working sessions are recorded here; formal latency measurements and comparative validation remain separate work.
  • A convincing violin-like instrument remains open. Bow excitation and resonant-cavity response work, but the current system does not yet resolve the full nonlinear bow–string–bridge–curved-body–air feedback chain whose impedance, damping and mode coupling create the characteristic sound.
Video The creation lab reaches target frequencies, but this suboptimal base shape also shows the present limit: later notes become tense and sustain poorly. One-parameter search plus manual refinement remains the most reliable route.
Explore this fieldMinimal Membrane Drawing with harmonics
Page reviewed September 14, 2026. Demonstrations and technical notes reflect the showcased version.
Project overview