MATRIXSYNTH: My Sine Oscillator Experiment


Monday, May 28, 2007

My Sine Oscillator Experiment

via thumbuki

"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....

The oscillators in question are:

Csound Digital Oscillator
Doepfer A-110
Cwejman D-DLFO
Plan B Model 15"

Title link takes you to the results.

11 comments:

  1. You should do a high-res FFT analysis on those waveforms.

    What you'll find is the relative strength of other harmonics. These can make a sine wave very pure (absence), a bit wooly, or otherwise different.

    When you see a plumped up sine wave, or a skinnier sine wave, it's harmonics in the waveform that are doing it.

    If you can get the relative strength of the first few harmonics, one can input that into Csound, or an additive synth (e.g. Kyma) and re-create those sine-waves reasonably.

    On the Kyma, there are waveforms for Serge, Juno, Prophet, and other synths sine waves. Some are not even symmetrical (first 180 is not mirror of second 180). One fun thing is to make a synth and have it morph between different synths waveforms. The changes are sometimes subtle, but often larger than you'd think!

    Remember, if you're doing something like FM, it's not just the fundamental frequency that is modulating, it's all the harmonics too.

    OMG why am I making a sane post. This is not normal for me.

    ReplyDelete
  2. I do have to say, the thought has crossed my mind. I've been thinking of several approaches to doing this. Using an FFT to find the strengths of the harmonics, and then generating a series of band-limited tables would probably yield the best results. Or if I didn't want to worry about processor efficiency, I could go the additive route and have multiple sine oscillators running at once.

    I've also thought about creating transfer functions directly from analog wave forms. If I utilized -90º to 90º of an analog single cycle wave as my function, and ran a triangle wave through it, it should approximate the contour of the wave. I could then create several transfer functions from the same oscillator taken at different frequences (ie one wave form per octave) and then interopolate the transfer functions based on the current frequency. If we really wanted to get crazy, the low end functions could be from a juno, the mid range could come from a moog, and the high end could be pure digital. This should work in theory.

    Another possibility is to create a table from a single cycle, and then use this as the waveform. Though these certainly wouldn't benefit from from the continuous micro variations in the waveform. Now that I think about it, nor would the transfer function solution. Though the benefit of the transfer function is that one could run other signals besides a triangle through them. Though I imagine aliasing would quickly become an issue.

    ReplyDelete
  3. "When you see a plumped up sine wave, or a skinnier sine wave, it's harmonics in the waveform that are doing it."

    Or, when you detect harmonics above the fundamental, it's the waveform that is doing it. So when you see a plumped up sine you can expect extra harmonics.

    To do additive resynthesis of any of these using CSound, just use its analysis generator with the desired fft resolution (8192 for me) on a soundfile. Then use this analysis file as the input to the pvoc opcode (phase vocoder), and oscillate away! For a less cpu hungry solution, take the power spectrum (as doktor noted) and use that data to write a sinsum table at the top of your sco file, which can be used by the oscil opcode, effectively creating an oscillator bank with one opcode (iirc).......

    BUT WHY EVER WOULD YOU WANT TO DO THAT!?

    ReplyDelete
  4. thumbuki, if you are going to use the wavetable approach aliasing would definitely be a problem. this paper on may be of interest.

    http://www.iua.upf.edu/mtg/publications/c96213-DAFX06-ggeiger.pdf

    ReplyDelete
  5. Thanks for the suggested reading. I love stuff like this.

    ReplyDelete
  6. Yes, great reading...thanks!

    ReplyDelete
  7. Ok, going to say something really geeky here, and I bet no one's even looking at this anymore... the plan b sine looks more like a piecewise quadratic to me, so I checked it out using apple's grapher app. The piecewise 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

    looks like a plumpy sine (overlay this with sinx). Turns out the osc has nothing to do with this idea, but (ignorantly) I assume that in analog it would be possible to shape a quadratic and perhaps even coerce the fatness inward a tad... Hell I have no idea what I'm talking about and I bet no one reading this does, either!

    ReplyDelete
  8. adam s:

    That equation is a very nice approximation of the Plan B wave. I went ahead and implemented it in Csound. Doesn't sound exactly like the Plan B, as the harmonic distortion is a bit louder and the frequencies produced by the distiortion are a little off.

    Here's the code that creates the waveform:

    gitemp ftgen 1, 0, 2^20, 10, 0

    instr 1
    itable = 1
    isize = tableng( itable )
    ictr = 0

    start:
    ivalue = -1 * ( 4 / ( $PI^2 ) ) * ( ( ictr / ( isize / 2 ) * $PI ) - ( $PI / 2 ) )^2 + 1

    tableiw ivalue, ictr, itable
    tableiw ivalue * -1, ictr + ( isize / 2 ), itable

    ictr = ictr + 1
    if( ictr < ( isize / 2 ) ) goto start
    endin


    I've uploaded piecewise.csd for anyone wishing to try it out. It alternates between the pure sine and the piecewise sine every four seconds for 16 seconds.

    ReplyDelete
  9. very cool. will check this out later.

    maybe I'll make a vst that does this.

    ReplyDelete
  10. can c-sound create vst instruments? that would be cool.

    ReplyDelete
  11. In a sense, yes. There is CsoundVST, which is a version of Csound that has been translated into a VST plugin. People can use Csound instruments as effects or as instruments in software that supports VST hosting. However, you can't compile a VST plugin directly from Csound, yet.

    I've not used CsoundVST. I think it only works on PC at the moment.

    ReplyDelete

To reduce spam, comments for posts older than one week are not displayed until approved, usually same day. Do not insult people. For items for sale, do not ask if it is still available. Check the auction link and search for the item. Auctions are from various sellers and expire over time. Posts remain for the pics and historical purposes. This site is meant to be a daily snapshot of some of what was out there in the world of synths.

PREVIOUS PAGE NEXT PAGE HOME


Patch n Tweak
Switched On Make Synthesizer Evolution Vintage Synthesizers Creating Sound Fundlementals of Synthesizer Programming Kraftwerk

© Matrixsynth - All posts are presented here for informative, historical and educative purposes as applicable within fair use.
MATRIXSYNTH is supported by affiliate links that use cookies to track clickthroughs and sales. See the privacy policy for details.
MATRIXSYNTH - EVERYTHING SYNTH