Numerical simulations of strings. I. A physical model for a struck string using finite difference methods AntoineChaigne SignalDepartment, CNRS UIL4 820, TelecomParis, 46 rue Barrault, 75634Paris Cedex13, France Anders Askenfelt Departmentof SpeechCommunication and Music ;Royal Institute of Technology(KTH), P.O. Box 700 14, S-100 44 Stockholm, Sweden

(Received 8 March 1993;accepted for publication26 October 1993) The first attempt to generatemusical by solvingthe equationsof vibratingstrings by meansof finitedifference methods (FDM) wasmade by Hiller and Ruiz [J. Audio Eng. Soc.19, 462472 (1971)]. It is shownhere how this numericalapproach and the underlyingphysical modelcan be improvedin order to simulatethe motion of the piano stringwith a high degree of realism.Starting from the fundamentalequations of a damped,stiff stringinteracting with a nonlinear hammer, a numerical finite differencescheme is derived, from which the time histories of stringdisplacement and velocityfor eachpoint of the stringare computedin the timedomain. The interactingforce between hammer and string,as well as the forceacting on the bridge,are givenby the samescheme. The performanceof the model is illustratedby a few examplesof simulated string waveforms. A brief discussionof the aspectsof numerical stability and dispersionwith referenceto the properchoice of samplingparameters is alsoincluded.

PACS numbers: 43.75.Mn

LIST OF SYMBOLS N numberof stringsegments coefficientsin the discretewave equation p stiffnessnonlinear exponent all(t) hammer acceleration s cross-sectional area of the core bl ,b3 dampingcoefficients T string tension c = transversewave velocity of string v(x,t) transversestring velocity E Young's modulusof string hammer velocity f(x,Xo,t) force density VHO initial hammer velocity (t = 0) fl fundamentalfrequency Xo distanceof hammerfrom agrafie L samplingfrequency y(x,t) transversedisplacement of string Fs(t) bridge force a =xo/L relativehammer striking position (RHSP) F/•(t) hammer force at=l/fe time step g( x,Xo) spatialwindow Ax= L/N spatialstep i spatialindex string stiffnessparameter K coefficient of hammer stiffness •/(t) hammer displacement L string length K radius of gyration of string Ms=pL string mass linear massdensity of string M•r hammer mass decay rate M•r/Ms hammer-stringmass ratio (HSMR) •= decaytime time index angular

INTRODUCTION from sucha set of equations.Consequently, it is necessary to use numerical methodswhen testing the validity of a The vibrationalproperties of a musicalinstrument-- physicalmodel of a musicalinstrument. like any other vibrating structure•can be describedby a Once the numerical difficulties have been mastered, a set of differentialand partial differentialequations derived simulationof a traditional instrumentby a physicalmodel from the generallaws of physics.Such a set of equations, meansthat the influenceof step-by-stepvariations of sig- which definethe instrumentwith a higher or lesserdegree nificant designparameters like string properties,plate res- of perfection,is oftenreferred to as a physicalmodel. Due onances,and others, can be evaluated. Such a systematic to the complexdesign of the traditionalinstruments, which researchmethod could hardly be achievedwhen working in most cases also include a nonlinear excitation mecha- with real instruments, not even with the assistance of nism, no analytical solutionscan, however,be expected skilled instrumentmakers. In the future, it is hoped that

