# A Dispersive Resonator in Real Time on MARS Workstation

Skip other details (including permanent urls, DOI, citation information)This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License. Please contact mpub-help@umich.edu to use this work in a way not covered by the license. :

For more information, read Michigan Publishing's access and usage policy.

Page 146 ï~~A Dispersive Resonator in Real Time on MARS Workstation Andrea Paladin (#), Davide Rocchesso (*) (#)IRIS S.r.l. Parco La Selva 151 - 03018 Paliano (FR) ITALY Fax. (775) 533343 - Tel. (775) 533441 - E-mail: nicola.larosa@eurokom.ie (*) C. S. C. - Centro di Sonologia Computazionale - Universita' di Padova Via S.Francesco 11 - 35121 Padova, ITALY Fax: (49) 8283733 - Tel. (49) 8283757 ABSTRACT When one uses waveguide resonators in physical models for sound synthesis, usually ignores the dispersion simulation. But this is actually very important in stiff strings, bars and non-conical acoustic tubes. In this paper we present a detailed simulation of this phenomenon in a one-dimensional waveguide resonator paying attention to the physical parameters that influence it. In the case of the stiff string we provide a closed formula for the group delay depending on a single parameter which is obtained through the physical properties of the string. With this formula we can design an all-pass filtering section that simulates dispersion with an arbitrary degree of accuracy. The same approach is shown to be useful when simulatig woodwind air columns with exponential or catenoidal shape. On the musical workstation MARS, realized by IRIS, we have implemented an algorithm that simulates in real time this dispersive and dissipative string. This algorithm allows changes in the rigidity coefficent, within a predefined set of values, using a table look-up technique to tune the model. The algorithm parameters, including losses and dispersions, are then configured and linked to MIDI controllers. In this way we have built a virtual instrument that is also usable for live performances. 1. OVERVIEW The digital waveguide modeling technique provides an efficient synthesis structure for musical instruments based on a onedimensional resonator (Smith 1990, 1991). In these models the musical instrument is divided into two basic blocks: an excitator which is a non-linear dynamical system and a resonator which is a linear system made up of digital delay lines and filters (Borin, et al. 1990). In the following we present an implementation of a generalized resonator model that could be used both in connection with a non-linear excitator model (reed, bow, etc.) and with a simple feed-forward excitation [see fig.1], like the one we find in the Karplus-Strong algorithm (Karplus and Strong 1983). In our model dispersion and lossparameters are provided for a real-time control. The physical interpretation of these parameters varies on passing from strings to air columns. excitator resonator i ini out non 1 inear d-- 'IIIelay Idynamical', Â~filters Figure 1. Generic physical model Usually dispersions are neglected or poorly simulated with a first-order all-pass filter (Jaffe and Smith 1983). Instead, from an acoustical point of view, wave dispersion causes a misalignment of sound partials from the harmonic series and this effect can have a great perceptual importance. Therefore it is very important to find algorithms that allow a physically consistent control of the amount of dispersion. The MARS workstation offers the possibility to implement these kind of algorithms based on waveguide modeling (Cavaliere, et al. 1992; Armani et al. 1992; Favreau, et al. 1990) and to experiment different links between the virtual instrument parameters and the gestural controllers (Palmieri and Sapir 1992; Andrenacci, et al. 1992) by MIIDI messages. 146

Page 147 ï~~2. DISPERSIONS IN STIFF STRINGS Let us consider the wave equation of a string with a modulus of elasticity Q and a radius r: 2 = K 2 - 4---"(1) at2 ax2 ix where: is the mass per lenght unity, K is the tension, and k = 2 If the eigenfunction y (t,x) = est+vx is substituted in (1) the solution is conform to the expression (Morse 1936) y (i,x) = y + (t -xIc (o))+y-(t +xIc (o)) where c (o) is the phase velocity and it depends on frequency. The exact expression we found for phase velocity is (Rocchesso 1992): c(wo) = - _k -0)(2) 1+ 1+4 2c(2 co where k0 = K, and ca = - is the wave speed in a non dispersive waveguide. From (2) it can be seen that a waveform disperses while traveling in the stiff medium because of the increasing speed of partials of increasing frequency. If we say to be X the spatial sample and To the time sample, it can be seen that, in discrete-time simulation, the one-sample delay of the digital waveguide z-1 has to be replaced by an element providing a group delay '1 0,() depending on frequency. From (2) it can be obtained the following expression for ' (A): Wt(.) = TiA. (3) 12(1 +r 2?.2( I+rl2?2 -1) Where A, = 27tflF.,mpi is the radian frequency and ri=2 oFs,,mpilco is a parameter depending on the physical properties of the string and proportional to the "stiffness constant" shown in (Morse 1936). This group delay can be approximated with a digital all-pass filter. Filter coefficients can be obtained with one of the all-pass design methods proposed in signal processing literature (Yegnanarayana 1982, Deczky 1972). For the purpose of efficiency, if we don't interact with N spatial samples of the waveguide, we can lump all dispersions of this portion into only one all-pass filter. This filter must be designed to provide a group delay of N times the expression (3). 3. DISPERSIONS IN NON-CONICAL TUBES In Acoustic tubes, dispersions are due to the shape of the air column: cylindrical and conical tubes are not dispersive and they can be simulated with a waveguide structure. On the contrary, acoustic tubes of non-conical shape are dispersive, i.e. phase velocity of pressure wave depends on frequency. The approximate one-parameter wave for this kind of tube is (Morse 1936): 1a S. _=1..1..._(4) S(sax ax coat2 where S is the area of a cross-sectional wave surface (generally not a plane) inside the tube, p is the pressure and co is the sound velocity. For two particular shapes we have found a closed formula, analogous with (3), for group delay in a spatial sample. For an exponential (Eq. 5) and catenoidlal (Eq. 6) tube the expressions are:,t P(A,) - -f---" (5); 4a"(A,) = fi'(6) 'Iii2X2- C~ qr12A2- c~ tanh2 (x/h).. Both (5) and (6) depends on a unharmonicity coefficient r"i = h F, analogous with the stiffness constant in (3) but related to 147

Page 148 ï~~the shape of the air column. In fact, the constant h is a measure of how slowly the horn flares out (Morse 1936): the smaller h is, the greater is the curvature of the profile. 4. REAL-TIME IMPLEMENTATION The resonator model implemented can be considered an extension of Smith's work (Smith 1990) where, starting from the wave-equation and sampling its solution in both time and space, Smith arrives at a signal flowchart where delay elements alternate with attenuation elements. Lumping losses and dispersions in a few filters increase the efficiency of the algorithm; in this way we can obtain the signal flowchart shown in fig.2(a). For simplicity we use a feed-forward excitation in such a way that the algorithm becomes an extension of the Karplus-Strong synthesis structure. TT iRESOTOR sel tab PARAMETERS MIDI CONTROLS sel tab Foot Ctrl. freq, delay Key, Pitch Bender amp Velocity, After Touch at, bw Key, Velocity, Mod. Weels eta Effect Ctrl 0 _ ]Key amp (a) at bw eta (b) Figure 2. Signal flowchart (a) and Model Parameters (b) In the MARS workstation the delay line can be implemented as a circular buffer. The input is written in Tab 2 addressing a dedicated space of the external memory by an oscillator with a fixed frequency incr. The output is read interpolating (Cavaliere, et al. 1992) two adjacent memory locations addressed by adding a delay and a correction to the writing phase. The correction is necessary because the all-pass filters introduce a further delay. The interpolation allows a delay which is not an integer multiple of the sampling period. The initial waveform of the sound, stored in a look-up table Tab 1,:is read by an oscillator with a frequency freq equal to the reciprocal of the delay line length. This waveform is then scaled by an envelope env. In this waywe can control the harmonic content and the excitation shape for the note played. For example, by storing white noise in Tab 1 and using a short rectangular envelope, one obtains a plucked metallic excitation. In our implementation the low -pass filter is a simple three tap FIR (Finite Impulse Response) filter with linear phase response. We provide two parameters (at,bw) for controlling attenuation and bandwidth. These two parameters are the gain at zero frequency, which determines the decay time, and the gain at half the sampling rate, which determines the spectral evolution. All-pass filters are used to simulate dispersion in wave propagation due io the stiffness, in the case of strings and bars, or due to the bore shape in the case of wind instruments. To simulate the dispersion in a variable-length string, we found that it is sufficient to provide a suitable number of equal all-pass filters, each of them approximating dispersion in a few tens of spatial samples. All-pass filters have been implemented using the normalized ladder structure because of its good behaviour in fixed-point arithmetic. The reflection coefficients are related, through pre-computed tables, with the stiffness parameter i1 (eta). The same parameter also influences the correction value coming from the block corr (see next paragraph). In MARS workstation we can configure all the algorithm input variables (entry arrows in Fig.l(a)) developing a sound object called tone (Palmieri and Sapir 1992; Andrenacci, et al. 1992). Tone parameters are initialized at the beginning of a note and are continuously updated during the. life-time of the note, according to a conversion formula. This formula dynamically links gestural events to physical parameters. In fig.2(b) dependences between parameters and MIDI controls are indicated. 148

Page 149 ï~~5. TUNING The architecture of the X20 DSP (Cavaliere 1992) of the MARS workstation allows an easy implementation of the firstorder interpolating delay line. Therefore we have tuned our instrument using a linear-interpolation instead of an all-pass filter. Slight differences occur in the frequency response of the feedback loop playing different pitches but we can compensate for these differences with a proper configuration of the parameters. The true difficulty for a good tuning is due to the dispersion all-pass filters: we have to correct the delay line length according both to the stiffness r1 and the fundamental frequency of the note. The problem is solved by storing in an external table the amount of the phase delay introduced by the all-pass filters corresponding to 13 different values of stiffness for each of the 128 MIDI keys. In fig.2 the block corr corresponds to this table entry for the chosen value of i" and key. The computing of these values of phase delay is done by starting from the reflection coefficient of the lattice/ladder all-pass filters. The following recursion formula can be found: 1f -kisin[(8, +1) X] 1s - sin[(, + 1) X] (7 11 + k, cos[(6, + 1) X]- [a ki+ cos[(8, + 1) X] Where ki is the i-th reflection coefficient and 0()) = 8N+1 (X) is the phase delay introduced by the N-th order all-pass filter. 6. CONCLUSION The digital waveguide modeling technique was applied to implement a one-dimensional resonator with dispersions and losses connectable to different excitator models. The dispersions were simulated for both strings and air-columns. We have implemented a real-time, controlled model of a stiff string on the MARS workstation. We can dynamically vary all the parameters of this model, including damping and stiffness, without detuning the instrument. The acoustical results obtained are encouraging because we can perceive realistic changes in string stiffness. This work is our first attempt at building a generalized musical instrument based on a one-dimensional resonator with a small set of parameters having an intuitive action on the produced sound. We will move in this direction with further studies that couple this resonator with different physical and non-physical excitators and we will combine the developed resonator algorithm with other classical synthesis techniques. REFERENCES P. Andrenacci, E. Favreau, N. Larosa, A. Prestigiacomo, C. Rosati, S. Sapir, "MARS: RT2OM/EDIT20 - Development tools and graphical user interface for the sound generation board ", ICMC 1992 Proceedings. F. Armani, L. Bizzari, E. Favreau, A. Paladin, "MARS - DSP environment and applications", ICMC 1992 Proceedings. G. Bonn, G. De Poli, G. Sarti "Excitator-Resonator Interaction and Sound Synthesis", Proc. Colloquium on Physical Modelling. Grenoble 1990. S. Cavaliere, G. Di Giugno, E. Guarino, "MARS. X20 architecture and SMJO00 sound generation board description", ICMC 1992 Proceedings. A.G.Deczky "Synthesis of Recursive Digital Filters Using the Minimum p-error Criterion", IEEE Trans. on Audio and Electoacoustics, vol. AU-20, n.4, October 1972. E. Favreau, A. Prestigiacomo, "ASM20 User's Guide", IRIS internal comunication, 1990. D.A. Jaffe, J.O. Smith "Extension of the Karplus-Strong Plucked-String Algorithm", Computer Music Journal, vol.7, n. 2, pp. 56-69, Summer 1983. " K. Karplus, A. Strong "Digital Synthesis of Plucked String and Drum Timbres", Computer Music Journal, vol.7, n. 2, pp. 43-55, Summer 1983. P.M. Morse "Vibration and sound", Amer. Inst. of Physics 1976 (1st edit. 1936) Â~ G. Palmieri, S. Sapir, "MARS - Musical applications" ICMC 1992 Proceedings. * D. Rocchesso "Realizzazione di Risuonatori Dispersivi in Tempo Reale", Tesi di Laurea in Ingegneria Elettronica, Univ. di Padova, 1992. * J.O. Smith "Efficient yet Accurate Models for String and Air Columns Using Sparse Lumping of Distribuited Losses and Dispersions", Proc. Colloquium on Physical Modelling. Grenoble 1990. * J.O. Smith "Wave guide Simulation of Non-Cylindrical Acoustic Tube", Proc. International Computer Music Conference 1991. * B. Yegnanarayana "Design of Recursive Group-Delay Filters by Autoregressive Modeling", IEEE Trans. on Acoust. Speech and Signal Proc., vol. ASSP-30, pp. 632-637, August 1982. 149