Open303 - open source 303 emulation project - collaborators wanted

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

Post

Kriminal wrote:but do we really need another 303 emu :lol: :lol: :lol:
yes we do, wanna know why?

- there's is no open source emu
- there's no emu that clones the original sequencer
- there's too much myths floating around
- there's people making money with crap clones and spreading false facts about it
- most clones miss a lot of details from the original
- most clones try to re-invent the wheel
- there's no good free clone that's cross platform


kthxbaay :party:

Post

mystran wrote:So unless I fudged something up (which is definitely possible, if not likely) you could get something like this (give or take a couple of sign inversions):

dV1/dt = Ic/C1*( tanh(Vin/(2*Vt)) - tanh((V1-V2)/(2*Vt)) )
dV2/dt = Ic/C2*( tanh((V1-V2)/(2*Vt)) - tanh((V2-V3)/(2*Vt)) )
dV3/dt = Ic/C3*( tanh((V2-V3)/(2*Vt)) - tanh((V3-V4)/(2*Vt)) )
dV4/dt = Ic/C4*( tanh((V3-V4)/(2*Vt)) - tanh(V4/(2*Vt)) )

There's a lot of assumptions above (some of which are probably totally bogus; like I said I don't know much about EE or do I have such a filter to look at, just going by Wikipedia basically), but point is, I can't find a derivation which would demonstrate that we can treat ladders like these as cascaded one-poles (unless someone can point to a reliable source saying that the schematic is totally wrong and the filter was actually wired as a transistor ladder instead).

Oh and when you find that I made some horrible mistake, please point it out. :)
you're correct. and i thought i was the only one... now taking into account the half-cap, we get the digital implementation with backward Euler:

y1 += 2*a*(tanh(x - k*y4) - tanh(y1 - y2))
y2 += a*(tanh(y1 - y2) - tanh(y2 - y3))
y3 += a*(tanh(y2 - y3) - tanh(y3 - y4))
y4 += a*(tanh(y3 - y4) - tanh(y4))

for cheaper processing it can be implemented like this:

y1 += 2*a*((x - k*tanh(y4)) - y1 + y2)
y2 += a*(y1 - 2*y2 + y3)
y3 += a*(y2 - 2*y3 + y4)
y4 += a*(y3 - 2*y4)

when k=17 the poles hit the imaginary axis in analog. beyond that the filter goes into self-oscillation (not the case with TB-303 thou). in digital it has to be tuned - k increases with frequency. also the coefficient a (which adjusts the cutoff) needs to be tuned.

Post

yeah, i asked around too yesterday (because i didn't believe JonnyG) and was told mystran is most likely right

Post

kunn wrote: you're correct. and i thought i was the only one... now taking into account the half-cap, we get the digital implementation with backward Euler:
[...]
when k=17 the poles hit the imaginary axis in analog. beyond that the filter goes into self-oscillation (not the case with TB-303 thou). in digital it has to be tuned - k increases with frequency. also the coefficient a (which adjusts the cutoff) needs to be tuned.
First of all, if one is going to skip the internal non-linearities, I'd just take the actual generic impedance and do a bilinear transform or something, then maybe put the poles (they'll be real anyway) back to cascade (with the individual cutoffs that BLT gives). A low-order integration scheme will behave much better that way. Time-variant behavior might get a bit off, but probably less so than what error comes from simplifying the non-linearities.

That said I've had luck with 2nd order RK (the Heun's variant works slightly better) giving essentially perfect resonance behavior up to about 1/4th of Nyquist (slightly above actually; it's quite reasonable to use it with 4 times oversampling) without any compensation whatsoever. The cool thing is that evaluating the differentials simultaneously (instead of a pipeline), it seems to run faster than typical Euler scheme with the same amount of work (quite likely because of the greatly reduced data-dependencies; it's still seems slightly slower than 4-times oversampled Euler though), without SSE optimization (which there is more opportunities because of the parallelism).

Basically: evaluate all the differentials with previous voltages, add them to the previous voltages (in parallel) to get estimated voltages. Then calculate new differentials from the estimated voltages, and finally average the two differentials before adding them to the voltage state variables. Repeat for the next sample. So double the work, but in practice runs faster than that.

edit: oh and the reason that I started looking into second order methods here was that I wanted to investigate the question that Urs made a while ago: whether there's any advantage of higher-order methods in DSP compared to just Euler + band-aid + oversampling. This one seemed like a nice target.

Post

kunn wrote:y1 += 2*a*(tanh(x - k*y4) - tanh(y1 - y2))
y2 += a*(tanh(y1 - y2) - tanh(y2 - y3))
y3 += a*(tanh(y2 - y3) - tanh(y3 - y4))
y4 += a*(tanh(y3 - y4) - tanh(y4))
*sigh* ... another filter to try out :D
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

mystran: is it too expensive (or even possible) to use Runge-Kutta with internal non-linearities?

btw i use Stilson-Smith way of doing things, where i dont need to compensate k, only tune a. the above is just the simplest form.

Post

kunn wrote:mystran: is it too expensive (or even possible) to use Runge-Kutta with internal non-linearities?
You mean RK4 (the one which is what is usually referred to "The Runge-Kutta")? I don't see why it wouldn't be possible, but you have to evaluate the whole thing 4 times then. Would still easily run real-time if one wanted to try it. Probably should try actually, but 2nd order (which I do run with the full non-linearities) sort of seemed "good enough" when one considers that some over-sampling is useful to help combat aliasing.