1112 d. Acoust.Soc. Am. 95 (2), February1994 0001-4966/94/95(2)/1112/7/$6.00 ¸ 1994 AcousticalSociety of Annefica 1112 advancedphysical models, which reproducethe perfor- with a nonlinearcompression characteristic. He investi- manceof traditionalinstruments with high fidelity,can be gated, in particular,some details of the hammer-string usedas a tool for computer-aided-lutherie(CAL). interaction,and the efficiencyin the energytransmission Variousnumerical methods have been used extensively from hammerto string.The effectof stringinharmonicity for manyyears in otherbranches of acoustics,for example was taken into accountin a simplifiedmanner by slightly in underwateracoustics where the goalis to solvethe elas- modifyingthe values of thelumped string compliances? tic waveequation in a fluid.I In musicalacoustics, it is of In a recentpaper, Hall madeuse of anotherapproach greatvalue to obtaina solutiondirectly in the time domain, for simulatinga stiffstring excited by a nonlinearhammer, sinceit allowsus to listen to the computedwaveform di- which he named a standing-wavemodel. His method can rectly,and judge the realismof the simulation.Among the be regardedas a seminumericalapproach, since it partially large numberof numericaltechniques available, finite dif- makesuse of analyticalresults. By this method, he inves- ferencemethods (FDM) are particularlywell suitedfor tigatedsystematically the effectsof stepby stepvariations solvinghyperbolic equations in the time domain. 2 For sys- of hammer nonlinearityand stiffnessparameters, among tems in one dimension, like the transverse motion of a otherthings? vibrating string, the use of FDM leads to a recurrence In comparison with the earlier studies mentioned equationthat simulates the propagation along the string. 3 above,the presentmodel has the featureof a detailedmod- The generalityof FDM makesit possibleto alsouse them eling of the piano stringand hammer as closelyas possible for solvingproblems in two and three dimensions.The to the basicphysical relations: Our modelis entirelybased main practicallimit then is set by the rapidly increasing on finite differenceapproximations of the continuousequa- computingtime. tions for the transversevibrations of a dampedstiff string Historically,Hiller and Ruiz werethe first to solvethe struckby a nonlinearhammer. The blow of the hammeris equationsof the vibratingstring numericallyin order to representedby a forcedensity term in the waveequation, simulatemusical sounds? The model of thepiano string distributedin time and space,and the dampingis fre- and hammerused by thesepioneers was, however,rather quencydependent. crudein view of the improvementsin pianomodeling over The presentationis organizedas follows.In Sec.I, the thelast two decades? For example, the crucial value of the continuousmodel for the dampedstiff string is briefly re- contact duration between hammer and string, in reality viewed,with regardto the waveequation, and to the equa- being a result of the complexhammer-string interaction, tions governingthe hammer-stringinteraction. In Sec. If, was set beforehandas a known parameter. it is shownhow this theoreticalbackground can be put into Someyears later, Baconand Bowsherdeveloped a dis- a discreteform for time-domainsimulations. Some impor- crete model for the struck string where the hammer was tant aspectsof numerical stability, dispersion,and accu- definedby its mass and its initial velocity. 6 Displacement racy are briefly discussed here, in particularthe selectionof waveformswere computed for both hammerand stringat the appropriatenumber N of spatialsteps as a functionof the contactpoint. Their modelcan be regardedas the first the fundamentalfrequency f• of the string, for a given seriousattempt to achievea realistic descriptionof the samplingfrequency f•. A detailedtreatment of the numer- hammer-stringinteraction in the time domain.However, ical aspectscan be found in a previouspaper by the first severaleffects were not modeled in detail. The damping author.• In Sec.III, thestructure of the computer program was includedas a single fluid (dashpot) term, and the is presented,and a few examplesof the capabilitiesof the stiffnessof the string was neglected.The model assumed modelfor representingthe wavepropagation on the string further a linear compressionlaw of the felt. From a nu- are given. mericalpoint of view, no attemptswere made to investigate A thorough evaluation of the model by systematic stability,dispersion, and accuracyproblems. comparisonsbetween simulated and measuredwaveforms More recently,Boutilion made use of finite differences and spectrawas left as a separatestudy. That work will for modelinga piano string without stiffness,assuming a alsoinclude a systematicexploration of the influenceof the nonlinearcompression law and the presenceof a hysteresis hammer-stringparameters on the piano tone. in the felt. He investigated,in particular, the hammer- I. THEORETICAL BACKGROUND stringinteraction for two notes,in the bassand mid range, respectively.7 A. Wave propagation on a damped stiff string In all three papers mentioned, the numerical velocity, The presentmodel describesthe transversemotion of a i.e., the ratio betweenthe discretespatial and time steps, piano string in a plane perpendicularto the soundboard. was set equal to the physicaltransverse velocity of the The vibrationsare governedby the followingequation: string. It has been shownthat this particularchoice is possiblefor an ideal string only, and that the numerical 2-2 oy scheme becomesunstable if stiffness,or nonlinear effects -- •+2b3 •---•+f(x,xo,t), due to largevibration amplitudes, are takeninto accountin (1) the model.3 in which stiffnessand damping terms are included. The At aboutthe sametime, Suzukipresented an alterna- stiffnessparameter is given by tive for simulatingthe motionof hammerand string,using a string model with lumped elementsstruck by a hammer e=•(ES/TL2). (2)

