dkbuilder: from circuit to LV2 plugin

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Wed Feb 27, 2019 7:00 pm

Dominique wrote:Thanks for the explanation and the links.


You are welcome.

Dominique wrote:Is it possible to use the dkbuilder with 2 inputs and 1 input schematic like a VCA?


No, only mono circuits been supported right now. (singular matrix in use)

Dominique wrote:Another question is that I don't understand if the "--table n" option must be used just to show a diagram, or if dkbuilder need it for some circuits to be correctly converted to plugins, and if so, how can I know when it is needed?


The --table n option is used to indicate the part of the circuit which introduce the non linear response. If a linear circuit is build ( like a EQ or a tonestack, or even a wah), no table is needed, so no --table n option needs to be given. If more then one part introduce non-linearity, multiple tables could be build by using --table 1 2 3 . . .

Otherwise, you could build any circuit as linear plugin, usually that is what I'm doing first. In later runs, I start to experimenting with the tables. They are produced by sending a numpy array (0-1.4 in 200 steps) to the circuit and measure the response.
On the road again.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 10:56 am

tramp wrote:
Dominique wrote:When making oscillator simulation for my theremin viewtopic.php?f=52&p=102700


Here we hit a border, as oscillator simulation didn't work very well with the dk builder.


Anyway, the pitch oscillator of a theremin is a beat oscillator made of 2 RF oscillators. Their frequency is around 800 kHz in my design, which is in the middle of the MW band and imply it would be needed to upsample a lot to make them work. The processor use will certainly be too high.

For the VCA, I can transform it into a preamp and control its gain with a potentiometer. That way, it would have only 1 input and 1 output. It must also be possible to make some kind of detection of the audio signal and use it to control the gain. That way we could have some kind of log or antilog amplifier. If I remember well, it is simpler ways to implement a logarithmic amplifier with tubes as well.

Last, I builded all examples with no tables. They are all working at the exception of 4: jcm800_power, BigMuffPi, Superfuzz and Stratoblaster, which load into guitarix, but stop the sound when activated. I try to build them with "--table 1", it work but that issue remain the same.

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Thu Feb 28, 2019 12:16 pm

Dominique wrote:Last, I builded all examples with no tables. They are all working at the exception of 4: jcm800_power, BigMuffPi, Superfuzz and Stratoblaster, which load into guitarix, but stop the sound when activated. I try to build them with "--table 1", it work but that issue remain the same.


Yea, that's why I start to split circuits into pieces, so for example the BigMuffPi and the SuperFuzz could be splitted into 3 parts, input buffer, clipper, and output buffer, then tables could be created for the clipper. The StratoBlaster have errors in the capacitor values.
The jcm800_power can't be splitted an more, to make it work, it needs to be simplified. So, for example the cabinet simulation on the output could be removed, some part's between the EL34's and the transformer as well.

Here a example for a power amp section of the rickenbacker m16 supersonic:
Image
which works nicely. Even when added a presence controller it works.
Dominique wrote:For the VCA, I can transform it into a preamp and control its gain with a potentiometer. That way, it would have only 1 input and 1 output. It must also be possible to make some kind of detection of the audio signal and use it to control the gain. That way we could have some kind of log or antilog amplifier. If I remember well, it is simpler ways to implement a logarithmic amplifier with tubes as well.


A variable resistor could easily replaced by a audio input in faust source, using abs, reduce and min(max) to get a usable control via audio input.
(I made a auto wah this way, and some other stuff)
So, sometimes it is required to do some hand work on the faust sources to reach a special goal. The dkbuilder could create some filters, which you may stick together later by your own.
This way you could as well process circuit parts in parallel, implement a selector (switch) and more.

Maybe, one day, I'll improve the dkbuilder to implement all those possibility's, but, I guess this will become a full-time job then. :lol:
On the road again.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 2:23 pm

Here is a paste of my modified VCA: https://pastebin.com/3ZcvUpAX

When I try to build it, I get:

Code: Select all

Traceback (most recent call last):
  File "./build-plug.py", line 258, in <module>
    main(sys.argv[1:])
  File "./build-plug.py", line 255, in main
    dk.build()
  File "./build-plug.py", line 213, in build
    faustdsp, faustui = c1.get_faust_code(filename=str(dspname))
  File "./analog.py", line 775, in get_faust_code
    self._ensure_filter(symbolic=symbolic)
  File "./analog.py", line 417, in _ensure_filter
    sim = dk_simulator.SimulatePy(dk_simulator.EquationSystem(p), self.solver, self.dc_method)
  File "./dk_simulator.py", line 901, in __init__
    self.out_labels = parser.out_labels()
  File "./dk_simulator.py", line 1776, in out_labels
    return [str(v) for v in self.element_name["O"][0][0].conn]
IndexError: list index out of range

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Thu Feb 28, 2019 3:11 pm

I did a quick test, the In/Output miss the refdes field, you schould paste the ones from the Startset.sch. R4 should be P4 (P = variable resistor, 3 connection) and miss some values (value=500k,var=Trim,a=3), but even then, nothing comes out of the simulation.
I'm not familiar with this kind of circuit. For example, a 30V Power against a 500p capacitor to GND looks strange to me.
On the road again.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 4:28 pm

tramp wrote:I did a quick test, the In/Output miss the refdes field, you schould paste the ones from the Startset.sch. R4 should be P4 (P = variable resistor, 3 connection) and miss some values (value=500k,var=Trim,a=3), but even then, nothing comes out of the simulation.

Now it work, but I get another error about the dsp code.
tramp wrote:I'm not familiar with this kind of circuit. For example, a 30V Power against a 500p capacitor to GND looks strange to me.

