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:for the resonance.. i think in most unmodified tb303 can't normaly go into selfoscillation, they are even quite far to figure the maximum resonance,
It's possible to increase the amount of resonance by changing the voltage feed to the filter via a trim pot (TM4 iirc), though it will never go into self osc (but gets pretty close).

Post

yeah, so there should be a knob for this in our synths too
kind of hidden one (backpanel or something)

Robin: pretty good looking code, but i was a little amazed by some things
you use FFT to generate your waveforms!?
i never got to understand how FFT code works, it's beyond me, can't help there
but it's a "pure saw" right? looking like a linear ramp thing?

blah, i probably got more questions, but i'll waste your time
what parts of the code needs to be improved?
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

btw, i'm still kind of struggling with the square waveform
using kunn's filter (which i like very very much) and 3 HP filters, plus my nasty square shaper circuit.. i can get almost the exact harmonics + levels
i'm using the last audio sample from rv0 (anttosqr.wav) and looking at VoxengoSpan, maximum resolution..
to get the low-freq attenuation curve, i have to tweak all HP 3 filters, including the one on the resonance, and i can get the whole thing to follow the audio sample really really close, but then the phases (or in other words - how the waveform looks on the scope) get ugly
i can either tweak it so that phases look OK but harmonic levels not, or vise-versa
what ever i do!
maybe i missed something?
does a digital ladder filter (be it this 303 ladder from kunn, or a moog ladder) have the same phase response as the analog filter, or not?
as far as i know, 1 pole filters (HP,LP) have the same characteristics as their analog brothers, but i think there was something about the "global feedback" or "feedback from the fourth pole" 1 sample delay issue that messes things up like the 17.0 K parameter that needs to be increased in the digital implementation
does this mess up the phase and it no longer looks like the analog filter or what?

i don't know what to do, i'm stuck, i want to continue work on the square wave till i make it perfect, but i'm running in circles since a weak or somethin' .. :tantrum:
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Is there a new version to download somewhere?
Best regards from Johan Brodd.
JoBroMedia since 1996.

Post

not sure, the code is available at sourceforge, but i didn't see a built version
just by looking at it, i think i won't be able to compile it without modification, because i use CodeBlocks, and my MSVC++ f*ck?d up recently
hm.. tho, i can configure CodeBlocks to use the MSVC++ compiler instead of GCC, not sure what'll happen ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

hey antto,

if you have reaktor you could take a look at this.
Gets rid of the one sample delay problem. And you don't even need oversampling.
it shouldn't be too hard to convert to code. there are papers available somewhere but I can't find them right now.

http://www.native-instruments.com/index ... tchid=7299

Post

nope, i don't have reaktor, what's it all about?
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:Robin: pretty good looking code, but i was a little amazed by some things
thanks.
you use FFT to generate your waveforms!?
yes, i'm using a technique known as mip-mapping to generate bandlimited waveforms. it goes like this: generate a prototype table -> take the FFT -> generate various bandlimited versions by truncating the spectrum and taking the inverse FFT
it's a "pure saw" right? looking like a linear ramp thing?
the prototype is a pure saw, yes
blah, i probably got more questions, but i'll waste your time
what parts of the code needs to be improved?
basically everything - oscilator waveforms, filter, envelopes. perhaps mostly tweaking of internal parameters but possibly also some architectural changes (maybe i'll switch to your square = tanh(hpf(saw)) scheme at some stage - although that would introduce aliasing already at the osc-stage which i don't really like). when i have some more documentation ready, i will come along with more specific requests
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

yeah, i also use a technique inspired by game textures, mip-mapping ;]
but probably in a different way, i generate one big table (the size of which depends on the sampling rate, and is big enough to be played at ~40Hz having all harmonics up to nyquist)
then i allocate twice that size, and i generate the same table more times, everytime twice smaller than the previous..
but i use additive synthesis (sin())

