On the perils of cross-fading loops in organ samples

云南快乐十分前三直选one common strategy when looping problematic organ samples is to employ a cross-fade. this is an irreversible audio modification that gradually transitions the samples leading up to the end of a loop to equal the samples that were leading into the start. the goal is to completely eliminate any sort of impulsive glitch and hopefully also create a “good spectral match”. while the ability to eliminate glitches is possible, creating a good spectral match might not be so simple.

we can think of an organ sample as being a linear combination of two signals:

  • A voiced/correlated/predictable component (choose your word) which represents the tonal part of the sample. Strictly speaking, the tonal component is not entirely predictable – there are continuous subtle variations in the speech of a pipe… but they are typically small and we will assume predictability.
  • An unvoiced/uncorrelated/unpredictable component which represents the pipe-noise of the sample.

云南快乐十分前三直选both of these components are necessary for realism in a sample.

云南快乐十分前三直选the following image shows a cross-fade of two entirely correlated signals. the top picture contains the input signals and the cross-fade transition that will be used, the bottom contains the input signals with the cross-faded signal overlaid on top. there is nothing interesting about this picture: the two input signals were the same. the cross-fade transitions between two identical signals i.e. the output signal is equal to both of the input signals.

Crossfade of correlated signal

crossfade of correlated signal

the next image shows a cross-fade of the same correlated signal with some uniform white noise overlaid on top. what is going on in the middle of output signal? it looks like it’s been attenuated a little bit and doesn’t appear to have a uniform distribution anymore.

Crossfade of correlated signal with uniform noise

crossfade of correlated signal with uniform noise

this final image is a cross-fade purely consisting of two uniform random signals to add some more detail.

Crossfade of uniform noise

云南快乐十分前三直选crossfade of uniform noise

it turns out that summing two uniformly distributed random variables yields a new random variable with a triangular distribution (this is how noise for triangular dither gets generated). during the cross-fade, the distribution of the uncorrelated components of the signal is actually changed. not only that, but the power of the signal is reduced in the middle of the transition. here is an audio sample of two white noise streams being cross-faded over 2 seconds:

listen for the level drop in the middle.

if the cross-fade is too long when looping a sample, it could make the pipe wind-noise duck over the duration of the cross-fade. while the effect is subtle, i have heard it in some samples and it’s not particularly natural. i suppose the tldr advice i can give is:

  • If you can avoid cross-fading – avoid it.
  • If you cannot avoid cross-fading – make the cross-fade as short as possible (milliseconds) to avoid an obvious level-drop of noise during the transition.

2 thoughts on “On the perils of cross-fading loops in organ samples

  1. Hi Nick
    Thanks for this posting – you’ve explained clearly but in better terms what I tried to get at in my blog posting on creating organs in Logic Pro X using the EXS24 sampler. I’m now studying the post in more detail to see if I can apply its techniques to my attempts to convert the venerable (but old!) Jeux-D’Orgues sound font file. My blog posting is at – please excuse the lack of technical knowledge, but I’m sure the information in your post should allow me to finesse this organ attempt – and resolve some of the bloody looping issues I had! My biggest challenge was getting the organ sample loops correct, particularly where the stereo channels went out of phase (meaning the loop points would be different). I was tempted to convert to mono, but was never overly satisfied with the results. Thanks again for the post.

    Reply
  2. Hi Nick
    An update a couple of years on: in an effort for efficiency over precision, I’ve recently tried converting my organ sample (single pipe) sound files to mono (where they were originally recorded in stereo, using differently positioned microphones in a church that had moderate reverb qualities). For non-Hauptwerk quality pipe organ SoundFont files, I found that this rough technique allowed me to set my loop points far more easily – which was my main hold-up point. I was then able to use end-stage modulation to create more realistic sounds – the effort at this part of the process saved me far more time than trying to get stereo samples looped properly (using cross-fading). I’m sure the result is not quite as pure, or fidelity-rich, but it meant I was able to more quickly create a credible pipe-organ SoundFont that I wanted to make (a North German-style organ) that I can load into the various software products I use (just Polyphone, Logic Pro X and MuseScore – I’m an obvious amateur!). I’d love to have the time (let alone the technical understanding) to make these sounds a more reflective and accurate rendition of their natural environment, but it gave me what I needed in the time I had. Regardless, I still love reading your posts and can aspire to the mathematics one day.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *