MUMT618 – Computational Modeling of Musical Acoustic Systems

Instructor: Dr. Gary Scavone





Final Project: Losses on a Violin String from Left-Hand Fingerings


Overview

Violinists are acutely aware that the fingering they choose has a direct effect on their sound. Each string and each finger leaves their own characteristic imprint on the musical passage, and players will often sacrifice ease of playing for a desired musical nuance.

In the realm of stringed instrument synthesis, these effects are understood as loss filters (usually lowpass filters) that colour the spectrum. The simplest model utilizing this is the Karplus–Strong plucked string algorithm [1], but because it was motivated primarily by computational efficiency rather than physical accuracy, it has very limited musical capabilities.

Since then, the advancement of computational power has allowed more sophisticated digital waveguide models to rise in prominence [2], each generation incorporating more and more physical insights. These models remain relatively efficient by commuting all of the losses into a single filter, its parameters adjusted simply by evaluating the output [2, 3]. While this may be suitable for the simplest models of string synthesis, this approach lacks the musical flexibility of a real instrument, as well as being physically inaccurate. Thus, we wish to create a more realistic filter by modeling real decay parameters.




Method

With a simple harmonic pattern, the spectrum of a plucked string does not offer many options for refinement. Instead, the bulk of the timbral qualities associated with the plucked string comes from the time-evolution of the spectral envelope. We can obtain this key information by taking near-field measurements of a plucked violin and the decay behaviour of each partial.

To explore the complete palette available to the violinist, we would need to measure every possible fingering for each note – that is, a given note needs to be measured while using different fingers and different strings. A loss filter could be designed by analyzing the trends associated with each finger. Finally, this filter can be applied to a plucked string algorithm, such as the Karplus–Strong algorithm.




Equipment & Setup

The violin used in this study was made by H. Armenious (Toronto) in 2005. Throughout the measurements, it was kept in a rigid mount to prevent the violin from moving during the pluck. Initial tests made without the mount showed significant amplitude modulations as the violin rocked back and forth relative to the stationary microphones.

All audio equipment was provided by the Centre for Interdisciplinary Research in Music Media and Technology (CIRMMT), including the following:
  • 2 microphones (Brüel & Kjær Type 4190-L-001, Serial 2601831 and 2601836)
  • Signal conditioner (Brüel & Kjær Type 2672, Serial 1921189)
  • Preamplifier and USB interface (RME Fireface UC, Serial 23171042)
  • Stands and cables
Measurements were conducted in an acoustically treated room within CIRMMT. The two microphones were placed at slightly different distances away from the instrument in order to capture a different radiation pattern through the two channels. The entire setup is shown in Figure 1 below.


Figure 1: The experiment setup.




Measurement & Analysis

To achieve a diversity of tone colours, each of the 4 fingers were placed in 4 positions on each of the 4 strings. Each configuration was measured 3 times, and with two microphone channels, we obtained a total of 384 measurements.

Analysis of the data was done using SMS Tools [4]. Its “harmonic” model provides partial tracking for sounds with a roughly harmonic spectrum. Small modifications were made to the Python code base to make it output the tracked partial information (viz., frequencies, magnitudes, and phases) to facilitate further inspection in MATLAB. Figure 2 demonstrates an example of the partial data extracted from SMS Tools and plotted using MATLAB.

Because exponential decays translate to linear decays on a logarithmic scale, a straightforward linear fit of the magnitude data could be performed on each partial.


Figure 2: Partial information extracted for the note B♭3 (234 Hz) played using the second (middle) finger on the G-String. The frequencies for the first 10 partials can be seen (top) along with their magnitude decays in dB/s (middle) and the phase of the first partial (bottom). Also shown are linear fits for the decay rate and phase of the first partial. Click to enlarge.

All of the extracted decay rates were then plotted on a scatterplot (Figure 3). It could be seen that the data follows a consistent downward trend for the first 6 partials or so, with the subsequent scatter in the higher harmonics the result of noise.


Figure 3: Plots of the extracted decay rates for the open G-String (196 Hz; left) and the first (index) finger at 4 hand positions (right). A linear fit across the hand positions – represented by frequency – is also shown. Click to enlarge.

For the lowest partials at least, the decay rates appear to be linearly dependent on frequency – that is, the same finger will cause the losses to increase the further away it is from the nut (i.e., the open string). This is consistent with musical observations, and may be explained physically by noticing that the increasing altitude of the string off the fingerboard results also in increasing the amount of contact between the string and the finger.

