Package: demakein
Demakein========http://www.logarithmic.net/pfh/designPaul Harrison - pfh@logarithmic.netDemakein is a set of Python tools for designing and making woodwindinstruments.This generally consists of two stages:- The "design" stage is a numerical optimization that chooses the boreshape and the finger hole placement, size, and depth necessary forthe instrument to produce the correct notes for a given set offingerings.- The "make" stage takes a design and turns it into a 3D object, thenthen cuts the object into pieces that can be CNC-milled or 3D-printed.Demakein can either be used via the command "demakein" or as alibrary in Python. Demakein has been designed to be extensible,and I hope you will find it relatively easy to write code tocreate your own novel instruments. You can either create subclassesof existing classes in order to tweak a few parameters, or createwholly new classes using existing examples as a template.Requirements============Python 2- Linux:Use your package manager to install Python 2 and pip.- OS XReported to be possible, however I can't give exact instructions.- Windows:Run Linux in a virtual machine such as VirtualBox.(confirmed to work)The "design" tools require nesoni. They should work on all platforms thatPython runs on.- nesonisudo pip install --upgrade nesoniThe "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- CGALsudo apt-get install g++ cmake libffi-dev libcgal-dev- cffisudo pip install --upgrade cffiInstallation, easiest method============================On a Debian or Ubuntu Linux system:sudo apt-get install g++ cmake libffi-dev libcgal-dev python-pip geeqiesudo pip install --upgrade demakein("--upgrade" ensures the latest version is installed)You can then run program by typing:demakeinor:python -m demakeinPyPy installation=================Using PyPy will let Demakein run considerably faster.The easiest way to do this presently is to create a"virtualenv".sudo apt-get install g++ cmake libffi-dev libcgal-dev python-pip geeqiesudo apt-get install pypy python-virtualenvvirtualenv -p pypy myenvmyenv/bin/pip install --upgrade demakeinYou can then run demakein with:myenv/bin/demakeinor:myenv/bin/python -m demakeinInstallation from source========================If using the "make" part of Demakein, you will need to install:- g++- cmake- CGAL- libffiand from the Python Package Index, install:- nesoni- cffiDownload and untar tarball and in the untarred directory:sudo python setup.py installExamples========Create a small flute:demakein design-folk-flute: myflute --transpose 12demakein make-flute: myfluteFiles are created in a directory called myflute.We've just made STL files for 3D printing. How about if we wantto CNC-mill the flute?demakein make-flute: myflute --mill yes --open yes --prefix millingIf you want to create your own custom instruments, you can createsubclasses of the instruments provided. Some examples of how to dothis can be found in the "examples" directory. You can use theseas a starting point.Instrument design tools are subclasses of demakein.design.Instrument_designer.These tools define a set of class attributes that constrain the instrument design.closed_top- boolIs 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 embouchurehole treated as a hole and the end set to closed.See examples/simple_reedpipe.py for an example with closed_top=True.See examples/simple_flute.py for an example with closed_top=False.inital_length- floatLength of the instrument at the start of the optimization.Automatically adjusted based on --transpose parameter.Just provide a roughly reasonable value,eg using demakein.design.wavelength functionn_holes- intNumber of finger holes.fingerings- 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.max_hole_diameters- list of n_holes floatsMaximum allowed finger hole diameters.min_hole_diameters- list of n_holes floatsMinimum allowed finger hole diameters.min_hole_spacing- list of n_holes-1 floatsMinimum space between finger holes in mm.top_clearance_fractionbottom_clearance_fraction- Minimum distance of top/bottom hole from top/bottom of instrument,as a fraction of the instrument length.balance- list of n_holes-2 floats or NonesValues should be in the range zero to one.Smaller values force the spacing between successive holes to be more similar.hole_angles- list of n_holes floatsVertical angle of each hole.Angled holes may allow more comfortable hole spacing.inner_diameters- 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.Advanced: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/stepped_shawm.py for an example of this.initial_inner_fractions- list of len(inner_diameters)-2 floatsInitial positions of kinks in the bore.min_inner_fraction_sep- list of len(inner_diameters)-1 floatsMinimum size of each linear segment of the bore,as a fraction of the overall length.outer_diametersinitial_outer_fractionsmin_outer_fraction_sep- As for inner_diameters,but defining the shape of the outside of the instrument(hence the depth of each finger hole).outer_add- bool, default FalseOptionally the outside diameters of the instrument can be definedas being in addition to the bore diameters rather thanindependent of them.See examples/simple_shawm.py for an example of this.