/ Modeling Piano Sound using Waveguide Digital Filtering Techniques

Page  89 ï~~Modeling piano sound using Waveguide Digital Filtering Techniques Guy E. Garnett GEG%CCRMA-F4@SAIL.Stanford.EDU Center for Computer Research in Music and Acoustics (CCRMA) Department of Music, Stanford University Stanford, California 94305 Abstract Physical modeling of aeoustle Instruments provides control and comprehension of the process of sound seynthesis to a greater degree than most other techniques. It allows for a modular approach with easy, Intuitive extensiblty from the acoustle model to hybrid structures and otherwise non-realizable or Imaginary Instrument types. A model of the acoustic plano is deserlbed and an Implementation using waveguide digital filters ([17]) and other digital signal processing techniques Is discussed. The model provides direct correlation between obvious physical parameters, such as string length and tenslon, soundboard size and key velocity, among others, and the resultant sound. Thus, a varlety of piano and pianolike sounds may be readily synthesized and played with simple, Intuitively obvious parameters. Waveguide digital filters provide the basic digital structure for the resonators (which Includes the strings and soundboard) because they have been shown to be highly stable, flexible and computationally Inexpensive ([18]). Some approximations to the model are discussed that serve to further minimize computation without loss of flexlbilty or compromising the resulting sound. I. Introduction Since the advent of electronic instruments, many attempts at synthesizing piano sounds have been made (see [3], [f], [13],[14], among others), but each attempt has fallen short of complete success. The methods used fall into four basic categories: * Waveform or spectrum matching. This includes frequency modulation, waveshaping, additive synthesis and others. * Linear Predictive Coding. * Sampling. * Physical, or quasi-physical, modeling. Each of the first three synthesis types shares the same chief disadvantage in that they derive their model from the time-varying frequency and amplitude response of recorded pianos. This means that any single tone can be well modeled by these techniques, but they do not provide a simple means for extrapolating from the specific recorded case to other musical performance situations. In other words, they are very good at reproducing recorded piano tones, but they are not very good instruments for musical performance. It has proved very difficult to control a large number of non-intuitive parameters over the extremely wide range of possibilities needed to produce musically useful results. This is not to imply that good music cannot be made with these techniques, it certainly can, but it does mean that often you end up taking what you get rather than getting what you want. The fourth method, and that which is considered here, is to model the physics of the piano more directly and thus provide a handle on the control of the many parameters involved. It provides input parameters, such as length of strings, size of soundboard and velocity and location of the hammer strike, that map directly onto the experience of playing and designing real physical pianos. This greatly simplifies controlling the performance of the digital instrument. In fact, once a particular piano is designed, a performance can be completely controlled by only 4 parameters: start of note, end of note, pitch and key velocity. Physical modeling has already yielded substantial results (see [1],[19] and [23]) and is likely to ultimately yield the best results of all, but, until now, it has typically resulted in systems requiring inordinate computing resources, and so has been impractical in a musical setting. To solve this problem of economy, my model incorporates new approaches to digital filtering, waveguide digital filters (see [17]), that result in a significant reduction in complexity and computation cost, and a technique of "lumping" many effects together into one whenever it proves feasible. This flexible approach has proved so useful that I have been able, to a large extent, to realize the basic model presented here on the Samson Box digital synthesizer at CCRMA in realtime. In addition to reducing the computational overhead, the use of waveguide filters provides a second significant benefit: 1987 ICMC Proceedings 89

Page  90 ï~~since there is a very clear correspondence between the physical wave-propagation system and the parameters of the filter sections-each signal in the waveguide network has an exact physical analogue-it is a relatively simple matter to design even a complex network built up out of basic functional units. This is so significant that preliminary work is already underway to incorporate these techniques in a toolbox for digital signal processing, modeling and synthesis. In the sections that follow, I will present an overview of waveguide digital filters and then proceed to explain the basic piano model. II. Waveguide Digital Filters Waveguide filters were introduced by Smith in [18]. The basic ingredients of waveguide digital filters are delay lines and junction connections. Simply put, a waveguide is a medium that guides or channels a wave in a particular direction. In the case of digital waveguides, a pair of delay lines, one for each direction in the case of a one-dimensional medium, serves to carry the digitally represented signal from one point, or junction, to another (see Figure 1). For simplicity I will use pressure as the signal variable, P, but it is equally possible to formulate the equations in terms of velocity, U, or root power, PU as well. The junction itself can be handled in a number of ways. Figure 2. One-multiply scattering junction. It can be seen, if Z1 = Z2, then k = 0 and there is no reflection at all; if Z2 is much greater than Z1, then k -- I and all of the signal is reflected from each incoming wave. Thus the more the impedances diverge from one another, the more the incoming signals are reflected instead of transmitted. Another waveguide junction I have used extensively in the piano model is known as a Multi-Input-Multi-Output (MIMO) junction [17](Figure 3). It accepts any number of inputs and, usually, an equal Figure 1. A simple digital waveguide and junction. Figure 2 shows a one-multiply version, after Smith [18]. It has two bi-directional waveguides attached as shown giving a total of two inputs and two outputs. The reflection coefficient, k, is determined by the relative impedances, Z and Z2, or the associated waveguides as follows: k Z2 - 1 Z1 + Z2 Figure 3. A Multi-Input-Multi-Output scattering junction. number of outputs. The a multipliers on the input waves are calculated like this: r1 a; =2N where ri is the admittance (1/Z1) of the ith incoming waveguide and N is the total number of incoming waveguides. The outgoing waves, P7, are calculated from the incoming waves, Pt, by first multiplying all the incoming 90 1987 ICMC Proceedings

