Open303 - open source 303 emulation project - collaborators wanted

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS
JC-303

Post

antto wrote:floor ;]
...
omega = freq / sampling_rate; // erm, this is always done via reciprocal, no division here
phase = phase + omega;
phase -= floor(phase); // keeps it in the range 0..1.0
Yeah, but the library floor is slow (or used to be) and I usually replace it with a faster version inside tight loops. I should retest this to see if it's still the case.

You can be sure you're not making a call to a function if you do this instead:

Code: Select all

phase += omega;
phase -= phase >= 1.0f;
That is, if C always evaluates true as one and zero as false. I use so many languages I always have to test these things. :-/
Swing is the difference between a drum machine and a sex machine.

Post

nah, if omega somehow is bigger than 1.0 - this code there would fail and if you were reading from a table - you go outside it (probably access violation)

the *perfect* code for what i need for this phase wraping thing would look like this:

phase += omega;
while (phase >= 1.0) { phase -= 1.0; }
while (phase < 0.0) { phase += 1.0; }

actually the floor() trick does exactly the same, maybe there are small differencies around the precision (since i'm subtracting there) but i haven't noticed any bad effects yet (and i'm using this trick since for quite long)
also, most of the times my phase is a double (64bit float)

btw, i tested the osc with a plain ramp (no tables, no nothing)
i could hear aliasing..
tho, i was generating the saw at the sampling rate, gonna try it at the 4x oversampling stage..
but i can really use this while the synth is silent
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

>>nah, if omega somehow is bigger than 1.0

I've made mine so omega is never negative nor anywhere close to 1.

Having said that, I do use the while during debugging. In my case it's a bug I assert on if omega is below zero or above 1. In fact, oversampled omega is always tiny--way, way below 1.

There's no problem with the floor "trick" other than it's silly to make a call to a library function when it's not needed. I do everything way oversampled, so I try to tighten up everything in the inner loop.

But you may not notice any difference.
Last edited by mistertoast on Sat Sep 19, 2009 7:12 pm, edited 1 time in total.
Swing is the difference between a drum machine and a sex machine.

Post

"btw, i tested the osc with a plain ramp (no tables, no nothing)
i could hear aliasing..
tho, i was generating the saw at the sampling rate, gonna try it at the 4x oversampling stage.. "

Yeah. I'm at 8x and may make a run for 16x with some more optimization.
Swing is the difference between a drum machine and a sex machine.

Post

well, you are writing a VST, i'm using SE.. doing 16x (or more) oversampling wouldn't be hard if i was doing the whole synth inside one single SE module, but i did it the "normal" way, each "part" as an individual module (so, more oversampling between my modules means more audio buffers..)

bandlimited + 4x (or no) oversampling will work for the osc

will try to catch the "bad" tuning of the osc now (using my measurements)
i'm thinking it's either just like a linear scaling, or some curve..
it's kinda hard when i got only 4 keys, but it would take more time if i had an audio with all the keys on the TB-303 (blah, like 3 octaves)
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:well, you are writing a VST, i'm using SE.. doing 16x (or more) oversampling wouldn't be hard if i was doing the whole synth inside one single SE module, but i did it the "normal" way, each "part" as an individual module (so, more oversampling between my modules means more audio buffers..)

bandlimited + 4x (or no) oversampling will work for the osc

will try to catch the "bad" tuning of the osc now (using my measurements)
i'm thinking it's either just like a linear scaling, or some curve..
it's kinda hard when i got only 4 keys, but it would take more time if i had an audio with all the keys on the TB-303 (blah, like 3 octaves)
Yeah. Absolutely. What makes sense for you and what makes sense for me will sometimes overlap and sometimes not. Always worth talking about alternatives. I'll write and rewrite my code several times.
bandlimited + 4x (or no) oversampling will work for the osc
At 2x, you can afford to use the bandlimited osc from an octave down. At 4x, you can use the bandlimited osc from two octaves down, right?
Swing is the difference between a drum machine and a sex machine.

Post

antto wrote:well, you are writing a VST, i'm using SE.. doing 16x (or more) oversampling wouldn't be hard if i was doing the whole synth inside one single SE module, but i did it the "normal" way, each "part" as an individual module (so, more oversampling between my modules means more audio buffers..)

bandlimited + 4x (or no) oversampling will work for the osc

will try to catch the "bad" tuning of the osc now (using my measurements)
i'm thinking it's either just like a linear scaling, or some curve..
it's kinda hard when i got only 4 keys, but it would take more time if i had an audio with all the keys on the TB-303 (blah, like 3 octaves)
I wonder if the tuning quirks are per-instrument (different among different hardware 303s) or whether there's some sort of distinctive tuning "errors" caused by the circuit design.
Swing is the difference between a drum machine and a sex machine.

Post

i guess a little of both ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:i guess a little of both ;]
In that case it's a problem of statistics.

But who knows--we might get samples from 3 different 303s and see that they are all pretty tightly clustered.
Swing is the difference between a drum machine and a sex machine.

Post

Slightly off topic, is the MC-202 as close to the TB-303 circuits as some people say?

Some say it's junk and some say it's awesome.

But anyhow. Some guy seems to have scoped the raw oscs in it and they are very telling. Especially look at how the saw is not symmetric.

http://analogsweden.com/blog/?tag=mc-202
Last edited by mistertoast on Sat Sep 19, 2009 8:14 pm, edited 1 time in total.
Swing is the difference between a drum machine and a sex machine.

Post

i'm very unfamiliar with analog synths, MC-202 hm.. i can only tell by the name that it is probably a roland synth? ;]

anyway.. just did some conversions back and forward..
the "bad" tuning seems to be really simple
after converting the frequencies of the notes into simple 1V/Oct linear scale value, the tuning looks like a simple linear scale ;]
i knew it ;P~
gonna add yet another hidden knob ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

