So I've been experimenting with generating music by computer program, and got a thing working with Python and fluidsynth, with a nice-sounding piano soundfont. I want to switch to distorted electric guitar sound, though. The problem is that a chord on a distorted guitar is made like this:

string vibration → multiple strings mixed by pickups → distortion

whereas anything based on soundfonts would be more like this:

string vibration → distortion → multiple samples mixed by synth

Distortion needs to happen after the strings are mixed together in order to sound correct.

What are my options? I could get a soundfont of undistorted guitar and then take the output of the synth and run it through a separate distortion program? In Linux this could be done with JACK, but I've been using Windows and is there an equivalent functionality there? Or maybe there's MIDI synths that support distortion?

2 Answers 2


There's of course plenty of ways to do that. The easiest way on Windows would certainly be to load both a SoundFont synth and an amp-simulator plugin into a DAW, but I suppose that's not the solution you want.

If you'd like to keep it down to a single executable and, as I suspect, you're more interested seeing in how intonation influences distortion-intermodulation than achieving an actual guitar sound, I'd suggest hacking a distortion patch into fluidsynth. If you're not fussy about aliasing (well I know you are...) then a basic distortion is laughably simple to implement, just do something like

U ↦ tanh(U + U2/2 + U3/3)

on the samples, to get both tube-bias like even overtones and smooth saturation. This will of course not sound like a proper overdriven guitar amp, but it's actually not that bad either – if you convolute the result with an impulse-response from a guitar cabinet (or, as an approximation thereof, apply a primitive third-order IIR lowpass at 7000 Hz and some random band boosts) then such a simple nonlinearity can sound surprisingly convincing.

  • Haha yes that's exactly what I'm doing. It doesn't have to sound perfect, it's just experiments. I don't know how to patch fluidsynth though :-\ I hadn't even thought of using a DAW though.
    – endolith
    Commented Oct 1, 2014 at 14:44
  • followed this but using stringthing2 for the clean guitar sound, and it's already pretty decent sound with the virtual MIDI keyboard in Reaper. now just need to figure out how to drive it from another program.
    – endolith
    Commented Oct 4, 2014 at 3:13
  • 1
    That should work with something like Loopbe. Commented Oct 4, 2014 at 8:23
  • yes I got that working :)
    – endolith
    Commented Oct 4, 2014 at 16:09
  • Nice! Will you put some of your results on SoundCloud or somewhere? This is a topic I'm extremely insterested in. Commented Oct 5, 2014 at 15:34

Unfortunately it is tough to generate a good sounding distorted guitar using only digital means. Although as sampling gets better this is slowly getting better as well.

Your idea of sampling a clean guitar sound and then routing it though a distortion unit and back into your DAW would be the route I would take assuming you cant get your hands on a real guitar and guitar player.

The basic issue you have is more or less as follows,

Distortion is in a nutshell a sound that occurs when your signal is out side of the range your amplifier or pre-amp can handle. This causes a "distorted" sound. Most of the time you are trying to avoid this in audio as you generally want a clean signal. However guitar happens to sound really nice when distorted and such distortion as an effect, and not a negative byproduct of using equipment incorrectly was born. Now the issue with the digital world is that when you have the same problem (a signal top great for the input) you end up with clipping. This is just in the form of unpleasant noise generally. Thus it is hard to recreate distortion by simply overdriving inputs (the way it was done in the analog world). This is why most distortion emulators dont sound as good as the real thing. No matter your sample source any artificially distorted sample will always sound like one. My advice is to find a local guitarist (they are all over the place) and record him playing the riff you desire.

  • 1
    While I agree that "if you want a good guitar sound, you should have a guitarist play it on guitar rather than synthesize something", that misses the point of this question. And the reason real guitar sounds better than synthetic guitar has little to do with real analogue distortion vs. simulation thereof, but everything with subtle details in the guitar playing itself. Simulation of distortion is actually a problem we have pretty firm grips on; if you let a guitarist play a part once through a tube amp and through a good amp simulation even experts will have difficulties telling them apart. Commented Sep 30, 2014 at 20:31
  • true, although I have found many of the simulators cant capture that tube warmth nor emulate a purely over driven amp quite the same. I will agree that most people wont know the difference.
    – Dave
    Commented Sep 30, 2014 at 20:36
  • i could play and record guitar, the problem is that I'm experimenting with just intonation/alternate tunings, so I'd need to refret my guitar between each chord ;)
    – endolith
    Commented Oct 1, 2014 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.