###

Validation of computational tuning systems

Keywords

Microtonal tuning

Temperament

Measurements of fundamental frequency

Lindley

Vallotti

Lehman

Validation

Physical Modeling
 

The following paper was first published at DAGA 2012.

by Timour Klouche, Teresa Samulewicz and L. Jakob Bergner,
(Staatliches Institut für Musikforschung PK, Berlin, Germany)

Introduction

This paper is about setting up and validating workflows to computationally auralize microtonal flections. Its pragmatic background has been to auralize musical temperaments to test the aesthetics of several competing proposals of how the musical tuning was supposed to be at the time of J. S. Bach.

For that purpose the score of a four part choral has been input to a score editing software and possibilities to auralize the score via MIDI incorporating three different temperaments (Lindley, Lehman, and Vallotti) have been researched. After a testing phase we settled on three different methodologies:

A) Playing the score via Finale to Pianoteq physical model auralization software.

B) Playing the score with Cubase to HALion synthesizer.

C) Directly auralize the score with Supercollider.

For validating the tunings´ accuracy a MIDI stimulus was built to guide as a lab-clean testbed together with the tuning instructions resulting in 25 testfiles by also varying generator parameters. The Midifile included chromatic scales and additionally several octaves to eventually measure the octave stretching feature available in the physical model used in Experiment A. Three commonly used software packages were chosen for measuring. While a short comparison of how the methodologies compare against each other is given, the present paper focuses on the description of the systems´ setup.

Experiment A: Pianoteq - Audiosculpt

For this experiment we synthesized the stimulus using a physical model of a piano with the commercial Pianoteq software. Detailed parameters are available to control features of the physical model, among them unison tuning (detuning of the strings hit by a single hammer), and octave stretching. Different musical temperaments are represented by building a Scala compatible file readable by Pianoteq. The resulting auralization of the Bach Choral sounds amazingly real, even noises of the piano hammer and pedals are reflected in the synthesis.

To test for accuracy, the synthesized stimulus has been measured with Audiosculpt software. Here we used the FFT based fundamental frequency analysis and zoomed in to a mouse-step of approx. 0.01 Hz with all parameters optimized for most accurate measurement of this stimulus. Two different window sizes (16483 and 2048 samples) have been chosen to compensate for the known compromises of short and long FFT analysis windows respectively.

Fig. 1: Fundamental Frequency Analysis using small (red line) and large (blue line) windowing
Fig. 1: Fundamental Frequency Analysis using small (red line) and large (blue line) windowing

To our surprise, frequency is seriously varying over time within a single synthesized piano note (cf. fig. 1). This accounts for the accurateness of the Pianoteq model that even provides for nonlinearities of the excitation patterns. The decision to select one measuring point for one specific note is thus open to controversy and involves human interpretation. Choosing an averaging method like a large window size loosens the burden to a limited extend but even then some hermeneutics is still in action (cf. fig. 1): Frequency changes for approx. 1.5 cent over the length of the note. Analysis of the measurements reveals a better approximation to the reference tuning with smaller windowing. This setting calculates the 13th stimuli (octave) an octave too low, which has thus been omitted in the deviation graph (fig. 2). Mean absolute deviation calculates to 0.96 cents (cf. fig. 6 for more data). Further research is being done to differentiate between measurement- and stimulus prone errors.

Fig. 2: Deviations to reference tuning (Lindley; Pianoteq)
Please hover over the particular bar to see the measured values!
  • 5
  • 4
  • 3
  • 2
  • 1
  • 0
C
3.4
C#
2.21
D
2.03
D#
2.48
E
3.46
F
4.07
F#
1.65
G
3.13
G#
0.58
A
0
A#
3.38
B
2.96
  • C4
  • C#4
  • D4
  • D#4
  • E4
  • F4
  • F#4
  • G4
  • G#4
  • A4
  • A#4
  • B4

Fig. 2: Deviations to reference tuning (Lindley; Pianoteq)
x-axis: pitch, y-axis: deviation in cent

Experiment B: HALion - Praat

Another opportunity to auralize microtonal flections is the use of a MIDI microtuner and a synthesizer supporting the MIDI Tuning Standard. In this case the synthesizer HALion was used as a plugin within Cubase 5. To obtain a sound of a wooden organ register the HALion preset Lower Manual was chosen with all preset effects such as vibrato disabled. With the help of Cubase's built-in microtuner MIDI plugin the appropriate temperament (Vallotti) has been set in terms of the deviation (1 step = 1 cent) of each tone from equal temperament within one scale.

The tuned output of HALion has been measured with the speech analysis software Praat by selecting the stationary phase of each tone and calculating the mean of all measured frequency points within that selection (autocorrelation, window length: 0.05 s). Within each tone the frequency changes for 0.3 Hz at most.

Fig. 3: Deviations to reference tuning (Vallotti; HALion)
Please hover over the particular bar to see the measured values!
  • 8
  • 7
  • 6
  • 5
  • 4
  • 3
  • 2
  • 1
  • 0
C
7.36
C#
7.4
D
0.46
D#
0.49
E
-0.32
F
-0.42
F#
-0.43
G
-0.24
G#
-0.33
A
0
A#
-0.17
B
-0.25
C
-0.4
  • -1
  • C4
  • C#4
  • D4
  • D#4
  • E4
  • F4
  • F#4
  • G4
  • G#4
  • A4
  • A#4
  • B4
  • C5
Fig. 3: Deviations to reference tuning (Vallotti; HALion)
x-axis: pitch, y-axis: deviation in cent

The deviation basically ranges between - 0.5 and + 0.5 cent, except for C and C#, which are even more than seven cents higher than expected. Likewise, the inspection of the other octaves shows an overall unsteady stepped progress of pitch deviation.

