bell notificationshomepageloginNewPostedit profiledmBox

Hoots : How can I re-create an instrument sound by superimposing sine waves? I'm a program developer. I'm interested in sound these days. I know I can synthesize the sound with a synthesizer. I don't have a synthesizer but I can - freshhoot.com

10% popularity   0 Reactions

How can I re-create an instrument sound by superimposing sine waves?
I'm a program developer.
I'm interested in sound these days.

I know I can synthesize the sound with a synthesizer.
I don't have a synthesizer but I can do that with programming code.

I made an organ sound with wave synthesis.
(I also made a siren sound.)

This link explains how to create drum sounds with waves.
I understand all that and can make it.

The problem is I don't have the trick to make a good sound myself.
It does not mean that I want to analyze the sound spectrum better with FFT formulas than it is now.

What do I need to know to have good tips?
(Maybe the problem is I don't know what I don't know.)

I hope that this ability does not increase only through long periods of practice.
Thank you :)


Load Full (4)

Login to follow hoots

4 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

@ggcg already provided very good information, which I will not repeat. I just want to add the following:

A very cheap way to play the synthesized sounds you make is to use the sound card of a computer. The same sound card, together with the appropriate software, can be used for sound acquisition and processing (calculating FFTs), wave forms (oscilloscope), frequency distribution (spectrum analyzer)... You play the sounds from the instruments you want to mimic into the microphone connected to the soundcard, and then start the analysis and synthesis.

It is a very common practice that the sounds of the instruments are no longer synthesized from sine waves. They just record the sounds made by the instruments, clean them a bit if necessary, and they play them as needed. Additionally, you might be interested to learn more about SoundFonts (and other similar technologies):

MIDI files do not contain any sounds, only instructions to play them. To play such files, sample-based MIDI synthesizers use recordings of instruments and sounds stored in a file or ROM chip.

With this approach in mind, you will be able to play not only music instruments, but also bird sounds, forest sounds, machinery working...

The problem is I don't have the trick to make a good sound myself.

"Good sound" is quite incompatible with "trick". What you want is actually real science, and to provide a proof, think about the Fraunhofer Institute. Read here about their most known technologies, including the ubiquitous mp3 music file format.


10% popularity   0 Reactions

You can consider every sound as being made up of a number of sine waves, each with variable amplitude and frequency.

I hope that this ability does not increase only through long periods of practice.

Sorry, but there will be a lot of learning to do! You could start with a program that is able to analyse sounds from the point of view i mentioned. One example is www.klingbeil.com/spear/.


10% popularity   0 Reactions

I've done this in the past both with software and hardware/firmware devices.

To get a realistic instrument sound from sine waves you need to have the FFT spectrum of the instrument but you need more than that. You also need to see how this spectrum evolves in time. There are three basic temporal elements to an instrument sound,

Attack
Sustain
Decay

If you FFT an entire sound file of a guitar or piano, etc, playing just one note you will have all this behavior mixed together. If all you did was create a superposition of sine wave components with the correct frequency, amplitude, and phase from this it would likely sound nothing like the real instrument.

The attack is very distinct for different instruments, perhaps the sustain is as well, but all instruments have damping which is frequency dependent. Over time the fundamental is the last tone to die out.

If you really want a high quality replication of an instrument you want to cut the spectrum up into small time windows, zero pad and window the data then FFT this. You will then create a synthesized sound with different components as a function of time.

You can control many factors using this technique.


10% popularity   0 Reactions

An instrument sound is made up by different characteristics. One of them is the spectral component (as in harmonics...) but others are related to attack (for instance, a guitar always has a strong attack whereas a violin can be bowed to have a low attack).
This has more to do with amplitude as a function of time.
When it comes to an instrument's tonality, the sound an instrument makes is made up of the fundamental tone and a series of harmonics (notes of higher frequency which are a multiple of the fundamental tone). The number and relative amplitudes of the harmonics are what allows you to tell one instrument from another. Unfortunately, I do not know of any reference that can tell you exactly what are the harmonics' relative amplitude for each instrument. Good luck and keep us posted!


Back to top Use Dark theme