Electrical Engineering for Musicians

I came to electronic music as someone with a lot of experience with computer & electrical engineering, at least at a theoretical and hobbyist level, but almost no experience with making music. Fortunately, music theory and practice is a heavily discussed subject online, and while electronic music isn’t always the focus of most resources, I’ve been able to learn a lot of things in that vein.

I don’t see much out there for “EE for musicians”; probably because, well, music theory and the techniques and practices of your craft are more important to the quality of your music! That said, I so often see people asking questions like, “is it okay to use a power adapter with too many amps?”, or otherwise saying things which demonstrate a lack of context around basic EE topics, and I would love to provide some of that context - so, here we go. I hope this thread can also serve as a place for people to ask questions.

What Is Electricity?

To avoid a long physics lecture, I’ll just say this: there is a thing called voltage potential. We can measure it. If it’s different in different places, and you connect those places with a conductor (like metal or ordinary water), an electric current flows between them. Nature is “trying” to make their voltage potential the same.

Static electricity - that “zap” when you touch a car in winter - is what happens when some voltage potential builds up naturally. When you touch the car, you are connecting a high and low potential, and a current flows to equalize them, which happens quite quickly.

Batteries and generators are machines which do a good job of creating and maintaining a voltage potential between the two sides of the battery, or the two prongs of an electrical plug, even while a current is flowing.

Ohm’s Law

This is the big one. Ignoring all other aspects of electronics for a moment, we have to acknowledge that all electronic devices - indeed, all electrical devices - require power to operate. We can think about voltage and current (measured in volts and amps) in terms of water in a pipe. Voltage is the pressure - how hard we are pushing on the water. Current is the volume - how much water is actually being moved.

If you think of your equipment like a water wheel, you’ll see that the two need to be matched to the equipment. Shooting a high-pressure jet of water at a mill won’t move it, but neither will an entire ocean of water that’s barely moving at all. The voltage needs to be high enough, but not too high, and there needs to be enough current available.

Considering this analogy, you might realize that to really understand what’s going on, we need to know something else: the diameter of the pipe, or the width of the stream. This is a quantity called by engineers resistance, and the three are related by the formula V = IR (I is for current, because C was taken.), or, equivalently, I = V/R and R = V/I (see this mnemonic). In other words, pushing harder through the same pipe means more water will move, and if you want to get more water through a narrower pipe, you have to push harder. This is called Ohm’s Law.

Powering Your Equipment Safely

Continuing our analogy, we can see why too much voltage might be dangerous; high pressure water can do all sorts of things, from spraying all over the kitchen to cutting through steel. Therefore, our devices and power supplies must agree on the voltage. Current, however, is restrained by resistance; if your device demands 2 amps, but your power supply could supply 10, nothing will be harmed. The device simply doesn’t open the tap wide enough for all that extra current to flow out.

We know, for instance, that Norns Shield requires 5 (or so) Volts, and consumes at most 2 Amps, so by Ohm’s Law, we see that R = 5 Volts / 2 Amps = 2.5 Volts per Amp. “Volts per Amp” are known as “Ohms”, so to your USB power supply, Norns looks rather a lot like a 2.5 Ohm resistor. If you were to feed it 12 volts - that is, to push the “water” about two and a half times harder - it would want to flow I = 12 Volts / 2.5 Ohms = 4.8 Amps, which is really rather a lot more current. Even at this very basic level, you can see that doing this would probably be quite bad for it!

Of course, it isn’t quite the same as a basic resistor - for instance, it shuts off entirely if you give it less than about 4.8 volts, and would very likely break down immediately, make a loud popping sound, and stop conducting at all if you gave it 8 or 12 volts - but that’s the principle.

Eurorack vs Line Levels

This should also tell you why it’s a bad idea to plug Eurorack levels into gear, like Norns Shield, that expects line levels. Eurorack can generate voltage differences of 10 Volts, while line levels are 1 Volt max and instrument levels are much, much lower. A clipping output on your Eurorack could be pushing 10x as much current through the sensitive analog to digital converters of your audio interfaces as it’s intended to handle. Most circuits will have overvoltage protections, but some may not, and anyway it’s a bad idea to rely on such safety features in everyday usage.

