5

I've been writing a program that functions similar to a MIDI interpreter, but the pure tones I'm currently using very poorly resemble the actual tones produced by guitars, pianos, and other instruments.

I know that instruments exhibit an overtone series, but I can't find any information about the specific overtone profiles of guitars. How exactly would I mathematically simulate the tone of an electric guitar? How exactly does its tone differ from a pure tone?

5
  • 2
    If you can find exactly how to express mathematically the waveform of a guitar, which sounds realistic for different attack and expression, you'll have solved a huge problem. Just to say that is not that easy, but approximations do exist and you can probably make one yourself by looking at the spectrum of a guitar sound.
    – Tom
    Apr 23, 2022 at 16:29
  • Also keep in mind that every single model of electric guitar has a different sound, oftentimes dramatically so. And that's just considering the DI signal. There is an entire art to picking the right preamp and cabinet, and that's without considering guitar pedals. There are ways to simulate an electric guitar with synthesis, but there's no exact harmonic profile for a guitar. Not because we don't have the technology to analyze a guitar sound, but because there are so many different guitar sounds!
    – Kevin
    Apr 23, 2022 at 17:18
  • 1
    If you want a simple model that produces sounds resembling plucked strings, look into Karplus-Strong. It's too simplified to really sound like a guitar, but vastly better than anything you could do in terms of an explicit overtone series. Apr 24, 2022 at 10:55
  • 1
    AS A starting point you can Google "electric guitar" fourier analysis which mostly gives instructional articles and videos on how to use Fourier analysis on electric guitars. There is one technical investigation article upfront: johndcook.com/blog/2016/05/10/electric-guitar-distortion. On the basis of the FA diagrams there and elsewhere, their frequency-power spectrum appears to be pretty messy, which may explain why they are so hard to model. Apr 24, 2022 at 13:15
  • If the goal is to write a program that analyses the sound of a real guitar and transform to midi, you could just use a real guitar sample. You most certainly will not need to synthesize the sound of a guitar to prove your concept. However, do some research, endless hours have been spent on this thematic and many algorithms are existent to tackle this non-trivial task.
    – Jürgen
    Apr 26, 2022 at 21:54

2 Answers 2

9

I know that instruments exhibit an overtone series

Yes - but even talking about 'the overtone series' of an instrument is a big simplification. In reality, each of the overtones might be considered to change amplitude and pitch over the duration of the note, according to a large number of different variables.

https://www.soundonsound.com/techniques/synthesizing-plucked-strings is looking at an acoustic guitar, but most of these aspects are still relevant:

  • Each string produces a different waveform depending upon the plucking position;
  • The shape and hardness of your fingers or the plectrum influences the high-frequency content of the initial waveform;
  • The amplitude envelope of the oscillators depends upon the direction in which you pluck the string(s);
  • The strings' harmonics are 'stretched' as the pitch increases and/or the excitation increases in amplitude;
  • The six strings interact with each other in different ways, depending upon their pitches and the number of them which are free to vibrate at any given time;
  • Each string interacts with a system of complex resonators (the guitar body) that absorbs energy and then directs it back to all the strings, exciting harmonics that may not be present in the initial waveform;
  • The body has many densely packed resonances and anti-resonances that can not be imitated using conventional equalisers or filters;
  • The nature of the resultant sound is extremely dependent on the position of the listener and the angle between the listener and the instrument.

It's probably no exaggeration to say that no two guitar plucks are exactly the same! It may be unintuitive, but a simple bit of wire tied to a bit of wood has incredibly complex behaviour...

If you want to dig into all this, the synth secrets series is an excellent primer - https://www.soundonsound.com/series/synth-secrets-sound-sound.

9

I'd like to start with a note that if I knew a good answer to this question, I would be spending my time earning money on selling guitar emulation virtual instruments, rather than sharing the information for free.

Note also, that as far as I'm aware, presently the best guitar virtual instruments are based on sampling, rather than modeling. This may give a hint about the difficulty of the task.

  • The first part of the sound is attack. It's percussive, i.e. continuous spectrum and broad band, depending on whether the string is plucked by a finger, finger nail, or plectrum, its shape, texture, and also angle and time duration of the contact with the string. Guitar body resonance (at least with classical and acoustic instruments) may contribute significantly to the attack sound.

  • Plucking the string starts with displacing it from the equilibrium into a triangular shape, with the tip rounded (due to finite size of the finger, nail or plectrum, and the string rigidity). Fourier transform of this shapes gives the initial ratio of amplitudes of the harmonic components.

  • As the string vibrates, the amplitude of various frequencies decays in various ways, as the energy is transferred to the instrument body, the air, or dissipated internally in the string, which depending on the string parameters.

  • Various characteristics of guitar body and construction affect how quickly energy various harmonic components is dissipated, for all types of guitars, both classical/acoustic, and for solid body electric as well.

  • There are (at least!) two effects causing inharmonicity:

    1. frequency of harmonic components is slightly increased due to string rigidity
    2. When a string vibrates with large amplitude, it's effective tension increases, resulting in pitch changing as a function of the decaying amplitude (time)

The inharmonicities depend on string material (Young's modulus), string gauge, length and tension. They also may result in transferring energy between harmonic components.

  • The string transfers energy to the guitar body via the bridge. For nylon strings this is primarily via transverse vibrations, while for steel strings both transverse and longitudinal vibrations contribute to a similar degree.

  • Finally, how the actual sound is produced? In classical/acoustic instruments the sound is primarily emitted by the top plate, with some additional contributions of the sound hole (resonance of the air cavity), and the back, altogether captured by a microphone, placed at some location. Then you have instruments with piezo pickups, and finally electric guitars with electromagnetic pickups. There are also some more exotic systems like optical transducers or pickups capturing vibrations of the body. Any of these systems, and its parameters affect the final sound significantly.

  • Last but not least are various additional sounds, characteristic for guitar. What comes to my mind is the noise when sliding the finger along the string (in particular the wound strings) and fret buzz. Also, guitarists use multiple articulation techniques which extend the spectrum of available sounds.

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.