Page  91 ï~~waves by the corresponding a;, then summing them into the junction, Pj, and subtracting the current input from this junction total: N P.= Lafi i-i and, P7 =- P - P Pj thus represents the total signal pressure at the junetion. HIII. The basic piano Figure 4 shows a schematic representation of the basic sounding elements of a modern grand piano. The most important sections of this instrument are: * hammer * multiple strings (single string shown) time with the right initial velocity. Once this release point is passed the hammer is subjected only to the forces of friction and gravity until it collides with the string. A simple analysis of the hammer/string interaction is presented in [2]. From this we can see that the general idea is that the force of- the hammer is countered by the tendency of the string to resist being pushed. A good first approximation of the resulting interaction is the hanning pulse 2irn f =.5 +.5cos(--) th a graph of which is shown in Figure 5. Here, n is the sample number, th is the time the hammer is in contact with the string-the duration of the pulse-in samples, and th <n< t 2 - -"2 * bridge For a more complete discussion, including some reasons * soundboard why this model is too simplified, see [4], [5], [8J, [21]. * pedals (not shown) The acoustically relevant details of each of these are considered next. 2. String The piano string is actually a taut steel wire with some 150 pounds or so of force stretching it between the cape TUNING PIN I CAPO DASTRO BAR BRIDGE HAMMER SOUNDBOARD HAMMER Figure 4. The basic acoustic piano. 1. Hammer The hammer is the source of the string's excitation-at least, in the most usual mode of playing. The musician presses one of the 88 keys and this action sends the hammer, via an elaborate mechanism, flying into the string. After a certain point, the key mechanism is no longer in contact with the hammer at all. So playing technique consists simply in striking, or pressing, the right key at the right Figure 5. A hanning pulse d'astro,or the agraffe, and the bridge. There is also a considerable force pushing downward against the bridge as can be seen from the downbearing of the strings after they pass over the bridge in Figure 4. The sounding length varies considerably from one piano to another even for a given sounding pitch, but in general the lowest pitched strings are about six feet long, while the highest have sounding lengths of about two inches. The modern grand piano has 88 keys, corresponding to 88 different pitches, but it has far more than 88 strings. 1987 ICMC Proceedings 91