The triode on the left command the gain. It is done via the pot on the 30V that fix the bias of the 2 triodes of the VCA. That fix the gain, note it can be some grid current, and as I don't have any curves or power indication of the G+ for that tube, I put a very conservative and high value for the grid stopper resistance. The 500pF is from the original circuit, i left it because of the grid current, that way the AC component of that grid current will be amortized. I will try later to remove it and see what append.

The audio come into the grid of the second triode, which is a cathode follower. As it is on the same node than the cathode of the first triode, with a common cathode resistor, and as the grid of that first triode is at a fixed potential, it is amplified by the first triode on its anode. The third tube is just a buffer stage. I will try to remove it to simplify the circuit.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 4:29 pm

snip
Last edited by Dominique on Thu Feb 28, 2019 4:48 pm, edited 1 time in total.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 4:46 pm

tramp wrote:I did a quick test, the In/Output miss the refdes field, you schould paste the ones from the Startset.sch. R4 should be P4 (P = variable resistor, 3 connection) and miss some values (value=500k,var=Trim,a=3), but even then, nothing comes out of the simulation.

Now it work, but I get another error about the dsp code.
tramp wrote:I'm not familiar with this kind of circuit. For example, a 30V Power against a 500p capacitor to GND looks strange to me.

The triode on the left command the gain. It is done via the pot on the 30V that fix the bias of the 2 triodes of the VCA. That fix the gain, note it can be some grid current, and as I don't have any curves or power indication of the G1 for that tube, I put a very conservative and high value for the grid stopper resistance. The 500pF is from the original circuit, i left it because of the grid current, that way the AC component of that grid current will be amortized. I will try later to remove it and see what append.

The audio come into the grid of the second triode, which is a cathode follower. As it is on the same node than the cathode of the first triode, with a common cathode resistor, and as the grid of that first triode is at a fixed potential, it is amplified by the first triode on its anode. The third tube is just a buffer stage. I will try to remove it to simplify the circuit.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 10:30 pm

I rewrote it from the scratch in a simpler version starting with Startset.sch
https://pastebin.com/ny0xXfeV

It begin to work with "./build-plug.py -i VCA.sch --build -n VCAnt"

Code: Select all

build gx_plugin from: ['VCA.sch']
dkbuild/vcant/vcant.dsp:warning: parameters in dkbuild/vcant/vcant_ui.cc not found in faust dsp: vcant.Gain
created and copied dkbuild/vcant/vcant.so


The result is an unusable Gain control, but I can get some sound when Input and Volume are at their maximum.
Do you know what I can do to get that control to work?

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 10:45 pm

I added 2 Cga condensators, the Miller caps, and now the dkbuilder is happy:
https://pastebin.com/4kZN6r93

In guitarix, the control is here, I can change it, but it doesn't work, the sound doesn't change.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Thu Feb 28, 2019 11:32 pm

I simplified it further by replacing the Input and Volume potentiometers by resistors. I also changed the Vcmd, this make the sound louder, but the Gain pot still doesn't work.

https://pastebin.com/72CKxpFh

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Fri Mar 01, 2019 11:48 am

Dominique wrote:Do you know what I can do to get that control to work?


Nope, sorry. I'm not very familiar with those "synth" stuff. :)

Here is a voltage controlled EL84 circuit, maybe this is of some help for you?

https://pastebin.com/uGvZ0TYu
On the road again.

Dominique
Established Member
Posts: 54
Joined: Sat May 26, 2018 10:24 am

Re: dkbuilder: from circuit to LV2 plugin

Postby Dominique » Fri Mar 01, 2019 6:26 pm

Thank you, I will try it later.

For now, I am making a Blow Me Amplifier simulation with 2 x 6L6 in PP and a driver with a single ended EL84. It is simpler than the JCM or the Marshall and should provide a better sound. I call it the Blow Me Amp because if someone want to build it, he will have to civilize it a lot.

With a simulation, we get stabilized supplies for free, and the EL84 driver is able to provide the 1.5 W per G1 on the 2 6L6 (datasheet values). Which imply the 6L6 are pushed to their limits (600 V on the anodes and 300 V on the G2) and that combined with the EL84 driver made they can exhibit the maximal dynamic they can do in theory. It work with a simulation, but in order to made a real amplifier from this, it would be necessary to implement some protections against the oscillation and a self limiting bias like in the JCM, and that even if the supplies are not stabilized.

The parameters for the transformer model look like this: w1=1000,w2=1000,w3=64,R=358
OK, w1, w2 and w3 are the number of turns of the windings, but what is the R please?

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Sat Mar 02, 2019 4:39 am

R is the magnetic reluctance.
Description of the modelling is here: https://www.vutbr.cz/www_base/zav_prace ... e_id=60090
part 3.1.1
Dominique wrote:With a simulation, we get stabilized supplies for free, and the EL84 driver is able to provide the 1.5 W per G1 on the 2 6L6 (datasheet values). Which imply the 6L6 are pushed to their limits (600 V on the anodes and 300 V on the G2) and that combined with the EL84 driver made they can exhibit the maximal dynamic they can do in theory. It work with a simulation, but in order to made a real amplifier from this, it would be necessary to implement some protections against the oscillation and a self limiting bias like in the JCM, and that even if the supplies are not stabilized.


Yes, one have to keep in mind that we use idealised models, without been bounded to real physics.
On the road again.

tramp
Established Member
Posts: 1416
Joined: Mon Jul 01, 2013 8:13 am

Re: dkbuilder: from circuit to LV2 plugin

Postby tramp » Sat Mar 02, 2019 5:00 am

Dominique wrote:For now, I am making a Blow Me Amplifier simulation with 2 x 6L6 in PP and a driver with a single ended EL84.


Here you'll find some nice schematics for speaker simulations,
http://www.hexeguitar.com/diy/techinfo/cabsims
On the road again.


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 0 guests