# 12.3.1 Simulating a tanpura or bray harp

Following the approach of Valette and Cuesta [1], the simplest model for the buzzing bridge of a tanpura or a bray harp is sketched in Fig. 1. A string has fixed ends at $x=0$ and $x=L_1$, and can execute small transverse vibration with displacement $w(x,t)$. At $x=L_2$ there is a rigid stop which might be in line with the string’s equilibrium position or might be offset by a small distance $y_1$. During contact the short piece of string between $L_2$ and $L_1$ is assumed to be in its static equilibrium position, because any residual vibration there will be rapidly damped out: in the case of the tanpura, by contact with the cotton jivari thread. In Fig. 1, the solid line shows a typical string displacement when out of contact, while the dashed line shows an in-contact case. Note that for clarity this figure shows a rather large distance between the stop and the end of the string, but in real instruments that distance is very short.

When the string is not in contact with the stop, we can express the displacement as a modal sum in the form

$$w_1(x,t)=\sum_n{\sin \dfrac{n \pi x}{L_1} (a_n \cos \omega_n t + b_n \sin \omega_n t)} \tag{1}$$

whereas when it is in contact we can write

$$w_2(x,t)=\sum_n{\sin \dfrac{n \pi x}{L_2} (c_n \cos \Omega_n t + d_n \sin \Omega_n t)} \tag{2}$$

where in the second case the expression only applies for $0 \le x \le L_2$. The natural frequencies of the full string, without the stop, are $\omega_n$, while those the string would have if it was permanently fixed at the stop are $\Omega_n$. Suitable expressions for these frequencies were derived from section 5.4.3, incorporating the inharmonicity effect of bending stiffness in the string. For simplicity, damping has been omitted from equations (1) and (2): it does not play a significant role in the process of switch-over when contact is made or lost, which we will deal with next. However, allowance for small damping will be incorporated in the final simulation model.

At a moment when contact with the stop is made or lost, we need to relate the two expressions (1) and (2) by requiring that the displacement and velocity of the string for $0 \le x \le L_2$ are the same whether calculated from $w_1$ or $w_2$. The two requirements are

$$\sum_n{\sin \dfrac{n \pi x}{L_1} (a_n \cos \omega_n t + b_n \sin \omega_n t)}$$

$$\mathrm{~~~~~~~~~~~~~~}=\sum_n{\sin \dfrac{n \pi x}{L_2} (c_n \cos \Omega_n t + d_n \sin \Omega_n t)} \tag{3}$$

and

$$\sum_n{\sin \dfrac{n \pi x}{L_1} \omega_n (b_n \cos \omega_n t \mathrm{~} – \mathrm{~} a_n \sin \omega_n t)}$$

$$\mathrm{~~~~~~~~~~~~~~} =\sum_n{\sin \dfrac{n \pi x}{L_2} \Omega_n (d_n \cos \Omega_n t \mathrm{~} – \mathrm{~} c_n \sin \Omega_n t)} . \tag{4}$$

Since we have used sinusoidal shapes in both expressions, this amounts to calculating the Fourier series decomposition of $w_1$ and $\dot{w}_1$ in terms of the sine functions used to express $w_2$. The method was explained in section 2.2.1: we need to multiply both equations through by $\sin m \pi x/L_2$, integrate over the range of $x$ from $0$ to $L_2$, and take advantage of the orthogonality of the sine functions.

For equation (3), the result is

$$c_m \cos \Omega_m t + d_m \sin \Omega_m t \mathrm{~~~~~~~~~~~~~~}$$

$$\mathrm{~~~~~~~~~~~~~~} = \dfrac{2}{L_2}\sum_n{I_{mn} (a_n \cos \omega_n t + b_n \sin \omega_n t)} \tag{5}$$

where

$$I_{mn}=\int_0^{L_2}{ \sin \dfrac{n \pi x}{L_1} \sin \dfrac{m \pi x}{L_2} dx} . \tag{6}$$

The corresponding result from equation (4) is

$$d_m \cos \Omega_m t \mathrm{~} – \mathrm{~} c_m \sin \Omega_m t \mathrm{~~~~~~~~~~~~~~~~~~~~~~}$$

$$\mathrm{~~~~~~~~~~~~~~} = \dfrac{2}{L_2 \Omega_m}\sum_n{I_{mn} \omega_n (b_n \cos \omega_n t \mathrm{~} – \mathrm{~} a_n \sin \omega_n t)} . \tag{7}$$

The integral $I_{mn}$ can be evaluated straightforwardly, making use of the trigonometric identity

$$\sin A \sin B = \dfrac{1}{2} [\cos(A-B) – \cos(A+B)] , \tag{8}$$

