Projects:2018s1-192 Karplus-Strong Synthesis of Sound

From Projects
Revision as of 23:07, 21 August 2018 by A1668360 (talk | contribs) (Clock Conditioning)
Jump to: navigation, search

Project Team

  • David McQueen
  • Samuel Churches
  • Sam Haberman

Supervisors

  • Dr Andrew Allison
  • Dr Brian Ng

Introduction

The Karplus-Strong (KS) plucked-string algorithm was a computational model developed in the early 1980s as an efficient model for vibrating strings based on physical resonance. It was praised for the rich and realistic timbres it generated despite its simplicity. Briefly explained, the algorithm works by placing a delay element into a positive feedback configuration together with a simple low pass filter. Short noise bursts injected into the feedback loop will resonate in the system at a frequency defined by the delay period, and decay away due to the action of the filter. This model is analogous to a plucked string, with the noise bursts acting as the plucks, and the resonating feedback loop acting as the string medium. By modifying the transient shape and frequency content of the noise burst, and the cutoff frequency and gain of the filter, different pleasing output timbres can be synthesised.

Since its conception, many advances have been made in developing the KS algorithm in efforts to generate more realistic models of instruments and to widen the range of instruments available for simulation through advances in the theory of digital waveguides for the modelling of multi-dimensional systems. Efforts have been made to produce musical synthesisers as products, with patents being applied for in 1986 and 1987 and both Mattel and Yamaha licensing the technology however no products have been brought to market using the algorithm from these efforts.

Some modular synthesiser systems are available that provide sufficient building blocks to run a Karplus-Strong model, but these synthesisers are cumbersome, do not support easy chromatic tuning and require much work to implement polyphony, and as such lack playability via standard MIDI control methods.

Abstract

The goal of the project is to develop two synthesizers based on the Karplus-Strong algorithm. The first will implement the model using analog electronics, with digital electronics to control it and the second will be purely digitally based. The synthesizers will be required to be playable using a MIDI controller (such as a keyboard) and have a user interface that allows the character of the generated music to be intuitively adjusted.

The three main research goals of this project are to:

  • Highlight the frequency domain differences between Karplus-Strong synthesisers implemented in the digital domain and with analogue electronics
  • Study the subjective perceptual timbral differences between analogue and digital Karplus-Strong synthesisers through systematic surveying
  • Investigate the commercial viability of producing a hardware Karplus-Strong synthesiser using analogue electronics.

The basis of the analogue electronics KS implementation are bucket-brigade delay lines, and the digital synthesiser is implemented in the MATLAB environment.

Background

Karplus-Strong Synthesis

Karplus-Strong (KS) synthesis produces musical notes by impulsing a filtered positive feed- back delay line with short bursts of noise. The method was presented in 1983 as a way to digitally synthesise musical notes using as little computational overhead as possible. KS synthesis works as a simplified physical model of a plucked string, such as that found on a guitar, cello or harp. The noise burst represents the energy stimulation (pluck) imparted on the string. The delay element encapsulates the time delay between the energy wave on the string, as a result of stimulation, travelling between each reflective ends of the string. The low pass filter attenuates high frequency components in the ’reflected’ wave (delayed impulse), imitating the same dampening effect found in real plucked strings due to viscosity in the air medium they travel on, and the energy transferred to the reflective element. Gain control in the feedback path regulates the sustain effect of a plucked string, with a lower feedback gain leading to a shorter note sustain time. Gain control is limited to unity, or below, such that the output signal will always decay to zero. Finally, the summing element of the feedback loop adds the reflected waves back into the signal path, to be delayed and filtered again.

By tuning the delay period to be that of the frequency of a desired note, and using appropriate filtering and gain parameters, the Karplus-Strong model can synthesise realistic plucked string timbres.

Bucket-Brigade Devices

Bucket-brigade devices (BBD) are discrete time, continuous voltage analogue signal delay lines. They function as a queue of electrical charges stored in capacitors, shifted along by switching MOSFETs using alternating clock signals. The high price of bucket brigade devices is the past was prohibitive of their use in affordable synthesisers, but now these devices are affordable, which has encouraged their use in this project. Additionally, to precisely control the delay line, a highly precise digitally controlled clock signal is required, the implementation of which has only become cost effective for use in synthesis in recent years.

Transient Envelopes

A common control signal used in synthesisers is called an envelope. An envelope is triggered by note a gate and/or a trigger signal, which are engaged by a new keyboard note event, and outputs a control voltage which will typically control either a filter cutoff frequency or the gain of a note output signal. An typical envelope has four control parameters: attack, sustain, decay and release (ADSR). Attack controls the time from the start of the note event to the envelope reaching its peak level. Decay controls the time from the envelope reaching its peak level to reaching its sustain point. Sustain controls the level of the sustain point. Release controls the time from the note gate ending to the envelope reaching zero.

Market Analysis

Analogue electronics based instruments and effects units are currently seeing a renaissance in the music technology market. Consumers are returning to older music technology, embracing their subtle imperfections and rich tonality compared to their digital counterparts, which are perceived as comparatively sterile [5]. Karplus-Strong synthesis is also receiving more attention in recent times, as the computational power required for detailed, polyphonic, real time KS synthesis becomes cheaper and more readily available.

At this point in time, no fully integrated KS synthesiser implemented using analogue electronics exists. It is predicted that due to the current state of the market, there may be a consumer demand for this product. The function of this project is to determine whether such an analogue implementation is different enough to warrant bringing this product to market.