Page  92 ï~~A typical piano has one string for each pitch in the lowest octave, two strings per pitch above that until about C3, then, for the rest of its range, it has three strings per pitch The effects of this multiple stringing are complex. See especially, [24) for a thorough treatment. For my purpose it is sufficient to note two effects: the multiple strings are always slightly detuned and thus contribute a mild, slow beating to the timbre; second, multiple strings contribute tc the effect known as a double decay-the amplitude envelope of the piano dies away very rapidly at first and then, after the first few tenths of a second, much more slowly. This double decay shape would seem to be partly, and perhaps more significantly, caused by the presence of at least two spatially polarized modes of vibration. There is a vertical mode that dies away rather quickly and a horizontal mode that takes a much longer time to decay. Again, see [24] for a more detailed discussion of this. 3. Bridge and soundboard The bridge serves the purpose of transfering the vibrational energy of the strings to the soundboard and to each other. In most pianos the bridge is actually two seperate bridges, one for the lowest, cross-strung, strings and another for the rest. A significant effort has been made by piano designers and manufacturers to balance the impedance characteristics of the bridge with the impedance of individual strings so that each string will resonate for the longest time possible. The way this is done is to ensure that the bridge has a much higher impedance than the string, thus tending to reflect the string's vibration back into the string, but not so much that insufficient energy is transmitted to cause the soundboard to vibrate. Too much bridge impedance means the soundboard will get too little energy and we won't hear a thing. Too little bridge impedance means the string will die away too quickly. The job of the soundboard is simply to transmit the vibration of the strings to the air with large enough amplitude for it to eventually reach our listening ears. Usually, a large piece of laminated pine is used for this purpose. A study by Suzuki [22] shows quite clearly the first few vibration modes of a Steinway soundboard. He reported measuring six low-frequency peaks in the spectrum: 49.7, 76.5, 85.3, 116.1, 135.6 and 181.1 hertz. These apparently correspond to the fundamental vibration modes of the particular soundboard studied. It must be noted, however, that the soundboard studied by Suzuki was without the cast-iron plate and strings and thus may only partially correspond to the resonances of soundboards in the complete piano. Preliminary studies by the present author and Julius Smith have shown similar frequency characteristics in fully functional pianos (see Figure 6); there are some shallow, Figure 8. The measured frequency response of the soundboard in a Yamaha Conservatory model grand piano low frequency resonances followed by approximately 14 dB drop per octave thereafter. This frequency response, by itself, would be relatively simple to model with low-order filters. However, the time domain characteristics of the soundboard are not so simple, as can be seen from Figure 7 and Figure 8. Figure 7 is an impulsive signal that was fed into a soundboard. The resulting response of the soundboard is shown in Figure 8. Figure 7. An impulsive signal used to excite a soundboard. Figure 8. The response of the soundboard in a Yamaha Conservatory model grand piano to the signal in Figure 7. 92 1987 ICMC Proceedings

Page  93 ï~~4. Pedals There are, on most grand pianos, three pedals, each with a slightly different function. The left-most pedal is called the "soft" pedal or una corda pedal. It shifts the action, including the hammers, slightly to the right so that each hammer hits fewer strings or hits its string with a less centered blow of the hammer. The chief result of this is not so much to reduce the overall amplitude of the sound as to alter the timbre and, possibly, the decay characteristics. The middle pedal simply serves as an extra hand to hold down any notes that are sounding when it is pressed. It is not necessary to go into this here. The right-most pedal is probably the most important and the most often used. It raises the dampers on all the strings, whether the pianist has played them or not. The effect of this is to add a whole bunch of sympathetic resonances to the sound. Whatever string is struck by the keys has its energy slowly "picked-up" by the other strings that are now free to vibrate. Quantitive studies of this effect are currently underway at CCRMA. IV. The basie model Each of the aforementioned structures has a corresponding module in the synthesis model. Basically, the piano structure is approximated by a complex network of resonators fed from a nearly impulsive source. The main sections of the digital model are then (see Figure 9): * The hammer blow to the string (initial impulse) * The resonance of the strings (primary resonator) * The reflection, transmission and absorption of the bridge * The resonance and radiation of the soundboard (secondary resonator) * The sympathetic vibrations of the pedal system Each of the resonator systems is modeled by one or more waveguide digital filter sections [17) that are then coupled to the other resonating systems and the input signal. A more detailed discussion of each of these component systems is presented next. 1. Hammer My model uses as its excitation a hanning function as previously described. Though this has been shown to be accurate only to a first approximation (see, particularly, [4]), it will be shown in the next section that my model for the string accounts for a number of the secondary effects of the hammer-string interaction as well. smokeP"m Elm!1 Figure 9. The basic waveguide piano. The hanning pulse is applied directly to the string resonators (marked a and b in Figure 9) through a three-way junction. th is made to vary proportionally with key velocity so the faster the hammer is moving, the narrower the pulse will be and the wider the bandwidth of the resulting spectrum. See [2], [4], [5], [6) and [21) for further discussion of this. 2. Strings Each string is treated as one-dimensional and is therefore modeled by a bi-directional waveguide that is initially split into two parts at the point of contact with the hammer. The first section, from the capo d'astro bar (near the keyboard) to the hammer strike position (in most pianos the hammer strikes the string 1/7 to 1/8 of its length from the capo d'astro); second, from the hammer strike position to the bridge. The blow of the hammer can be thought of as driving a smoothed pulse away from the strike position in both directions simultaneously. In some cases the pulse traveling toward the capo has time to reflect from the capo d'aatro and return to the hammer strike position before the hammer has left the string and this has several consequences. * The original hammer pulse is deformed by the returning wave (see [21] and [4],[5],[6]). * The hammer is thrown off of the string sooner than it would be otherwise. * Some partials of the fundamental frequency of the string are damped by the action of the hammer (see [2]). My model accounts for this very simply, the point of contact between the hammer and the string is explicitly modeled with a time-varying waveguide junction. From the moment the hammer strikes the string there is a gradual 1987 ICMC Proceedings 93