Experiment C: Supercollider - Matlab

The text-based programming environment Supercollider provides extensive methods for audio synthesis. Auralization within Supercollider is based on periodic or randomized signal generators. Customized signals however can be generated with hands on every detailed parameter. The predefined tuning class allows to switch between different musical temperaments as well as to define tunings manually by specifying each semitone with its particular interval (Ex. 1, line 1). The following lines show the main part of the frequency conversion for a Lehman temperament.

1
lehman_semitones = [0.06, 1.04, 2.02, 3.04, 3.98, 5.08, 6.02, 7.04, 8.04, 9, 10.04, 11">;
2
t = Tuning.new(lehman_semitones, 2, "Lehman");
3
lehman_scale = Scale.chromatic(t);
4
freq = lehman_scale.degreeToFreq(degree, 0.midicps, octave);
5
{SinOSC.ar(freq, 0, 0.5)}.play;
Ex. 1: Supercollider Code

By submitting the designated scale degree and octave (line 4) the corresponding frequency is calculated. This frequency again can be transferred to a signal generator as the very simple example in line 5 shows.

The analysis of the generated wave file is accomplished with a Matlab script. The used mathematical function to estimate the fundamental frequency is autocorrelation since it is regarded to be more robust against windowing than frequency domain methods like DFT / FFT algorithms.

The deviations in cents from the original frequencies for every semitone is depicted in the following chart.

Fig. 4: Deviations to reference tuning (Lehman; Supercollider)
Please hover over the particular bar to see the measured values!
  • 0.3
  • 0.2
  • 0.1
  • 0
C
0.02
C#
0.02
D
-0.16
D#
0.27
E
-0.24
F
-0.55
F#
-0.06
G
-0.05
G#
-0.29
A
0
A#
-0.15
B
-0.13
C
-0.52
  • -0.1
  • -0.2
  • -0.3
  • -0.4
  • -0.5
  • -0.6
  • C4
  • C#4
  • D4
  • D#4
  • E4
  • F4
  • F#4
  • G4
  • G#4
  • A4
  • A#4
  • B4
  • C5
Fig. 4: Deviations to reference tuning (Lehman; Supercollider)
x-axis: pitch, y-axis: deviation in cent

Interrelating generators and measurements

In order to distinguish between the influence of the different generators and different measurement systems we also consistently measured each generator with one software, which was Praat.

Figure 5 shows the Praat measurements of the Pianoteq, Supercollider and HALion test stimuli in comparison. Since there weren't any specifications about the absolute pitch of A4, we can only analyze the relations of the frequency deviation within the given scale. Therefore, the measurements were scaled to the pitch of A4, because A is the only tone for which there is no deviation from equal tuning expressed in all reviewed tuning instructions.

Fig. 5: Measurements with Praat
Please click on a button below to see the respective measured values!
  • 8
  • 7
  • 6
  • 5
  • 4
  • 3
  • 2
  • 1
  • 0
C
0.92
7.36
0.02
C#
-0.3
7.4
-0.01
D
-0.74
0.46
0.02
D#
0.16
0.49
0.0003
E
-1.69
-0.32
0.008
F
0.28
-0.42
-0.01
F#
0.53
-0.43
-0.02
G
0.41
-0.24
0.0009
G#
0.05
-0.33
0.005
A
0
0
0
A#
1.28
-0.17
-0.00004
B
0.08
-0.25
0.002
C
2.6
-0.4
0.01
  • -1
  • -2
  • C4
  • C#4
  • D4
  • D#4
  • E4
  • F4
  • F#4
  • G4
  • G#4
  • A4
  • A#4
  • B4
  • C5
Fig. 5: Measurements with Praat
x-axis: pitch, y-axis: deviation in cent

The measurements of Supercollider with Praat approximate the reference tuning best. The range of deviation and the mean absolute deviation of each measurement can be seen in detail in the following boxplot.

Fig. 6: Range of deviation and mean absolute deviation of each generator
Fig. 6: Range of deviation and mean absolute deviation of each generator and measurement to its reference tuning

The measurements with Audiosculpt and Matlab are comparatively consistent with the respective measurements of Praat. However, the different generators diverge from each other and also from their theoretical values, most for HALion, least for Supercollider.

While this research has its background, among other things, in a discussion about aesthetics, it is remarkable, that the sinusoid auralization of supercollider is the only one which is reasonably accurate to display the intended tuning. According to our measurements it seems to be quite hard to compromise on aesthetical and accurately tuned auralizations at the same time.

Concluding Remarks

Notwithstanding the aesthetically pleasing and convincing results, measurements reveal deviations to the reference tunings in the magnitude of up to 15-times the specified threshold expressed in the tuning instructions. Within the reviewed methodologies, validating more subtle pitch deviations like octave stretching phenomena remain illusive. These findings are even more problematic because the chosen generators and measurement systems are quite commonly used tools. While the present paper focused on the diversity of systems and their setups in a realistic music research environment and has only touched on a systematic-comparative approach, the latter remains to be done in more detail, in a dedicated subsequent study incorporating a) even more varied stimuli and b) systematically controlled and unified generator-measurement-stimuli relations.

Three desiderata have been identified:

i) Empirical-aesthetical experiments in music must be treated cautiously. Validating tools and methods are of priority before making any analytical statements.

ii) Education: With the availability of computational tools to non-technical researchers the need arises to make limits of tools, methods and measurements clearer.

iii) Create a feedback loop between developers, theoreticians and users to make better, validated tools for music research and signal analysis.

Technical implementation of this media rework by Teresa Samulewicz