Hordijk Harmonic Oscillator

This is a repost of part of a thread on the old forum.


My next stop while working my way though the treasure trove that is the NOVARS collection of Hordijk tutorials, has been his Harmonic Oscillator – a module I’ve been keen to take a closer look at for quite some time.

In the first of two videos he provides a general introduction to the basic idea of the oscillator – one in which the three classic parameters of sound synthesis: pitch, timbre, and amplitude, are all present, and all available for voltage control.

In the second video he takes a closer look at the algorithm that defines the oscillator: a sine/cosine oscillator that feeds back on itself via linear FM, creating a spectrum that contains all harmonics. A second spectrum containing only odd harmonics is created with a Chebyshev polynomial feeding back the pitch an octave higher. The combination of the two spectra creates pulse-width timbres.

Despite Hordijk’s warnings on the difficulties of implementing his Harmonic Oscillator algorithm digitally, I was keen to try out some of the ideas in Audulus. One of the aspects of the feedback loop involves using a cosine waveform to avoid the DC offset that would occur when feeding the sine back on itself. In the Hordijk’s diagrams he indicates a crossfade between the sine and cosine signals as part of the feedback loop, but I kept on running into the pitch drop problem that he explains is a result of the DC offset. (There’s more from Hordijk on FM synthesis on the old Clavia Nord Modular website, fortunately still available via the Wayback Machine.) I eventually gave up on the linear FM route and decided to try implementing it with phase modulation instead – with some success.

The morph from sine to saw has a different character than making a crossfade between the two waveforms since the saw edge gradually tilts rather than appearing as an abrupt vertical, and the sawtooth and square waves also have a rounder edge than the characteristic forms of these waves. (I’m curious as to why the inverted form of the waveform appears to be slightly lower in pitch. In the case of this oscillator shifting the “All” knob in the positive direction results in what is commonly know as a reverse (or inverse) sawtooth. This is the default result of the pitch being fed back on itself.)

I haven’t been able to achieve quite the same sharpness in the shapes that Hordijk does with his analogue implementation (compare the waveforms at the beginning of the second video) since the phase modulation begins to distort, but the somewhat more mellow quality that results also has a charm of its own. (It is possible to increase the definition of the square wave a little more than I have, but that results in distortion when combining the square and sawtooth spectra.)

I’ve put it together as a simplified µModule, with the addition of a control that adjusts the level of both the odd and all spectra simultaneously in relation to the sine.

RH-RM uHRM.audulus (31.2 KB)

RH-RM uHRM Demo.audulus (245.9 KB)

4 Likes

After having taken a look at the Rob Hordijk Masterclass given at Sines & Squares 2014, I was inspired to take another look at using the Fourier sine/cosine combination waveform in conjunction with correcting the linear feedback in Hordijk’s Harmonic Oscillator.

This time round I have gotten it to work somewhat. The linear FM from the combined sin/cos signal is only applied to the sine oscillator, and the resulting wave is much richer than was possible with phase modulation. There is however a small but important detail – while the level for the sine feedback appears to be fully turned up, it is in fact very slightly reduced. This, for some reason, is what enables the result. When turned up fully the addition of harmonics by turning up the Linear FM and All/Odd knobs breaks down at certain points. (These breaks are quite interesting in themselves, especially at lower frequencies – something that could be explored further as a feature in itself.) A similar effect can be achieved by detuning one of the oscillators very slightly – something I discovered by accident, but which is the detail that gets the thing to work at all.

The waveform also gains much of it brightness from an extra spike, rather than approaching a sawtooth.

The odd harmonic feedback using the Chebyshev polynomial also allows for a slightly richer wave than was possible with phase modulation, but combining the all and odd waves unfortunately causes the feedback to break down completely.

Alternatively if the sine feedback is turned down completely one can achieve much cleaner FM timbres and the odd and all harmonics can be happily combined, even though the odd harmonics are much more easily drowned out.

These experiments haven’t brought me closer to recreating Hordijk’s Harmonic Oscillator, but have been interesting nonetheless.

Sin Cos OSC HRM.audulus (37.5 KB)

3 Likes

3D Sound – Hordijk’s ‘Corkscrew’ waveform

I’ve been fascinated by the Rob Hordijk’s description (in the Sines and Squares masterclass video) of how one might think about sound in three dimensions (rather than the two we are used to on our screens) and how sine and cosine waves can be used to describe the phase and amplitude of a resulting wave, defining its waveshape over time.

Sin Cos Waveshape.audulus (38.0 KB)

He describes it as a corkscrew waveform, also occurring in nature, with the phase describing its rotation, and the amplitude, distance. When viewed on an XY oscilloscope with a slow sine modulating the amplitude of the sine and cosine, it looks like a circle approaching from the distance and receding again. With very low frequencies one can view it as rotating points on an oscilloscope and get an even better idea of the ‘corkscrew’ effect.

image

This helps fill out some background on Hordijk’s thinking of sound in terms of depth – for example with his fluctuation waveform, in which amplitude and frequency modulation are combined to provide a special kind of vibrato. Based on a rounded triangle ’parabol’ waveform, the larger the wave is, the lower the frequency – i.e the lower part of the frequency fluctuation corresponds to the higher part of the amplitude modulation. In his 2015 masterclass on Waveshaping & Fluctuation Hordijk describes this waveform (when modulated) as advancing and receding – giving a perspective effect.

1 Like

Interesting what this does at slow speeds.

RH-RM uHRM Demo (slow).audulus (246.1 KB)

2 Likes

Yes, you’ve reversed the roles – the Harmonic Oscillator is now modulating the modulating oscillator, which is generating the pitch we hear. It gives some nice pluck-like sounds. (The little distortion glitches can be avoided by removing or reducing the modulation on the odd and all controls.)

The Audulus Waveform is showing the slow modulation curves (waveforms). Here are some screenshots of what is happening with the audio rate waveforms.

3 Likes

A nice interactve introduction to the Fourier transform with a good demonstration of the 3D “corkscrew” waveform Hordijk refers to:

4 Likes

That drawing section was really fun!

1 Like

Yes! :grinning:

1 Like

RH-RM uHRM Fan Patch.audulus (508.7 KB)

3 Likes

An update of the Harmonic Oscillator for Audulus 4.
RH-RM_HRM_OSC_v1.1.2.2.4.audulus4 (25.9 KB)

1 Like

RH-RM_HRM_OSC_v1.1.2.2.4__JS-Demo.audulus4 (482.0 KB)

2 Likes

How to make modules in audulus, what language is used?

First of all hi and welcome :wave:

Audulus is a mudular synthesizer and visual programming language at once. It has a set of build in low level building block-modules that you can use to build more complex modules.
Modules are just groups of building blocks and other modules with exposed controls.