Page  94 ï~~increase in the reflection and absorption at the point of impact until the hammer has attained its maximum push against the string. From this point on there is a gradual decrease in the reflection until the hammer leaves the string entirely. When this occurs, the string becomes one continuous bi-directional waveguide from the capo d'astro to the bridge. Since the real string is not an ideally flexible medium, it is necessary to take into account the inharmonicity of its partials due to the effects of stiffness of the steel wire. This is well known physically ([12]) but would be too expensive to compute in the classical manner. Instead, it is assumed that all of the effects of stiffness at each point along the string can be "lumped" together and accounted for solely at the junction of the string and the bridge. This has proved to be a reasonable assumption in the case of musical instrument strings that require substantial amplification (in this case by the soundboard) in order to be heard. Accordingly, a specially designed allpass filter is added at this junction as described in [20]. To simulate the effects of multiple strings on a single pitch, the present model uses multiple bi-directional waveguides closely coupled together. 3. Bridge As with the real piano, the model of the bridge must maintain a delicate balance between transmission and reflection. If too much string energy is transmitted the vibrations in the string would die away too quickly, and if too much energy is reflected back into the string the soundboard will have nothing to amplify and the piano would be inaudible. These reflection and transmission characteristics are dependent on the relative characteristic impedances of the string and the bridge. The string impedance can be calculated or estimated for a given piano from measurements of mass, tension and type of material. In the present model, I use a 1-multiply junction (see Figure 2) to connect each string with the bridge and soundboard. The transmission coefficient is on the order of.001, that is, 99.9 percent of the string energy is reflected and the final tenth of a percent is allowed to pass on through the bridge to the soundboard. The bridge is also responsible for a considerable amount of energy being lost due to friction and heating. This has been effectively modeled in the past by a simple moving average lowpass filter at the bridge junction ([7]). Its difference equation can be stated as: $n) = udx(n) + gax(n - 1)) Here, gi specifies the overall gain or damping characteristics, and g2 determines the cutoff frequency. See [15] for an introduction to difference equations and filter theory. This filter is inserted into the string waveguide right after the junction connecting the string to the bridge. 4. Soundboard The model of the soundboard is the least fully developed of all the components. It is simple to match the frequency characteristics noted by Suzuki ([22]), but to capture the effects of the time-domain response is not at all simple. The most accurate way would probably be to model it as a three dimensional waveguide. Unfortunately, this rapidly gets away from a reasonable compute time. Instead, I have concentrated on developing what is essentially a two dimensional model, albeit a rather limited two dimensions. This extremely oversimplified view nonetheless has yielded surprisingly good results. I have limited it to a structure of six waveguides each of which is connected directly to the bridge at a single location. I use a MIMO junction to handle this interconnection. In this way, some of the energy from a sounding string can be passed through the soundboard and can be returned to that string or to any other string who's damper has been removed. This provides a simple means to obtain some pedal effects as well. Each of these interconnected waveguides also contains a lowpass filter with a rather large damping factor. This soundboard network is tapped in several places and its output is sent to the DACs. By tapping it at widely separated points and sending each separate tap to a different output channel rich, decorrelated, multi-channel outputs can be had for almost no additional cost. V. Conclusions The basic elements of a modern acoustic piano have been considered and a method for cheaply and accurately modeling them digitally has been discussed. Work is underway at Stanford's Center for Computer Research in Music and Acoustics to develop a performance model based on this research. The basic model has been realized on a realtime digital synthesizer and exploratory work has been conducted on Symbolics Lisp Machines with FPS array processor hardware. The goal of future research is to expand the model, making it more physically accurate and meaningful, and to develop in the process a set of physical modeling tools that can be used in the design and study of other types of instruments. Thus, it should soon be possible for computer musicians, computists, to use the reed mechanism of a clarinet to drive a violin string which in turn is connected to a piano soundboard. Then the distinct advantages of physical modeling will be manifest. 94 1987 ICMC Proceedings

