9
Innovative Applications of O.R. Optimal electronic musical instruments David Hartvigsen Mendoza College of Business, University of Notre Dame, United States article info Article history: Received 12 October 2009 Accepted 1 March 2010 Available online 6 March 2010 Keywords: Combinatorial optimization Gray codes Musical instrument design abstract For many musical instruments, a musician depresses various combinations of keys in order to play the notes in the instrument’s range. For traditional (or acoustic) instruments of this type (e.g., woodwinds and most brass), the ways in which the combinations of keys can be assigned to the notes are limited by physics. However, for electronic instruments of this type, there are essentially no such limitations. In this paper, we exploit this freedom and present several designs for electronic instruments which are optimally easy to play; that is, the total movement of the fingers when playing some common sequences of notes (i.e., various, general collections of scales) is minimized. Our designs are built upon Gray codes, which are used in digital communications. Ó 2010 Elsevier B.V. All rights reserved. 1. Introduction In this paper, we are interested in the design of musical instru- ments that are optimally easy to play. We begin this introduction with a brief discussion of some general features of existing instru- ments, which are similar to those we want to design. Based on this discussion, we then introduce the type of instrument we want to design and what we mean by ‘‘easy to play.” Next, we present a concrete illustration of these notions and, finally, we give an out- line of the paper. We are solely concerned in this paper with instruments that can play sequences of single notes. Examples of traditional (or acoustic) musical instruments of this type include brass, woodwinds, orchestral strings, keyboard instruments, and guitars. (Although some such instruments, for example keyboards and guitars, can also play more than one note at a time, this feature does not con- cern us in this paper.) Typically, such instruments have a finite number of locations (typically keys or positions on strings) such that, for every note in some range, there exists a combination of these locations where the musician must place his/her fingers (e.g., depressing a key or string) in order to produce the note. For woodwinds and most brass instruments, for example, musicians must often use more than one key per note. For keyboard and string instruments, only one key or location is needed for each note. Some instruments have more than one combination of the keys that produce the same note (although, for each note, they of- ten have a preferred combination, which produces the best quality sound). For valve-based brass instruments, each combination of keys corresponds to more than one note (hence the musician must also adjust his/her lip tension). In addition to pressing combina- tions of keys, these traditional instruments also have an accompa- nying method for producing sound: for example, the breath, the pressure with which a key is pressed, the use of a bow, or the plucking of a string. The issue of the assignment of notes to combi- nations of keys is our main concern in designing an instrument. The traditional instruments have the property that the number of keys and the various combinations of keys used to produce dif- ferent notes (as well as the placement of the keys on the instru- ment) are largely determined by the physics of the instrument. In recent years new electronic variants of such instruments have become available. For these instruments notes can be assigned to combinations of keys with total freedom (and the keys can be placed on the instrument with a lot of flexibility). Examples in- clude the Electronic Wind Instrument (EWI) by Akai, the Yamaha WX, the Morrison Digital Trumpet (by Steve Marshall and James Morrison), the digital flute (by Yunik, Borys, and Swift; see [16]), the Bleauregard (by Gerald Beauregard; see [1]), the MIDI horn (by John Talbert; see [4]), the Hirn (by Perry Cook; see [5]), and the Pipe (by Gary Scavone; see [14]). See the book [9] by Miranda and Wanderley for a discussion of the last five of these instru- ments. (All of these instruments send MIDI signals to a synthesizer followed by a speaker.) Other examples are the Ocarina™ and Leaf Trombone TM by Smule, WIVI Band™ by Wallander Instruments, and the Pianist by MooCowMusic, all designed for the Apple iPhone. With the exception of the digital flute, the Bleauregard, and the Ocarina™, all of these electronic instruments use combina- tions of keys that are based on the traditional examples. In this paper, we present some new designs for electronic mu- sical instruments. Given a range of notes, our designs focus first on choosing the number of keys, and then assigning each note to a unique combination of the keys. (We are not concerned with 0377-2217/$ - see front matter Ó 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.ejor.2010.03.001 E-mail address: [email protected] European Journal of Operational Research 206 (2010) 614–622 Contents lists available at ScienceDirect European Journal of Operational Research journal homepage: www.elsevier.com/locate/ejor

Optimal electronic musical instruments

Embed Size (px)

Citation preview

Page 1: Optimal electronic musical instruments

European Journal of Operational Research 206 (2010) 614–622

Contents lists available at ScienceDirect

European Journal of Operational Research

journal homepage: www.elsevier .com/locate /e jor

Innovative Applications of O.R.

Optimal electronic musical instruments

David HartvigsenMendoza College of Business, University of Notre Dame, United States

a r t i c l e i n f o a b s t r a c t

Article history:Received 12 October 2009Accepted 1 March 2010Available online 6 March 2010

Keywords:Combinatorial optimizationGray codesMusical instrument design

0377-2217/$ - see front matter � 2010 Elsevier B.V. Adoi:10.1016/j.ejor.2010.03.001

E-mail address: [email protected]

For many musical instruments, a musician depresses various combinations of keys in order to play thenotes in the instrument’s range. For traditional (or acoustic) instruments of this type (e.g., woodwindsand most brass), the ways in which the combinations of keys can be assigned to the notes are limitedby physics. However, for electronic instruments of this type, there are essentially no such limitations.In this paper, we exploit this freedom and present several designs for electronic instruments which areoptimally easy to play; that is, the total movement of the fingers when playing some common sequencesof notes (i.e., various, general collections of scales) is minimized. Our designs are built upon Gray codes,which are used in digital communications.

� 2010 Elsevier B.V. All rights reserved.

1. Introduction

In this paper, we are interested in the design of musical instru-ments that are optimally easy to play. We begin this introductionwith a brief discussion of some general features of existing instru-ments, which are similar to those we want to design. Based on thisdiscussion, we then introduce the type of instrument we want todesign and what we mean by ‘‘easy to play.” Next, we present aconcrete illustration of these notions and, finally, we give an out-line of the paper.

We are solely concerned in this paper with instruments that canplay sequences of single notes. Examples of traditional (or acoustic)musical instruments of this type include brass, woodwinds,orchestral strings, keyboard instruments, and guitars. (Althoughsome such instruments, for example keyboards and guitars, canalso play more than one note at a time, this feature does not con-cern us in this paper.) Typically, such instruments have a finitenumber of locations (typically keys or positions on strings) suchthat, for every note in some range, there exists a combination ofthese locations where the musician must place his/her fingers(e.g., depressing a key or string) in order to produce the note. Forwoodwinds and most brass instruments, for example, musiciansmust often use more than one key per note. For keyboard andstring instruments, only one key or location is needed for eachnote. Some instruments have more than one combination of thekeys that produce the same note (although, for each note, they of-ten have a preferred combination, which produces the best qualitysound). For valve-based brass instruments, each combination ofkeys corresponds to more than one note (hence the musician must

ll rights reserved.

also adjust his/her lip tension). In addition to pressing combina-tions of keys, these traditional instruments also have an accompa-nying method for producing sound: for example, the breath, thepressure with which a key is pressed, the use of a bow, or theplucking of a string. The issue of the assignment of notes to combi-nations of keys is our main concern in designing an instrument.

The traditional instruments have the property that the numberof keys and the various combinations of keys used to produce dif-ferent notes (as well as the placement of the keys on the instru-ment) are largely determined by the physics of the instrument.In recent years new electronic variants of such instruments havebecome available. For these instruments notes can be assigned tocombinations of keys with total freedom (and the keys can beplaced on the instrument with a lot of flexibility). Examples in-clude the Electronic Wind Instrument (EWI) by Akai, the YamahaWX, the Morrison Digital Trumpet (by Steve Marshall and JamesMorrison), the digital flute (by Yunik, Borys, and Swift; see [16]),the Bleauregard (by Gerald Beauregard; see [1]), the MIDI horn(by John Talbert; see [4]), the Hirn (by Perry Cook; see [5]), andthe Pipe (by Gary Scavone; see [14]). See the book [9] by Mirandaand Wanderley for a discussion of the last five of these instru-ments. (All of these instruments send MIDI signals to a synthesizerfollowed by a speaker.) Other examples are the Ocarina™ and LeafTromboneTMby Smule, WIVI Band™ by Wallander Instruments,and the Pianist by MooCowMusic, all designed for the AppleiPhone. With the exception of the digital flute, the Bleauregard,and the Ocarina™, all of these electronic instruments use combina-tions of keys that are based on the traditional examples.

In this paper, we present some new designs for electronic mu-sical instruments. Given a range of notes, our designs focus firston choosing the number of keys, and then assigning each note toa unique combination of the keys. (We are not concerned with

Page 2: Optimal electronic musical instruments

D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622 615

the physical placement of the keys on the instruments. We are alsonot concerned with how notes are activated – for example, by thebreath or by bowing. Our instruments could be easily implementedby simple reprogramming of any of the first seven electronicinstruments listed in the previous paragraph.) Our main goal isto make our instruments as ‘‘easy to play” as possible. We opera-tionalise this goal by choosing a collection of ‘‘typical” sequencesof notes and looking for instruments that minimize the totalamount of movement by the musician’s fingers in playing all thesequences in the collection. Because scales, or parts of scales, arevery common components of Western music, we use various, gen-eral collections of them for our sequences of notes. In particular,the Harvard Dictionary of Music ([11], p. 757) states: ‘‘Central tothe structure of Western tonal music is the diatonic scale – a scalethat includes two semitones and five whole tones. . .” (We discussand make use of this scale in Section 2.) For this reason, virtually allintroductory books, for learning to play the types of instrumentsconsidered in this paper, stress the importance of learning to playscales. (For sequences other than scales, see the open problems inSection 7.) Our designs are built upon Gray codes, which are usedin digital communications and are related to the travelling sales-man problem.

Let us illustrate the type of instrument we want to design withan example (which turns out to be one of our optimal designs).(We use some music terminology in a loose way here. We intro-duce precise terminology in the next section.) Our example instru-ment can play three 12-note octaves, that is, 36 consecutive notes.A standard notation for representing the notes, from lowest tohighest, is the following: C1;C#1;D1;D#1; . . . ; B1;C2; . . . ;B2;

C3; . . . ;B3. The complete list appears in Fig. 1. The subscript repre-sents the octave and the other symbols represent pitch classes,which are notes (such as C1 and C2) that have a similar sound tothe human ear. The instrument in this example has six buttonsor keys and is represented by the 36� 6 f0;1g-matrix in Fig. 1.(In the figure, the matrix, which appears in parentheses, has beenbroken into three parts, corresponding to the octaves, to betterfit the page.) The ith note in the range corresponds to the ith rowof the matrix (see the labels on the rows in the figure), and eachcolumn corresponds to a key. The combination of keys to pressfor each note is indicated by its corresponding row (called a finger-ing), where the 1s indicate which keys to press. For example, F2 isplayed by pressing keys 1, 3, 4, and 6. Observe that each fingering isdifferent, which is a minimal requirement of our instruments.However, this instrument has an additional property (which isnot required in general): any two notes in the same octave havefingerings that agree on the first two entries, and any two notesin the same pitch class have fingerings that agree on the final fourentries. Hence a musician essentially needs to learn only 3þ 12different combinations of keys to play any of the 36 notes. Aninstrument with this additional property is called partitionable.

Fig. 1. Example of an instrument design.

For this range of notes, any f0;1g-matrix with 36 rows canserve as an instrument for us, as long as each row is unique. Thus,a basic question is how to compare such matrices. We address thisby using the notion of distance between two fingerings, which isthe number of keys on which they differ. For example, the distancefrom C1 to C#1 is 1 and the distance from C#1 to D1 is 2. With this,we can define the difficulty or cost of playing a sequence of notesto be the sum of the distances between adjacent pairs of notes inthe sequence and the cost of playing a collection of sequences tobe the sum of the costs of playing all the sequences in the collec-tion. As mentioned above, we use common scales for our se-quences for comparing instrument designs. (Observe that thefingerings for the instrument in Fig. 1 have the property that thedistances between notes that are one or two positions from one an-other (i.e., a half or whole step) are small, which implies that theinstrument should have a low cost on scales.)

Roughly speaking, our main result is a description of the matri-ces of optimal instruments, for any specified collection of scales(and for both the partitionable and non-partitionable cases). Thisresult also shows that there always exist optimal instruments thatuse the minimum possible number of keys (that is, the minimumnumber of keys so that there exists a f0;1g-matrix with differentfingerings for each note in the range and so that the instrument ispartitionable or not). (Observe that the piano uses the maximumpossible number of keys and turns out to be not optimal by our costcriteria. The pianist also faces the added complexity of decidingwhich finger to use for each note. In our optimal designs (for a rea-sonable sized range), each finger is dedicated to a single key, so wedo not face this added complexity; for example, our instrumentswith eight octaves require only seven keys.) We show, for example,that the instrument depicted in Fig. 1 is an optimal partitionableinstrument for a 36-note range and typical collections of scales.The matrices for our optimal instruments are built upon the well-known Gray codes, which are used in error correction of digitalcommunications and are related to the travelling salesman problem(see [7] and [12]). Our main result follows from another result thatgives an (almost) complete characterization of optimal instrumentsin terms of some properties they must have. We also see that, for agiven range of notes, there exist optimal partitionable instrumentsthat require at most one more key than an optimal non-partition-able instrument. We also show that for comparable ranges of notes,our new instrument designs always have significantly better objec-tive values than the existing traditional and electronic instruments(with one exception) and often use significantly fewer keys.

Let us consider some related work. The Bleauregard, mentionedabove, uses a fingering system that is based on Gray codes and isclosely related to one of the optimal designs presented in this pa-per. For this system, our results characterize the scales for which itis optimal, which is a new result. These types of scales are probablynot the most common to be found, hence other designs presentedin this paper are most likely preferable (see Remark 8). For the sit-uation of a given sequence of notes and a given instrument (from along list of traditional instruments) with multiple fingerings forsome notes, Worrall and Sharp [15] obtained a patent on a processfor finding optimal fingerings. For the situation of a given sequenceof notes to be played on the piano, Hart et al. [8] presented a dy-namic programming approach that finds the optimal finger touse for each note. A similar problem on stringed instruments isconsidered by Sayegh [13]. A related, non-musical invention wasthe Dvorak keyboard for typing [6], which was designed to be moreefficient, in terms of finger movements, than the standard QWERTYkeyboard layout. The keyboard design problem has also been stud-ied as a quadratic assignment problem in [2] and [10]. More effi-cient still, for typing, is the modern stenotype machine whichrequires the operator to typically press more than one key at a timeand on which experts can type in excess of 200 words per minute.

Page 3: Optimal electronic musical instruments

616 D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622

The paper is organized as follows. In Section 2 we precisely de-fine the instrument design problem. In Section 3 we present ourmain result, which is a description of optimal instruments for allpossible input parameters. In Section 4 we compare our optimalinstruments to some of the existing traditional and electronicinstruments discussed above. We prove our main result in Sec-tion 5. We discuss some design variations in Section 6, includingthe issue of allowing more than one fingering per note. Section 7contains a brief summary of the paper and mentions three openproblems.

Fig. 2. Another example of an instrument design.

Fig. 3. Partition matrices for the example in Fig. 2.

2. Notation, definitions, and the problem

In this section, we begin by presenting our basic terminologyand our model of a musical instrument. We then present the gen-eral form of the objective function we use for comparing designsand the general problem we want to solve. Finally, we define thenotion of scales, which specifies our objective function.

The instruments we are designing play all the notes or pitchesfrom the Western chromatic scale in a specified contiguous range.Let us call the notes in this range Nð1Þ; . . . ;NðnÞ. We assume theyare ordered from lowest to highest pitch. We also assume thatn P 12 and n is divisible by 12. This assumption allows us to par-tition the notes into octaves of 12 consecutive notes (as is standardin Western music). Let us denote the octaves Oð1Þ; . . . ;OðmÞ, whereOð1Þ is the set fNð1Þ; . . . ;Nð12Þg;Oð2Þ is the set fNð13Þ; . . . ;Nð24Þg,and so on; hence m ¼ n=12. Again in the standard fashion, we alsopartition the notes in a different way, into pitch classes. Let us de-note them Pð1Þ; . . . ; Pð12Þ, where Pð1Þ equals the set of lowestpitched notes in each octave, Pð2Þ equals the set of second lowestpitched notes in each octave, and so on. Hence Pð1Þ ¼ fNð1Þ;Nð13Þ;Nð25Þ; . . .g, Pð2Þ ¼ fNð2Þ;Nð14Þ;Nð26Þ; . . .g, and so on. Notesin the same pitch class have a similar sound to the human ear. Forexample, using common music terminology, Nð1Þ could denote thenote middle C, in which case Pð1Þ is the set of all C-pitched notes inthe range, Pð2Þ is the set of all C#-pitched notes in the range, and soon.

Observe that with this notation, every note in the range can beuniquely expressed as a pair of the form ðOðjÞ; PðkÞÞ.

Again using common musical terminology, we say that twonotes of the form NðiÞ;Nðiþ 1Þ are a half step and two notes ofthe form NðiÞ;Nðiþ 2Þ are a whole step.

Let us next consider the instrument we wish to design. We con-sider a general type of instrument and a special case with addi-tional structure.

An instrument has p buttons or keys. The instrument is repre-sented by an n� p f0;1g-matrix M, where row i corresponds tonote NðiÞ and is denoted MðNðiÞÞ, and each column correspondsto a key. The note NðiÞ is played on the instrument by pressingthe keys whose corresponding columns have a 1 in row MðNðiÞÞ.We refer to MðNðiÞÞ as the fingering for NðiÞ. Hence the matrixhas the property that no two rows are identical and 2p P n. Seethe example in Fig. 1, where m ¼ 3 and p ¼ 6, and the examplein Fig. 2, where m ¼ 2 and p ¼ 5. (The matrices in these figureshave been broken into three and two pieces, respectively, to betterfit the page; each piece after the leftmost should go below thepiece to its left.)

An instrument represented by M is called partitionable if it hasthe following additional structure. The keys are partitioned intotwo sets: the octave keys, of which there are p1, and the pitch classkeys, of which there are p2 . Hence p1 þ p2 ¼ p. In addition to M, theinstrument has two partitionmatrices. One, called M1, is anm� p1 f0;1g-matrix; its jth row corresponds to octave OðjÞ andis denoted M1ðOðjÞÞ; each column corresponds to an octave key.The other, called M2, is a 12� p2 f0;1g-matrix; its kth row corre-

sponds to pitch class PðkÞ and is denoted M2ðPðkÞÞ; each columncorresponds to a pitch class key. The matrices M1 and M2 havethe property that no two rows are identical; therefore, 2p1 P mand 2p2 P 12 (that is, p2 P 4). The matrices M;M1, and M2 are re-lated as follows: for each note NðiÞ ¼ ðOðjÞ; PðkÞÞ, we haveMðNðiÞÞ ¼ ðM1ðOðjÞÞ;M2ðPðkÞÞÞ. That is, the ith row of M consistsof the corresponding note’s octave row of M1 followed by the cor-responding note’s pitch class row of M2. Hence, the first p1 columnsof M correspond to the octave keys and the remaining p2 columnscorrespond to the pitch class keys. Fig. 1 contains an example of apartitionable instrument M, where m ¼ 3; p1 ¼ 2, and p2 ¼ 4; thecorresponding partition matrices M1 and M2 are shown in Fig. 3.Observe that the instrument in Fig. 2 is not partitionable (and can-not be made so by reordering the columns).

If the number of octaves is reasonably large, say m P 3, mostmusicians would probably find an instrument that is partitionableeasier to learn than an instrument which is not. The reason is thatit is natural for a musician to think of notes in the ðOðjÞ; PðkÞÞ for-mat. Therefore, a partitionable instrument requires learning,essentially, 12þm different fingerings, whereas a non-partition-able instrument requires learning 12 �m different fingerings. Forexample, the non-partitionable instrument with n ¼ 24 in Fig. 2 re-quires learning 24 fingerings while the partitionable instrumentwith n ¼ 36 in Fig. 1 requires learning 15 fingerings. On the otherhand, we show that ‘‘optimal” non-partitionable instruments canhave significantly lower objective function values than partition-able instruments. Surprisingly, depending on the input parameters,optimal non-partitionable instruments, with a minimum numberof keys, have the same number or only one fewer key than optimalpartitionable instruments, with a minimum number of keys, on thesame range. We will address these issues in more detail later.

We next need to consider how to compare different instru-ments so we can find the ‘‘best.” We do this by developing an

Page 4: Optimal electronic musical instruments

D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622 617

objective function that assigns a value to each instrument, wherethe lower the value, the better. A useful concept for developing thisobjective function is the ‘‘distance between fingerings,” which is ameasure of the difficulty of playing one fingering followed by an-other. We next discuss this issue.

If f1 and f2 are two note fingerings, then the distance from f1 to f2,denoted distðf1; f2Þ, is defined as follows:

distðf1; f2Þ ¼Xp

i¼1

jf1ðiÞ � f2ðiÞj:

In other words, the distance between two note fingerings is thenumber of keys that change from pressed to not pressed, or viceversa, as we play one fingering followed by the next. (This distancefunction is also known as the hamming distance.) For the example inFig. 2, observe that the distance between the fingerings is 1 for eachhalf step, and 2 for each whole step. For the example in Fig. 1, thedistance between the fingerings is 1 for the whole steps and everyother half step, and the distance between the fingerings is 2 for theremaining half steps, except for the steps that span two octaves,whose distance has an additional cost of 1.

For fs1; . . . ; srg a sequence of notes in the range of an instrumentwith matrix M, we define the cost of playing fs1; . . . ; srg to be

CostMðs1; . . . ; srÞ ¼Xr�1

i¼1

distðMðsiÞ;Mðsiþ1ÞÞ:

Finally, for any given collection of sequences of notes, call it C, andinstrument with matrix M, we define our objective function:

TotalCostMðCÞ ¼XS2C

CostMðSÞ:

This is a measure of how difficult it is to play all the sequences in C.We can now precisely define the problem we want to solve. Gi-

ven a range of notes, a set of p keys (with numbers p1 and p2 in thecase of a partitionable instrument), and a collection C of sequencesof notes, the instrument design problem is to find a matrix M (andmatrices M1 and M2 in the case of a partitionable instrument) withp columns that minimizes TotalCostMðCÞ (assuming such an instru-ment exists).

Let us next address the collections C we use in this paper. Be-cause a common building block of Western music is the scale(see [11]), we have chosen to use scales to comprise the collectionsC. We next discuss the details.

We define a scale pattern to be a sequence of types of steps,either whole or half, such that, if we count a whole step type ashaving value 2 and a half step type as having value 1, then thesum of the values is 12. Common examples are the following:

� Ionian (major): {whole, whole, half, whole, whole, whole, half}� Aeolian (natural minor): {whole, half, whole, whole, half, whole,

whole}� Mixolydian: {whole, whole, half, whole, whole, half, whole}� Whole tone: {6 whole steps}� Chromatic: {12 half steps}

The major and minor scales are particularly prominent in Wes-tern music and are examples of ‘‘diatonic” scales, which consist ofsimilar patterns of alternating whole (2) and half (5) steps (see[11]). A number of other scale patterns appear in Western music.In particular, jazz music uses several other permutations of fivewhole and two half steps; such patterns are called modes. Otherexamples of scales include the blues, pentatonic, and harmonicminor scales, which include pairs of adjacent notes that are neitherwhole nor half steps. We do not consider these types of scales inthis paper.

Let us extend the given range of notes Nð1Þ; . . . ;NðnÞ to

Nð�11Þ; . . . ;Nð0Þ;Nð1Þ; . . . ;NðnÞ;Nðnþ 1Þ; . . . ;Nðnþ 12Þ:

That is, we have added one octave below Oð1Þ, call it Oð0Þ, and oneoctave above OðmÞ, call it Oðmþ 1Þ. We call Nð�11Þ; . . . ;Nðnþ 12Þthe extended range.

Let P be a scale pattern and let S ¼ fs1; . . . ; srg be a sequence ofascending notes in the extended range, where r P 2. We call S a P -scaleif the r � 1 pairs of adjacent notes in S, in order, agree with thestep types of P, in order. Observe that the first and last notes in a P-scale are always in the same pitch class and in adjacent octaves ofthe extended range.

An example of an Ionian scale is

Nð1Þ;Nð3Þ;Nð5Þ;Nð6Þ;Nð8Þ;Nð10Þ;Nð12Þ;Nð13Þf g:

We can now define the types of collections of sequences ofnotes that we use for solving the instrument design problem. Con-sider a range and a collection of scale patterns denoted SP. The SP-scale collection on the range, denoted CðSPÞ, consists of the intersec-tion of each P-scale, for P 2 SP, with the (original) range, when theintersection contains two or more notes. Roughly speaking, foreach P 2 SP, and each note NðiÞ in the (original) range, CðSPÞ con-tains the maximal P-scales in the (original) range that ascendand descend from NðiÞ and contain at least two notes.

For example, if n ¼ 24, and if SP contains the Ionian-scale pat-tern, then CðSPÞ contains (among other sequences) the following:

� fNð2Þ;Nð4Þ;Nð6Þ;Nð7Þ;Nð9Þ;Nð11Þ;Nð13Þ;Nð14Þg (the completeIonian scale that begins at Nð2Þ);

� fNð1Þ;Nð3Þ;Nð4Þg (the part of the Ionian scale that ends at Nð4Þ);� fNð18Þ;Nð20Þ;Nð22Þ;Nð23Þ (the part of the Ionian scale that

starts at Nð18Þ).

Observe that, in general, a collection CðSPÞ is a multi-set, sincetwo different scale patterns P1 and P2 may have the property thatthey agree on the first i step types (in which case they contributeidentical partial scales to CðSPÞ in the last octave), or the last i steptypes (in which case they contribute identical partial scales toCðSPÞ in the first octave).

We next introduce two definitions that combine to give a for-mula for computing our TotalCost function.

Let SP be a collection of scale patterns. We let hðSPÞ denote thetotal number of half step types in the sequences in SP and we letwðSPÞ denote the total number of whole step types in the se-quences in SP. For example, if SP contains the Ionian and wholetone scale patterns, then hðSPÞ ¼ 2 and wðSPÞ ¼ 11.

Let M be a matrix that describes an instrument. We let HðMÞ de-note the sum of the distances between all the half steps in therange and we let WðMÞ denote the sum of the distances betweenall the whole steps in the range. That is,

HðMÞ ¼Xn�1

i¼1

distðMðNðiÞÞ;MðNðiþ 1ÞÞÞ; ð1Þ

WðMÞ ¼Xn�2

i¼1

distðMðNðiÞÞ;MðNðiþ 2ÞÞÞ:

The following proposition shows how these concepts yield aformula for the total cost function. We prove this result inSection 5.

Proposition 1. Let M be an instrument matrix and let SP be acollection of scale patterns. Then

TotalCostMðCðSPÞÞ ¼ hðSPÞ � HðMÞ þwðSPÞ �WðMÞ: ð2Þ

Page 5: Optimal electronic musical instruments

618 D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622

3. Main results

In this section, we begin by presenting two operations forconstructing f0;1g-matrices that can serve as solutions to theinstrument design problem. We then state our main result,which characterizes some optimal solutions in terms of thesematrices. The solutions depend on the relative sizes of hðSPÞand wðSPÞ.

A f0;1g-matrix with r rows and c columns is called a tour ifthe distances between each pair of adjacent rows, and the dis-tance between the 1st and last row, are all equal to 1. (For exam-ples, see matrices B1; B2; B3, and T in Fig. 4.) We next define twooperations that take an r � c matrix as input and output a2r � ðc þ 1Þ matrix. One well-known application of Operation 1is the generation of a class of matrices we denote Bs. These matri-ces are often called Gray codes. They play an important role in er-ror correction in digital communications, correspond toHamiltonian cycles in hypercubes, and have other applications(see [7] and [12]). The matrices generated by Operation 2 are avariation on Gray codes and appear to be new. After definingthe operations, we name and illustrate some special matrices ob-tained with these operations.

Operation 1: Let A be an r � c tour. Let A0 be the r � c tour ob-tained from A by reversing the order of its rows. (Hence the ithrow of A is the ðr þ 1� iÞth row of A0.) Let A00 be the 2r � c matrixwhose first r rows are A and whose second r rows are A0. Finally,let A000 be the 2r � ðc þ 1Þ matrix obtained by adding to A00 aðc þ 1Þst column whose first r rows are 0s and whose second r rowsare 1s. Output A000.

Operation 2: Let A be an r � c tour. Let A0 be the 2r � c matrixsuch that rows 2i� 1 and 2i, for i ¼ 1; . . . ; r, are identical to row iin A. Finally, let A00 be the 2r � ðc þ 1Þ matrix obtained by addingto A0 a ðc þ 1Þst column in which rows 2i� 1 and 2i, fori ¼ 1; . . . ; r, are 0 and 1, respectively. Output A00.

Remark 2. The output of Operation 1 is a tour. The output ofOperation 2 is not a tour.

We concentrate on the following matrices. (Observe that thematrices Bs are defined inductively, but the matrices Bs are not.)

� Let B1 be the 2� 1 tour in Fig. 4.� For s P 2, let Bs be the 2s � s tour obtained from Bs�1 by an appli-

cation of Operation 1. (See B2 and B3 in Fig. 4.)� For s P 2, let Bs be the 2s � s matrix obtained from Bs�1 by an

application of Operation 2. (See B3 in Fig. 4.)

Fig. 4. Matrices for constructing optimal instruments.

� For r 6 2s, let Brs and Br

s be the r � s matrices consisting of thefirst r rows of Bs and Bs, respectively. (See B6

3 in Fig. 4.)� Let T be the 6� 3 tour in Fig. 4.� Let D be the 12� 4 tour obtained from T by an application of

Operation 1. (See Fig. 4.)� Let D be the 12� 4 matrix obtained from T by an application of

Operation 2. (See Fig. 4. Note that this is also the same as M2 inFig. 3.)

The following theorem is our main result. It describes optimalsolutions for all cases. The proof is given in Section 5.

Theorem 3. Consider a range of n notes with m octaves and acollection of scale patterns SP. In all cases below, the defined matrix M�

minimizes TotalCostMðCðSPÞÞ. (We give multiple options when12 hðSPÞ ¼ wðSPÞ. Note that M� is formed from M�1 and M�2 for the caseof a partitionable instrument.)

Let p; p1, and p2 be the smallest integers such that n 6 2p;m 6 2p1 ,and 12 6 2p2 (i.e., p2 ¼ 4).

For a general instrument:

� Suppose 12 hðSPÞP wðSPÞ. Let M� ¼ Bn

p.� Suppose 1

2 hðSPÞ 6 wðSPÞ. Let M� ¼ Bnp.

For a partitionable instrument:

� Let M�1 ¼ Bm

p1.

� Suppose 12 hðSPÞP wðSPÞ. Let M�

2 ¼ D.� Suppose 1

2 hðSPÞ 6 wðSPÞ. Let M�2 ¼ D.

Example 4. The matrix in Fig. 2 is optimal for a general instrumentfor n ¼ 24 and any SP such that 1

2 hðSPÞP wðSPÞ. The matrix inFig. 1 is optimal for a partitionable instrument for n ¼ 36 andany SP such that 1

2 hðSPÞ 6 wðSPÞ.

The following two remarks and proposition describe someproperties of the number of keys in optimal solutions.

Remark 5. The theorem implies, by our choices of p; p1, and p2,that our instruments use the minimum possible number(s) of keys,and that these numbers are independent of any choice of SP.

Proposition 6. Let p; p1, and p2 be the smallest integers such thatn 6 2p;m 6 2p1 , and 12 6 2p2 (i.e., p2 ¼ 4). Then either p ¼ p1þp2 � 1 or p ¼ p1 þ p2 (and both are possible).

Proof. Since m ¼ n=12, we have that p1 is the smallest integer suchthat

n 6 12 � 2p1 :

Hence, either

n 6 8 � 2p1 ¼ 2p1þ3

or

n > 8 � 2p1 ¼ 2p1þ3 and n 6 16 � 2p1 ¼ 2p1þ4:

Therefore, since p is the smallest integer such that n 6 2p, we havethat either p ¼ p1 þ 3 or p ¼ p1 þ 4. Since p2 ¼ 4, we have thateither p ¼ p1 þ p2 � 1 or p ¼ p1 þ p2. Observe that for m = 1, 2, 3,and 4, we have p ¼ p1 þ 4. But, for m ¼ 5, we have p ¼ p1 þ 3. h

Remark 7. For a given range and collection of scale patterns, let I1

and I2 be the optimal general instrument and partitionable instru-ment, respectively, as described in Theorem 3. Proposition 6implies that I2 uses either the same number of keys as I1, or onemore key.

Page 6: Optimal electronic musical instruments

D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622 619

Remark 8. The author thinks it is far more likely that Westernmusic is better modeled by a set SP such that 1

2 hðSPÞ 6 wðSPÞ,rather than 1

2 hðSPÞP wðSPÞ, since all the relevant scale patternsdiscussed in Section 2 satisfy the first property, except the chro-matic scale.

The following result describes the two key components, HðMÞand WðMÞ in expression (2), in the optimal objective values forall four cases given in Theorem 3. We use it for our comparisonsof different designs in the following section. We prove it inSection 5.

Proposition 9. Consider a range of n notes with m octavesand a collection of scale patterns SP. In all cases below, M�

denotes any matrix that minimizes TotalCostMðCðSPÞÞ for the givensituation.

For a general instrument:

� Suppose 12 hðSPÞP wðSPÞ. Then HðM�Þ ¼ ðn� 1Þ and

WðM�Þ ¼ 2ðn� 2Þ.� Suppose 1

2 hðSPÞ 6 wðSPÞ. Then HðM�Þ ¼ 32 ðn� 2Þ þ 1 and

WðM�Þ ¼ ðn� 2Þ.

For a partitionable instrument:

� Suppose 12 hðSPÞP wðSPÞ. Then HðM�Þ ¼ ðm� 1Þ þ ðn� 1Þ and

WðM�Þ ¼ 2ðm� 1Þ þ 2ðn� 2Þ.� Suppose 1

2 hðSPÞ 6 wðSPÞ. Then HðM�Þ ¼ ðm� 1Þ þ 32 ðn� 2Þ þ 1

and WðM�Þ ¼ 2ðm� 1Þ þ ðn� 2Þ.

4. Comparisons

In this section, we compare our optimal instruments from The-orem 3 with each other and with other instruments. In particularwe consider the saxophone, the clarinet, the Midi Horn (which isthe same as the EWI with the so-called EVI fingerings), the Bleau-regard, and the piano.

The following four tables give the minimum numbers of keys pand values for HðMÞ and WðMÞ for our optimal instruments, so wecan compare them with each other and some other instrumentdesigns. The values for HðMÞ and WðMÞ are computed using theformulas in Proposition 9. The first two tables are for our generalinstrument and the next two tables are for our partitionableinstrument. In both cases we give the values for 2–5 octaves. Aspreviously defined, hðSPÞ and wðSPÞ are the number of half steptypes and whole step types, respectively, in an arbitrary collectionof scale patterns SP. They combine with HðMÞ and WðMÞ to givethe optimal values of the TotalCost function as given in expression(2).

# Octaves

p HðMÞ WðMÞ

General instrument: Optimal M if 12 hðSPÞP wðSPÞ

2

5 23 44 3 6 35 68 4 6 47 92 5 6 59 116

General instrument: Optimal M if 12 hðSPÞ 6 wðSPÞ

2

5 34 22 3 6 52 34 4 6 70 46 5 6 88 58

# Octaves

p p1 p2 HðMÞ WðMÞ

Partitionable instrument: Optimal M if 12 hðSPÞP wðSPÞ

2

5 1 4 24 46 3 6 2 4 37 72 4 6 2 4 50 98 5 7 3 4 63 124

Partitionable instrument: Optimal M if 12 hðSPÞ 6 wðSPÞ

2

5 1 4 35 24 3 6 2 4 54 38 4 6 2 4 73 52 5 7 3 4 92 66

4.1. Comparing the general and partitionable instruments

Consider first the case that 12 hðSPÞP wðSPÞ. Observe that the

values for p for the general instrument are less than or equal tothe corresponding values for the partitionable instrument andthe difference is at most one (which is the maximum possible asshown in Proposition 7). Also, the values for HðMÞ and WðMÞ forthe general instrument are strictly less than the corresponding val-ues for the partitionable instrument, hence the TotalCost values areas well, for any choice of SP . The same relationships hold for thecase that 1

2 hðSPÞ 6 wðSPÞ . Hence we can examine the trade-off be-tween using a lower cost general instrument versus an easier-to-learn partitionable instrument.

4.2. Saxophone

We consider the three octave range starting from the instru-ment’s lowest note D and the matrix M (not shown here) deter-mined by the primary fingerings on each note. (See, for example,[3] for a graphic of the fingerings.) These fingerings are partition-able for two of the octaves in the range. For these fingerings theinstrument uses 18 keys. We have HðMÞ ¼ 70 and WðMÞ ¼ 94.We can see that for all collections of scale patterns, all our optimalsolutions for three octaves are strictly better for both HðMÞ andWðMÞ (hence our solutions have strictly better objective functionvalues), and use far fewer keys.

4.3. Clarinet

We consider the four octave range starting from the instru-ment’s lowest note E and the matrix M (not shown here) deter-mined by the primary fingerings on each note. (See, for example,[3] for a graphic of the fingerings.) These fingerings are partition-able (although not by octaves) for a portion of the range. For thesefingerings the instrument uses 16 keys. We have HðMÞ ¼ 93 andWðMÞ ¼ 128. Again, we can see that for all collections of scale pat-terns, all our optimal solutions for four octaves are strictly betterfor both HðMÞ and WðMÞ (hence our solutions have strictly betterobjective function values), and use far fewer keys.

4.4. MIDI horn (see [4]) and EWI (EVI fingerings)

We consider a three octave range starting from the instrument’sC# and the matrix M (not shown here) determined by the primaryfingerings on each note. (See [9] for a description of the fingeringsystem.) These fingerings are partitionable for all three of theoctaves in the range. (The EWI’s fingerings for the octaves are a lit-tle different from ours; but they are effectively the same and wetreat them as such.) For these fingerings the instruments use six

Page 7: Optimal electronic musical instruments

620 D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622

keys. We have HðMÞ ¼ 64 and WðMÞ ¼ 70. We can see that for allcollections of scale patterns, all our optimal solutions for three oc-taves are strictly better for both HðMÞ and WðMÞ (hence our solu-tions have strictly better objective function values), except for thecase of a partitionable instrument where 1

2 hðSPÞP wðSPÞ. We seethat for WðMÞ, the EWI is slightly better. However, it is far worsefor HðMÞ, which more than compensates in the value of the Total-Cost function, since we have that hðSPÞ is at least twice as large aswðSPÞ.

4.5. Bleauregard (see [1])

This instrument uses fingerings that yield the same values ofHðMÞ and WðMÞ as our partitionable instrument under theassumption that 1

2 hðSPÞP wðSPÞ. (Hence our main result charac-terizes when the Bleauregard fingerings are optimal. Let us alsopoint out that the matrix we use for our optimal instrument, i.e.,D, is different from the matrix used for the Bleauregard; henceoptimal solutions are not unique.) Let us consider the more realis-tic assumption of a partitionable instrument where 1

2 hðSPÞ 6wðSPÞ.To compare the two cases, let us say k � hðSPÞ ¼ wðSPÞ, where k P 1

2.Then the total cost function is

hðSPÞ � HðMÞ þ k � hðSPÞ �WðMÞ ¼ hðSPÞ � ðHðMÞ þ k �WðMÞÞ: ð3Þ

Consider the two tables below. In the first table, we evaluate thetotal cost under expression (3) for the Bleauregard (the originalcase that 1

2 hðSPÞP wðSPÞ) for three values of k. We do the samein the second table below for our partitionable instrument (the ori-ginal case that 1

2 hðSPÞ 6 wðSPÞ) for the same three values of k. Inboth cases, under the columns listing the values of k, we reportonly the number HðMÞ þ k �WðMÞ, leaving off the common multi-plier hðSPÞ. For the case k ¼ 1

2 the two instruments have the sameobjective values. However, for the more realistic larger values ofk, our partitionable instrument has significantly better objectivevalues. (Observe that if SP contains only the scale patterns calledmodes, then k ¼ 2:5.)

# Octaves

p1 p2 HðMÞ WðMÞ k ¼ 12

k ¼ 1

k ¼ 2

Partitionable instrument: Optimal M if 12 hðSPÞP wðSPÞ

2

1 4 24 46 47 70 116 3 2 4 37 72 73 109 181 4 2 4 50 98 99 148 246 5 3 4 63 124 125 187 311

Partitionable instrument: Optimal M if 12 hðSPÞ 6 wðSPÞ

2

1 4 35 24 47 59 83 3 2 4 54 38 73 92 130 4 2 4 73 52 99 125 177 5 3 4 92 66 125 158 224

4.6. Piano

The distance between the fingerings for any two notes on thepiano is 2. Hence, for a range of n notes, HðMÞ ¼ 2 � ðn� 1Þ andWðMÞ ¼ 2 � ðn� 2Þ. It is easy to see that for any number of octavesthe values of HðMÞ and WðMÞ (as well as the number of keys) areconsiderably smaller for any of our optimal instruments.

5. Proofs

We begin this section by presenting two simple propositions,one for SP-scale collections and one for fingerings. The first of thesepropositions immediately yields a proof of Proposition 1. We thenpresent some conditions for instrument matrices M;M1, and M2.

Finally, we present a characterization of the structure of optimalsolutions to the instrument design problem from which Theorem3 and Proposition 9 follow immediately.

Proposition 10. Given an SP-scale collection CðSPÞ on a range ofnotes, each half step in the range is contained in hðSPÞ sequences inCðSPÞ and each whole step in the range is contained in wðSPÞsequences in CðSPÞ.

Proof. Let CðSPÞ0 denote the P-scales on the extended range thatcontain at least two notes in the (original) range. Observe thatthere is a 1-1 correspondence between the P-scales in CðSPÞ0 andthe sequences in CðSPÞ.

Select an arbitrary half step NðiÞ;Nðiþ 1Þ, call it H, in the(original) range. Select an arbitrary scale pattern P in SP and anarbitrary half step type, call it H0, in P. (Hence we distinguish thehalf step types in P.) Observe that there is a unique sequence inCðSPÞ0 generated by this pattern where H and H0 correspond. Itfollows that each half step in the range is contained in hðSPÞsequences in CðSPÞ0. Since there is a 1-1 correspondence betweenthe P-scales in CðSPÞ0 and CðSPÞ, the result follows for the half stepsin the (original) range. The argument for the whole steps in the(original) range is analogous. h

It follows from this proposition that for any instrument matrixM and collection of scale patterns SP,

TotalCostMðCðSPÞÞ ¼Xn�1

i¼1

hðSPÞ � distðMðNðiÞÞ;MðNðiþ 1ÞÞÞ

þXn�2

i¼1

wðSPÞ � distðMðNðiÞÞ;MðNðiþ 2ÞÞÞ: ð4Þ

5.1. Proof of Proposition 1

Observe that Proposition 1 follows immediately from expres-sion (4).

Proposition 11. Consider three different fingerings f1; f2; f3. Ifdistðf1; f2Þ ¼ distðf2; f3Þ ¼ 1, then distðf1; f3Þ ¼ 2.

Proof. Immediate. h

For convenience, let us use the following notation. Let M be aninstrument matrix. Let M0 ¼ M. If the instrument is partitionable,let M2 be the matrix obtained from M by deleting the first p1 col-umns (i.e., the columns corresponding to the octave keys). For anote NðiÞ ¼ ðOðjÞ; PðkÞÞ, we let MqðNðiÞÞ denote the ith row of Mq,for q ¼ 0;2; hence M2ðNðiÞÞ ¼ M2ðPðkÞÞ.

Consider the following conditions for arbitrary instrumentmatrices M;M1, and M2, where q ¼ 0;2:

Conditions 1:

(1a) For all whole steps NðiÞ;Nðiþ 2Þ, we have

distðMqðNðiÞÞ;MqðNðiþ 2ÞÞÞ ¼ 2:

(1b) For all half steps NðiÞ;Nðiþ 1Þ, we have

distðMqðNðiÞÞ;MqðNðiþ 1ÞÞÞ ¼ 1:

Conditions 2:

(2a) For all half steps NðiÞ;Nðiþ 1Þ, where i is even, we have

distðMqðNðiÞÞ;MqðNðiþ 1ÞÞÞ ¼ 2:

(2b) For all half steps NðiÞ;Nðiþ 1Þ, where i is odd, we have

distðMqðNðiÞÞ;MqðNðiþ 1ÞÞÞ ¼ 1:

Page 8: Optimal electronic musical instruments

D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622 621

(2c) For all whole steps NðiÞ;Nðiþ 2Þ we have

distðMqðNðiÞÞ;MqðNðiþ 2ÞÞÞ ¼ 1:

Condition 3:

(3a) For all pairs of octaves OðiÞ;Oðiþ 1Þ, we have

distðM1ðOðiÞÞ;M1ðOðiþ 1ÞÞÞ ¼ 1:

Observe that the definitions of Conditions 1 and 2 containredundancies due to Proposition 11. In particular, Condition 1a isimplied by Condition 1b; and Condition 2a is implied by Conditions2b and 2c.

Proposition 12. For a general instrument, the matrices M ¼ Bnp

satisfy Conditions 1 and the matrices M ¼ Bnp satisfy Conditions 2. For

a partitionable instrument, the matrices M1 ¼ Bnp1

satisfy Condition 3;pairs of matrices M1 ¼ Bn

p1and M2 ¼ D yield matrices M2 that satisfy

Conditions 1; and pairs of matrices M1 ¼ Bnp1

and M2 ¼ D yieldmatrices M2 that satisfy Conditions 2.

Proof. By inspection. h

Proposition 13. Consider a collection of scale patterns SP.For a general instrument:

� Suppose 12 hðSPÞ > wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ iff

M�0 satisfies Conditions 1.

� Suppose 12 hðSPÞ < wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ iff

M�0 satisfies Conditions 2.

� Suppose 12 hðSPÞ ¼ wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ if

(but not only if) M�0 satisfies Conditions 1 or 2.

For a partitionable instrument:

� Suppose 12 hðSPÞ > wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ iff

M�1 satisfies Conditions 3 and M�

2 satisfies Conditions 1.� Suppose 1

2 hðSPÞ < wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ iffM�

1 satisfies Conditions 3 and M�2 satisfies Conditions 2.

� Suppose 12 hðSPÞ ¼ wðSPÞ. Then M� minimizes TotalCostMðCðSPÞÞ if

(but not only if) M�1 satisfies Conditions 3 and M�

2 satisfies Condi-tions 1 or 2.

Proof. For a general instrument: Let n denote the number of notesin the range. Observe that the total cost function (4) can be rewrit-ten as follows:

Xn�2

i¼1

12 hðSPÞ � distðM0ðNðiÞÞ;M0ðNðiþ 1ÞÞÞþ12 hðSPÞ � distðM0ðNðiþ 1ÞÞ;M0ðNðiþ 2ÞÞÞþwðSPÞ � distðM0ðNðiÞÞ;M0ðNðiþ 2ÞÞÞ

8><>:

9>=>;

þ 12

hðSPÞ � distðM0ðNð1ÞÞ;M0ðNð2ÞÞÞ

þ 12

hðSPÞ � distðM0ðNðn� 1ÞÞ;M0ðNðnÞÞÞ:

Suppose 12 hðSPÞ > wðSPÞ. Observe that there is a 1-1 correspon-

dence between each bracketed term in the summation and thewhole steps in the range. Also, each such term involves the dis-tance between the notes in a whole step and the two half steps‘‘contained in” that whole step. By Proposition 11, for each of thesewhole step terms, the lowest possible value is uniquely achievedby a matrix M0 that sets the whole step distance to 2 and thetwo half step distances to 1. If such an M0 also sets the step dis-tances in the last two terms of the expression to 1, then it mustbe optimal. Hence we have that if M�

0 satisfies Conditions 1, then

M� minimizes TotalCostMðCðSPÞÞ. We can conclude the converse istrue if we can produce a matrix M�

0 that satisfies Conditions 1. Thisfollows from Proposition 12. Hence, the result for the first bulletpoint follows.

Suppose 12 hðSPÞ < wðSPÞ. By Proposition 11, for each bracketed

term, the lowest possible value is achieved by a matrix M0 that setsone of the half step distances to 2 and the other two step distancesto 1. If such an M0 also sets the step distances in the last two termsof the expression to 1, then it must be optimal. Observe that such asolution must have some additional structure. Due to setting thedistances in the last two terms of the expression to 1, the preciseset of half step distances to be set to 2 is uniquely determined. Thatis, for all half steps NðiÞ;Nðiþ 1Þ, we have distðM0ðNðiÞÞ;M0ðNðiþ1ÞÞÞ ¼ 2 if and only if i is even. (We use here the fact that n is even.)Hence we have that if M�0 satisfies Conditions 2, then M� minimizesTotalCostMðCðSPÞÞ. We can conclude the converse is true if we canproduce a matrix M�0 that satisfies Conditions 2. This follows fromProposition 12. Hence, the result for the second bullet pointfollows.

For the case that 12 hðSPÞ ¼ wðSPÞ, the above arguments show

that either type of solution is optimal. However, in this case, therecan be optimal solutions that do not satisfy the conditions foreither case.

For a partitionable instrument: Observe that the total costfunction (4) can be rewritten as follows:

Xn�2

i¼1

12 hðSPÞ � distðM2ðNðiÞÞ;M2ðNðiþ 1ÞÞÞþ12 hðSPÞ � distðM2ðNðiþ 1ÞÞ;M2ðNðiþ 2ÞÞÞþwðSPÞ � distðM2ðNðiÞÞ;M2ðNðiþ 2ÞÞÞ

8><>:

9>=>;

þ 12

hðSPÞ � distðM2ðNð1ÞÞ;M2ðNð2ÞÞÞ

þ 12

hðSPÞ � distðM2ðNðn� 1ÞÞ;M2ðNðnÞÞÞ þ F

We have divided the contribution to the objective function for eachhalf and whole interval into the cost due to the pitch class keys (allthe terms involving M2) and the cost due to the octave keys, whichwe have combined into the single term F. Observe that there is anonzero contribution from the octave keys to F if and only if aninterval spans two octaves. Hence if M�

1 satisfies Conditions 3, thenthe contribution of F to TotalCostMðCðSPÞÞ is minimized.

Consider the case that 12 hðSPÞ > wðSPÞ. Using the arguments from

the general instrument case, we have that if M�2 satisfies Conditions1, then the contribution of M�2 to the terms involving M2 inTotalCostMðCðSPÞÞ is minimized. Thus we have proved the ‘‘only if”direction of the first bullet point. To prove the ‘‘if” direction we needonly produce a matrix M�1 that satisfies Conditions 3 and a matrix M�2that satisfies Conditions 1. This follows from Proposition 12.

Consider the case that 12 hðSPÞ < wðSPÞ. Using the arguments

from the general instrument case, we have that if M�2 satisfiesConditions 2, then the contribution of M�2 to the terms involving M2

in TotalCostMðCðSPÞÞ is minimized. Thus we have proved the ‘‘onlyif” direction of the first bullet point. To prove the ‘‘if” direction weneed only produce a matrix M�1 that satisfies Conditions 3 and amatrix M�2 that satisfies Conditions 2. This follows from Proposition12. h

5.2. Proof of Theorem 3

The theorem follows immediately from Propositions 12 and 13.

5.3. Proof of Proposition 9

This proposition follows immediately from Proposition 13 andConditions 1–3.

Page 9: Optimal electronic musical instruments

622 D. Hartvigsen / European Journal of Operational Research 206 (2010) 614–622

6. Design variations

In this section, we consider some variations on the instrumentdesigns previously considered in this paper.

Up to this point we have required that our instruments have aunique fingering for each note. Let us consider an example showinghow we can benefit from relaxing this requirement. Consider anyoptimal partitionable instrument that uses M2 ¼ D. The matrix Duses 12 of the total of 16 different f0;1g-vectors that indicatethe fingerings on the four pitch class keys. Let us assign the fourunused f0;1g-vectors to the notes as shown in Fig. 5. (Woodwindand brass instruments often have such alternate fingerings, whichmake certain sequences of notes easier to play, but at the cost oflower sound quality.) Hence the notes Nð2Þ;Nð4Þ;Nð5Þ, and Nð7Þ(and any notes in the same pitch classes in other octaves) can eachbe played in two ways. Consider a (partial) scale whose last twonotes are Nð4Þ;Nð5Þ. If we play this scale using the original finger-ings, then we incur a cost of 2 playing Nð4Þ then Nð5Þ. However, ifwe use the alternate fingering for Nð5Þ, then the cost is one less.We can similarly reduce the cost of (partial) scales that end withNð6Þ;Nð7Þ by using the alternate fingering for Nð7Þ . Next, considera (partial) scale whose first two notes are Nð2Þ;Nð3Þ. If we play thisscale using the original fingerings, then we incur a cost of 2 playingNð2Þ then Nð3Þ. However, if we use the alternate fingering for Nð2Þ,then the cost is one less. We can similarly reduce the cost of (par-tial) scales that start with Nð4Þ;Nð5Þ by using the alternate finger-ing for Nð4Þ. Thus, if our collection of scale patterns includes apattern that starts and/or ends with a half step type, then we canreduce the cost of the instruments described in Theorem 3.

One possible concern in playing one of our optimal instrumentsis the playing of trills. (A trill is a quick, repeated interchange be-tween two notes that are a half step or a whole step apart.) A trillshould be fairly easy to play in most cases when the distance be-tween the notes is 1. But for a distance of 2 or 3, it could be difficultto play. (A distance of 3 is the maximum possible and only occursfor partitionable instruments in our solutions; see, for example, thehalf step B1;C2 in Fig. 1.) A solution is to add two extra keys, suchthat depressing one takes the current note up a half step anddepressing the other takes the current note up a whole step. Thistype of solution is used quite effectively on the EWI under theEVI fingering system, which is partitionable with p2 ¼ 4. Such asolution can also be used to reduce the cost of playing some scales,as discussed above for alternate fingerings.

We next observe that the fingerings for the octave keys on apartitionable instrument can be handled in a different fashion,which for most practical situations can be easier to play for the

Fig. 5. An optimal instrument with alternate fingerings.

musician. The idea is essentially to have one key for each octave,where one finger (a thumb) is dedicated to pushing these keys. Thiswill in most cases add extra keys to the instrument, however, thisis the way the EWI is designed (and its range spans eight octaves).In fact, the keys are implemented as a sequence of rollers and posi-tioning the left thumb between two rollers selects an octave. Slid-ing the thumb up or down to the next position selects an adjacentoctave. This mechanism turns out to be quite efficient, as long asone is not jumping between non-adjacent octaves. A similar designis used, for example, for the Leaf Trombone, which was mentionedin the introduction.

7. Conclusion and open problems

In this paper, we have shown how to design electronic musicalinstruments that are optimally easy to play. In particular, ourinstruments minimize the amount of finger movement requiredto play a variety of common sequences of notes: musical scalesconsisting of sequences of half and whole steps.

The following questions remain open:

� Describe optimal instrument designs for more general collec-tions of scales; that is, scales that allow intervals other thanthe half and whole step, such as the pentatonic and blues scales.

� Describe optimal instruments based on sequences other thanscales. One example to consider is arpeggios and another isthe sequence based on the ‘‘circle of fifths” (see [11], p. 180):C, G, D, A, E, B, F#, C#, G#, D#, A#, F, C.

� For an instrument with a given number of keys and a scale pat-tern collection SP, what is the optimal instrument design, interms of finger movement, if we allow alternate fingerings?

References

[1] G. Beauregard, Rethinking the Design of Wind Controllers, Master’s Thesis,Dartmouth College, 1991.

[2] R.E. Burkard, J. Offermann, Entwurf von Schreibmaschinentastaturen mittelsquadratischer Zuordnungsprobleme, Zeitschrift für Operations Research (B) 21(1977) B121–B132.

[3] D.L. Carroll, <www.fingering-charts.com>, 2006.[4] J. Chadabe, Electric Sound: The Past and Promise of Electronic Music, Prentice

Hall, Upper Saddle River, NY, 1997.[5] P. Cook, A meta-wind-instrument physical model, and a meta-controller for

real time performance control, in: Proceedings of the 1992 InternationalComputer Music Conference (ICMC’92), San Jose, CA, ICMA, San Francisco,1992, pp. 273–276.

[6] A. Dvorak, W.L. Dealey, Optimize the Character Layout of the ComputerKeyboard, US Patent 2040248, 1936.

[7] F. Gray, Pulse Code Communication, US Patent 2632058, 1953.[8] M. Hart, R. Bosch, E. Tsai, Finding optimal piano fingerings, UMAP Journal 21

(2) (2000) 167–177.[9] E.R. Miranda, M.M. Wanderley, New Digital Musical Instruments: Control and

Interaction Beyond the Keyboard, A-R Editions, Inc., Middleton, Wisconsin,2006.

[10] M.A. Pollatachek, N. Gershoni, Y.T. Radday, Optimization of the typewriterkeyboard by simulation, Angewandte Informatic 17 (1976) 438–439.

[11] D.M. Rondel, The Harvard Dictionary of Music, fourth ed., Bel Knap Press ofHarvard University Press, Cambridge, MA, 2003. p. 757.

[12] C. Savage, A survey of combinatorial Gray codes, SIAM Review 39 (1997) 605–629.

[13] S. Sayegh, Fingering for string instruments with the optimum path paradigm,Computer Music Journal 13 (3) (1989) 76–84.

[14] G. Scavone, The PIPE: Explorations with breath control, in: Proceedings of the2003 International Conference on New Interfaces for Musical Expression(NIME’03), Montreal, Canada, McGill University, Montreal, 2003, pp. 15–18.

[15] R.W. Worrall, R.W. Sharp, Method of Automated Musical Instrument FingerFinding, US Patent 7238876, 2007.

[16] M. Yunik, M. Morys, G.W. Swift, A microprocessor based digital flute, in:Proceedings of the 1983 International Computer Music Conference (ICMC’83),Rochester, NY, ICMA, San Francisco, 1983, pp. 127–136.