Aliasing due to repitching

Update: There is no audible aliasing in Hauptwerk 6 (published in 2020) or higher Hauptwerk versions due to the new quality of audio processing. The comparison of the audio quality of Hauptwerk 4.2, Hauptwerk 6 and Hauptwerk 7 is available separately.

What is written below, applies only to the older versions of Hauptwerk, and it was first published in 2013.

Hauptwerk v. 4.0 uses very sophisticated pitch control of the organ pipe sample. Repitching happens due to various circumstances: by tuning the instrument up or down, due to the wind fluctuations, due to the tremulant, due to changing temperaments, etc. Repitching has a lot of meaningful functions in Hauptwerk during performance even at the original organ tuning, unless the interpolation is switched off in the Organ Settings.

At the same time, Hauptwerk produces some harmonic distortion when the sample is repitched by more than few cents. When the base pitch of the sample is sufficiently high, the harmonic distortion manifests itself as aliasing - new sub-harmonics are produced and heard more or less prominent. In this indirect way, repitching contributes to the audio distortion which affects playback.

It was suggested some time ago, that a sample set producer should intentionally cut the highest frequecies away from the samples to create some headroom to prevent aliasing from happening. Unfortunately, this suggestion ignored the harmonic distortion produced by Hauptwerk audio engine, and so this technique does not prevent aliasing from happening.

Following examples demonstrate the harmonic distortion and aliasing phenomenon. A pure sine wave was created at 3kHz and loaded into Hauptwerk. The original wave file contains nothing but a steady 3kHz sine wave, no additional signal. So, one would expect no aliasing occurring, since there is pure digital silence above 3kHz. Unfortunately, the aliasing is produced and it negatively affects the audio output.

The black areas in the visualizations below represent a digital silence, the more color - the more sound (hiss is usually violet, audio signal red or yellow). The vertical axis is logarithmic (Hz), the horizontal axis represents the time.

Original 3kHz wave file loaded into the Hauptwerk for experimenting: 079.wav

Hauptwerk recording (the audio files below are direct Hauptwerk recordings with no further processing. The bitrate is 48 kHz, plain wave format):

When it comes down to music, you hear this (ScaleHighAliasing), instead of this (ScaleHighNoIntr).

Result: Hauptwerk would greatly benefit from anti-aliasing and anti-harmonic-distortion filtering. Whenever repitching happens by more than a few cents, audible harmonic distortion and aliasing occurs, provided that the base sample frequency is sufficiently high. The source of this phenomenon is not the audio content of the sample directly, but a distortion produced by the audio engine. In this way, it cannot be prevented by a sample set creator. Loading the samples in the highest possible resolution (24-bit) is of no help in minimizing this phenomenon.