Page  00000001 IF I HAD A HAMMER: DESIGN AND THEORY OF AN ELECTROMAGNETICALLY-PREPARED PIANO Edgar Berdahl, Steven Backer, Julius 0. Smith III eberdahl, sbacker jos @ ccrma.stanford.edu Center for Computer Research in Music and Acoustics (CCRMA) Stanford University, Stanford, CA 94305 ABSTRACT In an attempt to create alternative methods of both playing and studying vibrating strings, we have modeled and constructed a software-driven instrument for use in the electromagnetic excitation of an acoustic grand piano's strings. Both a virtual and material version of such a system are discussed, along with some of the theory of operation. Applications to musical composition and expression, piano string characteristic identification, arbitrarily long sustained tones, and digital waveguide model calibration are presented, along with ideas for future experimentation and creation of new music and sound. 1. INTRODUCTION Composer Per Bloland initially motivated this research by requesting a device capable of vibrating piano strings using electromagnetic waves. Commissioned by SEAMUS/ASCAP 2005, Bloland's acoustic piano composition entitled Elsewhere is a Negative Mirror, Part I incorporates an electromagnetic preparation of the piano. Although the final prototype turned out to be much different, in some ways the early conceptions of this instrument gave a nod to the popular "Ebow" [5] string sustainer long used by electric guitarists and others. Perhaps the most significant deviation from this design is that we do not rely on mechanical-electrical feedback in the same sense; instead, we transmit sounds into the piano, which then emanate acoustically from the piano without any internal electrical feedback. Possibly the largest similarity is that the sound of the piano's strings and body can be made to endure for long periods of time, a quality found in many extended bowing techniques. 1.1. Prior Work Electromagnetism has long been used in musical instruments and related equipment. Of course, it can be found in virtually any computer music environment, whether introduced intentionally or inherently. Conventional speakers, microphones, hard disk drives, and other means of electronically manipulating and producing sound rely on electricity and magnetism. In addition, many composers and scientists have explicitly exploited electromagnetism. Maggi Payne's Holding Pattern, Stephen Scott's Resonant Resources, and John Cage's Postcard from Heaven are just a few that come to mind. Yet another relevant reference to magnetic vibration of strings is the work done by Weinreich and Causse [8] involving bowed string motion simulation using hybrid mechanical-electrical systems. 2. OVERVIEW Our excitation device is capable of receiving an arbitrary waveform from any common computer soundcard or electrical signal source, and in turn relaying this information to a piano string, without physically making contact with the string itself. Widely available software such as Pure Data or Cycling74's Max/MSP is ideal for sending a variety of signals to the device, from pure sine tones, rich orchestral samples, and voice clips, to simply white noise. However, due to the flexibility of the device, one need not be constrained to any specific software or type of sound. From a hardware prototype point of view, the system is quite simple; the three major building blocks consist of an audio power amplifier, an electromagnet, and two permanent bar magnets positioned orthogonally to the string lying in a plane a short distance above the string. Combined in the right manner and within the physical constraints presented by the piano, arbitrary string motion can be created to a degree of accuracy high enough for both scientific measurements and subjective aural observations. Sustained resonances can be produced from strings over almost the entire range of the piano. Also, individual partials of each string can be isolated and evoked independently of the fundamental string vibration frequency. In some cases one can even reproduce a continuum of sound over frequency from a single string. Some sound samples are posted on a website [2], though they are by no means representative of the full capabilities of the instrument. In the block diagram shown below (see Fig. 1), the basic structure of the device is depicted for one channel.' Beginning as a concept in computer software, a musical signal finds its way from the output of a soundcard (DAC) to the input of an audio amplifier via standard audio cables and jacks. Instead of connecting a conventional speaker to the amplifier's output, a similar load was presented in the form of an electromagnetic transducer with a real impedance of 8Q. The portion of the device that 1A total of 12 channels / notes were implemented.