so, the FFT thing reduces the spectrum, and i know FFT kinda works cheap, it'll probably be much faster than my additive synthesis (tho, it's only on init, not really critical)
does the waveform still look like a pure-saw after being FFT'ed?

as for the square, i actually figured that using the bandlimited sawtooth to drive the square shaper is worse, because you get a nasty edge right on the positive peak of the square, which "rings"
using a math-ramp instead was better, and the aliasing isn't so bad
also, if you generate the math-ramp in the 4x oversampling stage, the filter won't mind
and consider the actual frequency range of the TB-303 sequencer + TUNE knob.. isn't really high
but for the sawtooth itself - the bandlimited one should be used definately

i am still not happy whith my square waveform experience so far, i can't get good results and i *think* it might be because of the phase response of the filter, being too different than the analog one, probably because of the delay in the feedback which doesn't work exactly like in the analog one
so i can't get close-to-perfect results in both oscilloscope and FFT
i can't report anything right now, i'm stuck here

my idea is: i have an audio sample of the same thing (sequencer range test) with the same settings recorded twice with each waveform (saw/square)
one of the settings is no resonance
so i think that when i tweak my HP filters to match the same looks (phase response, harmonic levels curve) of the sawtooth audio, i will automaticaly have the same looks/harmonics when i switch to square and compare to the square sample
but this idea fails
and when i tweak the thing a little more so the square looks better - then when i switch back to sawtooth and compare - damn, spoiled
but i don't think these internal HP filters in the real TB-303 have anything to do with the waveform choice, they must be static, as far as i understand, anything beyond a 1 pole RC filter is not cheaper, and i don't think some of these might have different settings depending on the waveform choice, or am i wrong?

but i think, the digital filter phase response should be verified, unfortunately, i can't, mystran/kunn/Tim should be able to tell about it
if getting the waveform looks (due to phase response difference) is normal - then there are two ways to go:
1. figure anything that might fix it, so it looks like the analog filter
2. live with it, and stop looking at the oscilloscope, only the FFT (which is harder most of the time)
:shrug:
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

i give up, i will now do whatever tricks i can to immitate the saw/square waveforms, without thinking about the real circuit or anything
i will probably ignore the ugly "bump" on the square wave too

i tweaked a setup now, where my feedback-HP filter is lower than i like it (54Hz) so i will probably increase the frequency depending on the resonance level of the main filter
..this is what neotec is doing too if i remember correctly
anyway, i'm focused on the samples of the saw/square with no resonance
the feedback-HP at 54Hz
the last HP (A/D convertor or whatever) at 32Hz
and the DC-Killer (input-HP) depends on the waveform
for the sawtooth i use 17Hz, which is very very close
then, for the Square, it's higher, something like 61Hz
..but no "bump"

:? :shrug:
i hope someone has better ideas about the square..
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 give up, i will now do whatever tricks i can to immitate the saw/square waveforms, without thinking about the real circuit or anything
i will probably ignore the ugly "bump" on the square wave too

i tweaked a setup now, where my feedback-HP filter is lower than i like it (54Hz) so i will probably increase the frequency depending on the resonance level of the main filter
..this is what neotec is doing too if i remember correctly
anyway, i'm focused on the samples of the saw/square with no resonance
the feedback-HP at 54Hz
the last HP (A/D convertor or whatever) at 32Hz
and the DC-Killer (input-HP) depends on the waveform
for the sawtooth i use 17Hz, which is very very close
then, for the Square, it's higher, something like 61Hz
..but no "bump"

:? :shrug:
i hope someone has better ideas about the square..
Antto, the square is fairly unremarkable when decoupled from the rest of the signal path, its pretty much a stock square wave with duty cycles which you previously noted. It's when it is coupled with the filter and the other blocks odd things start to happen. The filter is unbuffered and it bears down on the osc in unpredictable ways.

Also, your square was sounding pretty accurate last time I checked, what aspects on it are you trying to improve exactly?

Post