Method

Analogue Synthesiser Design

A high level design outlining all major subsystems in the analogue KS synthesiser is presented below.

KSSystemDiagram.png

Bucket Brigade Delay

The first BBD that was investigated was the 512 stage Phillips TDA1022. It was chosen as an ideal candidate for its comparatively wide range of delay periods (51.2 - 0.512ms) compared to other BBDs, which would allow a wide range of playable note frequencies (19.5Hz - 1953.1Hz). The TDA1022 has ceased production, and because of this is quite difficult to attain. However, due to the bespoke nature of this instrument prototype, it was deemed within the project’s budget to use the TDA1022.

A batch of ten TDA1022 DIP-16 packages were procured via an online eBay auction, with a price of approximately $8 each. After extensive attempts using all ten units in both manufacturer test circuits, and third party delay line circuit designs, none of these BBDs were able to function correctly. It is believed that the ICs were either counterfeits, factory discarded units, or have degraded over time due to high temperature storage. Prices for the TDA1022 from other vendors are well in excess of $20 each, which is too expensive for this project, and is not a cost or risk that was deemed worthwhile.

The next BBD to be assessed for implementation was the CoolAudio V3207. This IC, currently being mass manufactured, is a reproduction of the 1024 stage MN3207 BBD manufactured by Panasonic in the mid 1970’s. While having a more limited and slower delay range (2.56-51.2ms) than the TDA1022, it is easily procured new and is of significantly lower cost per unit (∼ $2).

Clock Conditioning

The output of the function generator (V.12) is defined by interface VI.12, which states that it will be a square wave with logic levels VOH = 3.3V, and VOL = 0V. To condition this signal such that it is suitable for a BBD clock input, it must be converted into two antiphase clock signals, and their logic levels must be raised to the prescribed levels of the BBD.

The first BBD investigated, the Phillips TDA1022, required a clock signal VIH =−1.5↔0V, and VIL = −10 ↔ −18V= −15V (typical). To attain the large logic level shift and antiphase copy required, inputting the clock signal into an inverting, and non-inverting op- amp (Operational Amplifier) Schmitt trigger design was tested. For this method, the initial logic level shift of the function generator clock signal from 0 ↔ 3.3V to 0 ↔ −3.3V required to trigger the Schmitt triggers was to be determined later. Using a function generator to output a 0 ↔ −3.3V clock signal, the output of each Schmitt trigger was analysed using a digital oscilloscope. Initial testing with common op-amp IC’s (LM741, TL07X) showed that for such a big voltage swing (0 ↔ −15V), the op-amp slew rate caused significant reduction in the output logic rise and fall time.

Op-amps with this relatively high slew rate were found to be particularly expensive, to the point that this method was no longer cost effective. Thus, the op-amp Schmitt trigger method of clock conditioning was abandoned.

Next, a variation of the Schmitt trigger method was attempted, using the 40106 hex Schmitt trigger inverter IC. This 14 pin DIP IC contains 6 fully integrated, high performance inverting Schmitt triggers, and can operate at the voltage swing level required for the TDA1022. By feeding the digital clock signal into one Schmitt trigger inverter, and then feeding the output of that into another Schmitt trigger inverter, the outputs of the two Schmitt trigger inverters were the required antiphase clock signals. One caveat of this method was that the VIH threshold of the 40106 was greater than the 3.3V that the digital clock function generator could output. It was proposed that the function generator (FG) would output a sine wave, which would be amplified to a level that it would trigger a 50% duty cycle clock output from the Schmitt trigger IC. Simulating these conditions with a bench function generator, an acceptable set of clock signals were generated, but due to the malfunctioning TDA1022 IC’s, the credibility of these signals was unable to verified.

Despite the op-amp Schmitt trigger design being able to meet this slew specification with medium cost op-amps, it was found to be more cost effective to use Schmitt trigger ICs.

Because of the lower clock voltage level requirements of the V3207 BBD, a different Schmitt trigger IC can be used. The 74HC14 hex Schmitt trigger offers incredibly fast logic rise and fall times (effectively instantaneous for the required clock speeds), and robust output buffering. This is desirable, as it may allow for overclocking of the BBD delay times.

Voltage Controlled Low Pass Filters

Anti-Aliasing and Reconstruction Filter

Feedback Gain and Sum

Output Stage EG & VCA

System Evaluation

Conclusions and Future Work

In conclusion, the design and research conducted for this project presents multiple outcomes. First, it has shown that implementation of the subsystems of a KS synthesiser is possible using analogue electronics, but the efficacy of these subsystems as a full KS synthesiser has yet to be determined. Digital KS synthesis has been achieved successfully, and a method for modelling the filters used in the analogue synthesiser has been proposed. The motivations for creating an analogue KS synthesiser have been discussed, and comparative mechanisms for evaluating its value to the music technology market have been presented. Ultimately, no conclusion can be drawn regarding the merit of a KS synthesiser implemented with analogue electronics as yet.

Alternative implementations of KS synthesis could be studied further in the interest of creating unique and desirable musical instruments for the music technology market. Investigations into alternative methods of creating variable signal delay lines, such as physically separated transducers, could be valuable, as the BBD delay line is still a discrete time device. Further study could also be done on modelling the phase delay of analogue electronic filters and amplifiers, to aid in the tuning of analogue KS synthesisers.