mistertoast wrote:@antto, all those things like whether you try to get rid of Gibbs with multipliers and whether you slightly change phases, etc. can affect the filter response. That's one reason I bailed on band-limited oscs for this current project of mine. I wanted the filter to actually hit the RAW osc, no matter what the note. I'm trying to sound as analog as possible. That's actually more important to me than matching the 303.
Careful there. Your filter is probably not analog, and therefore can possibly only attempt to model the analog behavior up to some finite frequency. By feeding it with something that isn't band-limited just means feeding it stuff (namely alias) that isn't there in the analog version.

I'm personally not convinced that the Gibbs effect is all that big of a deal. It'll increase your peak-to-peak amplitude, which might have an effect depending on the waveshapers you're using, and very narrow transitions (the type that you get if you naively add sines together up to Nyquist) will have a lot of audible ringing (just like any sufficiently steep filter) but that's about it.

With non-bandlimited oscillators the general aliasing noise and it's endless intermodulation products will certainly help to mask the additional aliasing products from the non-linearities, but I'm not convinced that's the right approach.
That's the great thing about this whole project, to me. All of us (you, me, Robin, mystran, and anyone who starts with Robin's code) will end up with different synths because we will make different trade-offs and have different areas of exploration and pickiness.
Careful, I'm not doing a 303 emulation. :roll:

Post

yeah, i really don't want to get the whole thing starting off with aliasing from the Oscillator in the first place (would make a mess)
even that i'm using 4x oversampling, i lookup in the tables where there are no harmonics above the original sampling rate (while i _could_ use the 4*sampling_rate as a upper limit, only i don't want to..)

i'm really not sure about wether the "gibbs" effect is good or bad in my case, i'm sure i don't like how it looks ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Yes, but you seem to be doing an acid synth of some kind. Didn't mean to say what you were doing, but you have been posting some nice sounds. :-)
Swing is the difference between a drum machine and a sex machine.

Post

antto wrote:i'm very unfamiliar with analog synths, MC-202 hm.. i can only tell by the name that it is probably a roland synth? ;]

anyway.. just did some conversions back and forward..
the "bad" tuning seems to be really simple
after converting the frequencies of the notes into simple 1V/Oct linear scale value, the tuning looks like a simple linear scale ;]
i knew it ;P~
gonna add yet another hidden knob ;]
http://analogsweden.com/blog/?tag=mc-202

Look at the saw and its asymmetry. And look at the edges of the pulse and square. Just thought it was interesting, as I don't know the MC-202 well at all, but it has high ratings over at Vintage Synth. And it is a Roland analog design. http://www.vintagesynth.com/roland/mc202.php
Swing is the difference between a drum machine and a sex machine.

Post Reply

Return to “DSP and Plugin Development”