the "visual" aspect mostly
at very low frequencies, there is a "bump" on the negative peak, which makes the negative peak weaker (in amplitude)
it looks like it's a bunch of HP filters and a hard-clipper going on there
i'll upload another sample, so you can see what i'm talking about

when the osc frequency rises, this bump "moves" .. and "joins" the negative peak, and it becomes stronger, equal (or almost) to the positive peak

now this might have pretty small effect on the harmonic character of the square, since such low frequencies are mostly inaudiable (and all of the HP filters afterwards kill much of the signal anyway)
i just want to get it right, because it bothers me when i do comparisons

btw, i previously said i would probably never have the chance to own a TB-303
well, there might be a chance (tho, i might regret it later)
we (me and my parents, actually, my mother) own two apartments, we only use the bigger one, and we're thinking to try and sell the other one, for about 37000 Euro or something
i could buy myself something, maybe a x0xb0x, it's cheaper.. tho i really want a real unmodded TB-303.. erm, and a midi keyboard
but have no idea would someone buy the apartment..
i just hope it happens.. soon
this was kinda offtopic, sorry, i really want a 303 in my hands ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

http://www.box.net/shared/f5edqc82pu (~8mb)
here, Left: Venom, Right: rv0's TB-303
both my synth, and the TB-303 sample were recorded at 88200Hz
first part is the sawtooth, i think it's ~93% perfect*
then the square, which i'm not happy with
you can see the "bump" on the first few notes (right channel)
now i know this is a hardclipper with a bunch of HP filters around it, it's just too tricky/complicated to replicate..
and because of it, look how the negative peak is "smaller" if you remove the HP filters after the osc (without this affecting the hardclipper that makes the bump) you will see this is natural because the hardclipper chops-off an amount of the negative peak, and the peak is now smaller
i can get the same effect, but if i only look at 1 note, while on the sample, you can see how this bump moves and joins the negative peak (this is actually the clipper clipping less and less when frequency increases)
this is the hard thing, tho, i can "automate" my clipper, so it is based on the osc frequency, and approximate the behaviour of the audio sample, but this is "cheating"
i was looking to recreate it thinking "analogish" .. failed

* the TB-303 filter is actually at a higher cutoff frequency, mine is lower, tho, both "join" when resonance is increased
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

i cheated, but got the results close, and this is the best i can do right now
so i used this scheme:

s0 = <sawtooth>; // -1 to +1 amplitude, nothing special!
s1 = s0; // another copy of the sawtooth here
s0 = HP1(s0,14.7); // this determines the assymetry
s0 = tanh(s0*-60); // square now ;] this -60 might be a little less -50 works too
s0 = (s0 + s1*2) * 0.5; // adding the unshaped saw here
// note, the shaped saw was inverted! (-60)

s0 = HP2(s0,27); // 27Hz HP
s0 = (s0 < -c ? -c : s0); // hardclipper (only negative values get clipped)
s0 = HP3(s0,14.7); // DC Killer
s0 = s0 * 1.6; // adjust amplitude, now sawtooth/square matches the audiosample

note: HP3 is what i call the "DC-Killer" which was previously inside my main filter (the first of the 3 HP filters around it)
here, it is set to 14.7Hz, but it's 17Hz with the sawtooth waveform
so, i used 2 additional HP filters for the square waveform, HP1 and HP2
harmonics are looking good now, so is the shape, not perfect, but good

oops, i forgot the C parameter, i approximated it with a quadratic fit:
double c = 0.090355991 + 0.0082714712 * Fc + 6.5665602e-005 * (Fc * Fc);
Fc is the (sawtooth) oscillator frequency in Hz!

will upload another audio file with the results
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote: so, the FFT thing reduces the spectrum, and i know FFT kinda works cheap, it'll probably be much faster than my additive synthesis (tho, it's only on init, not really critical)
does the waveform still look like a pure-saw after being FFT'ed?
What you're doing is the same as an inverse fourier transform. An inverse FFT is basicly just a sum of sine waves.

Post Reply

Return to “DSP and Plugin Development”