Page  00000002 rests within the piano was mounted on a piece of oak laid atop the large crossbars that connect to the piano frame. The electromagnets themselves were originally intended for holding applications. Bar Magnet DAC E-- - E^ //^Eitrn qnpe D... I...................---- -- j~ T...I-aFigure 1. System block diagram for one channel N, / Air gap z Current i Figure 2. Relationships between fz, i, and z 3.2. Analysis We can simplify the analysis by using the superposition principle to describe the flux density B(t) at time t at a particular point on the string. That is, similarly to the linearized analysis of analog circuits containing transistors, the signal variable B(t) can be split into a large signal component BL (t) and a small signal component Bs (t). B(t) = BL(t) + Bs(t) (1) 3. ELECTROMAGNETIC TRANSDUCERS 3.1. Summary The permanent magnets in the transducer magnetize the portion of the steel piano string near of the transducer, so that small currents flowing through the electromagnet can push and pull on the string. Similar electromagnetic transducers are often modeled as variable reluctance transducers by finding the equivalent electrical circuit and deriving its behavior [6]. The goal of our analysis is to determine the relationships between the force fz on the element in motion, the current i(t) flowing through the coil, and the air gap z, which is the vertical distance between the string and the transducer. In general, fz and i(t) will be nonlinearly related, as depicted in Fig. 2 (right). fz will be approximately proportional to i2(t), except for fields so high that the string saturates magnetically, in which case fz becomes nearly linearly related to i (circle in Fig. 2). By placing the permanent bar magnets such that the field is focused on the string, we can make the transducer operate in the approximately linear region, which is key in allowing the injection of arbitrary signals into the piano string. The force is commonly also a hyperbolic function of z (Fig. 2, left). This is undesirable since this makes the system time-varying. As measurements will show below, when the transducer is placed close to the agraffe, the displacement of the string is small enough so that the system is roughly time-invariant. Unfortunately our analysis is not so simple as in [6] because the path length that the magnetic flux flows along through the string is not constant. However, we will show that the analysis holds for an arbitrarily small string element. In addition, we will consider the case of only one string beneath the transducer for simplicity's sake. The model could easily be extended to multiple strings using coupled string methods [1]. BL(t) takes on the role of "biasing" the transducerstring system such that it operates nearly linearly. BL (t) turns out to correspond to the permanent magnets. Bs (t), on the other hand, causes the string to start vibrating according to the audio data from the sound card output, and as such, Bs(t) is proportional to i(t). 3.2.1. Magnetization of the String BL(t) magnetizes the piano string so that it can be more easily acted upon by the solenoid. However, because the magnetic field due to the permanent bar magnets is much stronger than that due to the coil, we will neglect the coil's contribution here. In addition, the piano string's excursion near the agraffe is small compared with the distance between the string and the permanent magnets, so Bpm can be approximated to be roughly constant: BL(t) = Bpm + Bcoil(t) BL B Bpm (2) The qualitative plot in Fig. 3 shows the shape of the magnetic field lines corresponding to BL as approximated by a two-dimensional electromagnetic field simulator. The field lines tend to flow along the string rather than near it because the magnetic permeability of the string p is much higher than that of free space Po. Figure 3. Expected magnetic field lines (side view)

Page  00000003 An arbitrarily small string element near the transducer can be considered to be roughly constantly magnetized since the core of the electromagnet is much larger in diameter than the string, since the variations in z are small relative to z, and since Bpm is approximately constant. We shall thus consider the magnetic moment m of the string element to be roughly constant. 3.2.2. Force on the String Element Now that the portion of the string near the permanent magnets is magnetized, any change in the magnetic field will either push or pull on the string depending on the direction of the change. The current i(t) flowing through the coil creates small time-varying changes in the magnetic-flux density Bcoil(t) at the string element we are considering. AB(t) = Bs(t) = Bcoil(t) (3) A magnetized element in the presence of an external magnetic field will experience a force. In our case, the magnetized element is the string element, and the external magnetic field is Bcoil(t). Let U(t) be the potential energy of the string element at time t that will contribute to the string's vibration. more traditional techniques that assume linearity. Instead, we applied Angelo Farina's technique for system identification using a swept-sinusoid technique [3], which will identify any system of the form below, where x(t) is the input, y(t) is the output, and the ki(t) are the Volterra kernels of up to the Nth order, y(t) = x(t) * ki(t) +... + xN(t) * kN(t). (8) In order to linearize the system as much as possible, we installed the transducer above the note A3 only 5" from the agraffe. At this point, the displacement of the string was rather small, so the air gap z changed less than if we had mounted the transducer near the center of the string. We left all of the dampers down except the damper corresponding to A3 to minimize the effects of the other strings. A sonogram of the measurement results with the magnitude plotted on a dB scale is shown in the upper half of Fig. 5. The Volterra kernels line up conveniently according to their indices i such that the kernel farthest to the right is ki(t), the kernel for x2(t) is just to the left of ki (t), and so on. The spacing between the kernels decreases with the logarithm of i, and while the lower-order kernels may appear to overlap, the gray blurring in the sonogram is actually due to low-frequency noise. The measurement results sound rather remarkable [2]. Even though the hammers are neither being used nor simulated, the lower-order kernels sound like the A3 note being played on a regular piano! The medium-order kernels sound like A3 notes mixed with lower-frequency noise that increases in frequency with i. The higher-order kernels are more difficult to perceive because they overlap with each other. Finally, since ki(t) is much greater in magnitude than the other kernels, the electromagneticallyprepared piano system is roughly linear and time-invariant (LTI). This property allows deterministic use of the instrument in musical contexts. 5. PHYSICAL MODELING We created a virtual physical model of the system to aid in simulation of the system, especially for composition in absence of the instrument [7]. The current incarnation of the digital wave guide (DWG) model for our system starts at first principles, and does not include all of the complexities of the piano, as of yet. The wave variable chosen for simulation is string displacement, y(n, x). Fig. 4 depicts the basic model, which, in simulation, was also made weakly nonlinear according to the polynomial: U(t) = --m Bcoil(t) cos(0) |m||Boil(t)| (4) The force in the z-direction can be determined by taking the derivative with respect to the z-direction. fz dU(t) dz Since the flux density Bcoil(t) is proportional to the current and roughly inversely proportional to a positive power M of the air gap z, we arrive at the proportionality relationships that were previously depicted in Fig. 2: fz oc z-M fz oc i(t) (6) (7) This analysis helped guide the design of the physical model, where the variation of the air gap z is assumed to be small enough that the system is roughly time-invariant and the force is a weakly nonlinear function of i(t). 4. SWEPT-SINE MEASUREMENTS We wanted to make some measurements on the system so that we could calibrate our physical model. Since we knew that there was a small degree of nonlinearity and time-variance inherent in the system, 2 we could not use 2 We determined that the system was not strictly LTI using a technique explained in [4], where a "string" is used with a much shorter memory than an actual piano string. That is, we bound a paperclip to a speaker in such a manner as to restrict the paperclip's motion to the z-dimension. Then, while applying a sinusoidal input to the transducer, we placed the transducer over the paperclip and measured the electrical response at the speaker terminals. fz(n) = fz(n) + 0.06f (n) + 0.03ff(n) (9) As shown previously, the force exerted on the string by the transducer is roughly proportional to the current flowing through the electromagnet. From this approximation for the force, the velocity wave excitation applied to the string can be found by dividing the force by twice the string wave impedance R [7]. The factor of two allows separation into the two traveling wave components.

