Skip to main content

Design woodwind instruments and make them with a 3D printer or CNC mill.

Project description


Paul Harrison -

Demakein is a set of Python tools for designing and making woodwind

This generally consists of two stages:

- The "design" stage is a numerical optimization that chooses the bore
shape and the finger hole placement, size, and depth necessary for
the instrument to produce the correct notes for a given set of

- The "make" stage takes a design and turns it into a 3D object, then
then cuts the object into pieces that can be CNC-milled or 3D-printed.

Demakein can either be used via the command "demakein" or as a
library in Python. Demakein has been designed to be extensible,
and I hope you will find it relatively easy to write code to
create your own novel instruments. You can either create subclasses
of existing classes in order to tweak a few parameters, or create
wholly new classes using existing examples as a template.


Python 2

- Linux:
Use your package manager to install Python 2 and pip.

- OS X
Reported to be possible, however I can't give exact instructions.

- Windows:
Run Linux in a virtual machine such as VirtualBox
(confirmed to work)


This may or may not work:
- install python 2 using the MSI package
- install distribute using the linked script
- install pip using easy_install

The "design" tools require nesoni. They should work on all platforms that
Python runs on.

- nesoni

pip install nesoni

The "make" tools additionally require CGAL and associated paraphenalia.
I have only tested this on Linux, but I'm told it's possible on OS X as well.

- g++
- cmake
- libcffi

apt-get install g++ cmake libffi-dev libcgal-dev

- cffi

pip install cffi


Easy way:

pip install demakein

From source: Download and untar tarball then

python install

You can then run program by typing



python -m demakein

If you know how to set it up, using PyPy will let Demakein run considerably faster.


Create a small flute:

demakein design-straight-folk-flute: myflute --transpose 12

demakein make-flute: myflute

Files are created in a directory called myflute.

We've just made STL files for 3D printing. How about if we want
to CNC-mill the flute?

demakein make-flute: myflute --mill yes --open yes --prefix milling

If you want to create your own custom instruments, you can create
subclasses of the instruments provided. Some examples of how to do
this can be found in the "examples" directory. You can use these
as a starting point.

Instrument design tools are subclasses of
These tools define a set of class attributes that constrain the instrument design.

- bool
Is the top of the instrument closed?
Reeds and brass-style mouthpieces are effectively closed.
A ney has an open end.
A flute might be approximated as an open end, or the embouchure
hole treated as a hole and the end set to closed.
See examples/ for an example with closed_top=True.
See examples/ for an example with closed_top=False.

- float
Length of the instrument at the start of the optimization.
Automatically adjusted based on --transpose parameter.
Just provide a roughly reasonable value,
eg using function

- int
Number of finger holes.

- list of tuples (note, [ 0/1,... ])
Desired fingering patterns to produce each desired note.
<note> is automatically adjusted by --transpose parameter.
The list starts from the bottom of the instrument.
Not all fingering schemes are physically possible,
this may require some experimentation.

- list of n_holes floats
Maximum allowed finger hole diameters.

- list of n_holes floats
Minimum allowed finger hole diameters.

- list of n_holes-1 floats
Minimum space between finger holes in mm.

- Minimum distance of top/bottom hole from top/bottom of instrument,
as a fraction of the instrument length.

- list of n_holes-2 floats or Nones
Values should be in the range zero to one.
Smaller values force the spacing between successive holes to be more similar.

- list of n_holes floats
Vertical angle of each hole.
Angled holes may allow more comfortable hole spacing.

- list of floats [advanced: or tuples (low,high)]
The first element is the bore diameter at the base of the instrument.
The last element is the bore diameter at the top of the instrument.
The bore is piecewise linear,
intervening elements are bore diameters boundaries between pieces (kinks).
Exact placement is subject to numerical optimization.

Instead of a single diameter, you can give a tuple (low,high)
to create a step in the diameter of the bore.
See the examples/ for an example of this.

- list of len(inner_diameters)-2 floats
Initial positions of kinks in the bore.

- list of len(inner_diameters)-1 floats
Minimum size of each linear segment of the bore,
as a fraction of the overall length.

- As for inner_diameters,
but defining the shape of the outside of the instrument
(hence the depth of each finger hole).

- bool, default False
Optionally the outside diameters of the instrument can be defined
as being in addition to the bore diameters rather than
independent of them.
See examples/ for an example of this.

Project details

Release history Release notifications

History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
demakein-0.12.tar.gz (271.3 kB) Copy SHA256 hash SHA256 Source None Nov 9, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page