to give

$$I_{mn} = \dfrac{L_1 L_2}{2 \pi}\left[ \dfrac{\sin \frac{\pi(n L_2 – m L_1)}{L_1}}{n L_2 \mathrm{~} – \mathrm{~}m L_1} – \dfrac{\sin \frac{\pi(n L_2 + m L_1)}{L_1}}{n L_2 +m L_1}\right] . \tag{9}$$

We can write these results in a compact form by defining vectors $\underline{A}$, $\underline{B}$, $\underline{C}$ and $\underline{D}$ with components given by

$$A_n=a_n \cos \omega_n t+b_n \sin \omega_n t \tag{10}$$

$$B_n=\omega_n(b_n \cos \omega_n t-a_n \sin \omega_n t) \tag{11}$$

$$C_n=c_n \cos \Omega_n t+d_n \sin \Omega_n t \tag{12}$$

$$D_n=\Omega_n(d_n \cos \Omega_n t-c_n \sin \Omega_n t) \tag{13}$$

and writing $I$ for the matrix with components $I_{mn}$: then equations (5) and (7) become

$$\underline{C} = \dfrac{2}{L_2} I \mathrm{~} \underline{A} \tag{14}$$

and

$$\underline{D} = \dfrac{2}{L_2} I \mathrm{~} \underline{B} . \tag{15}$$

Now we can describe the sequence of the simulation. Suppose we begin with an excitation of the string which is upwards, away from the stop. That means that the initial motion is out of contact, and our initial conditions define the coefficients $a_n$ and $b_n$. We then proceed by evaluating equation (1) at each time step (and at this stage we can insert the exponential factors necessary to describe the damping of each string mode). If $w_1(L_2,t)$ is still such that the string lies above the stop, we are still out of contact and we proceed to the next time step.

But when $w_1(L_2,t)$ lies below the position of the stop, contact has been made. We need to transfer attention to equation (2), so we need to know the values of $c_n$ and $d_n$. From the known values of $a_n$ and $b_n$, we calculate $C_n$ and $D_n$ from equations (14) and (15), then invert equations (12) and (13) to give

$$c_n=C_n \cos \Omega_n t-\dfrac{D_n}{\Omega_n} \sin \Omega_n t \tag{16}$$

$$d_n=\dfrac{D_n}{\Omega_n} \cos \Omega_n t+C_n \sin \Omega_n t . \tag{17}$$

Now at each time step we evaluate equation (2) (with the added damping terms) to give the string motion, then check whether contact has been lost. The condition for loss of contact is that the force on the stop is upwards rather than downwards in Fig. 1, so contact is lost the first time we find

$$T \left.\dfrac{\partial w_2}{\partial x} \right|_{x=L_2} < 0 \tag{18}$$

where $T$ is the tension of the string. This time, we know the values of $c_n$ and $d_n$, and we need to calculate corresponding values of $a_n$ and $b_n$. We can find $A_n$ and $B_n$ by inverting equations (14) and (15):

$$\underline{A} = \dfrac{L_2}{2} I^{-1} \underline{C} \tag{19}$$

and

$$\underline{B} = \dfrac{L_2}{2} I^{-1} \underline{D} , \tag{20}$$

then finally invert equations (10) and (11) to obtain

$$a_n=A_n \cos \omega_n t-\dfrac{B_n}{\omega_n} \sin \omega_n t \tag{21}$$

$$b_n=\dfrac{B_n}{\omega_n} \cos \omega_n t+A_n \sin \omega_n t . \tag{22}$$

The string is then out of contact again, and we repeat the process until the desired simulation time is reached.

The simulations in section 12.3 used this model, with parameter values loosely based on a tanpura. The string length was $L_2=0.99 \mathrm{~m}$, the distance $L_1-L_2$ was 5 mm and the string was assumed to be made of brass with a diameter 0.4 mm. The nominal tuned frequency was 73.4 Hz. Damping was included using the model developed in Chapter 5 and applied to a clavichord string in section 12.2.4. The resulting Q-factor, as a function of frequency, is shown in Fig. 2. For the cases shown in section 12.3, the stop was positioned exactly on the equilibrium line of the string. The sampling rate was 44.1 kHz, for convenience of audio sound demonstrations.

[1] C. Valette and C. Cuesta, “Mécanique de la corde vibrante”, Hermés, Paris (1993). A summary in English is given by C. Valette, “The mechanics of vibrating strings”, Chapter 4 of “Mechanics of musical instruments”, ed. A. Hirschberg, J. Kergomard and G. Weinreich; CISM Courses and Lectures no. 355, Springer-Verlag (1995).