The MATLAB script to plot and fit the partials is provided here, and the script to calculate the decay rates for each partial is here. The Python script to output the partial information from SMS Tools is here.




Filter Design

The primary measure of exponential decay is the time constant τk, representing the time it takes for the kth partial to decay to 1/e ≅ 36.79% of its initial value. On a logarithmic scale, this is equivalent to −8.69 dB. Therefore, the time constants for each partial can be known very simply since we already have their decay rates in dB/s (for any given finger and hand position).

Once we have the time constant, the gains of each partial can be calculated using the expression gk = exp(−1/(f0τk)), where f0 is the desired fundamental frequency. Within MATLAB, the invfreqz function attempts to fit a transfer function (of any desired order) to the provided gains, returning the filter coefficients b and a as output. For simplicity, we will assume the filter has linear phase from 0 to −π/2, but this can be refined using the extracted phase data.

An example fit to a first order FIR filter – suitable for a naive implementation of the Karplus–Strong algorithm – is shown in Figure 4. Note that the filter is dependent on the desired finger and its position (i.e., fundamental frequency or pitch).



Figure 4: Comparison of the Karplus–Strong algorithm (blue line) to the measurement based filters (red lines), overlaid on the measured gains of the first 10 partials (red crosses). On the left is the derived filter for the open G (196 Hz) and on the right is the first (index) finger holding down an A3 (220 Hz). Click to enlarge.

The MATLAB code used to create the filter is provided here, which feeds directly into a function containing a slightly modified Karplus–Strong algorithm here to generate an output.



Sample Results

Open G–String (196 Hz)
  • Real violin:
  • Extracted filter:
  • Karplus–Strong:


Figure 5: The signal of an open G (196 Hz) and its spectrum created by the extracted filter (left) and the Karplus–Strong algorithm (right).


1st finger A3 (220 Hz)
  • Real violin:
  • Extracted filter:
  • Karplus–Strong:


Figure 6: The signal of a first finger A3 (220 Hz) and its spectrum created by the extracted filter (left) and the Karplus–Strong algorithm (right).


Discussion

The sample results above demonstrate that the designed filter is capable of modifying the decay time of the notes without compromising the pluck-like quality of the sound. Yet, it is also clear that the sound does not contain the same timbral richness of the real violin. This may be due to a couple of reasons: firstly, our filter is only a first order FIR filter, and secondly, we were only able to reliably extract roughly ten partials for use (often less). Both of these factors greatly restrict the ability of the filter to imitate the timbral nuances of the measured signal. Thus, a future, more comprehensive study must take these shortcomings into account – the second issue in particular.

However, the solving the problem of the partials is not as straightforward as merely plucking with greater amplitude. While doing so would certainly imbue the higher partials with greater amplitude (which is what we want), it also applies indiscriminately to various non-linear coupled modes as well. These include the sympathetic vibrations from different parts of the instrument (for example, the other strings are not perfectly damped), but more prominently, between the horizontal and vertical polarizations of the same string. Their exchange of energy results in time-varying radiation patterns as each polarization interacts different with the bridge, and by extension, the body of the instrument. This effect could be seen in the middle plot of Figure 2, where even the lower harmonics are prone to cycle in magnitude.

Nonetheless, we were able to demonstrate that the traditional approach of using a single fixed commuted loss filter is insufficient to capture the musical variations sought by violinists. But for our results to be most useful, we would need to be able to extricate the losses solely associated with the finger from our measurements so that they could be used in more advanced systems of string instrument synthesis. Our results suggest that the losses from the finger outweighs those from the string itself – decreasing the vibrating length of the string should also decrease the amount internal friction encountered by the traveling wave (there is less string to travel across), leading to in a decrease in losses. Yet, what we see is a consistent increase in losses while the vibrating length is decreased (Figure 3). However, we do not know how it compares to the bridge losses since they are independent of the configuration. More careful study will be required to reveal the losses from the string and bridge.




References

[1] Karplus, K. and A. Strong. 1983. Digital synthesis of plucked string and drum timbres. Computer Music Journal 7 (2): 43–55.

[2] Smith, J.O. 2004. Virtual acoustic musical instruments: Review and update. Journal of New Music Research 33 (3): 283–304.

[3] Bank, B. and V. Välimäki. 2003. Robust loss filter design for digital waveguide synthesis of string tones. IEEE Signal Processing Letters 10 (1): 18–20.

[4] Serra, X. et al. 1989–. Spectral Modeling Synthesis Tools. Pompeu Fabra University, Barcelona. http://mtg.upf.edu/technologies/sms.