Virtual Analog Oscillator Hard Synchronisation: Fourier Series and an Efficient Implementation
Total Page:16
File Type:pdf, Size:1020Kb
Proc. of the 15 th Int. Conference on Digital Audio Effects (DAFx-12), York, UK, September 17-21, 2012 VIRTUAL ANALOG OSCILLATOR HARD SYNCHRONISATION: FOURIER SERIES AND AN EFFICIENT IMPLEMENTATION Joseph Timoney, Victor Lazzarini, and Jari Kleimola, Jussi Pekonen, and Vesa Välimäki, Matthieu Hodgkinson Sound and Music Technology research group, Dept. of Signal Processing and Acoustics, NUI Mayn ooth Aalto University Maynooth, Ireland Espoo, Finland [email protected] [email protected] [email protected] [email protected] [email protected] ABSTRACT should be able to suggest a way by which a digital imple- mentation could be made using tailored digital elements. This paper investigates a number of digital methods to This should lead to a less complex, and therefore cheaper, produce the Analog subtractive synthesis effect of ‘Hard way to implement it for virtual reproductions of analog Synchronisation.’ While the original effect is produced by synthesis operations. A lower implementation cost would an explicit waveform phase reset, other approaches are confer benefits such as greater polyphony from the virtual given that produce an equivalent output. In particular, synthesizer. In contrast, although attempting to directly si- based on measurements taken from a real-analog synthe- mulate a particular analog circuit design offers more mod- sizer, a comb filtering model is proposed. This description eling accuracy, it normally results in an algorithm that is ties in with earlier work but here an explicit structure is computationally intensive because of nonlinear circuit provided. This filter-based approach is then shown to be elements, requiring a significant oversampling factor to far more computationally efficient than the synchronisation operate correctly, see [7], [8], [9], and [10] for example. by phase reset. This efficiency is at a minor cost as it is In this paper, we will therefore present an additive syn- shown that it has a minimal impact on the sonic accuracy. thesis /Fourier series description of Hard Sync followed by an efficient implementation using standard DSP elements. 1. INTRODUCTION The paper is organized as follows: Section 2 examines the Hard Sync effect using examples that were measured from Oscillator synchronization (Hard Sync) is an important us- actual analog synthesizers. Derivations for the Fourier se- er option that any digital subtractive synthesizer should of- ries will also be given in Section 2. This will be followed fer. Synchronization was originally developed for analog by a delay-line filter-based implementation in Section 3. synthesizers to counteract the frequency drifting that can An evaluation of its computational efficiency relative to a occur between voltage controlled analog oscillators, as too recent alternative implementation reset-based implementa- much drift can make the musician appear to be out of tune. tion will be carried out in Section 4. Additionally, the ac- Oscillator synchronization comes in two forms: Hard sync curacy of the delay-line approach will be evaluated with and Soft sync. Of the two, Hard Sync is the more striking respect to the Fourier series description and the alternative effect. It is noted for its dynamic, expressive, screaming implementation. One benefit of the filtering approach is quality that is excellent for creating remarkable lead and that it will not introduce new aliasing distortion compo- bass sounds ([1], [2], and [3]). Hard synchronization is nents into the signal. Section 5 then completes the paper normally associated with sawtooth oscillators and requires with a conclusion and some areas for future work. two oscillators to work. These are termed as the Master and Slave respectively. For the effect to be noticeable, the Slave oscillator should be at a higher frequency than the Master. In essence, hard sync locks the waveshape of the slave oscillator to that of the master, resetting to its initial value ‘in sync’ with that of the Master as it commences a new period. This ensures that both oscillators are at the same period, eliminating the frequency drift between them. While algorithms for the bandlimited implementation of Hard Sync exist ([4, [5], and [6]), there is no ideal version against which to benchmark it. Thus, it would be very use- ful to have an Fourier series/additive synthesis description of the Hard Sync waveform. Having such a description it DAFX-1 Proc. of the 15 th Int. Conference on Digital Audio Effects (DAFx-12), York, UK, September 17-21, 2012 2. THE HARD SYNC EFFECT Hard sync oscillator with frequency control superimposed 0 10000 master -5 0.2 -10 0 8000 -0.2 -15 -0.4 6000 50 100 150 200 250 300 350 400 450 500 -20 slave 0.4 0.2 4000 -25 0 -0.2 -30 -0.4 2000 50 100 150 200 250 300 350 400 450 500 -35 hard sync 0.4 0 -40 0.2 0 2 4 6 8 10 12 14 0 -0.2 -0.4 Figure 2: Spectrogram of hard sync output signal with 50 100 150 200 250 300 350 400 450 500 frequency control adjustment superimposed as a solid white line. Fi gure 1: Example of Minimoog Hard Sync waveform. The top panel shows the Master waveform, the middle 2.1. Direct Digital Reproduction panel the Slave and the bottom panel the Hard Sync out- put. A direct digital reproduction of hard sync can be achieved by simply resetting the Slave waveform at the ap- Fig. 1 plots an example of oscillator sync from a Mini- propriate points in time. This can be illustrated using the moog Voyager [2]. The top panel shows the Master, while following. If the Master waveform is generated using the the middle panel shows the Slave, and the lower panel is phase accumulator the hard sync output. The reset in sync with the Master can be seen in the lower panel. What makes hard sync remark- θ t = θ t −1 + 2πf % 2π able, however, is that when the frequency control of the master ( ) ( master ( ) master ) ( ) (1) Slave oscillator is adjusted, either manually or using an where the frequency of the master waveform is given by LFO or envelope, the timbre of the Hard Sync output exhi- fmaster and the modulo operation is denoted by %. bits a harsh, dissonant quality. Similarly the phase accumulator for the Slave waveform Although the spectrum of the Hard Sync output has har- is given by monics at the same pitch as the Master, the timbral modifi- cation is manifested as regularly-spaced formant-like re- θ t = θ t −1 + 2πf % 2π sonances in the spectrum of the Slave. The sound is most slave ( ) ( slave ( ) slave ) ( ) (2) sonorous when the relationship between the pitch frequen- The phase accumulator for the hard sync waveform then cy and the frequency location of the resonances is non- is generated according to the following conditions integer. To illustrate, a hard sync output was recorded from the Minimoog Voyager at a sample rate of 44100Hz where the frequency of the Slave is driven by a rising envelope. θsync (t) = θslave (t) (3) The spectrogram in Fig. 2 shows the time-frequency pro- unless when θmaster (t)<2 πfmaster and the phase is reset ac- file of the oscillator output and superimposed is a solid cording to white line that shows the adjustment of the frequency con- trol of the Slave oscillator. This spectrogram was com- f puted using an 800-point Chebyshev window, overlapped slave θsync ()t = θmaster ()t by 50%. f In Fig. 2 the underlying harmonics of the sync waveform master (4) are shown as horizontal grey lines, and the resonances are A sawtooth can be generated from the accumulated phase visible as dark black lines. The actual harmonic frequen- by cies are static through-out, but the resonances move in an almost harmonic relationship following the Slave oscilla- S (t) = θ(t) 2π (5) tor’s frequency control in a quantized fashion. saw Fig. 3 gives an example of a Master and Slave wave- forms and the Sync output using this algorithm. The fre- quency of the Master is 441Hz, that of the Slave is 723Hz, DAFX-2 Proc. of the 15 th Int. Conference on Digital Audio Effects (DAFx-12), York, UK, September 17-21, 2012 for the Hard sync waveform is 441Hz. The effect of the Master. This can be written, where the asterisk denotes reset is clear on the Hard sync wave and it is clearly in convolution, as synchronization with the Master. Ssync (t) = (Sslave (t)W (t))* (ti ) (6) Master Sawtooth 1 where W(t) is a rectangular window 0.5 0 ,1 0 ≤ t < Tmaster -0.5 W ()t = ,0 otherwise 0 0.002 0.004 0.006 0.008 0.01 (7) Slave Sawtooth 1 where Tmaster is the period of the Master sawtooth, and i(t) 0.5 is the impulse train given by 0 ∞ -0.5 ()()ti = ∑δ t − kT master 0 0.002 0.004 0.006 0.008 0.01 k =−∞ (8) Phase Reset Hard Sync Sawtooth 1 In the frequency domain, eq. (6) can be written 0.5 0 Ssync (ω) = (Sslave (ω)*W (ω))i(ω) -0.5 (9) 0 0.002 0.004 0.006 0.008 0.01 Time (S) The continuous-time fourier transform of the product of the sawtooth Sslave (ω) and the rectangular window W(ω) is Figure. 3: Example of Hard Sync. The top panel shows T the Master waveform, the middle panel the Slave wave- − j master ω T 2 2 1 master jp π()Tmaster Tslave form and the lower panel a Hard Sync waveform synthe- − j e ∑ sinc ()ω p − ω e T p p 2π sized using eqns. (3),(4) and (5).