Open303 - open source 303 emulation project - collaborators wanted

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

Post

I was going through some of my notes for developing ABL1 and found some stuff that might be interesting (or not). I was planning on writing up a blog post about this stuff some years ago, but never got around to it. The images are low resolution unfortunately, I do have better images stored somewhere on my other (defunct) machine but this is what I recovered from my webserver.

Oscillator

Here's the square wave graphed as a 3D function. I've normalize the period of the waveform to scale uniformly so that we can see how the creases develop as a function of time and frequency (note number). So x-axis is time, y-axis is amplitude and z-axis is frequency in a log scale.

Image

The same for the sawtooth:

Image

More simple measurements of the oscillator: The upper graph shows the note number (as output by the 303 sequencer, which is converted into an analog pitch CV) vs frequency. As we ca see the tuning of my particular 303 is a bit off (the dashed line). The filled line is the exact theoretical tuning (i.e a regular pow curve).

The lower graph is rather interesting as it shows the duty cycle of the square wave as a function of note number (frequency) . The blue line is as measured on a 303 and the green line is an approximation as simulated in ABL1.

Image

Filter
Regarding the filter, it's tricky getting all the control signals right. I measured the resonant frequency as a function of the cutoff knob position. For this we used a midified 303 which accepts a cutoff value from 0-127. The cutoff knob position is normalized into 0.0-1.0 range. Note that we measure the resonant frequency which is not the same at the cutoff frequency, the reason we do this is because resonant frequency is the highest we can represent in digital which is up to nyquist. The cutoff frequency would actually be higher than nyquist at the top most range.

Image

This helps determine the overall knob response function, however more detailed work is needed to figure out how the envelope modulation and basic cutoff frequency combine to set the filter CV. The 303 schematics tell you whether the knob pots are anti log or linear in behavior, and IIRC the cutoff pot is anti log. Anti log in analog is not a perfect curve however. For reference here is a simple log/anti log graph:

Image

So the lower curve is the inverse of the upper curve. One fed into the other would produce a straight line. Doing the same on the 303 circuit produces however:

Image

(The graphs above are mislabeled, they are not log/antilog. They are antilog(log()) and log(antilog()) so still inverses of eachother). I think the red lines show the max/min variance that the antilog may have but I'm not sure of this.

Regarding the CV input of the filter I did some spice modeling to help figure this out, as well as measuring on a real unit. I have no idea if these are the complete spice schematics but I'll post them here anyway.

Image

Image

Again most of this work is 6-10 years old so I'm shady on the details. While I keep improving the 303 model on a yearly basis I feel we pretty much nailed the CV portion of the 303, and the analog synth portion keeps evolving.

So this is just a microscopic part of the work we did for the oscillator and filter CV sections, much work remains for the accent CV and actual filter modeling. I think someone released a pretty good analysis on how the 303 filter works however simulating it is a completely different ball game, as I'm sure you know.
AudioRealism
www.audiorealism.se

Post

very interesting, the "pulse width ratio" curve, looks a lot like mine (see soff variable on the previous page) only that mine goes negative after ~119Hz

the tuning is approximately like scaling the 1V/Oct voltage:
note number > convert to 1V/Oct, scale by 0.997, convert to Hertz
btw, ladyada's TB-303 has the same tuning of around 0.997, while rv0's and some of the other samples are above 1.0, for example 1.027 (rv0)

the resonant frequency vs cutoff knob is interesting, but i don't understand..
Y axis is in KHz?
and how was it measured? with envmod=? and, did you measured the highest peak, or the lowest (when envelope decays to ~0.0)

great stuff!
btw, Mike, do you still have the TB-303 there? ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote: the resonant frequency vs cutoff knob is interesting, but i don't understand..
Y axis is in KHz?
and how was it measured? with envmod=? and, did you measured the highest peak, or the lowest (when envelope decays to ~0.0)
great stuff!
btw, Mike, do you still have the TB-303 there? ;]
Ah, yeah the graph probably shows the CV input the filter as resulting resonant frequency, not cutoff knob position.
We used a modded 303 which took values 0-127 (via midi) which I normalized to 0..1 in the graph and the frequency range is about 200-25000 Hz.

And no, I don't have that 303 anymore. It belonged to friend of mine who helped me do the initial measurements.
I have another 303 now which is much more stock, i.e not modified at all.

--Mike

Post

envmod must have been max..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:..the symmetry, the additional sawtooth mix level, the negative clipper level, and the final volume are adjusted depending on frequency
it's not "correct" .. the smoother edge is smoother, but the shape is not exact, so my circuit is wrong somewhere, but anyway, the purpose of this smoother edge is only important to the filter, so it's fair..

the need to adjust the final volume also tells that my circuit is wrong somewhere..

so that kinda looks like this:

Code: Select all

		x = sawtooth; // my ramp, it's -1 to +1!
		xh = x * xha;
		x = shp((-x - soff), 0.027);
		x = (x > c2 ? c2 : x); // positive clipper here
		x = x + xh; // adding some of the sawtooth here
		x = hpf2(x,21Hz);
		x = (x < -c ? -c : x); // negative clipper
		output = x * ac; // amplitude correction

erm, the approximitations for these values are ugly, they waste CPU, but what the hell..

	double FcX2 = Fc * Fc; // optimization
	double xha = 0.36907658 + -0.00084413331 * Fc + 71.608498 / (FcX2);
	double soff = (0.90412745 + -0.0082430065 * Fc) / (1.0 + 0.057837048 * Fc + 3.1131084e-005 * (FcX2));
	double c = 0.82866767 * exp(-exp(4.1103204 - 0.1668213 * Fc));
	double c2 = 0.545;
	double Fc_pow = pow(Fc,-4.4282836);
	double ac = ((0.47700034 * 0.0019996586 + 321.55132 * Fc_pow) / (0.0019996586 + Fc_pow)) * 2.2;
