DAGA 2012 - Darmstadt

Validation of computational tuning systems Timour Klouche, Teresa Samulewicz, L. Jakob Bergner Staatliches Institut für Musikforschung, 10785 Berlin, E-Mail: [Klouche; Samulewicz; Bergner] @sim.spk-berlin.de

Introduction The decision to select one measuring point for one specific This paper is about setting up and validating workflows to note is thus open to controversy and involves human inter- computationally auralize microtonal flections. Its pragmatic pretation. Choosing an averaging method like a large window background has been to auralize musical temperaments to test size loosens the burden to a limited extend but even then some the aesthetics of several competing proposals of how the mu- hermeneutics is still in action (cf. fig. 1): Frequency changes sical tuning was supposed to be at the time of J. S. Bach. for approx. 1.5 cent over the length of the note. Analysis of the measurements reveals a better approximation to the refer- For that purpose the score of a four part choral has been input ence tuning with smaller windowing. This setting calculates to a score editing software and possibilities to auralize the the 13th stimuli () an octave too low, which has thus score via MIDI incorporating three different temperaments been omitted in the deviation graph (fig. 2). Mean absolute (Lindley, Lehman, and Vallotti) have been researched. After a deviation calculates to 0.96 cents (cf. fig. 6 for more data). testing phase we settled on three different methodologies: Further research is being done to differentiate between mea- A) Playing the score via Finale to Pianoteq physical model surement- and stimulus prone errors. auralization software. 5 B) Playing the score with Cubase to HALion synthesizer. 4 ) Directly auralize the score with Supercollider. 3

For validating the tunings’ accuracy a MIDI stimulus was cent in tion 2

built to guide as a lab-clean testbed together with the tun- devia ing instructions resulting in 25 testfiles by varying generator 1 0 parameters. The Midifile included chromatic scales and ad- C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 ditionally several to eventually measure the octave pitch Fig. 2: Deviations to reference tuning (Lindley; Pianoteq) stretching available in the physical model used in Experiment A. Three commonly used measuring software packages were Experiment B: HALion – Praat chosen. While a short comparison of the different methodolo- gies is given, the present paper focuses on the systems’ setup. Another opportunity to auralize microtonal flections is the use of a MIDI and a synthesizer supporting the Experiment A: Pianoteq – Audiosculpt MIDI Tuning Standard. In this case the synthesizer HALion For this experiment we synthesized the stimulus using a phys- was used as a plugin within Cubase 5. To obtain a sound of a ical model of a piano with Pianoteq. Detailed parameters are wooden organ register the HALion preset Lower Manual was available to control features of the physical model, among chosen. With the help of Cubase’s built-in microtuner MIDI them unison tuning (detuning of the strings hit by a single plugin the appropriate temperament (Vallotti) has been set in hammer), and octave stretching. Different musical temper- terms of the deviation (1 step = 1 cent) of each tone from ments are represented by building a Scala compatible file within one scale. readable by Pianoteq. The resulting auralization of the Choral sounds amazingly real, even noises of the piano hammer and The tuned output of HALion has been measured with the pedals are reflected in the synthesis. speech analysis software Praat by selecting the stationary phase of each tone and calculating the mean of all measured fre- To test for accuracy, the synthesized stimulus has been measured quency points within that selection (autocorrelation, window: with Audiosculpt. Here we used the FFT based fundamental fre- 0.05 s). Within each tone the frequency changes for 0.3 Hz at quency analysis and zoomed in to a mouse-step of approx. 0.01 most. Fig. 3 shows the deviations of the measured data com- Hz with all parameters optimized for most accurate measure- pared to the theoretical frequencies of the Vallotti temperament. ment of this stimulus. Two different window sizes (16k and 2k The deviation basically ranges between - 0.5 and + 0.5 cent, ex- samples) have been chosen to compensate for the known com- cept for C and C#, which are even more than 7 cent higher than promises of short and long FFT analysis windows respectively. expected. Likewise, the inspection of the other octaves shows To our surprise, frequency is seriously varying over time within an overall unsteady stepped progress of pitch deviation. a single synthesized piano note (cf. fig. 1). This accounts for 8 the accurateness of the Pianoteq model that even provides for 7 nonlinearities of the excitation patterns. 6 5

471.0 4

470.5 cent in tion 3 470.0 2

469.5 devia 1 469.0 equency in Hz