I honestly haven't done much of any "formal" research into the thing, 'cos I kinda started playing with it basically like "what the hell can be so hard about the whole 303 thing" and well.. I'm starting to understand though. :)
btw i use Stilson-Smith way of doing things, where i dont need to compensate k, only tune a. the above is just the simplest form.
Hmmh, you mean inserting zeroes to bring it closer to ideal? I tried something similar too, but couldn't get it to behave well enough, and didn't pursue it very far. I think I ultimately ended up with something like "something between 3 and 4 zeroes at -1" but never got it to behave satisfactorily, and didn't bother trying to find an exact solution.

Post

mystran wrote:Hmmh, you mean inserting zeroes to bring it closer to ideal? I tried something similar too, but couldn't get it to behave well enough, and didn't pursue it very far. I think I ultimately ended up with something like "something between 3 and 4 zeroes at -1" but never got it to behave satisfactorily, and didn't bother trying to find an exact solution.
it's not about inserting zeros, but finding the best zero location between Euler (zero at 0) and BLT (zero at -1) cause the perfomance between those is opposite.

Post

kunn wrote:
mystran wrote:Hmmh, you mean inserting zeroes to bring it closer to ideal? I tried something similar too, but couldn't get it to behave well enough, and didn't pursue it very far. I think I ultimately ended up with something like "something between 3 and 4 zeroes at -1" but never got it to behave satisfactorily, and didn't bother trying to find an exact solution.
it's not about inserting zeros, but finding the best zero location between Euler (zero at 0) and BLT (zero at -1) cause the perfomance between those is opposite.
Yeah ofcourse. I realize what I said probably doesn't make any sense to anyone else. Anyway, I realize the proper approach would be to figure out the error between gain/phase-shift, and then fit the zeroes to minimize that. I never bothered, trying (actually quite large variety of) alternative approaches. :)

Post

finaly, some on-topic discussion again ;]
btw, i am using the transfere function that kunn showed, the one with only 1 nonlinearity, which seems to behave the same way as the original filter (i mean, i haven't seen it fail yet, and i'm using it since like a month or something)
/* EDIT: erm, you know.. i've added a HP filter on the feedback, and another one on the input */

kunn: will the one with all the nonlinearities sound different/better or something? haven't tested it

EDIT_2: btw, has anyone a clue where the first HP filter has to be exactly?
i mean, the one which is filtering the input to the filter?
is it some sort of DC-Killer which is right after the oscillator, or inside the main-filter?
it will make a difference
my idea is:
1. DC-Killer: OSC > HP1 > MainFilter
2. OSC > MainFilter
..where it'll look probably like: (kunn's code, a little changed variables:
feedback = (hpf1(input) - k * tanh(hpf2(y4)));
y1 += 2.0 * a0 * (feedback - y1 + y2);

<or>

feedback = hpf1(input - k * tanh(hpf2(y4)));
y1 += 2.0 * a0 * (feedback - y1 + y2);

there is at least one other combination i can think of, what do you think?
can anyone tell?
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

report: i checked it out, needed to change it
now it's:
x0 = hpf1(input);
feedback = hpf2(x0 - k * tanh(y4));

and, when i add the 3rd HP filter at the end, i can perfectly match the audio (looking both at a spectroscope and oscilloscope)
now going for the square..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

rv0 wrote:
Kriminal wrote:but do we really need another 303 emu :lol: :lol: :lol:
yes we do, wanna know why?

- there's is no open source emu
- there's no emu that clones the original sequencer
- there's too much myths floating around
- there's people making money with crap clones and spreading false facts about it
- most clones miss a lot of details from the original
- most clones try to re-invent the wheel
- there's no good free clone that's cross platform


kthxbaay :party:
well, most of those points are moot, but basically, there a few really good emu's out there already, and as the original is not exactly a powerhouse synth, i see little point in ppl keep trying and trying to do it again and again and claim its better....as you said, its re-inventing the wheel...its been done, they work, move along

why not try something someone hasnt already done?

just an idea

Post

Kriminal wrote:
why not try something someone hasnt already done?

just an idea
sounds fashionable..

but thats where it ends. some people are after this, and they dont want something different. just like i need my 303 (although my music sounds rather different sometimes)

as for doing stuff nobody else has done before, imo there is still a world of possibilities out there with the 303.. if played like a real musical instrument.. too bad for the hype and it's scarcity.. fatboy slim was right there..

Post

rv0 wrote:
Kriminal wrote:
why not try something someone hasnt already done?

just an idea
sounds fashionable..

but thats where it ends. some people are after this, and they dont want something different. just like i need my 303 (although my music sounds rather different sometimes)

as for doing stuff nobody else has done before, imo there is still a world of possibilities out there with the 303.. if played like a real musical instrument.. too bad for the hype and it's scarcity.. fatboy slim was right there..
well, i wish you good luck with the venture, seriously

personally i couldnt stand them (i had 2 in early 90's) but i do love the 'acid' sound still...but i can get that from any synth...

Post

Kriminal: i'll give you an advise: ignore any thread that's related to 303 clones and emulations and we'll all be happy ever after ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post Reply

Return to “DSP and Plugin Development”