<<

David Løberg Code Groven.Max: School of Western Michigan University Kalamazoo, MI 49008 USA An Adaptive Tuning [email protected] System for MIDI

Groven.Max is real-time program for mapping a renstemningsautomat, an electronic interface be- performance on a standard keyboard instrument to tween the manual and the pipes with a kind of arti- a nonstandard dynamic tuning system. It was origi- ficial intelligence that automatically adjusts the nally conceived for use with acoustic MIDI pianos, tuning dynamically during performance. This fea- but it is applicable to any tunable instrument that ture overcomes the historic limitation of the stan- accepts MIDI input. Written as a patch in the MIDI dard keyboard by allowing free modulation programming environment Max (available from while still preserving just-tuned intervals in www.cycling74.com), the adaptive tuning logic is all keys. modeled after a system developed by Norwegian Keyboard tunings are compromises arising from composer Eivind Groven as part of a series of just the intersection of multiple—sometimes oppos- intonation keyboard instruments begun in the ing—influences: acoustic ideals, harmonic flexibil- 1930s (Groven 1968). The patch was first used as ity, and physical constraints (to name but three). part of the Groven Piano, a digital network of Ya- Using a standard twelve-key piano keyboard, the maha Disklavier pianos, which premiered in Oslo, historical problem has been that any fixed tuning Norway, as part of the Groven Centennial in 2001 in (i.., with acoustically pure tri- (see Figure 1). The present version of Groven.Max ads) will be limited to essentially one key. Temper- accepts input via MIDI keyboards or a MIDI file. ing provided a wider range of available keys, but at This input is analyzed and rerouted to three sepa- the expense of the purity of the intervals. Mechani- rate instruments (real or virtual) tuned to produce a cal solutions involving keyboards with more keys 36-tone scale. In performance, one can either select per , such as Giovanni Battista Doni’s cem- fixed, twelve-note scales from among the 36 avail- balo pentarmonico from 1635 with 68 keys per oc- able tones, or use the adaptive tuning feature for tave, or Julian Carrillo’s sixteenth-tone piano from dynamically selecting just intervals while modulat- the mid 20th century with 96 keys per octave, re- ing keys. quired performers to learn a new, and sometimes awkward, playing technique, and thus never gained Background widespread popularity. A more comprehensive overview of microtonal keyboards can be found in Keislar (1987). Eivind Groven and His Renstemt Organ Groven sought a solution that would require only a standard keyboard (and keyboardist), yet use The Norwegian composer and ethnomusicologist a larger number of pitches per octave. At any given Eivind Groven (1901–1977) spent much of his life time, each individual key on the manual is con- striving to bridge the gap between his native folk nected to one of three possible pipes, each tuned to music and Western classical music. His most no- a slightly different . One can either pre- ticeable accomplishment in this regard was the select a fixed set of twelve pipes for the duration of construction of the 36-tone renstemt, or pure- a performance or engage the adaptive tuning fea- tuned, pipe organ for playing both traditional folk ture or the renstemningsautomat for dynamic and standard classical repertoire. The scale is based tuning. on just intonation, a tuning system using acousti- Inspired by telephony, Groven built his first ren- cally pure intervals from the harmonic series. The stemningsautomat most remarkable feature of the organ is Groven’s using automatic telephone switchboard relays that, in essence, routed calls Computer Music Journal, 26:2, pp. 50–61, Summer 2002 from the organ manual to the bank of pipes (see ᭧ 2002 Massachusetts Institute of Technology. Figure 2).

