dkbuilder: from circuit to LV2 plugin

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

I have a clue on what characterize a non-linear behaviour, it is when a non-linear component like a diode have an action on the signal path. But the clipping issue confuse me a little bit. It doesn't need a table, which imply dkbuilder consider clipping into a tube as a linear behaviour, which in turn makes me to wander if, to determine when a table is needed or not, is as simple than that.

Edit: Oops, reading my notes on that thread, I saw that into the BajaTubeDriver example, a table is used for the active part of that circuit. Which imply clipping must be a non linear behaviour.

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

Making a RLC tone control, the passive version run fine, but the active version gave me an oscillator :lol: , no sound but a motor boating like sound. When I move the knob, the frequency change, but if I move it more, the audio stop and it hang the bank into guitarix.

tramp
Established Member
Posts: 2425
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 11 times
Been thanked: 543 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

Yep, dkbuilder could only generate linear Faust filters (iir) from circuits. To implement the non-linear components it simply send a signal to the circuit and compare the output with the input, from that it create the lookup table to implement the non-linear clipping.
We've worked as well on c++ filter generations which implement the non-linear parts directly, similar to NAM, but at the time we worked on it the CPU's we had was to slow to do all the work, so after doing two sims for JCM800 pre and power amps we give up on that, as it was just to much work to overcome the limits we had in hardware.
However, still not all circuits been usable within dkbuilder, the filter generation may fail then you get the Syntax error message. Often it helps to rework some values of resistors or capacitors, often it helps to put a capacitor in parallel to stabilise the signal flow.
And yes, the table is only meant to reflect non-linear behave, in a tone control you didn't need it.

On the road again.
Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

dkbuilder is a great tool. For the active version of that tone control, I will combine the passive version with a preamp in separated schematics, instead of making a 2 active ways filter.

When making my theremin, I used ng-spice a lot for the oscillators, and simulated them when variating the values of several components at a time. The result was so many plots that I scripted the whole thing in order to make movies out of them. It took a while for ng-spice to make the movies, but they was the most effective way, and the only practical, to compare the plots. I like free software, they are the best.

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote: Tue Oct 01, 2024 8:29 am

often it helps to put a capacitor in parallel to stabilise the signal flow.

What do you mean by that? Or in parallel of what?

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

I get strange result with the frequency plot of that schematic: Image

Code: Select all

./build-plug.py  -i B2PreTest1.sch -p freq

Image
If I remove C2, it gets:
Image
So I don't understand why the bandwidth in the bass is so bad. With such a montage that have a gain of 1, the only factors that limit it are C1 and C3. If I put C1=470n instead of 4700n, it change nothing, and for C3:

After that, I put C3=1000n (without C2):
Image
It is that preamp combined with a RLC that gave me the motor boating like oscillator.

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

The bandwidth issue seam to be related to the tube and its load, because with C3=470n and P1=1000k, I get:
Image

Remain these oscillation like bursts in the curve. I will look how it sounds.
Edit: It give nothing I can hear. Which imply that to make an effect out of that instability, One should find a way to increase it by a great magnitude.

tramp
Established Member
Posts: 2425
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 11 times
Been thanked: 543 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

R4 looks really great, I usually have there some resistors around 1.5k and, maybe a capacitor parallel to it.

On the road again.
Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote: Thu Oct 03, 2024 1:51 pm

R4 looks really great, I usually have there some resistors around 1.5k and, maybe a capacitor parallel to it.

Me too, but that circuit was think as a high input impedance buffer with gain 1 in order to see if it makes a difference on the Q as a load for a passive 2 ways RLC tone circuit.

BTW, I saw that to add capacitors to the ground from the 2 primary windings of an output transformer in pp improve the convergence of the iterations with the -g option of build-plug.py. I saw that because -t was working, but not -g, so I added these 2 caps and both tables are running fine and are very symmetrical.

Dominique
Established Member
Posts: 113
Joined: Sat May 26, 2018 10:24 am
Has thanked: 5 times
Been thanked: 5 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

I pushed a dkbuilder ebuild into the proaudio-gentoo overlay: https://github.com/domichel/proaudio-ge ... /dkbuilder

It install the docker directory of the guitarix sources into /usr/share/dkbuilder, and a 'dkbuilder' helper script in /usr/bin. The helper script depend on bash, docker and git, it use the docker files and let the user install the dkbuilder docker environment into the directory of his choice.

Post Reply