Sound Design: Ring Mod with low-frequency modulations

Audio example of Ring Modulation with low-frequency modulations

Experiments with complex ring modulation and low-frequency modulations for sound design. Each ring modulation generates sidebands for the previous signal and with four ring modulations up to 16 frequencies could be generated. Modulating with ring modulation leads to interesting, synthetic sounds due to the ratios of frequencies changing over time. Having multiple orders of ring modulations allowed for interesting patterns of spectrums to develop (see spectrogram).

Spectrogram from Audacity (2048 bin size, 0-16000 Hz, linear)

This example has two instruments, RM1 and RM2. RM1 uses exponential envelopes to start and end at harmonic ratios but has different rates of change due to different starting ratios. (Mentioned here as ratios since the outputs are being used to multiply the p4 base frequency.) RM2 is a variation on RM1 and uses a sawtooth LFO for one of the modulations. Both use a high-pass filter to remove frequencies generated below the base frequency.

The score plays a pattern with RM1 twice, once with 0.5 durations and again
with 0.25 durations. This sounded to me like they could be used as a simple
laser sound in a game or as a component of more complex laser sound design. The score then has a 20 second long note for RM2 that gives it enough time to hear the evolving frequency patterns.

Sound Design: FM with Modulations

Audio Example of Complex FM sound with modulations to indices

Complex FM (4 operator, what Chowning and Bristow calls Parallel Carrier,
Independent Modulator in “FM Theory and Applications”). The two operator stacks are using 4:2 and 1:1 C:M ratios. expseg envelopes are used to modulate the overall shape of indices and unipolar square lfo’s are used for an additional layer of modulation. I thought the 12 and 3 Hertz for the lfo’s gave some nice texture between the two layers.

I think it probably works best in the low end to middle of the frequency range. The result using pch of 5.00 reminded me of things heard in some progressive house tracks.

randcubic glissandi: random line with cubic interpolation

Audio example of randcubic used for glissandi

Custom Csound user-defined opcode randcubic to generate cubic interpolated lines. Example above uses randcubic for achieving time-varying glissandi with multiple voices.

Based on code from

Code for UDO is as follows:

opcode randcubic, a,kk
  kamp, kfreq xin
  ky0 init random:i(-1, 1)
  ky1 init random:i(-1, 1)
  ky2 init random:i(-1, 1)
  ky3 init random:i(-1, 1)  
  kcount init 0
  asig init 0
  kperiod = sr / kfreq
  kndx = 0
  while (kndx < ksmps) do
    ka0 = ky3 - ky2 - ky0 + ky1
   	ka1 = ky0 - ky1 - ka0
    ka2 = ky2 - ky0
    ka3 = ky1
    kmu = kcount / kperiod
    kmu2 = kmu * kmu
    asig[kndx] = ka0 * kmu * kmu2 + ka1 * kmu2 + ka2 * kmu + ka3
    kcount += 1
    if(kcount > kperiod) then
      ky0 = ky1
  	  ky1 = ky2 
  	  ky2 = ky3       
      ky3 = random:k(-1, 1)  
      kcount -= kperiod
    kndx += 1
  asig *= kamp
  xout asig

Lockhart Wavefolder

I’d like to share a Csound user-defined opcode port of the “Virtual Analog Model of the Lockhart Wavefolder” by Fabián Esqueda, Henri Pöntynen, Julian D. Parker and Stefan Bilbao that was presented at SMC 2017. The paper reference is:

F. Esqueda, H. Pöntynen, J. D. Parker and S. Bilbao, “Virtual Analog Model of the Lockhart Wavefolder”, in Proceedings of the 14th International Sound and Music Computing Conference (SMC-17), Espoo, Finland, July 5-8, 2017, pp. 336—342.

The authors have placed a website with the original paper, errata, and a Max/MSP/gen~ implementation at:

I have converted the gen~ code to a Csound user-defined opcode and placed the code and test file here:

The test instrument follows the recommendations of the paper to use a cascaded wavefolder structure with input gain and DC offset parameters. (See figure 9 in the paper.) The sampling rate is 88.2khz as mentioned in the paper to deal with anti-aliasing issues without having to use oversampling.

An example render of the test CSD file is below, modulating both the gain and DC offset parameters:

I’m very excited by all of the wonderful sonic possibilities! Bravo to the original authors for their work!

Additive Pitch Rhythms Using Hexbeat

Practice session today using additive pitch hexbeat rhythms to generate melodic contours.

Each hexbeat() is generating sequences of 1’s and 0’s which are then multiplied to alternate between things like 7 and 0.  So if I add one that alternates between 2 and 0, I get 9,7,2, and 0 as possibilities.  Then with say 4 and 0, I get additional combinations.  With the patterns of different lengths (I’ve been using mostly prime number lengths) it generates a nice long overall pitch pattern, which is then masked by the rhythmic hexplay() pattern.  I then add a choose() to say “play 70% of the time” and I find all of that together is quick to write, generates good variety, but has an underlying structure that is stable.  (It’s been on my mind how to mix randomness + stability in interesting ways and I’ve found these explorations have been leading to some interesting pattern generation.)

This desmos graph visualizes an example of a 3-part hex pitch rhythm added together:

(Click on the “Edit on Desmos” link in the graph to turn on/off visualization of the various individual hex pitch rhythms.)