<<

A Real-Time Synthesis Oriented Tanpura Model

van Walstijn, M., Bridges, J., & Mehes, S. (2016). A Real-Time Synthesis Oriented Tanpura Model. In Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16) (pp. 175-182). (International Conference on Digital Audio Effects ). http://dafx16.vutbr.cz/dafxpapers/25-DAFx-16_paper_08- PN.pdf Published in: Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16)

Document Version: Publisher's PDF, also known as Version of record

Queen's University Belfast - Research Portal: Link to publication record in Queen's University Belfast Research Portal

Publisher rights © 2016 The Authors

General rights Copyright for the publications made accessible via the Queen's University Belfast Research Portal is retained by the author(s) and / or other copyright owners and it is a condition of accessing these publications that users recognise and abide by the legal requirements associated with these rights.

Take down policy The Research Portal is Queen's institutional repository that provides access to Queen's research output. Every effort has been made to ensure that content in the Research Portal does not infringe any person's rights, or applicable UK laws. If you discover content in the Research Portal that you believe breaches copyright or violates any law, please contact [email protected].

Download date:25. Sep. 2021 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

A REAL-TIME SYNTHESIS ORIENTED TANPURA MODEL

Maarten van Walstijn, Jamie Bridges, and Sandor Mehes Sonic Arts Research Centre School of Electronics, Electrical Engineering, and Computer Science Queen’s University Belfast, UK {m.vanwalstijn,jbridges05,smehes01}@qub.ac.uk

cotton ABSTRACT thread finger Physics-based synthesis of tanpura drones requires accurate sim- tuning nut ulation of stiff, lossy string vibrations while incorporating sus- bead tained contact with the bridge and a cotton thread. Several chal- lenges arise from this when seeking efficient and stable algorithms 0 xc xb → x xe L for real-time sound synthesis. The approach proposed here to address these combines modal expansion of the string dynamics Figure 1: Schematic depiction of the tanpura string geometry (with with strategic simplifications regarding the string-bridge and string- altered proportions for clarity). The string termination points of the thread contact, resulting in an efficient and provably stable time- model are indicated with the vertical dashed lines. stepping scheme with exact modal parameters. Attention is given also to the physical characterisation of the system, including string damping behaviour, body radiation characteristics, and determi- the reliance on iterative solvers and from the high sample rates nation of appropriate contact parameters. Simulation results are needed to alleviate numerical dispersion. presented exemplifying the key features of the model. This paper aims to formulate a leaner discrete-time tanpura string model requiring significantly reduced computational effort, but retaining much of the key sonic features of the instrument. 1. INTRODUCTION Two aspects that distinguish this challenge somewhat from other cases of string-barrier interaction are (a) the sustained nature of Among mechanically-induced sound effects naturally afforded by the impactive interaction (with a high potential for audible high- musical instruments, the generation of in tanpura drone frequency artefacts, including aliasing) and (b) the sensitivity of playing is one of the more spectacular and intriguing examples. In the jvari to some of the system parameters and to discretisation er- Indian musical tradition, the phenomenon is known as jvari (mean- rors. The key features of the proposed model, presented in Section ing ‘life-giving’), and arises from the impactive interaction of the 2, can be summarised as follows: vibrating string with a hard-surfaced bridge. The player fine-tunes the effect by carefully positioning a thin thread between the bridge the spatially distributed string-bridge collision forces are sup- and the string (see Fig. 1). • pressed to a single variable, which - in conjunction with neglect- As a vibrational phenomenon, the jvari effect has attracted ing contact damping and using a unity exponent in the contact scientific interest for almost a century, starting with the musical law - allows updating the numerical system without the use of acoustics poineering work by Raman [1]. Several ways of analy- an iterative solver; sing and modelling the vibrations of the tanpura and other ‘flat- the thread interaction, which effects a ‘softer’ string termina- bridge’ instruments such as the , , and biwa have been • proposed since, with the aims ranging from theoretical understand- tion, is explicitly modelled as a local spring-damper connection; ing (usually relying on simplifying assumptions regarding the na- a modal expansion approach is utilised, which allows formulat- ture of the interaction [2, 3, 4]) to more practical discrete-time sim- • ing a numerical model with exact modal frequencies and damp- ulation [5, 6] including several synthesis oriented studies [7, 8]. ing; The problem also naturally bears some resemblance to various other cases involving collisions, including string-fingerboard con- discretisation is performed on a first-order partial derivative form • tact in the guitar [9, 10], [11], and bass guitar [12, 13, 14]. of the modal differential equations, which facilitates the use of a Despite these advances, efficient and realistic synthesis of the two-point discrete gradient for discretisation of the bridge con- sound of flat-bridge string instruments appears to have remained a tact force; somewhat elusive goal. One of the original difficulties, namely that numerical stability is independent of the system parameters and of potential instability when incorporating collision forces, has re- • the temporal step; the only numerical constraint is that the mode cently been addressed more widely within a finite-difference con- series is truncated at Nyquist in order to avoid mode aliasing. text, by construction of time-stepping schemes that respect the en- ergy balance inherent to the underlying continuous-domain model For realistic synthesis of tanpura drones, one also needs to de- [15, 16, 17, 18]. Tanpura models based on such energy meth- termine appropriate system parameters, including those related to ods can reproduce the jvari effect by simulating distributed string- string damping, bridge and thread contact, and sound radiation; bridge collisions [17, 19, 20]. However the algorithms that im- this is discussed in Section 3. Exemplifying simulation results are plement these tanpura models are not particularly suited to sound then presented and discussed in Section 4, followed by concluding synthesis because of the high computational burden resulting from remarks and perspectives in Section 5.

DAFX-175 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

40 6 2. TANPURA STRING MODEL m]

µ 1 20 string bridge 5 2.1. Model Equations 0 force 0 4 The transversal displacement of the string depicted in Fig. -20 y(x, t) -1 axial position [mm] displacement [

1, with the spatial domain defined as x [0,L] and t denoting -40 force density [kN/m] 3 time, may be described by: ∈ 2 4 6 8 10 0 5 10 axial position [mm] time [ms] ∂2y ∂2y ∂4y ∂y Figure 2: Left: string motion snapshot obtained with a model sim- ρA = T EI γ(β) ∂t2 ∂x2 − ∂x4 − ∂t ulating distributed bridge contact [28]. The profile of the orange + c(x, t) + b(x, t) + e(x, t), (1) surface indicates force density, and the dash-dot line indicates the F F F corresponding instantaneous central contact point. Right: Varia- in which ρ, A, T , E, and I are mass density, cross-sectional area, tion of the central contact point over the first 12ms. The flat dashed tension, Young’s modulus, and moment of inertia, respectively. lines indicates periods of no contact. Assuming simply supported ends, the boundary conditions are ∂2y where both height constants h and h are normally zero to en- y(x, t) = 0, = 0. (2) c b x=0,L ∂x2 x=0,L sure grazing contact at equilibrium. From the second equation it is straightforward to derive that Frequency-dependent string damping is incorporated by defining ∂Vb the parameter γ(β) in (1) as: Fb(t) = . (10) − ∂yb h 2 i γ(β) = 2ρA σ0 + σ1 + σ3β β , (3) The forces exerted by the string at the left-end termination (‘o’) | | and the nut end (‘n’) are where β is the wave number and σ0,1,3 are fit parameters. The ∂y ∂3y interactions with the cotton thread, the bridge and a plucking fin- Fo(t) = T EI , (11) ∂x x=0 − ∂x3 x=0 ger are modelled using the force densities c(x, t), b(x, t) and F F ∂y ∂3y e(x, t), respectively. These are defined here in a simplified form F (t) = T + EI . (12) n 3 byF pre-determining their spatial distributions, hence modelling each − ∂x x=L ∂x x=L as (z = c, b, e): Since Fo(t) is generally much smaller than Fc(t) and Fb(t), the total force exerted by the string on the bridge can be calculated as z(x, t) = ψz(x)Fz(t), (4) F Fd(t) = Fc(t) Fb(t). (13) − − where ψz(x) are spatial distribution functions of the form Approximations to the emitted sound can be found by filtering Fd(t) and Fn(t), where the filters have transfer functions that ap- ( π h π i 2w cos w (x xz) : x Dz proximate measured body radiation responses (see Section 3.3). ψz(x) = z z − ∈ (5) 0 : otherwise The plucking force is specified here in highly simplified form: in which D = [x 1 w , x 1 w ] denotes a spatial domain of z z 2 z z 2 z  a sin2 [(π/τ ) h (t t )] : t width w and centre− position −x . Equation (5) is a good approx- F (t) = e e e e e , (14) z z e 0− : otherwise∈ T imation to the force profile typically observed in the initial vibra- tions as computed with distrubuted contact models (see the left where e = [te, te + τe] and with T   plot of Fig. 2). In addition this form provides a convenient way of 1 τe sinh(βet/τe) 1 he(t) = t + . (15) exciting mainly the first mode of the string (by setting xe = L, 2 2 sinh(βe) w = L). The impactive contact with the bridge is modelled here e As seen in Fig. 3, the parameter β > 0 controls the attack and using a lossless contact law with unity exponent and elasticity con- e release slopes of the plucking function, which allows mimicking stant k : b the gentle style in which tanpura strings are generally plucked. Fb(t) = kb hb yb(t) , (6) b − c The other control parameters are the amplitude ae and the over- in which y denotes u(y) y, where u(y) is the unit step function. all pluck signal timespan τ . More sophisticated plucking models b c · e Given that the string never detaches from the cotton thread, this have been proposed (see, e.g. [9]) but may not be needed given interaction can be modelled as a simple spring-damper connection that the characteristics of the tanpura sound are heavily dominated by the nonlinearity of the string-bridge interaction, with relatively ∂yc Fc(t) = kc [hc yc(t)] rc , (7) little dependence on the intricacies of the finger-string interaction. − − ∂t where rc is a damping parameter. The term yz(t) (z = b, c) in 1 equations (6) and (7) represents a spatially averaged value of the β = 3 e

string displacement at xz: e β = 5 e a / 0.5 e β = 10 Z xz +wz /2 f e β = 30 yz(t) = ψz(x) y(x, t)dx. (8) e xz −wz /2 0 0 0.2 0.4 0.6 0.8 1 The contact potential energies are (t - t )/τ e e kc 2 kb 2 Vc(yc) = [hc yc] ,Vb(yb) = hb yb , (9) 2 − 2 b − c Figure 3: Normalised plucking force signal for four values of βe.

DAFX-176 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

2.2. Modal Expansion The mid-point-in-time discretisation of equations (23) and (24) can then be written as The solution of (1) can be expressed as a superposition of the nor- n+1 n+1 mal modes of the string (indexed with i): δy¯ 2 µp¯ 2 i = i , (27) M X ∆t 2m (16) n+1 n+1 n+1 y(x, t) = vi(x)y ¯i(t), 2 2 2 1 δp¯i µy¯i δy¯i X n+2 i=1 = ki ri + gz,iFz , (28) ∆t − 2 − ∆t where y¯i(t) denotes the mode displacement and vi(x) = sin(βix) z=c,b,e is the corresponding mode shape (spatial eigenfunction) for the which is equivalent to applying the trapezoidal rule. The exter- boundary conditions given in (2), with βi = iπ/L. After substi- 1 1 n+2 nal force is calculated as µFe , and the cotton thread force is tution of (16) into (1), then multiplying with vi(x) and applying 2 a spatial integral over the length of the string, one obtains that the obtained by discretising (7): dynamics of each of the modes is governed by: n+1 1  1  2 n+ n+ δyc 2 2 1 2 (29) ∂ y¯i ∂y¯i X Fc = kc hc 2 µyc rc . m = kiy¯i(t) ri + F¯z,i(t), (17) − − ∆t ∂t2 − − ∂t z=c,b,e Special care has to be taken regarding stability in discretising the 1 bridge contact force, due to its non-analytic form [15, 16]. A suit- in which m = 2 ρAL is the modal mass (which is the same for all 1 4 2 1 able numerical term is obtained by discretising (10), which yields modes), and where ki = 2 L EIβi + T βi and ri = 2 Lγ(βi) are the elastic and damping constants of the mode, respectively. the two-point discrete gradient: Within the constraint ri < 2√kim, the modal frequencies are n+1 1 2 n+1 n p 2 n+2 δVb Vb(yb ) Vb(yb ) ωi = ki/m αi , where (in accordance with (3)) F = = . (30) b 1 n+1 − n − − n+2 − 3 δy yb yb αi = ri/(2m) = σ0 + σ1βi + σ3βi (18) b − n n are the modal decay rates. The force terms in (17) are Using the scaled momentum value q¯i = (∆t/(2m))¯pi , the sys- Z L tem equations (27,28) can be written more conveniently as F¯z,i(t) = vi(x)ψz(x)Fz(t)dx = gz,iFz(t), (19) 1 1 n+2 n+2 0 δy¯i = µq¯i , (31) 1 1 1 1 1 where : n+2 n+2 n+2 X n+2 π2 sin(β x ) cos(β w /2) δq¯i = aiµy¯i biδy¯i + ξ gz,iFz , (32) i z i z (20) − − gz,i = 2 2 2 . z=c,b,e π βi wz − 2 1 2 −1 1 −1 In modal form, the spatially averaged string displacement at x = where ξ = ∆t /(2m), ai = 4 ki∆t m , and bi = 2 ri∆tm . 1 xz (z = c, b) is n+2 Once the force terms Fz are known, the dynamics of each mode n+1 n+1 Z xz +wz /2 M M X X can be simulated by solving for y¯i and q¯i at each time step. yz(t) = ψz(x) vi(x)¯yi(t)dx = gz,iy¯i(t), However, unless a very small temporal step is used, this procedure xz −wz /2 i=1 i=1 would lead to severe numerical dispersion. Therefore the coeffi- (21) cients in (31,32) are replaced by the values (a∗, b∗) below, which and the nut force can be expanded as i i ensures that the modes have exact modal frequencies and damping: M h i 2 X 0 000 2 2 1 R  Fn(t) = T vi(L) + EIvi (L) y¯i(t), (22) ∗ 1 2RiΩi + Ri ∗ i − ai = − 2 , bi = − 2 , (33) i=1 1 + 2RiΩi + Ri 1 + 2RiΩi + Ri where v0(x) and v000(x) denote the first and third spatial derivative i i where Ri = exp( αi∆t) and Ωi = cos(ωi∆t). This is readily of vi(x), respectively. verified by testing the− (31,32) without the force terms for the ansatz n n 2.3. Discretisation in Time y¯i = exp(sdn∆t), q¯i = C exp(sdn∆t), (34) where is the complex resonance frequency of the We may re-formulate (17) in first-order form as follows: sd = jωd αd discretised mode,− with j=√ 1, and C is a complex constant. This ∂y¯i p¯i − = , (23) leads to a characteristic equation in zd = exp(sd∆t): ∂t m  1 a   1 + a b  ∂p¯i ∂y¯i X z2 2 i z + i i = 0. (35) = kiy¯i ri + gz,iFz(t), (24) d − d − ∂t − − ∂t − 1 + ai + bi 1 + ai + bi z=c,b,e After substituting (33) this becomes in which p¯i represents the modal momentum. Gridding time by n −1 2 2 denoting y y(n∆t), where ∆t = fs is the temporal step, zd 2Ri cos(ωi∆t)zd + Ri = 0, (36) we introduce≡ the difference and sum operators − which has the solution zd = Ri exp(ωi∆), from which it follows 1 1 ∂y n n+2 n 2 that s = jω α , i.e. the discrete system has exact modal fre- δy = y y − ∆t , (25) d i i − ≈ ∂t t=n∆t quency and damping.− The above coefficient replacement can be n n 1 n 1 +2 2 thought of in terms of the following adapted elasticity and damp- µy = y + y − 2 y . (26) ≈ t=n∆t ing values: 1 ∗ ∗ Note that care has to be taken in evaluating (20) for βi = wz/π, using π ∗ 4mai ∗ 2mbi lim g = sin(β x ). ki ki = , ri ri = . (37) βi→wz /π z,i 4 i z → ∆t2 → ∆t

DAFX-177 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

An accompanying restriction - necessary to avoid aliased modes - n yes u ∆y ? sb = u is that none of mode frequencies exceeds the Nyquist frequency, ≤− − yes 2ϕ∆yn u u2 4ϕ∆yn(u+∆yn) i.e. , which defines the largest possible truncation of no s = ωi < π/∆t b − − 2(1− + ϕ) the modal series expansion in (16). A seemingly simpler way to ∆yn 0? p yes 2ϕ∆yn u ≤ s = avoid numerical dispersion is to discretize (17) using the impulse no b 1+ ϕ− invariant transform and defining (30) in three-point form. However n no 1 1 2 n 2 u ∆y (ϕ 1)? sb = u + u + 4ϕ(∆y ) the resulting model would not be provably stable due to mode de- ≥ − − 2 2 pendency of the modal force coefficients, which precludes defining p an energy balance with non-negative energy. Figure 4: Analytic solution of equation (48), where ϕ = θkb/2 n n and ∆y = hb y . − b 2.4. A Vector-Matrix Update Form If we stack the variables in column vector form, for M modes we where may write the system equations as n kc (hc yc ) φcuc φcθbc vc = − − , βc = . (47) n+1 n+1 δy¯ 2 = µq¯ 2 , (38) 1 + φcθcc 1 + φcθcc

1 1 1 1 Now substituting this into (43) and evaluating the bridge force term n+ n+ n+ X n+2 δq¯ 2 = Aµy¯ 2 Bδy¯ 2 + ξ gzFz , (39) − − with (30) one obtains the nonlinear scalar equation z=c,b,e n n Vb(sb + yb ) Vb(yb ) where A and B are diagonal matrices with diagonal entries Aii = sb + u + θ − = 0, (48) ∗ ∗ sb ai and Bii = bi , and where column vectors gz hold the values defined with (20). A convenient vector update is then found by where θ = θbb βcθbc and u = ub θbcvc. This equation is − − − n+1 n+1 analytically solvable according to four distinct cases [18] as shown using (38) to define ¯s = δy¯ 2 = µq¯ 2 , and substituting in Fig. 4. Once sb is known the bridge force can be calculated y¯n+1 = ¯s + y¯n, q¯n+1 = ¯s q¯n, (40) accordingly and the thread force is updated with (46). − in (39), which allows solving for ¯s with 2.6. Numerical Energy Balance and Stability n+1 n+1 s u e 2 e 2 ¯ = ¯ + bFb + cFc , (41) The energy of the numerical model can be calculated for any time −1 −1 instant n by summing up the mode energies and adding the poten- where eb = ξJ gb and ec = ξJ gc, with J = I + A + B, and where tials of the bridge and thread interaction: 1 −1h n n n+2 i u¯ = J 2 (q¯ Ay¯ ) + ξgeFe . (42) M  ∗  − n X 1 n 2 ki n 2 n n H = (¯pi ) + (¯yi ) + Vc(yc ) + Vb(yb ) n+1 n+1 2m 2 2 2 i=1 Hence once the contact forces Fb and Fc are known, eq. n+1 n T n n T n (41) immediately yields the step ¯s, after which both y¯ and (q¯ ) q¯ + (y¯ ) Ay¯ kc n 2 kb n 2 n+1 = + [hc y ] + hb y . q¯ can be updated using (40). A further update comprises eval- ξ 2 − c 2 b − b c 1 n+2 uating the nut force Fn with the vector form of (22). Note that (49) since the matrices J and A are diagonal, the matrix operations in n+1 T (42) can be implemented very efficiently via componentwise mul- Multiplying the left-hand side of (39) with (µq¯ 2 ) and the right- n+1 T tiplication/division. hand side with (δy¯ 2 ) yields, after a few further algebraic ma- nipulations, the energy balance

2.5. Solving for the Contact Forces n+1 δH 2 1 1 n+2 n+2 1 1 = P Q , (50) n+2 n+2 ∆t − In order to solve for the forces Fb and Fc , (41) is pre- multiplied with gT, which (also using s = yn+1 yn) yields where b b b b 1 1 n+1 − n+2 1 −1 T n+2 2 the scalar equation P = 2 ∆t ge δy¯ µFe (51) 1 1 is the input power and n+2 n+2 sb = ub + θbbF + θbcFc , (43) b 1 1 n+ T n+  1 2 n+1 (δy¯ 2 ) Bδy¯ 2  rc  n+ T T T 2 2 (52) where ub = gbu¯, θbb = gbeb and θbc = gbec. Similarly, one Q = + 2 δyc T ξ∆t ∆t can pre-multiply (41) with gc , giving

1 1 is the dissipated power. From inspecting (33), it follows that the n+2 n+2 sc = uc + θbcFb + θccFc , (44) diagonal matrices A and B can only contain real-valued positive T T elements and are thus positive definite. This implies unconditional with uc = gc u¯ and θcc = gc ec. Setting φc = kc/2 + rc/∆t, the n n+1 numerical stability, as both and 2 are consequently guar- numerical thread force in equation (29) can be written in terms of H Q anteed to be non-negative (i.e. the total energy can increase only sc as 1 through external force excitation). It is worthwhile pointing out n+2 n Fc = kc (hc y ) φcsc. (45) − c − that the energy balance in (50) relies not only on the use of the Combining with (44) to eliminate sc then gives discrete gradient in (30), but also on the fact that equations (4) and

1 1 (8) utilise the same spatial distribution function, which ensures that n+2 n+2 Fc = vc βcF , (46) the vector terms gb are eliminated in the calculation process. − b

DAFX-178 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

C C 3. PHYSICAL CHARACTERISATION 60 2 4 bridge 3.1. String Parameters 40 nut

The string parameters L, A, E and ρ are readily available for a 20 given string, and the tension T can be set accordingly such that 0 the correct fundamental frequency results. The moment of inertia 1 4 is calculated directly from the string radius as . The -20 r I = 4 πr magnitude [dB] damping coeffcients σ0,1,3 in (18) can be estimated from a plucked string signal measured with a freely vibrating string (i.e. no bridge -40 contact), for example as in [21]. Given the importance of the role -60 of string damping in the jvari effect, it is worthwhile noting that 101 102 103 104 these coefficients can be expressed directly in terms of the phys- frequency [Hz] ically motivated fit parameters used by Woodhouse in eq. (8) of [21] for characterising guitar strings: Figure 5: Tanpura body magnitude response measured with an im- pact hammer applied at the bridge (top) and the nut (bottom), and 1 1 1 with a microphone positioned at 80cm from the instrument. For σ0 2 ηA, σ1 2 c ηF , σ3 2 c λ ηB , (53) ≈ ≈ ≈ clarity, the responses have been offset by 50dB. The grey shaded p with c = T/(ρA) and λ = EI/T , and where ηA, ηF , and area indicates the range in which the fundamental frequency of a ηB represent “air”, “friction”, and “bending” damping, respec- tanpura string would normally fall. tively. Woodhouse’s modal decay rate form, which was adapted from [22], generally allows an excellent low-parameter fit to mea- sured string data over a wide frequency range [22, 21]. For this 3.3. Body Radiation Filters reason equation (18) is preferred here over the even-order form Fig. 5 shows the body magnitude responses of a tanpura as ob- P 2j αi = j σj βi often used in sound synthesis. tained with impact hammer experiments. The fundamental fre- quency of a tanpura string will generally fall in the range between Table 1: Physical parameter values used for a C3 string. that of a C2 string (f1 = 65.4Hz) and a C4 string (f1 = 198Hz). string parameters contact parameters As the plot shows, the body radiates less powerfully in this fre- −3 L 1.0 [m] xb 10×10 [m] quency range, to a first approximation acting as a high-pass filter. −4 −3 ρA 4.83 ×10 [kg/m] wb 2.0×10 [m] The black thin solid lines in Fig. 5 indicate the responses of 2048- 8 T 33.1 [N] kb 4.39×10 [N/m] tap FIR filters obtained by truncating the measured body impulse −5 2 −3 EI 6.03 ×10 [Nm ] xc [4.0 - 8.0]×10 [m] responses. Significantly more efficient body filters models can be −1 −3 σ0 0.6 [s ] wc 1.2×10 [m] achieved in IIR form (see, e.g. [24]). −3 5 σ1 6.5 ×10 [m/s] kc 1.2×10 [N/m] σ 5.0 ×10−6 [m3/s] r 1.2 [kg/s] 3 c 4. SIMULATION RESULTS

4.1. Simulation of a C3 String 3.2. Contact Parameters Fig. 6 shows a small selection of string profile snapshots obtained The rationale for using a contact law with unity exponent is based with the simulation of a C3 string, using the parameters listed in on an analogy to contact between two cylinders with parallel axes. Table 1, with xc = 5mm. To exemplify the role of the bridge and the thread, the string was excited using ae = 0.4N, τe = 50ms, From Hertzian contact theory, the force F is proportional to the − depth of indentation d for this case [23]: βe = 30, xe = L/2 and we = L, effectively initialising the string approximately to the first mode shape. As seen in Fig. 6(a) the π F = E∗l d, (54) string motion becomes progressively Helmholz-like, as also found 4 in earlier studies [22, 19]. The zoomed view in Fig. 6(b) shows where l is the contact length, with the contact modulus given as that a small level of string motion is allowed at the thread position. The bridge on the other hand is far less compressive, approximat-  2 2 −1 ing a one-sided constraint. The role of the cotton thread connection ∗ 1 ν1 1 ν2 E = − + − (55) can be summarised as follows: the thread damping provides addi- 2E1 2E2 tional attenuation of the high-frequency standing waves along the for materials with Young’s moduli E1,E2 and Poisson’s ratios string length between the left termination and the bridge, which ν1, ν2. This law is independent of the radii of the two cylinders and in combination with the lower elasticity constant effects a ‘soft’ thus is applicable also to contact between a cylindrical string and termination (somewhat similar to a violin string stopped by a fin- a nearly flat surface. By loosely equating d and ∆y = hb yb an ger rather than the nut). This avoids the harsher sound that would 1 − ∗ estimate of the elastic constant in (6) is found as kb = 4 πE wb, result with a (near) rigid termination. with E∗ evaluated using the values for steel (or bronze when ap- Fig. 7 shows how the displacement at the bridge evolves over plicable) and ivory in eq. (55). The cotton thread contact param- time. The string-bridge compression is extremely small (less than eters are not as easily determined and are empirically set here as 3 10−8m over the whole duration). The plots demonstrate the 8 −6 × kc = wc 10 N/m and rc = kc 10 N/m. The parameters used emergence of a high-frequency wavepacket in the waveforms. Due for a one· metre long male tanpura· string (steel, radius = 0.14mm) to string stiffness this precursive wave arrives back at the bridge when tuned to the note C3 (f1 = 130.81Hz) are listed in Table 1. before the lower frequencies, thus escaping the periodic closing of

DAFX-179 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

(a) (b) (a) 2 20 m] 0.2 µ F 0 d F n 0 0 force [N] -0.2 D D c b -0.4 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 displacement [ displacement [mm] -2 -20 0 0.5 1 0 5 10 15 (b) axial postion [m] axial postion [mm] 10 p 0 d p Figure 6: Snapshots of the profile of a C3 string excited us- n ing the parameters xe = L/2, we = L. The sampling fre- -10 pressure [mPa] quency is 44.1kHz. Left: full string profile. Right: zoomed view 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 of the thread/bridge region; the grey shaded rectangles indicate time [s] the force-active regions of the thread (Dc) and the bridge (Db). For both plots, the time instants are t = 49.0ms (dash-dot blue), Figure 8: Waveforms of the bridge and nut driving force signals t = 52.6ms (dash-dot red), t = 208.4ms (dashed blue), t = 212.0ms (a) and the corresponding radiation pressure signals (b). (dashed red), t = 412.7ms (solid blue), t = 416.3ms (solid red). (a) 50 f = 352.8 kHz 20 20 20 s m]

µ f = 44.1 kHz [ 10 10 10 s b 0 y 0 0 0

74 76 78 210 212 214 346 348 350 -50 magnitude [dB] 20 20 20 m]

µ 0 5 10 15 20

[ 10 10 10 b y 0 0 0 (b) 50 482 484 486 618 620 622 754 756 758 760 f = 352.8 kHz s f = 44.1 kHz 20 20 20 s 0 m] µ

[ 10 10 10 b y 0 0 0

magnitude [dB] -50 890 892 894 896 1026 1028 1030 1032 1164 1166 1168 time [ms] time [ms] time [ms] 0 5 10 15 20 frequency [kHz] Figure 7: Evolution of the displacement (yb) at the bridge. Figure 9: Spectral envelopes of the bridge radiation pressure signal (a) and the nut radiation signal (b), for different sampling frequen- the gap between the string and the bridge [3]. Running the simu- cies. In each plot, the magnitude spectrum obtained with eight lation with EI = 0 confirms that the precursor, which is the prin- times oversampling (fs =352.8kHz) is plotted in light grey. cipal oscillatory manifestation of the jvari effect, disappears in the absence of string stiffness. As can be gleaned from the plots, the spectral centroid of the precursor gradually diminishes over time, 4.2. Convergence which is due to the string damping being frequency-dependent. The rate at which the centroid descends also depends on the dis- In a sound synthesis context, it is natural to use a standard audio tance between the bridge and the thread [3]; this is one of the sonic rate. However mainly due to the nonlinear phenomena, the model features that tanpura players control when, in preparation of a per- will not give exactly the same result as for higher sampling fre- formance, they adjust the thread position in search of a desired quencies, even when the number of modes is kept the same. Fig. 9 jvari. shows the magnitude spectra (light grey line) of the radiation sig- Fig. 8(a) shows the global evolution of the driving forces Fd nals pd and pn, as obtained with for a C3 string using eight times and Fn. Comparison with the corresponding pressure signals pd oversampling. In each of the plots the thin black line represents the and pn shown in Fig. 8(b) highlights the difference in terms of corresponding spectral envelope while the thicker, red line indi- the initial attack transient, which is almost completely absent from cates the envelope of the spectrum obtained using fs = 44.1kHz. the radiation signals; this is because they contain much less of For both sampling frequencies, the number of modes was set to the low-frequency excitation components and are dominated by 133, which corresponds to truncating the mode series at 20kHz. the frequencies that make up the precursor. The aural impres- The plots show that while there is little difference between the nut sion is therefore that the sound grows in amplitude over the ini- radiation signals, the 44.1kHz model bridge signal is artificially tial 500ms, which is contrary to our normal experience of plucked strong in amplitude at high frequencies (f > 15kHz). Percep- strings. These results suggest that the high-pass nature of the body tually, the discrepancy is very small but nevertheless noticeable. responses (explained earlier in Section 3.3) is a key ingredient in Informal listening experiments indicated that oversampling by a producing this effect, which is further enhanced by the frequency- factor two (i.e. using fs = 88.2kHz) is sufficient to reduce any dependent sensitivity of human hearing [3]. differences to almost unnoticeable levels.

DAFX-180 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

C G C 3 2 2 4 total equation (44) 3 contact forces

2 runtime [s] 1

0 40 60 80 100 120 140 160 180 number of modes Figure 10: Matlab computation times for one second of simu- lated sound when using a 44.1kHz sampling frequency. The results were obtained using a machine with an i7 CPU 2.93GHz processor and 4GB RAM. Figure 11: Spectrogram of a four-string tanpura bridge driving force signal. The strings were excited at te = 0, 1.2, 1.8, and 2.4s. 4.3. Algorithmic Efficiency The Matlab runtime for one second of simulation (see Fig. 10) as such opening up possibilities for real-time implementation on is only mildly dependent on the number of modes included and standard processors. The modal approach taken results in spectral does not exceed 2.5 seconds for any practical string (compared accuracy of the behaviour, and also facilitates ef- to 2 minutes with the model in [19], which requires four times ficient implementation due to the diagonality the system matrices. oversampling in order to alleviate numerical dispersion). A signif- Modal expansion is, of course, not a new concept in sound icant speed-up is achievable with an optimised C implementation, synthesis, originating some decades ago as modal synthesis [25]. bringing the proposed model in range for real-time application on It also underpins the more formalised functional transformation standard processors. Note that the filtering of the nut and bridge method [26, 13] and other modular approaches [27]. What is dif- driving signals is not included in the computational operations that ferent in the approach presented here is that collision forces are are time-measured. As is evident from the plot, more than half of incorporated in a provably stable manner, which is of particular the computational effort comprises updating equation (42), while importance in a real-time sound synthesis context. solving for the contact forces takes up an almost negligible frac- The model could also be formulated in finite difference form, tion. for example using a parametric implicit three-point scheme for the string [18] which can be tuned to closely approximate spectral ac- 4.4. Drone Synthesis curacy. However for the relatively simple model proposed here this In order to get a first glimpse of what a virtual-acoustic tanpura approach holds no efficiency advantages, since matrices would be would sound like, four separate string models were tuned to pro- sparse rather than diagonal. In addition, the three-point form of (30) is a less accurate approximation of the bridge contact force. duce a panchamam pattern of G2-C3-C3-C2. The total bridge and nut driving forces are now Among several possible model extensions, either in modal or finite difference form, probably the most important ones are (a) the 4 4 X X simulation of sympathetic vibrations by also modelling the string- Fˆd = (Fc,j + Fb,j ) , Fˆn = Fn,j , (56) − body coupling and (b) the re-introduction of distributed bridge col- j=1 j=1 lisions [28]. Because the latter effects a periodic modulation of the where subscript j indexes the strings. These are filtered as before central contact point between the string and the bridge (see Fig. 2(b)), it would be sensible to consider this in conjunction with ten- with the body radiation filters, with the filter outputs pd and pn assigned to the left and right channel of an audio signal; a sound sion modulation, which is potentially relevant given that tanpura example can be found on the accompanying webpage2 alongside strings are loosely strung. The literature already contains vari- further supporting material. Fig. 11 shows the spectrogram of the ous techniques for incorporating tension modulation into modal schemes [26, 29, 27] and finite difference formulations [30], but total bridge force Fˆd for a single drone cycle. The plot illus- trates the migration of energy from the lower partials to higher the proposed two-point scheme requires a re-formulation. Such ex- frequency components. The precursors are manifested in the time- tensions would pave the way for a rigorous evaluatory comparison frequency representation as formants with descending centre fre- between the proposed model, more complete models, and mea- quencies. Also noticeable is that the precursors generated with the surement data. However they will also increase the complexity and computational load of the model, meaning real-time synthesis C3 and C2 strings together construct a joint, seamless jvari pattern, which adds to the sense of continuity of the drone [3]. may be viable only via hardware acceleration, such as graphical processing units [31] or field programmable arrays [32]. Besides model refinements and extensions, the most pertinent 5. CONCLUDING REMARKS AND PERSPECTIVES advance may be the implementation of a real-time virtual-acoustic The proposed model permits simulation of tanpura drones with tanpura that affords real-time control options. This would allow significantly increased efficiency compared to previous models, fine-tuning of the jvari effect by ear through on-line adjustment of the parameters of the string, thread, and bridge, much in the same 2www.socasites.qub.ac.uk/mvanwalstijn/dafx16a/ way as real-world tanpura players set up their instrument.

DAFX-181 Proceedings of the 19th International Conference on Digital Audio Effects (DAFx-16), Brno, Czech Republic, September 5–9, 2016

6. REFERENCES [17] V. Chatziioannou and M. van Walstijn, “Energy conserv- ing schemes for the simulation of musical instrument contact [1] C. Raman, “On some indian stringed instruments,” in Proc. dynamics,” J. Sound and Vibration, vol. 339, pp. 262–279, of the Indian Assoc. for the Cultivation of Science, 1921, 2015. vol. 7, pp. 29–33. [18] S. Bilbao, “Numerical Modeling of String/Barrier Colli- [2] R. Burridge, J. Kappraff, and C. Morshedi, “The sitar sions,” in Proc. of the Int. Symp. Musical Acoustics (ISMA), string, a vibrating string with a one-sided inelastic con- 2014. straint,” SIAM J. Appl. Mathematics, vol. 42, no. 6, pp. 1231– [19] M. van Walstijn and V. Chatziioannou, “Numerical simula- 1251, 1982. tion of tanpura string vibrations,” in Int. Symp. on Musical [3] C. Valette, C. Cuesta, C. Besnainou, and M. Castellengo, Acoustics (ISMA), 2014. “The tanpura bridge as a precursive wave generator,” Acus- [20] J. Bridges and M. van Walstijn, “Investigation of tan- tica, vol. 74, pp. 201–208, 1991. pura string vibrations using a two-dimensional time-domain [4] C. Vyasarayani, S. Birkett, and J. McPhee, “Modeling the model incorporating coupling and bridge friction,” in Third dynamics of a vibrating string with a finite distributed unilat- Vienna Talk on Music Acoustics, At Vienna, Austria, 2015, eral constraint: Application to the sitar,” J. Acoust. Soc. Am., pp. 126–131. vol. 125, no. 6, pp. 3673–3682, 2009. [21] J. Woodhouse, “Plucked guitar transients: Comparison of [5] T. Taguti, “Dynamics of simple string subject to unilateral measurements and synthesis,” Acta Acustica united with constraint: A model analysis of sawari mechanism,” Acoust. Acustica, vol. 90, no. 5, pp. 945–965, 2004. Sci. Technol., vol. 29, no. 3, pp. 203–214, 2008. [22] C. Valette and C. Cuesta, Mécanique de la corde vibrante, [6] D. Kartofelev, A. Stulov, H. Lehtonen, and V. Välimäki, Hermes, Paris, 1993. “Modeling a vibrating string terminated against a bridge with [23] V. L. Popov, Contact Mechanics and Friction: Physical arbitrary geometry,” in Stockholm Musical Acoustics Conf., Principles and Applications, Springer, Heidelberg, New 2013. York, 2010. [7] A. Krishnaswamy and J. Smith, “Methods for simulating [24] B. Bank, “Direct design of parallel second-order filters string collisions with rigid spatial obstacles,” in Proc. IEEE for instrument body modeling,” in Int. Comp. Music Conf. WASPAA, New York, 2003. (ICMC), 2007, pp. 458–465. [8] S. Siddiq, “A Physical Model of the Nonlinear Sitar String,” [25] J.M. Adrien, “The missing link: Modal synthesis,” in Rep- Archives of Acoustics, vol. 37, no. 1, Jan. 2012. resentations of Musical Signals, Giovanni De Poli, Aldo Pic- [9] G. Evangelista and F. Eckerholm, “Player-instrument in- cialli, and Curtis Roads, Eds., chapter 8, pp. 269–298. MIT teraction models for digital waveguide synthesis of guitar: Press, Cambridge, MA, USA, 1991. Touch and collisions,” IEEE Trans. Audio, Speech and Lang. [26] L. Trautmann and R. Rabenstein, Digital Sound Synthesis Proc., vol. 18, no. 4, pp. 822–832, 2010. by Physical Modelling Using the Functional Transformation [10] S. Bilbao and A. Torin, “Numerical modeling and sound syn- Method, Kluwer Academic / Plenum Publishers, 2003. thesis for articulated string/fretboard interactions,” J. Audio [27] F. Avanzini and R. Marogna, “A modular physically based Eng. Soc., vol. 63, pp. 336–347, 2015. approach to the sound synthesis of membrane percussion in- [11] C. Desvages and S. Bilbao, “Two-polarisation finite differ- struments,” IEEE Trans. Audio, Speech, and Lang. Proc., ence model of bowed strings with nonlinear contact and fric- vol. 18, no. 4, pp. 891–902, 2010. tion forces,” in Proc. of the 17th Int. Conf. on Digital Audio [28] M. van Walstijn and J. Bridges, “Simulation of distributed Effects (DAFX-15), 2015. contact in string instruments: a modal expansion approach,” [12] E. Rank and G. Kubin, “A waveguide model for slapbass in Proc. Europ. Sig. Proc Conf (EUSIPCO2016), Accepted synthesis,” in IEEE Int. Conf. on Acoust., Speech, and Sig. for publication, 2016. Proc., 1997, vol. 1, pp. 443–446. [29] S. Bilbao, “Modal type synthesis techniques for nonlinear [13] L. Trautmann and R. Rabenstein, “Multirate simulations of strings with an energy conservation property,” in Proc. Int. string vibrations including nonlinear -string interactions Conf. Digital Audio Effects (DAFx-04), 2004, pp. 119–124. using the functional transformation method,” Appl. Signal [30] S. Bilbao and J. O. Smith, “Energy-conserving finite dif- Proc., vol. 7, pp. 949–963, 2004. ference schemes for nonlinear strings,” Acta Acustica u/w [14] P. Kramer, J. Abeßer, C. Dittmar, and G. Schuller, “A digital Acustica, vol. 91, no. 2, pp. 299–311, 2005. waveguide model of the electric bass guitar including differ- [31] S. Bilbao, A. Torin, P. Graham, J. Perry, and G. Delap, “Mod- ent playing techniques,” in Proc. Int. Conf. Acoust. Speech ular Physical Modeling Synthesis environments on GPU,” in Sig. Proc., 2012, pp. 353–356. Int. Comp. Music Conf. (ICMC), 2014, pp. 1396–1403. [15] V. Chatziioannou and M. van Walstijn, “An energy conserv- [32] F. Pfeifle and R. Bader, “Real-time finite difference physi- ing finite difference scheme for simulation of collisions,” in cal models of musical instruments on a field programmable Sound and Music Computing (SMAC-SMC 2013), 2013. gate array (FPGA),” in Proc. Int. Conf. Digital Audio Effects [16] S. Bilbao, A. Torin, and V. Chatziioannou, “Numerical mod- (DAFx-12), 2012. eling of collisions in musical instruments,” Acta Acustica united with Acustica, vol. 101, no. 1, pp. 155–173, 2015.

DAFX-182