Vacuum Tube & Distortion Emulation
Total Page:16
File Type:pdf, Size:1020Kb
AdAddendum A19 Vacuum Tube & Distortion Emulation Part 2 Will Pirkle May 14, 2019 Copyright (c) 2019 Addendum A19 Designing Audio Effects Plugins in C++ Copyright © 2019 Will Pirkle Addendum Preface This addendum accompanies Will Pirkle’s Designing Audio Effects Plugins in C++, 2nd Edition. It specifically addresses material that was removed from Chapter 19 on nonlinear processing. Due to space limitations, the vacuum tube chapter had to be cut short and the projects slimmed down to simple wave shaping and filtering. I almost removed the entire chapter; however there has been demand for this kind of information. The reason I removed the material has to do with a special situation that happens with vacuum tubes in high-gain modern guitar amplifiers. In these designs, the engineers purposefully overdrive the inputs to the tube devices in order to create the modern distortion that is currently popular. In contrast, non-guitar tube-amp circuits are usually designed to stay within the proper operating conditions so that their inputs are not purposefully overdriven. When you overdrive the input to most amplifying devices like transistors or op-amps, once you’ve exceeded the operating limits, no more amplification will occur. The device simply won’t amplify the signal outside of its input range, and the signal is hard-clipped at that point. For a vacuum tube, this is true for the negative part of an over driven input signal. But when the positive portion of the input goes outside the limit, everything changes and the tube’s behavior becomes very dynamic. Cascading multiple overdriven stages together with differing amounts of gain between stages produces a very complex harmonic effect where the harmonic component amplitudes are directly linked to the signal amplitude. This situation is called grid-conduction. As I went further into the operational notes on grid-conduction it became more and more clear that in order for someone to understand how the objects emulate these tubes, they would need not only a background in analog electronics, but also some amount of tube circuit theory – at least enough to understand the fundamentals. Without this information, my objects and code would appear to be almost like magic to you and there would be no way for you to personalize them and make them your own. Once I added the tube theory, the chapter ballooned out to a ridiculous size and I was forced to remove it. So, that is why the chapter is organized the way it is, and that is why I wanted to make sure you have this addendum to accompany the book. Modeling: Simulate or Emulate? Right up front we have to make a choice as to the fundamental approach to a vacuum tube algorithm. There are two main paths to choose: simulate and emulate. In tube circuit simulation you use SPICE techniques to model the tube as an electronic circuit. In some cases this may involve iterative solutions and methods. Peavey’s Revalver ® uses this approach that allows the user to specify exact component values for resistors, capacitors, etc… with excellent results. A downside for teaching is that in order to understand it, you not only need to know audio electronics and tube circuit design, but also circuit component SPICE simulation techniques. 1 Addendum A19 Designing Audio Effects Plugins in C++ Copyright © 2019 Will Pirkle Modeling via emulation has an equivalency with the perceptual reverb modeling, where you make no attempt to solve a set of equations that describes the system and instead you analyze the reverb and model it with structures that emulate sound waves echoing of off surfaces and the like. For an interesting read concerning this kind of modeling, check out James Gleick’s book Chaos Making a New Science. There is a section about modeling the human eyeball as it moves back and forth in the eye socket. Since it is a bag full of fluid, we have fluid dynamics at work, and since there are muscles attached at various points that pull in various directions, we have a physics problem. One approach is to develop a set of differential equations that describes the system, then setup an initial condition and solve the equations simultaneously. That would be a direct or simulation approach. A second solution to the problem is to model the eyeball moving back and forth as a ball rolling down an inclined plane that you can tilt from left to right. The ‘eye’ ball will roll down and swerve from left to right as you tilt the inclined plane. The path of the ball represents the motion within the socket. This solution discards the notion of solving simultaneous differential equations and provides an elegant solution. This addendum will use the emulation-model approach for vacuum tubes. This involves first understanding how tube circuits are designed and operate. Then, we analyze what happens to the tube with an overdriven input and try solutions that model that system. I have multiple patents attached to the appendix of the document. A few of them involve analog modeling of vacuum tubes with analog circuit components. These are invaluable, as they must teach the modeling techniques that specifically address key vacuum tube functionality under different conditions. I have patents from Peavey, Scholz R&D and Yamaha in addition to an independent patent application regarding Class-B operation attached here. The emulation techniques that I am currently using are more aligned with the Yamaha techniques that we will discuss. But in my mind, I see a connection to the Peavey TransTube® patents as well, since these are also excellent emulation modelers that model the same phenomena using analog components. I worked very hard on the 2nd edition of Designing Audio Effects Plugins in C++ and I wanted to make sure that this information was also available to the book readers to provide a more complete work. All the Best, Will Pirkle 14-May-2019 2 Addendum A19 Designing Audio Effects Plugins in C++ Copyright © 2019 Will Pirkle Contents: Part I: Basic Tube Circuit Theory Part II: Fundamentals of Overdriving the Grid Part III: Digital Implementation Techniques Part IV: Filtering and Distortion Part V: C++ Objects and Projects There are two chapter plugins based on multiple chapter C++ effect objects. In order to distinguish between these new vacuum tube C++ objects and the ones in the book, I am using the more European name “valve” in the object names. In this Addendum the two main tube objects are ClassAValve and ClassBValvePair. The two plugin-projects are: 1. SuperSaturator: a distortion box emulation specifically for guitar 2. WickerAmpCombo: a complete tube guitar amp simulation, from input to speaker, with reverb; includes a 4-triode Class-A preamp and a 2-pentode Class B power amp all done with emulation modeling – a guitar amp tone stack model is included 3 Addendum A19 Designing Audio Effects Plugins in C++ Copyright © 2019 Will Pirkle A19 Addendum: Vacuum Tubes and Distortion Modeling Part I: Basic Tube Circuit Theory In this first section, I’ll go over just enough tube theory to get you up and running reading tube schematics and figuring out how the FX book code and projects fit within the realm of the basic low distortion tube amplifiers. The most important constraint for this first section, which was the same constraint placed on the book code and projects was: CONSTRAINT: The inputs to the tube devices are always kept within the legal range of values that the design dictates. In these circuits, we may generate significant harmonic distortion, but we do not overdrive the tube device inputs nor do we attempt to clip the signal waveforms. If you think about it, there are many types of audio devices and FX systems that operate within these constraints: • microphone preamp • tube-based EQs • audiophile tube power amp • compressors and limiters that include tubes • other FX • early amplifier designs The nonlinear chapter in the FX book was aimed at these systems specifically as opposed to modern high gain guitar amplifiers in which the designers purposefully overdrive and overload various tubes within the circuit. This is because high-gain guitar (and bass) amps are designed with a very different purpose than the rest of the devices that include tubes. This means that guitar and bass amps represent a niche sub-set of the tube audio circuits. The second section of this addendum will focus specifically on high-gain guitar amplifiers and pre-amplifiers. This can then be extended to bass amplifiers as well, through lowered distortion levels and changes to the frequency responses of the sub- circuits. 4 Addendum A19 Designing Audio Effects Plugins in C++ Copyright © 2019 Will Pirkle A19.1 Basic Vacuum Tube Theory Although there seems to be an argument over who invented the light bulb, we do know that Edison tried to improve the invention. When you run an electrical current through fine wire, the wire will glow, or give off light, for a short time just before it catches on fire. If you put the wire in a vacuum, it could be put in the glowing state and held there. Without oxygen, the wire (called a filament) cannot catch on fire. In the early light bulbs, the bulb would eventually expire because the vacuum was not perfect, but not before the inside of the glass bulb was covered with black soot – the “ashes” of the filament. The black soot caused the bulb to dim, and be less and less useful. The dimmed bulb was still giving off light, but it was hidden behind the layer of dark powder. Edison wanted to extend the life of the bulbs by eliminating, or at least delaying, the appearance of the soot.