Bowed String Additive Synth

About 12 years ago, someone told me that additive synthesis will never be practical. My initial reaction was, “we’ll see about that.” This person’s background was that of modular subtractive synths, and was quite knowledgeable. From that perspective, I could see their point. Who want’s to take the time to create complex envelopes for each individual harmonic? My mind has often wondered back to this incident.

Today, additive synths are becoming more common thanks to faster computers. Many of their UIs do help programmers with the large amounts of complexity additive brings to the table. And there are many useful and valid approaches, each with their own strengths and weaknesses.

Download: bowed_string.csd

My approach has been floating around my head on and off for about a decade. The first iteration was completed around 2002, and was shelved until recently. Today’s csd is a continuation of the second iteration of the design, which I had originally intended to use with Fragments (see here), but ran out of time. For the next couple of weeks, I plan on taking this instrument to its illogical conclusion (I have no idea what it’ll be like when it’s done.) When I am finished, I’ll write an in depth article for The Csound Journal on the final design.

The premise for my approach is to use f-tables as a shortcut for specifying and controlling additive synth data. In today’s example, the audio generator produces a 32 band-limited sawtooth wave. However, before the sine waves are generated with oscil, the synth data is run through two transfer functions, stored as f-tables. One transfer function changes the amplitudes of the harmonics, emulating the EQ of a virtual acoustic body. The other bends the frequencies, causing frequency distortions. Frequencies continue to be processed by the transfer functions, even as they are modulated, which I believe is key to convincing acoustic viability.

The reason why this sounds similar to a bowed stringed instrument is because the amplitude transfer function is filled with the right amount of bipolar noise. The truth is, I had no intention of creating a string-like sound. I was just toying with it and thought I’d try something drastic like using a table filled with noise. After the discovery, I spent considerable time tweaking the values trying to get it to sound a little bit more expressive.

I should warn you, there are some clear cases of aliasing occurring in today’s example. I think I know what’s causing it, but I’ll have to go back and run some tests to be certain. In the mean time, I hope you enjoy.

The Backlog

I’m reposting all the Csound Blog posts from the original site.  The write-ups are stored within the Csound files themselves.  I’m really looking forward to posting new content, and will hopefully have something up by the end of the week.  Without further ado:

SineBox

The Csound Blog
Issue #12

Today’s blog is on SineBox: a “music box” like instrument that plays itself. Once a user starts SineBox with a single i-event in the score, SineBox creates instances of itself, generating multiple sine tones over time. This may not be the most musical piece of Csound technology ever conceived of. It can, however, be molded to fit a wide range of uses, musical and otherwise.

Topics

  • P-Fields
  • if
  • schedule

More at The Csound Blog. For more information about Csound, please visit cSounds.com.

Oscillator Experiment Update: Piecewise Sine

After matrixsynth.com picked up “My Sine Oscillator Experiment,” doktor future started a discussion about different ways of emulating analog oscillators in digital. Adam S mentioned that he thought the Plan B sine looked like a piecewise quadratic to him and provided the following function:

y=
-(4/pi^2)[x - (pi/2)]^2+1, x from 0 to pi
(4/pi^2)[x-(3pi/2)]^2-1, x from pi to 2pi

After having checked it out in grapher.app myself, and confirmed it did look similar to the Plan B sine, I implemented this as a wave table in Csound. See piecewise.csd.

Piecewise + Plan B Model 15

In this image, I have superimposed Adam’s recommended piecewise function over the Plan B’s Model 15 sine wave. As you can see, their contours are not quite identical, though very, very similar.

After listening to both waves side-by-side, the harmonic distortion in the piecewise sine example is a tad louder, and the frequencies are just slightly off. At least to my ears. However, I consider it to be a wonderful approximation of the Model 15.

Oh, the Irony

Peter Grenader, the principle designer at Plan B, has this written in his bio:

“In 2001 , Peter returned to analog after a 22 year hiatus because he tired of trying to force digital instruments to behave in like manner.”

I’m finding this whole discussion a bit humorous as the three of us are doing exactly this, trying to force digital instruments to sound like analog. In this case, Mr. Grenader’s analog oscillator.

My Sine Oscillator Experiment

Over the weekend, I recorded/generated four sine waves of different synthesizer modules and compared the results. Each of the four oscillators are tuned to approximately to 440Hz, close enough to get a sense of each wave shape.

This is a very casual observation of contour and contour only, so please do not read too much into my findings. Here are the results:

Csound Digital Oscillator

This first graph shows a digital sine wave generated within the computer music language Csound. This is what I used as my test reference. Being that this is a purely mathematical construct, I figured this would be the perfect wave to compare against its analog counterparts.

Doepfer A-110 Standard VCO

Upon casual observation, you may notice that the sine isn’t the most accurate in the world. In fact, you might go as far to say this isn’t a sine wave at all. One noticable feature of this oscillator is that little glitch you see at 90º. This is consistent among every cycle at the stated frequency. I have two of these modules, and there were no significant differences when compared to each other.

Now it might sound like I’m completely down on this module. The truth is, I’m actually quite happy with this dirtiness of this unit, as it adds character. It is sometimes the imperfections that make something great.

Plan B Model 15

This unit has the smoothest contour of the three analog examples. Though the shape doesn’t adhere completely to the perfectly generated Csound test reference, it certainly gets close. The peak and the dip seem to be a bit rounder, almost as if they are slightly compressed.

Cwejman D-LFO

Now, I must say that it probably isn’t fair that I’m comparing a device designed specifically for low frequencies. With that being said, the contour fared noticeably better than the Doepfer. You might notice that the peak and the dip are both a little on the sharp side. The D-LFO comes with two oscillators, both of which I tested. I found both to be consistent with one another.

All Examples Compared

For fun, I thought it would be nice to superimpose each example over one another so we can better observe how much variation can exist between sine wave oscillators.

Other Variables in the Equation

Since I recorded the three analog signals, there were at least two extra variables that may have introduced distortion to the resulting wave shapes. The first would be the recording device, an Apogee Ensemble with the soft limit feature set to off. The second is the cable. I used the same cable for all the recordings. I always patched directly from the sine wave outputs to the Ensemble input.

I did go the extra step and recorded the Csound sine wave with the Ensemble and cable. I found there were no significant differences, in terms of contour, between the original generated wave and the recorded version.

My Methods

Last, I want to share the methods I used to collect and present the data. I recorded the three analog signals with the Apogee Ensemble, and with the software Peak. I took screen captures of peak, and then processed them in Photoshop. In Photoshop, I removed the dotted zero line, and replaced it with a solid line. I also resized each image so the waves would have matching periods. Though I compressed the width of each waveform, the contours of the waves were not affected.

And like I said, this experiment is just the casual observations of one guy, and completely non-scientific.