Page  95 ï~~Thnks This work would not have been possible without the support of many people. In particular, I thank Julius Smith for his frequent advice, enthusiasm, technical know-how and friendship. I also thank John Chowning for allowing me to use the facilities and resources of CCRMA. But most of all I thank my wife, Sherry, for her love and support and faith in me. This work was supported in part by Dynacord. Referenees [1] J. M. Adrien and X. Rodet, "Physical Models of Instruments: A Modular Approach, Application to Strings," Proc. 1985 Int. Conf. Computer Music, Vancouver Canada, Computer Music Assoc., 1985. [2] A. H. Benade, Fundamentals of Musical Acoustics, Oxford University Press, New York, 1978. [3] R. Cann, "An Analysis/Synthesis Tutorial," Computer Music J., vol. 4, no. 1, pp. 36-42, Spring 1980. [4] D. E. Hall, "Piano string excitation in the case of small hammer mass," J. Acoust. Soc. Amer., vol. 79, no. 1, pp. 141-147, Jan. 1986. [5] D. E. Hall, "Piano string excitation II: General solution for a hard narrow hammer," J. Acoust. Soc. Amer. vol. 81, no. 2, pp. 535-546,Feb. 1987. [6] D. E. Hall, "Piano string excitation III: General solution for a soft narrow hammer," J. Acoust. Soc. Amer., vol. 81, no. 2, pp. 547-555, Feb. 1987. [7] D. Jaffe and J. O. Smith, "Extensions of the KarplusStrong Plucked String Algorithm," Computer Music J., vol. 7, no. 2, pp. 56-69, 1983. [8] K. Karplus and A. Strong, "Digital Synthesis of Plucked-String and Drum Timbres," Computer Music J., vol. 7, no. 2, pp. 43-55, 1983. [9] J. Marks and J. Polito, "Modeling Piano Tones," Proceedings, ICMC, pp 263-268, 1986 [10] M. E. McIntyre, R. T. Schumacher, and J. Woodhouse, "On the Oscillations of Musical Instruments," J. Acoust. Soc. Amer., vol. 74, no. 5, pp. 1325-1345, Nov. 1983. [11] M. E. McIntyre and J. Woodhouse, "On the Fundamentals of Bowed String Dynamics," Acustica, vol. 43, no. 2, pp. 93-108, 1979. [12] P. M. Morse, Vibration and Sound, published by the American Institute of Physics for the Acoustical Society of America, 1076 (1st ed. 1936, 2nd ed. 1948). [13] I. Nakamura and S. Iwaoka, "Piano Tone Synthesis Using Digital Filters By Computer Simulation," ICASSP-86: Proc. IEEE Int. Conf. Acoust. Speech and Sig. Proc. [14] B. Schottstaedt, "The Simulation of Natural Instrument Tones using Frequency Modulation with a Complex Modulating Wave," Computer Music J., vol. 1, no. 4, pp. 46-50, 1977. [15] J. O. Smith, "Introduction to Digital Filter Theory," In J. Strawn, ed., Digital Audio Signal Processing: An Anthology. William Kaufmann, Inc., Los Altos, California, 1985. [16] J. O. Smith, "A New Approach to Digital Reverberation using Closed Waveguide Networks," Proc. '1985 Int. Conj. Computer Music, Vancouver Canada, Computer Music Assoc., 1985. Music Dept. Tech. Rep. STAN-M-31, Stanford University, July 1985. [17] J. O. Smith, "Waveguide Digital Filters," Center for Computer Research in Music and Acoustics (CCRMA), Dept. of Music, Stanford University, March 1985. (In preparation: Draft copies available upon request.) [18] J. O. Smith, "Elimination of Limit Cycles and Overflow Oscillations in Time-Varying Lattice and Ladder Digital Filters," Music Dept. Tech. Rep. STANM-35, Stanford University, May 1986. Shorter version, "Elimination of Limit Cycles in Time-Varying Lattice/Ladder Filters," in Proc. IEEE Conf. Circuits and Systems, San Jose, May 1986. [19] J. O. Smith, "Efficient Simulation of the Reed-Bore and Bow-String Mechanisms," Proc. 1986 Int. Conf. Computer Music,, The Hague, Netherlands. [20] J. O. Smith, "Methods for Digital Filter Design and System Identification with Application to the Violin," Ph.D. Dissertation, Elec. Eng. Dept., Stanford University, June 1983. [21] 11. Suzuki, "Model Analysis of a Hammer-String Interaction," ICASSP-86: Proc. IEEE Int. Conf. Acoust. Speech and Sig. Proc. [22] H. Suzuki, "Vibration ans sound radiation of a piano soundboard," J. Aeoust. Soc. Amer., vol. 80, no. 6, pp. 1573-1582, Dec. 1986. [23] J. Wawrzynek, C. Mead, T. Lin, H. Liu, and L. Dyer, "A VLSI Approach to Sound Synthesis," Proc. 1984 Int. Conf. Computer Music, Paris France, Computer Music Assoc., 198 4. [24] G. Weinreich, "Coupled Piano Strings," J. Acoust. Soc. Amer., vol. 62, no. 6, pp. 1474-1484, Dec. 1977. 1987 ICMC Proceedings 95