Conclusion

I hope this is helpful and not just a totally incomprehensible wall of text. If so, I would love to put together some basic-level posts on how resistance affects pitch stability, capacitance, and other useful things. And as I mentioned, please use this thread as a space for music- and art-related EE questions!

166 Likes

Talk about serendipity! I’ve been wanting to try to wrap my head around the basics of electrical engineering for the last few weeks. Thank you so much @NoraCodes! This was so helpful and easy to digest. I will be following this thread closely.

Two questions: first, what (if any) is the relationship between voltage and volume? Does more volts equal more volume? When I first started playing with eurorack I was running euro levels straight into my mixer with the gain all the way down. Was that gain reduction somehow dampening euro-level voltages or is this a whole other can of worms?

Second, are there any basic types of circuits that you (or anyone else) would recommend looking at in order to start getting a grip on electrical engineering as it is applied in music?

2 Likes

It depends on the circuitry. For some analog circuitry, yes increasing voltage will increase volume, but it’s not really so simple as a direct relationship like that. Your eurorack devices are designed so that the output can handle being shunted to ground in an analog mixer, you weren’t changing their actual operating voltage.
Do you have some specific devices in mind that you’d like to build? I suggest checking this out, from Nicolas Collins: https://routledgetextbooks.com/textbooks/9780367210106/

3 Likes

I’m so so glad! :grinning_face_with_smiling_eyes:

This is a super interesting question! As a general rule here, I’d say that given that your source can provide enough current to actuate your sink, voltage == volume.

That’s a pretty big caveat. In your audio interface, even a tiny amount of current can “move” the digital-to-analog converter, so voltage and volume are equivalent. In headphones or speakers, though, there is an important, and often low, resistance associated with the actual sound.

Plugging a random Eurorack module into your 4 Ohm headphones, might lead to a shortage of current. Eurorack signals can go from -10 to 10 Volts, so 20 Volts peak to peak. Thus, the current required is I = 20 Volts / 4 Ohms = 5 Amps. That’s far, far more current than your average Eurorack module can supply, and also more than your average 4 Ohm headphones can take. That’s fortunate, because instead of bursting into flames, they just won’t reproduce the signal correctly.

Yes, that’s almost exactly right. In a simple mixer circuit, you can use a potentiometer configured as a voltage divider to mix things. In other words, the position of the knob directly alters the incoming voltage to alter the volume; to use the water analogy, some of the pressure is sent off in another direction, so only a little of the water flows into the mixer.

In most actual mixer circuits, the knob adjusts the gain of an internal amplifier (which helps avoid “knob noise” and scratchiness, and helps with repairability), but it’s the same idea.

As @Dragoicho says, you can actually increase the output volume of some analog gear by literally feeding in a higher voltage from the power supply - but this is usually a bad idea, as I outlined in the original post.

My favorite thing to play with when I’m bored is the Falstad circuit simulator. It’s a wonderful tool for getting an intuition for circuit behavior, and once you get a basic grip on resistors and capacitors, I’d look into transistor amplifiers, “astable multivibrators” (oscillators), and especially op amps!

EDIT: Too many "though"s from moving stuff around. I need to take a composition class. :stuck_out_tongue:

12 Likes