50 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 1. World Premie`re Figure 2. Eivind Groven of the Groven Piano, 19 soldering relays in his April 2001, Oslo, Norway automatic tuning device. (Disklaviers courtesy of Yamaha Scandinavia).

This was cutting-edge technology in 1939, when this project was begun, as the automatic switch- board had not been in widespread use in Norway for very many years. In the 1960s, the closet-sized switchboard interface was replaced by a smaller de- vice using electronic transistors, built by Bjørn Raad at the Central Institute for Industrial Re- search in Oslo, Norway. Although showing signs of age, this interface is still in operation today and services both the pipe organ and 36-tone electronic organ built in 1965. These organs, along with a 43-tone electronic organ (built in 1965 but no longer in operation), are housed at the Eivind Groven Institute for Just Intonation on the out- skirts of Oslo, Norway. Further background infor- mation about Groven’s work can be found in Code (2001; in press), Groven (1927, 1934, 1935, 1948a, 1948b, 1955, 1968, 1971), and Lysdahl (1997). More recently, interest in Groven’s work has led to the development of computer programs that simulate aspects of his renstemningsautomat (but not in real-time), such as those written by Jørn Ar- vidsen (1982) and Lars Frandsen (1995). Knut-Einar Skaarberg (1995) has adapted Groven’s tuning logic into a program that controls the MIDI pitch-bend function of an electronic synthesizer in perfor- mance (with polyphonic textures using multiple MIDI channels).

Code 51

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Groven.Max was originally developed for use the other to select a tuning. (A similar concept was with custom-tuned pianos, but it can also be used employed in Cooper’s 1998 software RealTime with synthesizers or other MIDI-controlled in- Tuner 1.2.) When a tuning key was pressed, a set of struments. There is currently a project underway relays actuated electromagnets to stretch or relax with NoTAM (Norwegian Network for Technol- each string individually in accordance with a given ogy, Acoustics, and Music) to renovate Groven’s scheme. While the piano was not supposed to pipe organ and replace the current electronic inter- change tuning by itself, it could (in theory) be in- face with a computer-operated system using stantly re-tuned during performance by pressing an- Groven.Max. While the work of Arvidsen , Frand- other of the 23 available tuning keys. The design sen, and Skaarberg represents the first transferences was never fully tested, as Groven was unable to ob- of Groven’s logic from hardware to software, there tain funding to build a prototype piano and turned are of course numerous other precursors to his attention to organ instead. Groven.Max within the field of automatic (and In 2001, his original goal of creating a variably- semi-automatic) tuning systems. Other adaptive tuned acoustic piano was finally realized with the tuning systems and software for various electronic world premiere of the Groven Piano. Named in instruments not related to Groven’s work have also honor of Groven’s hundredth birthday, the Groven been developed since his death. See, for example, piano comprises a network of three acoustic pi- Cooper’s RealTime Tuner (available from anos, a control keyboard, and a computer interface socrates.berkeley.edu/ϳwcooper/realtimetuner running Groven.Max software. Like Groven’s or- .html), Gannon’s and Weyler’s Justonic (available gan, the pianist plays upon a standard keyboard from www.justonic.com), as well as Denckla that, instead of making its own sound, sends a (1997), Polansky (1987), Scholz (1986), and Steck MIDI signal to Groven.Max. Three Disklavier pi- and Roush (1998). It is beyond the scope of the anos, donated for the premiere by Yamaha Scandi- present article, however, to provide a comprehen- navia, were each tuned differently, thus providing sive survey of such work. 36 strings per octave to match the organ’s 36 pipes. Groven himself cites as a precedent John Hay- Thus, unlike Skaarberg’s program, Groven.Max wood Compton’s 1933 British patent describing an does not send pitch-bend or system-exclusive com- mands to retune the instruments dynamically, but ‘‘’’ organ similar in operation to Harold simply reroutes the MIDI signal for each note Waage’s more recent ‘‘intelligent keyboard’’ (1988). played to the piano with the desired tuning for that Compton’s organ featured an extra set of equal- pitch (similar in function to Groven’s renstemning- tempered pitches 14 cents below the first that sautomat). The premiere took place on 19 April would be automatically inserted when necessary to 2001 at Norges musikkhøgskole (The Norwegian produce more favorably-tuned thirds and sixths. Academy of Music) in Oslo, Norway, with support from Yamaha Scandinavia, Norsk Kulturra˚, the Ei- vind Groven Institute for Just Intonation, the US- The Groven Piano Norway Fulbright Foundation, and the University of Oslo. (Photographs and audio samples of the pre- Groven’s first attempts to solve the keyboard’s miere are available online at vms.cc.wmich.edu/ ‘‘tuning problem’’ actually did not use the organ, ϳcode/groven/konsert.html.) The concert, which but rather the piano, and they involved an auto- was intended to demonstrate the versatility of the mated, but not adaptive, re-tuning system. In the instrument, featured classical, jazz, and folk music mid 1930s, he received patents in several countries with both solo piano and ensemble pieces. The for a variable tuning device for piano (e.., British North American premiere of the Groven Piano is patent No. 422,669; 1935). According to his design, scheduled for May 2002 at the Irving S. Gilmore In- the tension for each piano string would be con- ternational Keyboard Festival (www.gilmore.org) in trolled by its own rotating electromagnet. The pi- Kalamazoo, Michigan, with instruments on loan ano itself had two keyboards: one to play upon, and from Yamaha USA.

52 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Table 1. Tuning of three output pianos (given in stead of a pure 3:2 ratio (701.955 cents). The devia- cents deviation from 12-tone ) tion of 0.244 cents is much smaller than the just noticeable difference (JND) of human pitch percep- Blue Gold Red tion, and for the purposes of this article, I will refer to this micro-tempered interval (701.711 cents) as a 20.5ם 0.0 20.5מ pure perfect fifth to distinguish it from other sizes 12.0ם 8.5מ 29.1מ C-sharp ם ם מ D 17.1 3.4 23.9 of perfect fifths available within the scale (e.g., ם מ מ E-flat 25.6 5.1 15.4 681.2 or 722.2 cents). In total, there are from five to 27.4ם 6.9ם 13.6מ E eight variants of each available 18.8ם 1.7מ 22.2מ within this system, such as seven different shades 10.2ם 10.3מ 30.8מ F-sharp ,of minor thirds (including the just, Pythagorean 22.2ם 1.7ם 18.8מ G and 11:9 ratio minor thirds). The advantage of this 13.6ם 6.9מ 27.4מ A-flat particular tuning is that it can produce essentially 25.6ם 5.1ם 15.4מ A just major and minor triads in any key, in addition 17.1ם 3.4מ 23.9מ -flat .to numerous other specialized scales and intervals 8.5ם 12.0מ 32.5מ B The current tuning logic used in Groven.Max is based upon the above scale system, although the Tuning Specifications general method of adaptive tuning employed can be modified for use with other tunings. An alternate The three pianos of the Groven Piano—designated version is presently being developed that uses three ס Blue, Gold, and Red—are custom-tuned to the twelve-tone equal-tempered scales at A 436 Hz, ס ס scales shown in Table 1. A 440 Hz, and A 444 Hz (an extension of the The pitch offsets are the same for all . For tuning used in Compton’s enharmonic organ). This acoustic pianos, the actual tuning deviates slightly threefold tempered system would allow each piano from these prescribed offsets in the upper and to remain in twelve-tone equal temperament (en- lower registers according to the normal octave abling the pianos to be used separately for other stretching required for the particular piano (necessi- purposes) and would limit the amount of deviation tated by of the piano strings). As is of the piano strings from their customary tuning. evident, there are three versions of each The greatest deviation from tuning would be separated from each other by 20.5 cents. This is only 15 cents, versus 32.5 cents in Groven’s origi- distance is approximately a syntonic comma, the nal tuning. This system could also be used for digi- difference between just (5:4 ratio) and a tal pianos in which all of the pitches can only be Pythagorean major third (81:64 ratio). Combining tuned up or down together by the same amount, all of the pitches together produces a 36-tone scale without independent control of the tuning of indi- spread across the three pianos comprised of just vidual pitches or pitch classes. To take into ac- major and minor thirds and nearly pure perfect count different tuning systems, I use the generic fifths. term tuned pitch class to indicate the combination 1 The scale is a ⁄8th-skhisma quasi-just intonation of a pitch class and its tuning color (Blue, Gold, or scale that employs pure just major thirds (5:4 fre- Red). As an example, the tuned pitch class Red D quency ratio) and slightly tempered perfect fifths. refers to all members of pitch class D tuned in ac- Using strictly pure thirds and fifths, the difference cordance with the Red scale. between a just major third (e.g., E-flat–G) and a di- minished fourth (e.g., D-sharp–G) is a skhisma, or approximately 1.954 cents. This discrepancy is dis- Groven.Max: User Interface tributed across the span of eight perfect fifths, re- ducing the difference to 0.244 cents per fifth. In The user interface of Groven.Max (see Figure 3) is other words, each fifth is now 701.711 cents in- used to display and manage MIDI input from the

Code 53

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 3. User interface for Groven.Max.

control keyboard and MIDI output to the Blue, distributed among all three instruments to produce Gold, and Red pianos. Several subpatches contain a variety of specially tuned scales. The Pitch Box is instructions and troubleshooting tips for each con- arranged in rows of perfect fifths and columns of trol. In addition, a controller allows users to play or just major thirds. Thus, Blue-E and Gold-B form a record MIDI sequence files, and a subpatch can perfect fifth, even though they are from different route all MIDI output to an optional fourth instru- instruments. The last pitch in each row, for exam- ment for direct comparison between the Groven ple Blue C, is also a perfect fifth above the first tuning and equal temperament. pitch in the next row (e.g., Blue G), accomplished by the micro-tempering of the fifths as described above. This same pitch is also a pure major third Pitch Box above Gold-G-sharp, in which case it should be designated Blue-B-sharp. Since it is impossible for The Pitch Box displays the current tuning of the the Pitch Box to display the correct spelling for all Groven Piano and can also be used to manually en- of the perfect fifths and all of the major thirds, ter tunings. The user selects individual pitches by some of them appear enharmonically as augmented clicking on a pitch button in the blue, gold, or red sixths or diminished fourths, respectively. When a shaded regions of the Pitch Box (i.e., the twelve up- choice was necessary, I usually opted for the more per, middle, or lower pitch buttons, respectively) . convenient enharmonic spelling to make the inter- When a button is highlighted, all MIDI inputs for face more user-friendly. As stated above, the three that pitch class are sent to the corresponding in- variants, or tuning colors, of a single pitch class strument. When Auto-tune is engaged, the buttons (e.g., Blue C, Gold C, and Red C) are about 20 cents turn on and off automatically as the tuning itself apart. In the present configuration, however, only changes. In the Manual mode, one may send all of one variant is used at a time; thus the three but- the notes to a single piano or a blended selection tons for a given pitch class function like radio but-

54 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 4. Pitch field 3 with fixed tones highlighted (in boldface).

Pitch field 3 ← Perfect 5th →

↑ D1 A1 E1 B2 F#2 C#2 G#2 → (D#2 = Eb2) Ma j 3rd Eb2 Bb2 F2 C2 G2 D2 A2 E2 → (H2 = Cb3) ↓ Cb3 Gb3 Db3 Ab3 Eb3 Bb3 F3 X1 = Blue, X2 = Gold X3 = Red

tons (e.g., turning on Blue C will automatically quence of fifths. This means that two of the pitch turn off Gold C and Red C). classes remain assigned to a fixed tuning color, To send all twelve pitch classes to the same in- while the other ten are variable; each of these 10 strument, the user can select one of the three col- are available in two tuning colors, for a total of 2 ored keyboard icons in the bottom row of the Pitch plus 20 tuned pitch classes. Pitch field 3 (see Figure Box. Additional preset scales are available from the 4) contains 22 consecutive tones from Blue D pull-down menu in the upper-right corner of the through Red F, with Gold C and Gold G as fixed Pitch Box. This feature is similar to the semi- tones. (The tuning colors are represented by inte- ס ס ס automatic system proposed in Groven’s original pi- gers: X1 Blue, X2 Gold, X3 Red.) ano patent. Most of the current presets are tunings The keys best suited to field 3 include C and G used for specific compositions and arrangements of major and minor, and others listed in the bottom Norwegian folk music. corner of the window. One can experiment with different pitch-fields to find the one best suited for each piece of music or change fields in the middle Auto-Tune of a piece if desired.

In general terms, Auto-tune is an adaptive tuning system that adjusts the pitch output to produce tri- Field Size ads in just intonation, even when modulating to different keys. To engage the real-time tuning func- The standard pitch field utilizes 22 tones as de- tion, one selects the Auto-tune button (so that it is scribed above. Two alternate field settings, Py and highlighted). When Auto-tune is first engaged, the Z, are available, each of which uses an array of only default settings are shown underneath (pitch field 18 tones: six fixed and six variable. In a Py field, 3, standard size), and a default C just scale is set in the six fixed pitches form a sequence of fifths, the Pitch Box. The user can change the pitch field starting with the same two fixed tones used in the or size using the pull-down menus. Further details standard field. For example, pitch field 3-Py spans about the tuning logic itself are described later in from Gold F-sharp to Red F, with Gold C through this article. Red C-flat as fixed tuned pitch classes (see Figure 5). This produces with more Pythago- rean thirds in place of just thirds. In a Z-field, the Pitch Fields fixed pitches include the standard fixed tones for that field (e.g., Gold C and Gold G) plus the pairs of To prevent drifting of the tonic, a pitch field is se- major thirds directly above (e.g., Blue E and Gold B) lected before playing in accordance with the key or and below (e.g., Red A-flat and Red E-flat), as keys of the piece. (The phrase ‘‘pitch field,’’ trans- shown in Figure 6. Both of these reduced fields lated from the Norwegian tonefelt, was coined by have a more limited range of suitable keys and ex- Groven.) A standard pitch field as used in Groven’s hibit more distinct key coloration as the music renstemningsautomat contains 22 tones in a se- modulates, because not all triads are tuned alike.

Code 55

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 5. Pitch field 3-Py Figure 6. Pitch field 3-Z with fixed tones high- with fixed tones high- lighted (in boldface). lighted (in boldface).

Pitch field 3-Py ← Perfect 5th →

↑ F#2 C#2 G#2 → (D#2 = Eb2) Ma j 3rd Eb2 Bb2 F2 C2 G2 D2 A2 E2 → (H2 = Cb3) ↓ Cb3 Gb3 Db3 Ab3 Eb3 Bb3 F3 Figure 5

Pitch field 3-Z ← Perfect 5th →

↑ D1 A1 E1 B2 F#2 C#2 Ma j 3rd Bb2 F2 C2 G2 D2 A2 ↓ Figure 6 Gb3 Db3 Ab3 Eb3 Bb3 F3

Input/Output Transposition

Groven.Max accepts MIDI as input, whether from The MIDI input may be transposed as much as an external MIDI keyboard controller, some other twelve half-steps up or down before it is processed MIDI device, a MIDI sequence file, or a software through the tuning logic. When a transposition source of MIDI data. When the input device is level is selected, an indicator appears above the dis- properly connected and has the correct port assign- play keyboard marking concert C. This feature ment, the lower left-hand corner of the white key- transposes the keyboard, not the Pitch Box. The board icon will flash every time an incoming MIDI tuning of the Pitch Box should always be set in re- signal is received. Similarly, the lower right-hand lation to the sounding pitches. If, for example, one corner of one of the colored keyboard icons will wishes to play from music in a G scale so that it flash to indicate to which piano the MIDI output is sounds a step lower in F, the Pitch Box must be set being sent. Additionally, the keys on the one- to a tuning based on F. octave display keyboard will light up to indicate the pitch class of each MIDI note. Occasionally, a note may get held or ‘‘stuck’’ (i.e., it did not receive Pedals the proper note-off signal). To prevent this, Groven.Max contains a subroutine that automati- Groven.Max can accept and send pedal control cally generates and sends note-off messages to the messages (e.g., sustain pedal) from either the input previous tuned pitch when a new tuning color is device or a MIDI file. The message is always sent selected for that pitch class. Another subroutine to all three instruments simultaneously. The indi- monitors the incoming and outgoing MIDI mes- vidual output devices might respond differently to sages to keep track of the currently active notes. the same pedal control, because the pedal informa- Whenever it detects that there are no active notes tion is expressed in a continuous controller mes- coming from the MIDI input (i.e., a pause in the sage (not as an on-off switch), and different pianos’s music), it sends a note-off to any notes still being pedals release the dampers at slightly different po- held by any of the output devices. As a last resort, sitions. As a result, the notes of a sustained chord there is a manual reset button on the user interface might not release simultaneously. The best way to that sends a note-off message to all notes on all avoid this is to use three identical make and model pianos. output devices. Otherwise, modifications can be

56 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 7. Chord progres- sion illustrating basic prin- ciple of adaptive tuning.

D1 D1 C2 C2 B2 Bb2 Bb2 A1 G2 G2 G1 F2 F2 E1 D2

made to the pedal subpatch to synchronize the tim- for the same pitch on the previous channel as a se- ings internally. Similarly, it is sometimes necessary curity measure. to individually adjust the outgoing note velocities to compensate for discrepancies in the dynamic re- sponse of different instruments. The yellow LED Adaptive Just Intonation button will flash whenever a pedal control message is sent out and will stay on as long as there is a de- Groven.Max’s adaptive tuning feature relies on a pressed pedal on any of the three output pianos. combination of intelligence and memory. The Should a pedal become unintentionally stuck in same combination of pitch classes may get tuned the depressed position, the manual reset button can differently depending on the context. When notes be used to send a pedal-off message. are played, they are analyzed to determine which particular tuned pitch classes are required to pro- duce just intervals (i.e., intelligence), with prefer- Note Processing ence usually, but not always, given to the tuned pitch class that sounded most recently (i.e., mem- At the most basic level, the function of ory). At any given moment, there are tuning colors Groven.Max is to take incoming MIDI data and as- designated for each of the twelve pitch classes. sign it a MIDI channel (1, 2, or 3) to reroute it to When a key is actually played on the control key- the appropriate Blue, Gold, and Red pianos. The board, the corresponding pitch class and tuned first step is to parse the incoming raw MIDI bytes pitch class are flagged as active. When a new chord to separate pitch, velocity, note-on/note-off, and is played, whichever chord member was most re- control data. All of this information is stored in an cently flagged is designated as the reference point indexed queue to await the determination of the for tuning the chord. In other words, if possible, the tuning color (i.e., MIDI channel). Meanwhile, the flagged pitch remains fixed, and the other chord pitch data is also sent to a ‘‘keypress’’ that converts members are adjusted (if necessary) in relation to the MIDI note numbers to a generic pitch class (0– that fixed pitch (in accordance with the principles 11) and packs together all simultaneous pitch of just intonation). Figure 7 illustrates how this classes into an array. If Auto-tune is engaged, this process works in a simple progression of triads array is sent through the tuning logic to calculate with common tones present between each pair of the desired tuning color for each pitch class. When chords. In the figure, ‘‘1,’’ ‘‘2,’’ and ‘‘3’’ refer to the this process (which will be described shortly) is MIDI channels and their corresponding tuning col- completed, it triggers the waiting note data to be ors of Blue, Gold, and Red respectively. combined with a channel assignment. Following the opening G , the com- The channel assignments are sent from the Pitch mon tones serve as the reference point in tuning Box into a two-dimensional array together with the the next chord. In the second chord, for example, pitch class. As each note is released from the F2 (Gold F) is used (rather than F1 or F3), because queue, its pitch class is calculated again and that is the tuned pitch class of F that forms a just matched with the channel array. The complete major triad with the already active pitches D1 and note data is then output to the appropriate piano. If B-flat2. Notice in the final chord that the tuned this is a new channel, a note-off is also generated pitch class D2 now occupies pitch class D, instead

Code 57

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Figure 8. Pitch field 0 and the keys that function best within it.

Pitch field 0 ← Perfect 5th →

↑ B1 F#1 C#1 G#1 D#1 A#1 E#1 B#1 → (Fx1 = G1) Maj 3rd G1D1A1 E1 B2 F#2 C#2 G#2 → (D#2 = Eb2) ↓ Eb2 Bb2 F2C 2G 2D 2

Best major keys : D1, A1, E1, B2, F#2, Bb2, F2, C2 Best minor keys : d1, a1, e1, b2

of the previously sounding D1. This occurs be- of implicit harmonic context as part of the criteria cause, within the final chord, G has priority over D for determining a tuning color. as the more recently active pitch class, and thus G2 serves as the reference point. Whenever a particular tuned pitch class is given Pitch Fields priority as a reference point, the logic ‘‘locks out’’ a designated set of incompatible tuned pitch classes Within an unlimited pitch universe, tuning based (i.e., tuned pitch classes that would form ‘‘out-of- on intervals alone would, of course, lead to a con- tune’’ intervals as determined by aesthetic priori- tinuous drifting of pitch. To ensure that a piece of ties programmed into the tuning logic, which will music that modulates can return to the exact same be elaborated upon shortly). Any of the currently starting tonic, the performer selects ahead of time assigned tuning colors deemed incompatible are au- one of fourteen standard pitch fields, each contain- tomatically switched to a compatible one before ing only 22 of the 36 tuned pitch classes as men- the next notes actually sound. Hence, in Figure 7, tioned previously. Figure 8 shows the default field D1 is already eliminated from the queue and re- of the tuning logic designated pitch field 0 (corre- placed by D2 at the time of the fourth chord (along sponding to the most of the top three rows of the with some other pitches of which we are not yet Pitch Box in Figure 3). aware, because they do not happen to be part of the According to Groven, each standard pitch field is final chord). In other words, the program can antici- capable of suitably rendering approximately twelve pate which tuned pitch classes might be needed so different keys (some major and some minor) in just that they are, in a sense, ready and ‘‘standing by.’’ intonation. This does not necessarily imply that This is not intended to prevent delays between the any key outside of this set is unusable, but rather MIDI input and MIDI output, but rather to influ- that it will contain some triads which are not just, ence the tuning outcome in melodic passages or in and hence some degree of key coloration will be chord progressions that do not involve common present. As an alternative, it is also possible to tones. Imagine a context with D2, and F-sharp3, change pitch fields in the middle of a performance and A1 as active tuned pitch classes. If these three with little difficulty. pitch classes were played as a chord (i.e., simulta- Although these pitch fields help eliminate large- neously), the tuning logic would alter the tuning scale drifting, the prioritization given to the quality colors to produce a pure D major triad (e.g., D2, of the harmonic intervals can produce microtonal F-sharp2, A2). If the logic relied only upon the ex- frequency sliding between would-be common plicit harmonic context, however, then the tuning tones. For example, within pitch field 0, movement colors would remain unaltered (hence ‘‘out-of- from the dyad C–A to C–G-sharp and back again tune’’) in a strictly melodic arpeggiation of the normally results in the sliding down same triad. The logic therefore incorporates a kind and up by a syntonic comma (e.g., from C2 to C1 to

58 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 C2), owing to the second interval’s being tuned as a sXn short-term memory of recent tuned just major third, C–A-flat. Since the tuning color of pitch classes used A is fixed at A1 in this pitch field, the first interval smXn combination of sXn and tXn (minor third) requires C2. However, there is no ma- jor third available below C2, thus forcing the shift cXn special conditions necessitating a par- to C1. This situation can only be avoided by sacri- ticular tuned pitch class ficing some of the just intervals, an option which Groven allowed for by the creation of the addi- The tuning assignments are stored in the array tional, more limited, pitch fields Z and Py. As dis- pX (where Xn represents one of the twenty tuned cussed above, each of these fields contains six fixed pitch classes available for the ten variable pitch tones and six variable ones for a total of 18 avail- classes). For example, if the Pitch Box shows Blue ס ס able tuned pitch classes. In pitch field 0-Z, for ex- D in use, then pD1 1 and pD2 0. The initial val- ample, there is only one tuning color for C, thus ues of the p-array are entered externally each time avoiding the sliding described above. a new pitch field is selected. These preset values can be changed by the logic according to the fol- lowing algorithm: pX1 and not pX2) or smX1 or cX1) ס Tuning Logic pX1

The tuning logic in Groven.Max is essentially a In general terms, a tuned pitch class is selected if translation of Groven’s wiring diagrams for the ren- the alternate tuned color for that pitch class has stemningsautomat (Groven 1968) into a compiled not been selected, it was used recently and that Max external object written in the C programming pitch class is currently being played, or it is part of language (with programming assistance by Lars a combination of pitch classes that requires it. Frandsen, James Steck, and Peter Elsea). Groven’s The second of these condition involves what banks of telephone switchboard relays have be- Groven called the self-holding relays, or sXn. When come a series of arrays and ‘‘if-then’’ statements. a tuned pitch class is played, the selection is also Because each standard pitch field is identical in stored in the s-array. An s-value will remain posi- structure (i.e., a sequence of 22 perfect fifths), it is tive after the current note has ended until (or un- only necessary to consider one of them. As such, less) some new tuned pitch class is played with all notes get transposed to pitch field 0 (the one which it is incompatible. This logic is the primary which begins on Blue B, or B1) before they are in- source for the implicit harmonic context described put through the tuning algorithms, and the results above. For example, sD1 is turned off by sD2 (the are transposed back again on output. As shown in alternate tuning color), sG2 (which is not a pure Figure 6, pitch field 0 contains 22 pitches, with A perfect fifth), sB-flat1 or sF-sharp2 (not pure major and E fixed at A1 and E1. The other ten pitch thirds). This is expressed in the code for sD1 as fol- classes each have only two possible tuning colors lows: sD1 and not(sD2 or sG2 or sB-flat1) ס e.g., C1 or C2), thus limiting the total number of sD1) variables to be calculated. The following is a sum- or sF-sharp2)) or cD1 mary of the arrays defined in the tuning logic: This is actually one of the shorter examples, be- pXn the current status (active or inactive) cause A1 and E1 are both fixed tuned pitch classes of each tuned pitch class (pC1, pC2, within this pitch field and are compatible with D1. etc.) The c-array is the most complex and important tX the current keys (i.e., pitch classes) element of the adaptive tuning system. It is here being played (tC, tC-sharp, etc.) that simultaneous notes (i.e., chords) are analyzed Xn combination of pXn and tXn (C1, C2, and tuned according to the aesthetic priorities of C-sharp1, etc.) the programmer. The present system is based upon

Code 59

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 the principles of just intonation espoused by and refined his system, experimenting with both Groven. As exemplified in the following logic different scales (e.g., a 43-tone just scale) and differ- statement for cD1, the criteria necessitating a par- ent tuning criteria. The first goal of Groven.Max ticular tuned pitch class can involve the presence was to transfer the original tuning logic of the ren- or absence of specific pitch classes (tX), tuned pitch stemningsautomat into software for use in the classes (Xn), implied tuned pitch classes (sXn) and Groven Piano. As an adaptive system, it can be ap- combinations thereof. plied to any variety of instruments, and future ver- sions of Groven.Max will include new tuning ] tD and ס cD1 logics that more specifically suit the needs of indi- (((tB-flat and not G2) or smC1) vidual musical styles and performers. and not A-flat2 and not F-sharp2) or (smF-sharp1) or (tA and (not F2 or not B2) and (not tE or not C2)) References or ((G1 and B1) and not sD2) or (A-flat and (not sD2 or Z)) Arvidsen, J. K. 1982. ‘‘Eivind Grovens renstemte orgel med automatisk toneoppvalg.’’ Norsk kirkemusikk ] 8:295–303. Code, D. L. 2001. ‘‘Eivind Grovens ‘Rein’boge: Det ren- Notice, for example that the D1 used in the ˚ opening chord of Figure 7 is in accordance with the stemte orgelet som folkeinstrument.’’ Arbok for norsk folkemusikk 10:100–110. first line of code: the pitch class B-flat is being Code, D. L. In press. ‘‘Acting Natural: Eivind Groven’s played, but G2, A-flat2, and F-sharp2 are not pres- Naturskalaen and the Renstemte Organ.’’ Norsk Folk- ent. On the other hand, in the final chord of the meusikklags skrifter. same excerpt, there are no conditions met that sat- Compton, J. H. 1933. ‘‘An Enharmonic Music Instru- isfy cD1, hence D2 is used instead. Note that cD1 ment.’’ British patent no. 421,298. is only one example; each tuned pitch class has a Denckla, B. 1997. ‘‘Dynamic Intonation for Synthesizer different kind of logic, owing to its unique position Performance.’’ Master’s thesis, Massachusetts Institute relative to the other tuned pitch classes in the of Technology. pitch field. Frandsen, L. 1995. ‘‘Livsløgnen og drømmen om det fuld- Examining the c-array carefully, one will notice komne. Om anvendelsen af ren stemning i forbindelse that so-called ‘‘wolf’’ (i.e., obviously ‘‘out-of-tune’’) med det sædvanlige 12-tonige klaviatur, med udgang- spunkt i Eivind Grovens renstemte orgel.’’ Master’s intervals can still occur in specific pitch combina- thesis, Aalborg Universitet. tions with three or more simultaneous tones. For Groven, E. 1927. Naturskalen. Skien: Norsk folkekultur. example, in the chord C-D-G-A, it is impossible to Groven, E. 1934. ‘‘Det renstemte klaver. Eivind Grovens have every pair of pitches optimally tuned in rela- revolusjonerende opfinnelse patentert i en rekke land.’’ tion to each other: if all of the fifths are kept pure, Tonekunst 17/18:135–146. then the minor third A-C will not be pure; if the Groven, E. 1935. ‘‘Improvements in a Tuning System for minor third is kept pure, then one of the fifths Pianos.’’ British patent no. 422,669. must be sacrificed. Groven methodically antici- Groven, E. 1948a. ‘‘Temperering av tonesystemer.’’ Fra pated all of these exceptional situations and wired fysikkens verden 1:24–34. the renstemningsautomat with his solution to Groven, E. 1948b. Temperering og renstemming. Oslo: each. In this regard, his renstemningsautomat also Dreyer. [English translation Equal Temperament and Pure Tuning, self-published, 1969]. embodies within it a rather comprehensive musical Groven, E. 1955. ‘‘My untempered organ.’’ Organ Insti- system of consonances and dissonances (not unlike tute Quarterly 5(3):34–40. that of Paul Hindemith, 1942), that merits further Groven, E. 1968. Renstemmingsautomaten. Oslo: Univ- investigation in its own right. ersitetforlaget. There is, of course, no single, correct adaptive Groven, E. 1971. Eivind Groven—Heiderskrift til 70-a˚ rs- tuning system. Groven himself constantly revised dagen 8. okt. 1971. Oslo: Olav Fjalestad.

60 Computer Music Journal

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021 Hindemith, P. 1942. The Craft of . Scholz, C. 1986. ‘‘Do-It-Yourself Software: Just Intona- New York: Associated Music Publishers. tion.’’ Keyboard (February):49–143. Keislar, D. 1987. ‘‘History and Principles of Microtonal Skaarberg, K.-E. 1995. ‘‘Algoritmer for renstemt klaverin- Keyboards.’’ Computer Music Journal 11(1):18–28. strument.’’ Master’s thesis, Universitetet i Oslo. Lysdahl, A. J. K. 1997. ‘‘I den Gryende Morgentime: Ei- Steck, J. E., and D. K. Roush. 1998. ‘‘Dynamic Optimal vind Grovens arbeid med det renstemte orgelet i his- Tuning of Electronic Keyboards As They Are Being troisk og estetisk perspektiv.’’ Studia Musicologica Played.’’ Paper presented at the Acoustical Society of Norvegica 23:5–20. America, 26 June, Seattle, Washington. Polansky, L. 1987. ‘‘Paratactical Tuning: An Agenda for Waage, H. 1988. ‘‘The Intelligent Keyboard.’’ 1/1 (The the Use of Computers in Experimental Intonation.’’ Quarterly Journal of the Just Intonation Network) Computer Music Journal 11(1):61–68. 1(4):1, 12–13.

Code 61

Downloaded from http://www.mitpressjournals.org/doi/pdf/10.1162/014892602760137176 by guest on 30 September 2021