468.5 fr 0 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11.0 -1 time in s C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 C5 Fig. 1: Fundamental Frequency Analysis using small (red line) and pitch large (blue line) windowing. Fig. 3: Deviations to reference tuning (Vallotti; HALion)

193 DAGA 2012 - Darmstadt

Experiment C: Supercollider – Matlab Figure 5 shows the Praat measurements of the Pianoteq, The text-based programming environment Supercollider Supercollider and HALion test stimuli in comparison. The provides extensive methods for audio synthesis. Auralization measurements of Supercollider with Praat approximate the within Supercollider is based on periodic or randomized signal reference tuning best. generators. Customized signals however can be generated The range of deviation and the mean absolute deviation of each with hands on every detailed parameter. The predefined tuning measurement can be seen in detail in the following boxplot. class allows to switch between different musical tempera- 8 ments as well as to define tunings manually by specifying each 7 with its particular interval (see below, line 1). The 6 following lines show the main part of the frequency conversion 5 for a Lehman temperament. 4 1 lehman_semitones = [0.06, 1.04, 2.02, 3.04, 3.98, 5.08, 3 tion in cent in tion 6.02,7.04, 8.04, 9, 10.04, 11]; 2

2 t = Tuning.new(lehman_semitones, 2, "Lehman"); devia 3 lehman_scale = Scale.chromatic(t); 1 4 freq = lehman_scale.degreeToFreq(degree,0. 0

midicps,octave); -1 5 {SinOSC.ar(freq, 0, 0.5)}.play; -2 Praat: Pianoteq Praat: HALion Praat: Supercollider Audiosculpt: Pianoteq Matlab: Supercollider By submitting the designated scale degree and octave (line (Lindley) (Vallotti) (Lehman) (Lindley) (Lehman) 4) the corresponding frequency is calculated. This frequency Fig. 6: Range of deviation and mean absolute deviation of each again can be transferred to a signal generator as the very sim- generator and measurement to its reference tuning. ple example in line 5 shows. The measurements with Audiosculpt and Matlab are compar- The analysis of the generated wave file is accomplished with a atively consistent with the respective measurements of Praat. Matlab script. The used mathematical function to estimate the However, the different generators diverge from each other fundamental frequency is autocorrelation since it is regarded and also from their theoretical values, most for HALion, least to be more robust against windowing than frequency domain for Supercollider. methods like DFT / FFT algorithms. The deviations in cents While this research has its background, among other things, in from the original frequencies for every semitone is depicted a discussion about aesthetics, it is remarkable, that the sinusoid in the following chart. auralization of supercollider is the only one which is reason- 0.3 ably accurate to display the intended tuning. According to our 0.2 measurements it seems to be quite hard to compromise on aes- 0.1 thetical and accurately tuned auralizations at the same time. 0.0

-0.1 Concluding Remarks tion in cent in tion -0.2

-0.3

devia Notwithstanding the aesthetically pleasing and musically -0.4 convincing results, measurements reveal deviations to the ref- -0.5

-0.6 erence tunings in the magnitude of up to 15-times the speci- C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 C5 pitch fied threshold expressed in the tuning instructions. Within Fig. 4: Deviations to reference tuning (Lehman; Supercollider) the reviewed methodologies, validating more subtle pitch de- viations like modeling octave stretching phenomena remain Interrelating generators and measurements illusive. These findings are even more problematic because In order to distinguish between the influence of the different the chosen generators and measurement systems are quite generators and different measurement systems we also con- commonly used tools. While the present paper focused on sistently measured each generator with one software, which the diversity of sys­tems and their setups in a realistic music was Praat. research environment and has only touched on a systematic- comparative approach, the latter remains to be done in more 8 detail, in a dedicated subsequent study incorporating a) even more varied stimuli and b) systematically controlled and uni- 7 fied generator-measurement-stimuli relations. 3 Three desiderata have been identified:

2 i) Empirical-aesthetical experiments in music must be treated

tion in cent in tion cautiously. Validating tools and methods are of priority before 1 making any analytical statements. devia 0 ii) Education: With the availability of computational tools to non-technical researchers the need arises to make limits of -1 tools, methods and measurements clearer.

-2 C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 C5 iii) Create a feedback loop between developers, theoreticians pitch HALion (Vallotti) Pianoteq (Lindley) Supercollider (Lehman) and users to make better, validated tools for music research and signal analysis. Fig. 5: Measurements with Praat

194