Updated

Box Flute Designer

Design a folded-bore box flute, hear it play, then print it.

Status: A printed prototype still needs testing and voicing, and the model does not simulate the 3D airflow at the mouthpiece.

Box Flute Designer: x-ray view of a folded flute bore next to its fingering table

What it is

A box flute is a recorder-style instrument whose air column doubles back and forth inside a rectangular body. Folding is how a 1.57 m air column for a low A fits in a 242 × 42 × 284 mm part that a desktop 3D printer can make.

Box Flute Designer turns a key and a sound character into that geometry. You drag parameters, watch the folded bore update in 3D, play the result by holding its holes, and download the STLs. A Python command-line generator shares the design model and can rebuild the exact parts from a design exported by the browser.

It started from a single Python script that looked correct and exported clean meshes, but its flutes played two semitones sharp. The script counted the air in each folded turn about three times over, leaving the column roughly 171 mm short. That bug is why the acoustics and the geometry now read the same cavity outline, so they can no longer disagree.

How it works

  • A transfer-matrix model of the folded bore, tone holes, U-bends and window predicts pitch, tuning and timbre from the geometry instead of assuming them.
  • Each folded turn counts as an equivalent length of tube. Open floor cavities add length, and the 45° gable ceilings, shaped to print without supports, take it away.
  • Tone holes are placed with the standard single-hole substitution formula, and an autofit searches fold count and box height so every hole the acoustics need physically fits on the body.
  • Sound comes from a jet-drive physical model in an AudioWorklet. The air jet at the window drives the resonator, so the flute can refuse to speak, overblow to the octave, or change tone with breath pressure.
  • The Python and TypeScript models are pinned together by a shared golden-file test, and browser and command-line exports agree to within 1 mm³ of body volume.

Built with

  • TypeScript
  • three.js
  • Web Audio
  • manifold-3d
  • Tweakpane
  • Python
  • trimesh

Started