dkbuilder: from circuit to LV2 plugin

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote: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
Thanks
tramp wrote:Yes, one have to keep in mind that we use idealised models, without been bounded to real physics.
I see that the Koren model in use in the dkbuilder doesn't' modelize the grid current (I can be wrong on this, because i just took a fast look on it). Which imply a saturated push-pull will work with greater dynamics than the real stuff. It is the main issue with spice for simulation of guitar amps, and even the Koren model that incorporate a diode to simulate the grid current is a crude approximation, because it doesn't modelize the influence of that grid current on Ia and Ig2 (it is better for triodes but very bad in that regard for pentodes). The Ayumi model is better, but it can be really difficult to make it to converge. This show the limit of all tube models based on the constant voltage curves, because of the huge changes of the tubes parameters on these curves, they become too complicated if you want to correctly modilize the tubes when they are used in extreme conditions like the ones into a guitar amp.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote:Here you'll find some nice schematics for speaker simulations,
http://www.hexeguitar.com/diy/techinfo/cabsims
Interesting! With my theremin, which I can also use as guitar amplifier, I made comparaison with its own speaker (an antique philips) and a Fender Champ speaker. The difference in sound is very huge, and that both when used as theremin or as guitar amp. The Champ's speaker is bigger and much better in the bass and medium bass, when the philips speaker is a little bit better in the treble.

Also in the past, I used a high-end 5 ways 200W RMS Dahlquist speaker with a 160W Peavey mace. The sound level was lower than with the peavey speakers, but much better especially with the clear sounds. It was really possible to make a good single coil electric guitar to sound like an acoustic guitar with this setup.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote: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
I am also reading one of the references of that paper https://www.researchgate.net/publicatio ... Amplifiers

The differences the authors found between the Fender and the Marshall transformers doesn't surprise me. The most typical fender failure with many of their amps when they are pushed hard, is blowed output transformer. They are of good quality, but just rated too small. The result is a good sounding amp (more core saturation imply more heat into the transformer, but it doesn't degrade much the sound) with a predominance of the mediums and trebles into the sound, that because the dimensions of an underrated core are too small to get good basses. All other manufacturers make compromises in order to be cost effective against the concurrence, and the sound of a given amp depend on great part on these cost motivated compromises.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

Dominique wrote:I see that the Koren model in use in the dkbuilder doesn't' modelize the grid current
We have, but just the simple approximation of a diode’s characteristic.

Code: Select all

calc_Ig = sp.Piecewise((0, Ug1k < Gco), (-Gcf*pow(Ug1k-Gco, 1.5), True))
On the road again.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

Dominique wrote:I am also reading one of the references of that paper https://www.researchgate.net/publicatio ... Amplifiers

The differences the authors found between the Fender and the Marshall transformers doesn't surprise me. The most typical fender failure with many of their amps when they are pushed hard, is blowed output transformer. They are of good quality, but just rated too small. The result is a good sounding amp (more core saturation imply more heat into the transformer, but it doesn't degrade much the sound) with a predominance of the mediums and trebles into the sound, that because the dimensions of an underrated core are too small to get good basses. All other manufacturers make compromises in order to be cost effective against the concurrence, and the sound of a given amp depend on great part on these cost motivated compromises.
Nice, just download it, need to read !
On the road again.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

I have a new question. When an amp plugin is loaded into JACK, it can provide a huge signal gain, and in order to not saturate jack , but to really get the sound of the plugin, the output level must be adjusted somewhere. Is it enough to assume than the output level of the plugin must be about the same than its input level, or is it a better way to go?
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

That depend on your taste. I, for example, love it loud. Using a amplifier to amplify the incoming signal. My setting is that I can't hear my guitar, when connected via jack to output, without amplification.
But, indeed, in the digital domain you wont clip in the DAC, so often the Volume needs to be reduced after saturation in the simulation.
I tent to add a active volume control after the transformer before the cabinet simulation, so I could saturate the tubes, and if it gets to loud, reduce the volume, and, if I prefer a clean tone (sometimes) I could reduce the incoming signal and recover the volume afterwards, so the I get the level I need.
On the road again.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