For basic types of circuits, the first one to understand is a “voltage divider” like @NoraCodes mentioned can reduce voltage: It’s a circuit where you put a voltage across two resistors, and then treat the place between the two resistors as your output. Since the voltage will “divide” equally across the resistors, your output voltage will be “bottom resistor/(top + bottom resistors)” (treating the “top” of the two resistors as your input and the “bottom” as ground/0v.

For example: input 5v, bottom resistor 200 ohms, top resistor 300 ohms, the voltage will “divide” proportionally, so the bottom resistor will have 2v across it, and the top will have 3v across it — and the point between will be one bottom-resistor-voltage away from 0, or 2v.

From there, single-capacitor passive low-pass and high-pass filters are a good place to go — you can treat a capacitor as a kind of resistor that depends on frequency (as 1/(frequency*capacitence)). So for voltage signals with a really high frequency, it’s almost like it’s just a wire, and when you have a really low frequency, it’s like the two ends aren’t even connected… which means a voltage divider with a capacitor replacing one of the resistors is a filter. If it’s the “top” of the divider, it will “pass” those high frequencies, and “block” the low frequencies and all the high frequency voltage will appear across the resistor, but none of the low — high pass filter! If the capacitor is the “bottom” of the divider, the high frequencies will be pulled near ground because the capacitor doesn’t block them, and the low frequencies will appear across the capacitor at the output — low pass filter!

Then, as @NoraCodes says, uhh… opamps. You can do basically anything with opamps.

5 Likes

+1 for Falstad!
+1 for understanding voltage dividers. It’s necessary to completely comprehend what they are and how they work, because as you’ll discover, much of analog circuitry is some form of voltage divider. Resistance is a good place to start, because the math is mostly intuitive. Once you get into frequency dependent circuitry, like anything with capacitors or inductors, say filters, for example, the math gets more and more complicated. You have to rely more on actual experimental data instead of theorizing. For instance, you have to check with your ears and a `scope instead of just do the math on paper. But for resistance, everything is pretty straight ahead, it’s the right place to start.
Don’t be afraid of “teach yourself electricity” type of books. There are very few books out there specifically for audio electronics, and many of those are very expensive and require an understanding of the basics anyway, so start at the beginning regardless of your pursuits.
Check out this site for a good place to reference: https://www.electronics-tutorials.ws

6 Likes

Thanks for the information. Really appreciate your work on the subject.

I am currently (ho…hoo) enjoying Dave Smith’s Circuit Analysis for Complete Idiots (Electrical Engineering for Complete Idiots) book. I have zero knowledge of this area but I’m aware that it is super helpful with sound synthesis.

As far as books on electronic music that talk about electronics goes there’s Daphne Oram’s An Individual Note of Music, Sound and Electronics. I’ll keep adding to the list when I get a minute.

Roland’s A Foundation for Electronic Music is kind of the bridge, imo, between this subject and sound synthesis. If anyone feels strongly that this is not on topic then please let me know and I’ll remove it.

Brice Ward’s - Electronic Music Circuit Guidebook is a look at how certain synthesisers were built and has circuit diagrams to browse etc.

7 Likes

Learning music production helped a lot when learning about digital signal processing (DSP), circuits, control systems, and radio communications at university.

An old and great site called ElectroSmash - Electronics for Audio Circuits. that gives great overviews of different guitar pedals and their schematics. I tried building this many years ago: The Technology of Wah Pedals (geofex.com) where there’s a great diagram about halfway through that goes through each component and says what it is, what it does, and how changing the value affects the audio.

I was going to write a short thing and it ended up being long because I love this stuff:

Resistors are used to reduce current flow. Without enough resistance, there could be too much current buzzing through your circuit and your components could get very hot. When electronics get hot it’s usually because there’s a lot of current being sourced through resistors which then that power loss is measured in Watts and emitted as heat. Think toasters! They’re literally a voltage source into a very low resistance wire, and then connected to ground. When you press the switch down, the voltage connects to ground through the resistor and current starts conducting. If you had a high resistance, then there would be less current, there would be less heat, there would be no toast. :frowning:

Okay so now we have a toaster. Say it’s 1V “across” the resistor when you press the button, and then it’s 0V “across” the resistor when you don’t press the button and the switch is opened. Power loss across the resistor is measured as follows: P = V^2 / R, so if you google how much heat/power/watts does it take to toast bread (I googled it and found it’s around 1200W), and you know you have 1V coming in, you can calculate how much resistance you need to get that much heat out, so that would be 1^2 / 1200 = 0.00083 Ohms, which would probably immediately melt because you’d have V = IR, so I = 1 / 0.00083 = 1200A going through it which is a lot. Cheap over drive pulls 0.012A.

Okay so let’s say we have a switch, you press it and get 1V, don’t press it and it’s 0V. My “input” is the voltage source, my “system” is the toaster (resistor connected to ground), my “output” is whatever variable I’m looking at (voltage across the resistor, so that would also be 0 to 1V). Capacitors are used to reduce the speed in which voltage changes (think slew limiters, or increasing the attack or release of an envelope) Charging a Capacitor (gsu.edu) It looks kind of like an ADSR envelope to me. If we connect a capacitor between the resistor and ground then press the button, our input voltage goes from 0 to 1V, but now the voltage across the capacitor will need some time to go from 0 to 1V. More capacitance, more time needed. Multiplying resistance and capacitance together is called the “time constant” which describes the “responsiveness” of your circuit. Variable capacitors are hard to come by, but variable resistors (potentiometers) are easy to make, so when you turn up the attack knob on your synth ADSR, it’s something like this where you’re increasing the resistance and in turn the time response of your circuit.

This 0 to 1V input is given a name called “step response” to a system and is quite useful at understanding how systems will react to various inputs.

A thing worth mentioning here is the “impulse response” which is a “step response” but as short as possible. As if you just tapped the switch in the shortest time you could manage. In the audio world these are usually called IR’s, and there’s guitar amp IR’s, reverb IR’s, and so on. If you walk into a church, clap, and listen to the resulting reverb, that’s an IR. A short burst of input into a system and observe the output. These are used in the circuit world for frequency analysis, spectrum analysis. Looking at a spectrum there’s frequency across the bottom and amplitude across the top. White noise gives you an equal amplitude at every frequency point in the spectrum. If you do an impulse of white noise (clap) into a system (church) and observe the resulting output (reverb audio signal) in the frequency domain (spectrum analyzer) then you can see how the system will respond to a given frequency.

Given our toaster example, the time response controls how quickly the circuit responds to our button press. More capacitance roughly speaking, and it would take longer for the toaster to heat up. If you pressed the switch on and off at a certain rate, the toaster would never heat up because you don’t give it enough time for the capacitor to charge. For each rate of button presses, or frequency input, (say 440Hz, and 220Hz both inputs are equal volume 0db) there will be a different amplitude output depending on the system you’re working with (0db, -5db, the 220Hz input got smaller but 440 stayed the same, this is a high pass filter, or maybe it’s just an EQ and you turned 220 down?). You can think of the impulse response as a million of these interconnected RC circuits exactly tweaking every little frequency input to some output and that’s “natural sound” or what you’re hearing. Using RC pairs to model physical systems is a pretty common technique. Capturing the system’s response given a known input signal is how digital guitar amplifier and cabinet modeling can be done, or how to capture the IR of a given concert hall for IR reverbs. Once the model of that IR is known you can feed it any sort of input, and now you have the Convolution Reverb plug-in in Ableton. It was hard to digitally model things because we didn’t have the computational means to account for all the systems acting on the sound. The resulting sound changes depending on the input and physical characteristics of the amplifier and recording environment…

…it’s a lot of toasters.

7 Likes

Great subject. A concept I’ve never really understood (or had the patience to understand) is impedance – and how it differs/relates to resistance, since they are both expressed in ohms.

I would love an explanation suitable for 12-year olds. :hugs: Can the water-hose analogy be used for impedance as well in some way?

2 Likes

Succinctly, resistance is for DC while impedance is for AC. They’re both “resistance to applied voltage and current” but impedance is “frequency specific voltage loss”. In a sense, resistance is just impedance at 0hz input, or in other words, DC input. Battery is DC input while audio signal is AC input. Impedance has frequency and phase considerations, so a sine wave input at 100Hz 0db 0degree phase shift input could give you a 100Hz -3db -15degree phase shift output. This means that if you give it 100hz it’s quieter on the output which means you need more power to get that 100Hz signal up to the normal volume. It’s like resistance to an audio signal.

Empress Effects Buffer & Buffer+ - YouTube

This video helped make impedance click in my head.

Hose analogy: DC is water flows out of a pipe, AC is water flows forward and backward through the pipe like tides, only it’s 60 times per second it switches direction. The water start to accelerate up the pipe, then slows down as it hits the top of the wave, then starts to accelerate back down the pipe, then slows down as it hits the bottom of the wave, then starts to accelerate back up, and so on. The intensity of the water flowing is kind of like the amplitude which is kind of like the volume. The number of times it switches direction in a given time period is kinda like the frequency. High impedance for 60hz would mean something like “okay less intense sloshing around in the pipe when you’re switching back and forth at 60 times a second” and the audio volume would be reduced for that 60hz frequency.

Understanding the basics of electricity by thinking of it as water (freeingenergy.com)

7 Likes

Here’s the Q&D:

resistance (Ω) = resistance
impedance (Z) = frequency-dependent resistance

It’s extra confusing because of how people misuse “impedance” or “matching impedance”. Generally speaking, you never want actually matched impedance. It’s easy to understand once you have a grip on what a voltage divider is. Speaker terminology muddies the waters further. Generally speaking, that number on the speaker isn’t impedance. Then there are transformers…

Actual impedance is a complex number. In case you don’t remember from math class: a complex number is a number that can be expressed in the form a + bi, where a and b are real numbers, and i is a symbol called the imaginary unit, and satisfying the equation i^2 = −1. We haven’t even got to phase yet. So, now you know why you haven’t found a 12-year-old friendly answer :slight_smile:

EDIT: I forgot to add, in audio electronics, you’ll hear a lot about input and output impedance. It’s usually spoken of in terms of Ohms as if it’s DC resistance. There are many considerations but often it’s the case that low output impedance to a higher input impedance is desirable, it goes back to ye olde voltage divider. It’s not so simple of course…

6 Likes

Water pipe analogies for other types of impedance!

Capacitance: my water pipe has a rubber membrane across it. The membrane will deform when pressure is applied, but also “push back” when it’s deformed. Water can’t exactly flow through, but changes in water pressure on one side will push the water on the other side. If all the water is doing is wiggling back and forth, the wiggling is transmitted as current back and forth on both sides. A consistent pressure on one side won’t be transmitted, it’ll just result in a consistent membrane deformation. (An electrolytic capacitor is represented by a membrane that’ll only deform one way, and pop if you apply a pressure the other way)

Inductance: the hose is long enough the water has some momentum. When you apply a pressure, it takes a while for the water to get moving.

All conductors have some inductance, and all conductors in proximity to each other have some capacitance, but for wires it’s usually small enough not to worry about unless you’re doing stuff at frequencies much higher than audio.

3 Likes

These are very good!! I had never extended that bit of analogy to other components, but I think it’s a really good way to build intuition.

Kinda like how all hoses/pipes store expand a little when you pressurize them, and all water carries some momentum, but usually it doesn’t matter for watering your garden. :slight_smile:

2 Likes

Yeah, this is how I’ve thought about impedance since I was learning basic EE, but I don’t think I’d articulated it before.

And then your long-hose membrane system gets in a situation where the membrane is deformed so pushes the water in the long hose, but at the point that the membrane deformation is nil the hose water is going quite fast so the momentum pulls the membrane into negative deformation and the membrane pulls back, getting the water in the pipe moving the other direction and pushing the membrane back positive deformed and starting all over again and the water sloshes back and forth.

Any time anyone says “resonant” I translate in my head to “sloshing”.

2 Likes

Thanks for all the time put in by everyone, very much enjoyed reading this, always wanted to learn basic circuits an this has helped a lot. I’ve been toying around with the falstad simulator too, making small experiments and such. I was curious as to the accuracy of such a simulation, how likely is a real-life version to behave similarly? …Would there be a way to make such a circuit ‘safe’ for use with CV by adding some diodes / resistors or is that asking for trouble?

Something I’ve wondered about for ages – how does -ve voltage relate to input/output?

In euro, there’s warnings not to mix by multing 2 outputs into an input, but what does output and input mean when current flows both ways depending on voltage polarity?

Is a signal not the same thing as a current flow?

Actually, Falstad is a very good approximation of how circuits behave at audio frequencies and below. There are oddities that tend to crop up at higher frequencies, and those can have some effect in the high audio range (noise, for example, can come from cross-coupling and parasitic capacitances which are not modelled), but Falstad is a great simulation of low-frequency lumped-model circuits, which is about all you’d do in an undergrad physics curriculum, save a short aside on radio.

Falstad circuit.js is open source, and a few years ago, someone integrated the a SPICE simulation kernel, which means that even the semiconductors - transistors, diodes, SCRs, and the like - are pretty true to life. I’ve used it and a calculator as my only check on designs I put into short production runs.

Definitely! The thing to do is to analyze the circuit for any conditions that could damage the parts your using. The full scope of this kind of analysis is pretty far beyond this thread, but it’s worth saying that most parts have a maximum voltage they can tolerate, as well as a maximum wattage. Watts are a unit of power, and they directly translate to how hot a component will get. For example, common hobbyist kits include 1/4 Watt resistors, which means they can won’t overheat under normal conditions when dissipating 1/4 Watts of power. This can sometimes lead to unexpected issues!

The formula for wattage is P = VI; that is, power = voltage * current. So, we can use our Ohm’s Law to find how much current will flow through, say, a 40 Ohm resistor at 5 Volts:

I = 5 Volts / 40 Ohms = 0.125 Amps

We can then compute the power the resistor will have to handle, in Watts:

P = 0.125 Amps * 5 Volts = 0.625 Watts

That’s far more than a common 1/4 Watt resistor will handle. It may tolerate the load for a short burst, but over time, the resistor will heat up and may literally catch on fire. This has happened to me several times.

This is exactly the reason the warning is given. In the case that all the modules are well-designed with large resistances on their inputs and reasonable output resistances, all is well, as we see here:

The +5V output from the first module sums, correctly, with the -5V output from the second. The input correctly receives 0V and a small current flows. This is not the ideal scenario - design currents are likely in the <1mA range - but it’s hard to imagine a module design that would be seriously harmed by this.

On the other hand, if two of the jacks in question have an insufficient impedance, it’s another story:

First of all, the mixing is wrong - we’re summing +5 and -5 and ending up with a negative voltage! This is a non-unity voltage divider, and it’s not going to do what you expect.

In addition, the second module is now sinking almost 30 millamps of current. That’s no problem for a well-engineered module, but it’s dangerously close to, say, that 40 milliamp absolute maximum rating of the popular Atmel ATMega328P chip, and these kind of design mistakes tend to occur together; someone who carelessly miscalculated the output resistor for their module may well have set up their circuit to expose the microcontroller directly.

This is a contrived example, but it illustrates the principle. I’d say that Eurorack is one of the safest places to play with this kind of thing, because the vast majority of modules are engineered pretty well, and they’re all quite repairable, but it is possible to damage things.

7 Likes

Thanks for writing so much about impedance. I might be back with more questions, my inner 12-year old first needs to sit down and read very slooowly what you have already written.
My struggle with impedance is as you guessed pretty basic. Reamping stuff going from mixer to guitar pedals and back, driving a spring reverb tank etc.

:pray:

1 Like

I love your gradiant-coloring wires by voltage, it’s super clear where the voltage drops are.

So is this how every CV jack is wired? Usually in eurorack you can patch any signal of range of -10V to +10V to any other jack whether it’s audio or CV and not break anything, or better yet have it operate as intended. Do you have any resources I could look up to understand voltage protection better? Or a list of terms to google maybe. I was looking up “how to add CV to a guitar pedal” and I found some fun examples like Make a Voltage Controlled Resistor and Use It : 4 Steps - Instructables using a light dependent resistor taped to an LED to make a vactrol type thing to control the circuit. I have a pulsar-23 and what’s wild to me is how I can patch literally any pin to any other pin and nothing will break. I can also use my fingers to patch pins together and I don’t get shocked. I guess that’s because at each input and output the voltage level information transfers but the current is so low that I don’t get shocked? I’m more from a digital background so I’m a bit fuzzy on circuits these days.