Retuning to a regular temperament

LilyPond holds all the information for meantone temperaments or near-Pythagorean intonations. The default tuning is for 12 note equal temperament. This snippet changes that, and can be placed in an include file to work with pre-existing files. Key signatures are not supported.

The MIDI output works as well as any case of microtuning. Chords need to be split into separate voices. The example is a single line of rising pitches.

The tuning is specified as the number of steps to the octave for an equal temperament. Everything follows the nearest fifth to just in that equal temperament.