I made 2 simulations. The first one is a simple 2 stages preamp, the BlowMePreamplifier:
https://pastebin.com/Mrj7uWPX

and the BlowMeAmp:
https://pastebin.com/hSYgmW0b

It lack a tone control stage for now. The parameters for the transformers are guess for now.

When I run

Code: Select all

./build-plug.py -i BlowMeAmplifier.sch --table 1 --sig_max 20 --build -n BlowMeAmplifier_t1_20V
it make a table starting with 0V and ending zo 20V. If I run the same command with "--sig_max -20", the table start at -20V and stop at 0V. This show the amp is not symmetrical in its response to saturation, which is due to the driver stage. It would be nice to be able to make tables using 2 parameters, a sig_max and a sig_min.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote:That depend on your taste. I, for example, love it loud. Using a amplifier to amplify the incoming signal. My setting is that I can't hear my guitar, when connected via jack to output, without amplification.
I do the same, I first setup the input chain so that the input peak level doesn't go over 0dB into jack, but the level is high enough to hear the guitar.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

Dominique wrote:it make a table starting with 0V and ending zo 20V. If I run the same command with "--sig_max -20", the table start at -20V and stop at 0V. This show the amp is not symmetrical in its response to saturation, which is due to the driver stage. It would be nice to be able to make tables using 2 parameters, a sig_max and a sig_min.
pyplot does always plot from low to high, hence the table start at -20.
The logic I've implemented for interpolate the table was only good for positive signals. I guess that is a big part of the difference you've seen.
I've now pushed a new version to git, introduce two new options,
-g N or --table_neg N = build negative nonlinear response table from the N\'t circuit
and
-S or --scip_div = skip the divider for the negative nonlinear response table

the divider is used to translate the table into the digital domain (0 <-> 1) , default is, that the divider calculated for the positive sig, get used for the negative sig as well, you could scip that and a new divider will be calculated for the negative table.

--table_neg N were N is the number of the schematic you'll generate a negative table for. You could generate multiple as before with --table 1 2 3 . .
but, when a negative table is generated, a positive will be generated (and used) as well.
On the road again.
Dominique
Established Member
Posts: 68
Joined: Sat May 26, 2018 10:24 am
Has thanked: 3 times
Been thanked: 2 times

Re: dkbuilder: from circuit to LV2 plugin

Post by Dominique »

tramp wrote:I've now pushed a new version to git, introduce two new options,
-g N or --table_neg N = build negative nonlinear response table from the N\'t circuit
and
-S or --scip_div = skip the divider for the negative nonlinear response table
Thank you, I will try tomorrow.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

I've added now a option ( -2 or --stereo) to generate a stereo plug version of the circuit.
Still the circuit itself could only be mono, but running two instances in parallel.
Works for LV2 as for gx plugins.
On the road again.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: dkbuilder: from circuit to LV2 plugin

Post by tramp »

Hi

I've released now the example I use here in the first post, the BaJaTubeDriver. This one use the newly introduced async table generator. Additional it use a frequency splitter to emulate the difference in the frequency response of the tubes. As before it is extreme lightweight in CPU usage. Using it in combo with the UltraCab, and enjoy the sweet smooth extra harmonics. :twisted:

Image

source code is here:
https://github.com/brummer10/GxBaJaTubeDriver.lv2

regards
hermann
On the road again.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: dkbuilder: from circuit to LV2 plugin

Post by sadko4u »

The example images in the starting post have been lost. Could you please reload them?
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
milkii
Established Member
Posts: 477
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Has thanked: 92 times
Been thanked: 91 times
Contact:

Re: dkbuilder: from circuit to LV2 plugin

Post by milkii »

I'm wondering about the possibility of using dkbuilder to create LV2 plugins of modular synth modules. I guess this should be possible, though I also guess there isn't yet support for marking an input or output as CV?

they/them ta / libreav.org / wiki.thingsandstuff.org/Audio and related pages / gh

Post Reply