About

Muditulib, a multi-dimensional tuning library, is a library to be implemented (wholly or partly) in music production software. It consists of a core of C functions. Additionally a Pure Data implementation is provided. This implementation consist of several classes to be used as a modular system. The library makes use of a multi-dimensional numerical pitch representation system, a variant of the very well-known one-dimensional MIDI note system. Ambitions for other implementations are very welcome. Muditulib offers new ways of approaching tuning within the scope of diatonic (roughly the majority of) tonal music within the digital domain.

Why Muditulib?

Twelve tone equal temperament, the division of the octave in twelve equal parts on a logarithmic scale, has been the far most common way of tuning for the past 200 years and still is. However, this temperament is far from perfect for several intervals in the diatonic scale. The octave is perfect, the fifth is slightly too small, but the major third is way too large while the minor third is way too small. The effects to the ear are of beating and roughness when harmonies of tones with harmonic spectra are played[1].

An ancient temperament called mean tone tuned the major third to perfection, as the third became more important in the harmonies of western music after the Middle Ages[2]. Due to the fact that a semitone in mean tone temperament (just as in almost all tunings and temperaments) is not exactly half of a whole tone for example keyboard instruments can be played only in a couple of adjacent (in the circle of fifths) keys (keys in music, e.g. C major), six to be precise, for a regular keyboard has five black keys (physical keys, e.g. F-sharp) to modulate to these adjacent keys.

Muditulib offers tunings that are multi-dimensional, in the sense that one dimension represents one variable step in a scale, in contrast to all divisions in equal parts, whether 12, 31, 53 or whatever number. In the two-dimensional system, based on Ts values instead of or as an enrichment to MIDI note values, the ratio between the two variable steps semitone and whole tone is a parameter for the user (end-user or developer, according to the implementation), so this system is purely diatonic (just as traditional western music notation). By setting this ratio one can tune according to all possible two-dimensional tunings/temperaments, like for example mean tone or Pythagorean, but also to 12-TET, 31-TET, 53-TET, and all other logarithmic equal divisions that fit into the diatonic scale[3], but, and that is probably the best part of it, modulation boundaries have vanished. Modulation can be set manually as well as be controlled by real-time analysis algorithms. If such would have existed in the first half of the 18th century, J.S. Bach would not have had any reason to think of a well-tempered clavier. So why would we restrict ourselves to our present equally tempered clavier if there is no need for such in roughly 99 per cent of the western tonal music?

How does it work?

The two-dimensional system has already been described shortly in the previous paragraph. A three-dimensional part is added to the library. The Ts representation system is then extended to a Tts, which consists of three variable steps. Whole tones are split in two groups: one of large whole tones and one of small whole tones. The reason for this distinction is the five-limit just intonation[4]. The functionality of both systems is then divided into a couple of classes (in case of the Pd implementation), e.g. the translation from Ts to note names, to frequency, and also to Tts.

[1] For more information about beating, roughness, perceiving tone and harmony see for example the great work by Hermann von Helmholtz, called On the sensations of tone (English translation) or Die Lehre von den Tonempfindungen als physiologische Grundlage für die Theorie der Musik (German original, free HTML version).
[2] See for example Tuning and temperament by J. Murray Barbour for a historical overview of tuning (free version at archive.org) and A history of western music by Grout and Palisca for a general historical overview of music (theory and practice).
[3] The equal divisions, the diatonic scale, just as the the philosophy behind this two-dimensional system and the way it works, are described in detail in the article I wrote for the Johannes Gutenberg University, which can be found at the documentation/articles section (direct link here).
[4] Just intonation means that all intervals in the system are based on integer relationships. Five-limit means that the integers are limited to powers of prime numbers up to five. E.g. the interval 7/5 doesn't exist in five-limit, for 7 is a prime number and higher than 5. For more information read the articles at the documentation section.

Visual examples

Pure Data example patches

unable to open or find file 'muditulib-preview.png' unable to open or find file 'muditulib-preview-2.png'

Audible examples

Here you find sound examples of a part of the Prelude of the 5th English Suite by Johann Sebastian Bach in various tunings/temperaments. The key of the piece is E minor. The files were generated in Pure Data using muditulib for calculating the frequencies. Classes and parameters are given, where r is the semitone to whole tone ratio and x is the frequency ratio of the octave for the [ts2freq] class. Note that the parameter of [midi2ts] is set correctly for this piece ("2"), for the key is E minor and within the example it doesn't modulate outside of the range covered by this setting. If not set correctly some of the examples would sound terribly awful (at least more than they do now). The [midi2just] class expects parameters m for mode and t for transposition. How the classes work and how the parameters are calculated is explained in the Muditulib Reference Manual. However, this document is not yet ready for public release, nor is the software.

Just intonation (semi-fixed)
Pythagorean
Mean tone
Slightly stretched octave, perfect fifth and thirds
Equal temperament (12-TET)
31-TET
19-TET
5-TET
7-TET
Linear development
Mean Tone (false)

Just Intonation (semi-fixed)


This example makes use of [midi2just]. The tuning is five-limit just intonation.

Settings:
m = 0 (minor)
t = 4 (tonic on MIDI note 4)

Pythagorean

This example makes use of [midi2ts] and [ts2freq]. The tuning is Pythagorean, which is a three-limit tuning system, based on a fifth of 3/2.

Settings:
1/r = 2.26001
x = 2

Mean tone

This example makes use of [midi2ts] and [ts2freq]. The tuning is mean tone, which is based on a major third of 5/4.

Settings:
r = 0.606284
x = 2

Slightly stretched octave, perfect fifth and thirds

This example makes use of [midi2ts] and [ts2freq]. To adjust both fifth and major third to perfection the octave is slightly stretched.

Settings:
r = 0.634118985
x = 2.01246118

Equal temperament (12-TET)

This example makes use of [midi2ts] and [ts2freq], but is superfluous, except for the purpose of comparing. This is the far most common tuning system in the last two centuries.

Settings:
r = 0.5
x = 2

31-TET

This example makes use of [midi2ts] and [ts2freq]. The tuning is pretty close to mean tone, which can be derived from the comparison of parameters.

Settings:
r = 0.6
x = 2

19-TET

This example makes use of [midi2ts] and [ts2freq].

Settings:
1/r = 1.5>
x = 2

5-TET

This example makes use of [midi2ts] and [ts2freq].

Settings:
r = 0
x = 2

7-TET

This example makes use of [midi2ts] and [ts2freq].

Settings:
r = 1
x = 2

Linear development

This example makes use of [midi2ts] and [ts2freq]. r = 1 changes linearly from 0 to 1 during the piece.

Settings:
r = [0--->1]
x = 2

Mean tone (false)

This example makes use of [midi2ts] and [ts2freq]. Meantone temperament with false setting for [midi2ts] ("-1" instead of "2"). A-sharp, D-sharp, and G-sharp are mistakenly interchanged for B-flat, E-flat, and A-flat.

Settings:
r = 0.606284
x = 2

Downloads

This is the download section.

Pure Data

This is the Pure Data download section. Files listed are:

SOURCE:

Git

To browse code, git clone, report bugs, and discuss you can visit the Sourceforge project page

Licensing

Muditulib is released under the GPL version 3 and is free to use under its terms without any cost. If you'd like to use Muditulib (the core part) for a closed-source product please contact the author about the conditions.

Documentation

Learn to use Muditulib.

Muditulib Reference Manual

Articles

Contact

If you have any questions about Muditulib or licensing, would like to write your own implementation or would like to co-operate please get in touch.

E-Mail

Contact me by sending an e-mail to mail(at)funsseelen.eu.