i just found some small thing i need to investigate tomorrow, but if nothing happens, i'll probably use this code here
there, as i was changing the position of the clippers and stuff, i forgot to move one of the HP filters inside this circuit, it was supposed to filter the additional sawtooth (xh variable) before it gets added to the shaped saw.. (x = x + xh)
now i fixed that, added the HPF as it had to be, and started tweaking the knobs again
i think now there is no need for the final volume correction
still ain't finished but it's looking good.. i have to change all the other HPF filter frequencies now, then measure and blah blah.. :hihi:
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

failed, the coefficients i measured looked very ugly on the plot, not easy to approximate, and there was still the need to alter the final volume of the output (tho, not that much)
i'll use my previous circuit, blah

i just tested the synth with a state variable filter, muhahaha ;]
i added the nasty HPF on the feedback again, and used only the LowPass output, but it sounds very good with resonance
turning the resonance off and it gets real quiet.. not so exciting like the 303 filter, but this can be "fixed"
if anyone's interested i can record a demo ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

... BUMP!



It's been awfully silent.
I'm @ home till 4th of January so if there's any request for samples you'd better ask away now..


I'll be very busy next year :(

Post

cool!
rv0: i'm rewriting huge parts of my sequencer
samples - probably
but i'll mostly need your opinion

and if you happen to know someone who's selling either a TB-303 or a x0xb0x - let me know, i kinda have some money now ;P~
i'm going to work now, be back later
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

yes i haven't been around much here at kvr in general because i'm currently working on a big refactoring/rewriting of my entire codebase which takes up all my time. as for samples: i think, i currently have what i need

@Mike: i really appreciate your showing of your measurements. cool idea to plot the waveshape as function of frequency in a 3D plot.

i wonder if it could be advantageous to start with multi-samples from a raw 303 oscillator signal in the osc section instead of synthesizing the waveforms synthethically.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin: you still need to have the HP filters..
these make tiny sonic variations in the waveform depending on the notes played
otherwise, it'll sound completely "dead"

at least, that's my opinion..

oh, you said "raw" .. probably the square wave you meant?
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Robin from www.rs-met.com wrote:i wonder if it could be advantageous to start with multi-samples from a raw 303 oscillator signal in the osc section instead of synthesizing the waveforms synthethically.
+1

This is a great starting point for testing the accuracy of the filter.

Post

antto wrote:oh, you said "raw" .. probably the square wave you meant?
both, raw square and saw. and yes, the additional filters must probably be there regardless. but if the raw osc signal is already different from a mathematically perfect saw-/pulsewave, then it could make sense to use it 'as is', if available
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

yes, i still think the sawtooth is very simple, only the square has some dirtiness involved

but then, how will you extract the samples?!
if you somehow "hack-in" an audio output from the oscillator and record it, then you'll have at least 1 HP filter from your A/D converter
or instead, use an oscilloscope or some other recording method? seismograph? :-o
if someone can do this - it would be so brilliant!
but, as for using the recorded multi-samples, i'm not sure how it's gonna work when slides come to play.. especialy with the square..
with the samples, you could record any nonlinear stuff around the sawtooth like shapers if there are such, and it'll work with slides just fine, but the symmetry of the square has something to do with HP filters, and the ugly clipper has HP filters around it too, so multi-samples won't work there if you ask me..

btw, my last "approximitation" of the square is very good, altho aliasing if pitched high (which is unusual for the TB-303 in practice) and maybe hard on the CPU but..
tell me if you can't find it, i'll repost the whole thing (i might have done some small change since then)
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

you can cancel out the highpass filters by lowpass filtering. the dc levels will have a huge amount of noise on them though which means you can really gain about 40db (move the cutoff point five octaves lower)

that should be more than enough to get the waveforms "straight edged" again. in fact a linearity of 10 is usually enough.

it's pointless though - the model is a better solution because of the variation in the electronic versions. an audibly accurate model is even simpler than the one i suggested with the test application. the important thing with the model is that you need to start from the correct data in order to model anything - if you just take 303 output samples you'll get absolutely nowhere. for example, apparently people are unaware that a class-a amplifier inverts the output signal after a highpass filter. if you count every one there are seven highpass filters between the oscillator and output. the filter and vca have significantly non-linear inputs.

the issue with using samples for the waveform is that these will only be correct if used statically - if you change the tuning of the oscillator or adjust the waveform the output will no longer match the electronic circuit.

Post

hi all,
found this via the wikipedia entry about the filter
http://www.timstinchcombe.co.uk/synth/d ... diode.html
edit:oh, you've been there already.
http://www.timstinchcombe.co.uk/synth/d ... iode2.html
there's this too:
http://kn.theiet.org/magazine/issues/09 ... y-0918.cfm
found this fascinating, as with rest of thread.

if i may chip in, i feel it'd be good to keep the sequencer style,
albeit with a more convenient editing mode/alternative view, and some
extra compositional options ( the abl is pretty good ), and to have
graphics evoking the original fairly closely. doesnt have to be 'realistic',
but a 303 is a 303. once its nailed, soundwise etc. it can get its mods, no?

antto's plugin is just great, especially the sequencer operation, the acidevil
sounds pretty good too. still reading through your findings... 8)

Post Reply

Return to “DSP and Plugin Development”