SynthMaker

are all digital oscillators wave tables?

Archive · 2010 7 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

overhishead ·

i was wondering if there are any code or primitive-made examples of oscillators because i am fighting my brain to understand how oscillators work. reading...

Tzarls ·

Check this topic: using wave file converted to text as wavetables

There aren´t oscillators inside, but there are some maths-generated waveforms that can be used as the basis for an oscilator, maybe you´ll find that helpful.

oddson ·

But those are wave tables... all SM oscillators are wave tables but it's possible to make a digital OSC that isn't... but I'm not sure it's worth it since it would be indistinguishable.

MichaelBenjamin ·

i always wondered why the sine - if it really is a wavetable, never created any dat file.

the most simple explanation i can come up with is for a ramp oscillator. say you want 1 cycle per second, so the oscillator runs at 1hz. then you just divide the number of samples in one second by the number of cycles you want to have per second. in this case its 1/44100 or 0,000022675737 now when you add 0,000022675737 44100 times, you have 1. then just reset to 0 and you get a ramp that counts up from 0 to 1 in one second. the number that needs to be added is then called the frequency. now you just multiply by 2 and substract 1 to convert the 0-1 to -1 / 1 and you have a basic saw.

overhishead ·

at what point is a 'sound' value generated? would a static float value end up sending DC if it were sent to the sound card? what 'tells' the resulting value of a digital osc to 'read' a sine function (for example)

i guess a sine function can be made with maths, but how do you 'tell' the output to 'read' the values along that function in a linear fashion? i assume that has to be done with some code.

let me see, maybe one would establish the sine function and relate that to sample rate, and arbitrarily pick a place where the value of (y) is zero, and then sample-by-sample (the x-axis), read that value and send it to the output and add one sample unit and put that value into the sine function and return the value of (y) to the output... the value of (y) would eventually be zero after 90 degrees but 180 degrees would be the one to stop this 'reading' process and return the reading position to the initial zero position.

so if the project is 44.1k sample rate, and if the frequency of the note that the sine wave should play is 440hz, then every 100 samples, 180 degrees of a sine wave are made or something.

im guessing out loud though. as you might be able to tell, im trying to re-invent the wheel here, but i am still missing vital part of understanding on how an oscillator works, add the DSP programming conundrum to that and that equals a fraction of my ignorance.

Acrobat ·

overhishead wrote: i was wondering if there are any code or primitive-made examples of oscillators because i am fighting my brain to understand how oscillators work. reading...

The main difference is sound quality - the values of WT oscillators are treated in a way similar to samples in a sampler: an array of values describe a wave in a finite number of Ys on the X (time) axis , so sliding on the frequency control the values are played faster or slower, allowing the player to produce different pitches with almost the same spectrum content . A digital oscillator is only based on a math formula so it produces massive aliasing especially when playing polyphonically.

trogluddite ·

overhishead wrote: i am still missing vital part of understanding

Don't be so hard on yourself, you obviously understand better than you think... Your reasoning is pretty much spot on - the only thing wrong is that you have to do the complete 360 degrees to get the full cycle of the wave. The sine wave is above zero for 180 degrees, but also there is the below zero from 180 to 360. The only difference with most oscillators (as said by acrobat) is that instead of calculating the sine maths (uses lots of CPU), the output is read from a sample (the wave table, like a wav file) with 360 degrees of a sine inside it. For higher and lower pitches, you read the data faster and slower - but yes, this makes the quality worse because you may not be reading one whole sample each time - so then you need clever stuff like interpolation and filters to smooth the sound. Without the interpolation and filtering you get a sound like 8 bit glitch music (very crunchy, I like it 😈 )

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.