1113 J. Acoust.Soc. Am.,Vol. 95, No. 2, February1994 A. Chaigneand A. Askenfelt:Simulations of pianostring 1113 It has been shown that this stiffnessterm, which is the B. Initial and boundary conditions main causeof dispersionin piano strings,especially in the For the struck string, it is now well known that the lowest range of the instrument, givesrise to a "precursor" force F•t(t) is a result of a nonlinearinteraction process which precedesthe main pulsesin the string waveform. betweenhammer and string. 5 In ourmodel, the motion of Possibly it could also affect the perceived attack the string startsat t=0 as the hammer with velocity VH0 transient.•0 makescontact with the stringat the strikingposition x 0. It The two partial derivativesof odd order with respect is assumedthat F•(t) is givenby a powerlaw, 9 to time in Eq. (1) simulatea frequency-dependentdecay rate of the form, Ft.(t) =KI */(t) --Y(Xo,t)[P, (6) where the displacementr/(t) of the hammer head is given a= 1/r=b• +b3o2. (3) by As a consequence,the decaytimes of the partialsin the simulated tones will decreasewith frequency,as can be Mud----•= --F•(t), (7) observedin real . l• It mustbe pointed out that this simplifiedformula yields a smoothlaw of dampingwhich and wherethe stiffnessparameters K and p of the felt are is only a fair approximationof the reality.The constantsb• derivedfrom experimentaldata on real piano hammers. The lossesin the felt are neglected. and b3 in Eq. (3) were derivedfrom experimentalvalues throughstandard fitting procedures,and it is assumedthat In the computerprogram, the interactionprocess ends theseempirical laws accountglobally for the lossesin the when the displacementof the hammer head becomesless air and in the stringmaterial, as well as for thosedue to the than the displacementof the string at the center of the coupling to the soundboard.No attempts were made to- contactsegment (x0). This yields,among other things,the ward an accuratemodeling of eachindividual physical pro- contactduration between hammer and string. cessthat causesenergy dissipation in the strings.The form The string is assumedto be hinged at both ends,which of Eq. (3) is particularlyattractive as it hasbeen shown in correspondsto the following four boundary conditions? 4 previousstudies that the time responseof mechanicalsys- y(O,t) =y(L,t) =0 temsis stableand cau•alfor lawsof dampinginvolving evenorder polynomials in frequency. t2 and (8) The model does not include the mechanisms which give rise to two differentdecay times in the piano tone, • (0,t)=•Ix (L,t)=O. "promptsound" and "aftersound. "•3This effect is mainly due to string polarization, differencesin horizontal and Theseboundary conditions do not correspondstrictly verticalsoundboard admittance, and "mistuning"within a to the stringterminations in real pianos,and will be recon- string triplet. sidered in a future work. The forcedensity term f(x•Xo,t) in Eq. ( 1) represents The continuousmodel of piano stringsdeveloped in the excitationby the hammer. This excitationis limited in this sectionforms the basit of our numerical model. Em- time and distributed over a certain width. It is assumed phasiswill now be put on the computationalmethods used that the force densityterm doesnot propagatealong the for solvingthe equations,and the obtainedalgorithms will string, so that the time and spacedependence can be sep- be discussed. arated,

II. TIME-DOMAIN SIMULATIONS f(x,x o,t) = f l•( t)g(x,xo). (4) A. String model From a physicalpoint of view, it is clear that the di- The equationsof motion for the string and hammer mensionlessspatial window g(x,x o) accountsfor the width presentedin Sec. I are formulatedin discreteform using of the hammer.Within the contextof numericalanalysis, it standardexplicit differencesschemes centered in spaceand is interestingto notice that the use of such a smoothing time?The main variable is thetransverse string displace- window eliminates the artifacts that occur in the solution ment y(x,t) which is computedfor the discretepositions (in the form of strongdiscontinuities), when the excitation xi= i fix, and at discretetime stepst n = n At. Valuesof the is concentratedin a singlepoint. hammerposition r/(t) are computed,using the sametime The densityterm fu(t) is relatedto the time historyof grid and the sameincrement At. In the following,the sim- the forceFn(t) exertedby the hammeron the stringby the plified notation, followingexpression: y( x,t ) -• y( xi,t,) -, y( i,n ), (9) will be used for convenience In a secondstage, the velocity and accelerationof the hammer, and of each discretepoint of the string, are de- wherethe lengthof the stringsegment interacting with the rived from the correspondingdisplacement values by hammeris equalto 28x. means of finite differences centered in time. Finite differ-

1114 d. Acoust.Soc. Am., VoL 95, No. 2, February1994 A. Chaigneand A. Askenfelt:Simulations of pianostring 1114 TABLEI. Coefficientsof the recurrence equation for thedamped stiff 1000 string. (b) aI = [2-- 2r2 + b3/At-6•N:r2]/D a2= [- 1+b•At+2b3/At]/D a3 = [r2(1 +4eN2)]/D a4 = [b3/At-- 1oo as = [-- b3/At]/D (el where D= 1+b•At+2b3/At and r=cAt/Ax lO (•__AHLE encescentered in spaceare usedfor computingthe force transferredfrom one segment of the stringto its adjacent segments.This gives, in particular,the force Fa(t) exerted 1 by the stringon the bridge.The interactionforce between lO 100 1oo0 10o0o FUNDAMENTALFREQUENCY (Hz) thehammer and the string is obtainedin a straightforward way by putting Eq. (6) into a discreteform. These numerical schemes lead to convenient recur- FIG. 1. Maximumnumber of spatialsteps Nma x as a functionof the fundamentalfrequency ft of the stringfor differentvalues of the stiffness renceequations where, for eachpoint i, the variableunder parameter.(a) e= 10'-8;(b) e= 10-6;(c) •= 10 4.The sampling fre- examinationat a futuretime step(n + 1) is a functionof quencyis f•=48 kHz. the samevariable at the sameposition i and at adjacent positions(i--2,i--l,i+l,i+2) at presentand past time be confusedwith the intrinsicphysical dispersion due to steps(n, n'-- 1, andn-- 2). The recurrenceequation for the the stiffnessterm in Eq. (1). As a resultof the grid dis- transversedisplacement of a dampedstiff stringcorre- persion,the eigenfrequenciesof the stringand the inhar- spondingto Eq. (1), is givenby monicityare slightlyunderestimated for a givenstiffness parameter.Fortunately, this appliesprimarily to the fre- y(i,n+ 1) =a•(i,n) +azv(i,n- 1) quencyrange just belowthe Nyquistfrequency (re/2). By usinga sufficientlyhigh samplingrate so that the string +a3[Y(i+ l,n) + y(i- 1,n)] +a4[y(i+ 2,n) partialsnear the Nyquistfrequency contain no significant +y(i- 2,n) ] +a 5[y(i+ l,n- 1) energy, the effectsof this underestimationcan be made inaudible.Further, in orderto limit thedispersion as much +y(i-- 1,n-- 1) +y(i,n-2) ] as possible,N shouldbe equalto the highestpossible inte- ger valuewhich is immediatelylower than Nraax. + [At2NFn(n)g(i,io) ]/Ms, (10) Usually,the actualsampling frequency fe, is deter- wherethe coefficientsa• to a5 are givenin TableI. minedby the audioequipment. Therefore, it wasdecided Beforestarting the computation, an appropriatenum- to select,in thisparticular experiment, one of the standard ber (N) of spatialsteps must be selected.For a standard values(32, 44.1,and 48 kHz) for theoutput sampling rate. explicitfinite differencescheme, it has beenshown theoret- Figure 1 showsNm• • as a functionof the fundamental icallythat thisselection is criticalfor stabilityand numer- frequency(f•) of the string,at a samplingrate of fe•48 icaldispersion. 3 In practice, the stability condition pro- kHz for threedifferent values of the stiffnessparameter. videsus with a maximumnumber (Nmax) of discretestring The threedecades for f• shownin the figurecover the segments,(i.e., with a minimumsegment length AXmin) , rangeof a grandpiano. Notice that N•a • is not directly assumingthat the (dimensionless)stiffness parameter (e), dependenton the string length, but rather on the ratio thefundamental frequency (f•) of thestring, and the sam- betweenthis parameterand the transversewave velocity. plingfrequency (re) aregiven. The stability condition'ran In practice,the computationwill be madeat a lower be written as samplingrate (sayf,= 16 kHz) for noteswith fundamen- tal frequencybelow 100 Hz, in order to limit N to an Nmax={ [ -- 1+ ( 1+ 16e•)1/2]/8E}1/2, ( 11 ) acceptablevalue. The synthesizedsignals will be then in- where terpolatedby a factor2 or 3 and'played back at a standard samplingrate. At theother end, oversampling will benec- y=fo/2f•. (12) essaryfor thehighest notes of theinstrument (typically for If the stiffnessis neglected(e=0), thenEq. (11) reduces f• greaterthan 1 kHz, i.e., for note C6 and above),since to truncationerrors may appearin the solutionfor too small valuesof N. In this range,the computationswere made Nmax=y. (13) with a samplingrate of 64 kHz, or even 96 kHz for note In additionto thesestability requirements, the prob- C7, andthe signalswere played back after low-pass filter- lem of numericaldispersion must also be taken into ac- ing and decimation. count.It hasbeen shown that someunwanted dispersive effects(grid dispersion)may be presentin the solutionif B. Modeling the initial and boundary conditions an explicitfinite difference scheme is usedfor solvingthe At time t=0 (n----O),the hammervelocity is assumed stiffstring equation) This numerical dispersion should not to be equal to Vn0, and its displacementand the force

1115 J.Acoust. Soc. Am., Vol. 95, No. 2, February.1994 A.Chaigne and A. Askenfelt: Simulations ofpiano string 1115 exertedon the stringare takenequal to zero.For the sake of simplicity,only the simplestcase, where the string is assumedto be at restat the originof time, will be presented below. Note, however,that the model can handle any ini- 0.5 tial condition.With the string at rest at t=0, VV V V V V V V vlvvvvvvvvvvvv • -1 y(i,0) =0. (14) Z 0 10 20 30 40 50 60 • ms At time t=At (n=l), the hammer displacementis given by FIG. 2. Illustration of a repetitionof a note showingcomputed string displacement(at 40 mm from the hammer,bridge side). First blow of a7(1)= Vm0At. (15) hammerat t=0 with stringinitially at rest,followed by a repeatedblow At that time, Eq. (10) generallycannot be usedfor at t= 32 ms with stringin motion. computingthe stringdisplacement, since four time steps are involvedin the generalrecurrence equation. One solu- the worst cases.It was thereforedecided to calculateonly tion, however,consists in assumingthat the stringis at rest the first estimate of the variables, in order to limit the for the first threetime steps.Another technique used here computationaltime. is to estimatey(i, 1 ) bythe approximated Taylor series: 2 Once the valuesof the displacementsare known for the firstthree time steps,it is possibleto startusing the y(i, 1) = [y(i+ 1,0) +y(i-- 1,0) 1/2. (16) generalrecurrence formula givenin Eq. (10), wherethe Thus the force exertedby the hammer on the string future displacementy(i,n+ 1) is computedassuming that becomes the presentforce Fn(n) is known.The hammerleaves the stringwhen F•(1) =K I•/(1)--y(i0,1)I p. (17) ß/(n+ 1) (y(io,n+ 1), (21) This enablesus to computea first estimateof the dis- placementy(i,2). In orderto limit the time and spacede- after whichtime the stringis left to freevibrations. In this pendencefor n =2, a simplifiedversion ofEq. (10) is used, case,Eq. (10) still applies,but the forceterm is tempo- wherethe stiffnessand dampingterms are neglected.This rarily removed.By furthercomparisons of stringand ham- yields mer displacements,the possibilityof hammer recontact can be taken into account. This latter feature has been y(i,2) =y(i- 1,1) +y(i+ 1,1) --y(i,O) observedhowever only for the low bassstrings. An attractive feature of the method is that there is no + [ AI2NFn(1 )g(i, io) ]/Ms. (18) needto assumethat the stringinitially is at rest.The force Similarly,the hammerdisplacement •/(2) is givenby densityterm f(x,xo,t) canbe introduced at anytime in the waveequation, whatever the vibrationalstate of the string. •(2)=2•(I)--•i(O)--[At2Fn(1)]/Mn, (19) Thus the model makes it possibleto simulate not only and the hammer force is now written as isolatedtones, but also a musicalfragment with realistic transitionsbetween notes (see Fig. 2). In this case, re- Fn(2) =K 1(2) --y(i0,2)I p. (20) peatednotes are obtainedby re-initializingthe hammer positionto zero beforestriking the movingstring. This At this stage,one may ask if it is fully justifiedto featureis not availablein today'scommercial . computethe displacementsin Eqs. (18) and (19) at time As for the boundaryconditions, the numericalexpres- n=2 usingthe valueof the forceat time n = 1, i.e., with a sionscorresponding to hingedends case in Eq. (8) are timedelay equal to At. This followsfrom the implicitform straightforwardand yield: of Eq. (20), whichrequires the values of thedisplacements in order to computethe hammerforce. y(0,n)=0 and y(N,n)=O, (22) Normally,the effectsof this approximationcan be ne- glected,provided that thesampling frequency is sufficiently y(- 1,n) = --y(1,n) and (23) high. In that case,only the high-frequencycontent of the y(N+ 1,n) = --y(N-- 1,n). synthesizedsignal will be affectedby the delay, and the influenceon the computationswill be small. An accurate If the load of the soundboardat i=N is modeled by a estimation of the effect can be obtained by iterating the frequency-dependentadmittance, then the secondcondi- proceduredescribed above, and calculatinga secondesti- tion in Eq. (23) can convenientlybe replacedby the dis- mateof the displacementsusing Eq. (20), whichin turn crete form of the appropriatedifferential equation. This leads to a more accurate estimate of the hammer force. refinementhas already been successfullyapplied to the This procedurecan be repeateduntil no significantdiffer- guitar? ences between successiveresults are observed. In our sim- The conditionsgiven in Eq. (23) are importantfor ulations,the algorithmconverged rapidly, and the differ- derivingspecific recurrence equations for the pointsi= 1 ences between the first and second estimates for and i=N--1 which are close to the string terminations. displacementsand forceswere never greater than 1% in Due to the stiffnessterm, Eq. (1) is of the fourth-orderin

1116 d. Acoust.Soc. Am., Vol. 95, No.2, February1994 A. Chaigneand A. Askenfelt:Simulations of pianostring 1116 STRING VELOCITY STRING, BRIDGE SIDE STRING, AGRAFFE SIDE 1 1

0 o /"k •

-1 -i 5 ms 10 0 5 ms 10 :3 d)•l

-3 -3 5 ms 10 5 ms 10

STRING, STRIKING POINT HAMMER FORCE 2O

0 10

-1 0 0 5 ms 10 0 6 ms 10

FORCE AT THE BRIDGE 3 5

A H B o •/ . -3 -5 0 5 ms 10 0 õ ms 10 FIG. 4. Simulatedvelocity profile of a pianostring (C4) duringthe first 4 msafter the blow. The timestep between successive plots is 62.5 its. The stringterminations are indicatedby A (agrafie)and B (bridge),and the striking point by H (hammer). FIG. 3. Computedwaveforms for pianostring C4 at four positions. String,bridge side (a) stringdisplacement (at 40 mm t¾omthe hammer), the dampingcoefficients b• and b3 of the string,were de- (b) stringvelocity. String, agrafie side (c) stringdisplacement (at 40 rived from experimentaldata by meansof standardcurve- mm from the hammer);(d) stringvelocity. Striking point (e) string displacement,(f) stringvelocity. (g) hammerforce. Bridge (h) force fitting procedures. transmittedto the bridge. In its standardexecutable version, the programstarts with an interactionwith the user,requesting the sampling frequency(in kHz), the fundamentalfrequency (in Hz), space,and thus the recurrenceequation for the pointi will and the durationof the computednote (in s). This enables dependon the vibrationalstate of points i--2 to i+2. the programto computethe number(N) of spatialsteps, Therefore,it is necessaryto know the valuesof the dis- usingEqs. ( 11)-(13). This procedureis followedby the placementsy( -- 1,n) andy(N+ 1,n) in orderto compute computationof the firstthree time steps(n =0 to n=2), as the solutionat i= 1 and i=N-1, respectively.Because describedin the previoussection, using Eqs. (14)-(20). i= - 1 andi=N+ 1 do notbelong to the"physical" string, Then,the recurrenceparameters of thedamped stiff string Eq. (23) must be usedfor replacingy(- 1,n) and y(N givenin Table I are calculatedonce for all. For n•3, the + 1,n) by expressionsinvolving only the valuesof the dis- programcomputes the hammerforce F•(n), stringdis- placementsfor i withinthe interval[0,N]. placementy(i,n), andhammer displacement, •/(n), in par- allel. If the conditionin Eq. (21) is met, the forceterm is Ill. STRUCTURE AND PERFORMANCE OF THE removedfrom the recurrencescheme in Eq. (10) before COMPUTER PROGRAM the computationsproceed. At eachtime step,the programcan provide a complete The simulationprogram is written in Turbo-Pascal, setof signals,adding four variables--v(i,n),the stringve- and runson a 80486based Personal Computer DEC sta- locityat eachpoint of the string,FB(n), the forceexerted tion 425 PC677-A3.At a clockspeed of 25 MHz, it takes by the stringon the bridge,vu(n), hammervelocity, and about100 s to obtain1 s of soundat a samplingfrequency art(n) hammeracceleration--to y( i,n), •l( n), andF•( n), of 32 kHz, with the stringdivided into N= 100 spatial which are the three principalvariables in the computa- steps.This valueis a typicalorder of magnitudefor the tions.Examples of waveformsgenerated by the modelfor computingtime, althoughit may vary slightlyfrom one note C4 are shownin Fig. 3. string to the other. A greatadvantage of usinga finitedifference method is The main part of the programholds the modelof the that eachphysical quantity (displacement, velocity, force) stringmotion, described in the previoussection. This part is directlyavailable for all discretepoints at eachtime step. is linked with data files which contain the values of the In this way, it becomesstraightforward to plot the stateof hammerand stringparameters actually used in the simu- the stringat successiveinstants, in order to obtaina viewof lations.Some of the parameterswere measured by the au- the wavepropagation along the string.This featureis il- thors,while otherswere extractedfrom the literature.9'15'17 lustratedin Fig. 4, whichshows the velocityprofile of a C4 The stiffnessparameters K andp of the hammerfelt, and string during the first 4 ms after the blow of the hammer.

1117 J. Acoust.Soc. Am., Vol. 95, No. 2, February1994 A.Chaigne and A. Askenfelt: Simulations ofpiano string 1117 ment of SpeechCommunication and Music Acoustics, Royal Institute of Technology (KTH), Stockholm,with financialsupport from Centre National de la Recherche Scientifique(CNRS). The projectwas further supported by the SwedishNatural ScienceResearch Council (NFR), the Swedish Council for Research in the Humanities and Social Sciences (HSFR), the Bank of Sweden Tercente- FIG. 5. Comparisonof stringvelocities at the bridgeside of the striking nary Foundation, and the Wenner-Gren Center Founda- point (40 mm from the hammer), for a mid range note (C4) played tion. mezzoforte,simulated (dashed) and measured (full line)?6

In particular,the propagatingwave front and its reflection at the bridge can be clearly seen.Similar plots of the wave R. A. Stephen,"Solutions to range-dependentbenchmark problems by propagationon a piano stringhave beenpresented by Su- the finite-difference method," J. Acoust. SOc. Am. 87, 1527-1534 zuki, however, using a string model with lumped (1990). elements? 2A. R. Mitchelland D. F. Grifliths,The Finite Difference Method in A detailedtest of the model by comparisonsbetween Partial DifferentialEquations (Wiley, New York, 1980). 3A. Cbaigne,"On theuse of finitedifferences for musicalsynthesis. simulatedand measuredwaveforms will be the topic of a Applicationto pluckedstringed instruments," J. d'Acoust.5(2), 181- separatestudy. An exampleof the strengthof the modelis 211 (1992). givenin Fig. 5, which comparesstring waveformsfor the 4L. Hillerand P. Ruiz,"Synthesizing musical sounds by solvingthe note C4. It can be seenthat our model reproducesthe waveequation for vibratingobjects," J. Audio Eng. Soc. 19, 462-472 (part I) and 542-551 (part II) (1971). characteristicsof the measuredwaveform convincingly, us- •See,for example,the detailed tutorial on piano acoustics by It. Suzuki ing measuredvalues of stringand hammerparameters. The and I. Nakamura, "Acousticsof pianos,"Appl. Acoust.30, 147-205 small discrepancieswhich can be observedin the actual (1990). timing relationsbetween the pulsesare mostlydue to slight SR.A. Baconand J. M. Bowsher,"A discretemodel of a struckstring," Acustica 41, 21-27 (1978). differencesin observationpoints. X. Boutilion,"Model for pianohammers: Experimental determination and digital simulation,"J. Acoust. Soc. Am. 83, 746-754 (1988). IV. CONCLUSION 8I. Suzuki,"Model analysis of a hammer-stringinteraction," J. Acoust. Soc. Am. 82, 1145-1151 (1987). The numericalmodel presentedin this paperhas in- 9D. Hall,"Piano string excitation. VI: Nonlinearmodeling," $. Acoust. terestingfeatures, which allow a simulationof a piano SO½.Am. 92, 95-105 (1992). 1øM.Podlesak and A. Lee,"Dispersion of wavesin pianostrings," I. string very closely to the basic physical relations.The Acoust. $oc. Am. 83, 305-317 (1988). methodis time efficient,and the numericaladvantages and ugee,for example,J. Meyerand A. Melka,"Messung und Darstellung limitationshave been thoroughly investigated and are well des Ausklingverhaltensyon Klavieren," Das Musikinstrument32, documented.The first examplesand comparisonswith 1049-1064 (1983). nS. W. Hongand C. W. Lee,"Frequency and time domain analysis of measurementsindicate that the model generateswave- linear systemswith frequencydependent parameters," J. ¾ib. forms and spectrawhich closelyresemble the signalsob- 127(2), 365-378 (1988). servedin real pianos.Although all detailsin the designof "G. Weinreieh,"Coupled piano strings," J. Aeoust.Soc. Am. 62, 1474- the pianostill are not modeledas realistically as desired (in 1484 (1977). 14N. Fletcherand T. Rossing,The Physicsof MusicalInstruments particular the boundaryconditions), we considerthe (Springer-Verlag,New York, 1991). model to be a promisingtool for exploringthe spaceof •SD.Hall andA. Askenfelt,"Piano string excitation. V: Spectrafor real string-hammerparameters and their influenceon piano hammersand strings,"J. Acoust. Soc. Am. 83, 1627-1638 (1988). tone. •6A. Askenfeltand E. Jansson,"From touch to stringvibrations---The initial courseof the piano tone," SpeechTransmission Lab. Quarterly Progressand StatusReport, Dept. of SpeechCommunication and Mu- ACKNOWLEDGMENTS sic Acoustics,Royal Instituteof Technology,Stockholm, STL-QPSR 1, 31-109 (1988). Part of this work was conductedduring Fall 1990, •7A. Askenfeltand E. Jansson,"From touch to stringvibrations. III: whenthe firstauthor was a guestresearcher at the Depart- Stringmotion and spectra,"J. Acoust.Soc. Am. 93, 2181-2198 (1993).

1118 d. Acoust.Soc. Am., VoL 95, No. 2, February1994 A. Chaigneand A. Askenfelt:Simulations of pianostring 1118