Page  00000004 rft& **Agraff Ri id xTeI.i:inii n N11:)nJ Figure 4. Digital waveguide model for simulation Av(n= fz(n)/(2R) (10) Ay(n) = Av(n)/2 + Ay(n - 1) (11) By integrating this sampled velocity input, the string displacement input values for use in the model are determined. The filter placed at the bridge in the simulation is a symmetric 3-tap FIR filter that adds loss in the string loop. 5.1. Comparison of Spectra from Measurements To compare and contrast the waveguide's accuracy with that of the prototype in the Yamaha C7 piano, the DWG simulation was probed using the same swept sinusoid discussed previously as input to the model. Then, using the impulse response identification techniques outlined earlier, the Volterra kernels were extracted and displayed in a sonogram alongside the piano measurements (see Fig. 5). It appears there is some AM present in the upper partials for the real piano that has not been incorporated into our single-string physical model. This is expected since the DWG model does not include any simulation of coupling effects. Thus, the sonograms are not exactly identical, but apart from the slight AM and extraneous noise in the device measurements, are quite close. 6. CONCLUSION We have discussed an electromagnetic transducer capable of exciting piano strings using electromagnetic waves, as well as given an overview of the implementation and theory of operation. One application of the device is as an expressive accessory to piano performance and composition. Another application involved making measurements using Farina's logarithmic swept-sine technique, resulting in a robust measurement of the linearized system's impulse response. Based on preliminary measurements and experiments, we conclude that our excitation device is approximately linear, time-invariant, and helpful for new ranges of expression in composition. 7. ACKNOWLEDGMENTS We gratefully acknowledge Paul Berdahl, Per Bloland, Adrian Freed, Jay Kadis, Peter Lindener, and CCRMA for their assistance, and we thank the Stanford Graduate Fellowship program for supporting this work. 8. REFERENCES [1] Askenfelt, A. ed., Five Lectures on the Acoustics of the Piano, Stockholm: Royal Swedish Academy of Music, 1990, lectures by H. A. Conklin, Anders Askenfelt and E. Jansson, D. E. Hall, G. Weinreich, and K. Wogram. [2] Backer, S. and E. Berdahl. "Sound Samples" http://ccrma. stanford. edu/~sbacker/empp/ [3] Farina, A. "Simultaneous Measurement of Impulse Response and Distortion with a SweptSine Technique", 108th Convention of the Audio Engineering Society, Paris, France. February 19-22, 2000. [4] Freed, A. and 0. Isvan. "Musical Applications of New, Multi-axis Guitar String Sensors", Proceedings of the International Computer Music Conference, Berlin, Germany. 2000. [5] Heet, G. String Instrument Vibration and Sustainer. 1978. U.S. Pat. 4,075,921. [6] Sherman, C. and J. Butler. "Analysis of harmonic distortion in electroacoustic transducers", J Acoust. Soc. Am., September 1995. [7] Smith III, J. O. Physical Audio Signal Processing: Digital Waveguide Modeling of Musical Instruments and Audio Effects, August 2004 Draft. http://ccrma.stanford.edu/fjos/pasp04/ [8] Weinreich, G. and R. Causse. "Digital and Analog Bows: Hybrid Mechanical-Electrical Systems", IEEE Transactions on Acoustics, Speech, Signal Processing, 1986. time... ii. iii 50.0 time 70.0 Figure 5. Comparison of results between actual device in the piano (upper) and the DWG model (lower)