I was trying to replicate the notes of the C major scale on a circuit simulator and i found online that there are website that only give one frequency for a certain note in that octave, so i was wondering if all the 7 notes only contain one frequency component, so that only one sine wave is needed to be enveloped and produce that specific note. Thanks
Hello and welcome to Music Stack Exchange.
I think your question is a little too broad but I will still try and answer and help a little.
What does it mean to give "one frequency for a certain note in that octave"? Do you mean that only one note in the C major scale was provided? Or that each note had only one frequency provided? This is a critical piece of intel.
Based on your statements about an envelop and what you are trying to do I think you are asking about harmonic content of the notes. I could be wrong, please correct in the comments. Each note is characterized but a "fundamental" frequency. An example of this is A440, which is 440Hz and used as a reference to tune instruments. Other standards exist and the definition of an "A" has changed over the centuries. Given that you have the correct frequency for C, the starting point of the scale you can choose the other notes by more than one formula. In the Just tuning system the other note fundamental frequencies are given by a sequence of ratios relative to the first note.
If C is X(Hz) then the notes of the scale are (1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8, 2)*X.
In the 12 tone equal tempered system these are a root of 2. The half step is defined as the 12th root of 2 and the other notes are just a certain number of half steps.
In 12TET the notes would be determined by these powers, p = (0, 2, 4, 5, 7, 9, 11, 12).
To get the correct frequency of the "fundamental" you would take 2^(p/12) * X.
Now, that takes care of the tuning of the scale notes by some method. This is the only information required to generate the tones of the scale. But this is NOT all that goes into making the sound you hear when an instrument plays. The physics of the attack and the specific boundary conditions that determine the physics of the vibrations supported by the instrument all come into play.
Harmonics: Each type of instrument has a mechanism for initiating vibrations. On a guitar it would be the strings, on a sax it's the reed. In the case of the guitar the strings are held under tension and that, along with their density and length, determine the natural frequency of vibration. Strings support an infinite series of harmonics each related to the fundamental by n*f1, n = 1 is the fundamental or lowest note. For a horn these are determined by the length (or effective length) of the tube that supports a resonating standing wave in the air column. The reed starting and sustains the vibration by the length of the air column is what determines the harmonics.
Attack: When one plays a musical instrument the nature of the attach is what determines the amount of each harmonic initially present in the wave form. This is unique to each instrument and each type of attack. So I would ask you to clarify whether you are simulating or synthesizing just the scale notes or a real musical instrument. To do the former all you need is the fundamental. To do the latter you need a full time series a analysis of the attack spectrum, the sustain spectrum, and the decay spectrum and all this need to be modeled in the circuit.
Keep in mind that not all instruments produce a perfect harmonic sequence of overtones, n*f1 so using this sequence as an all purpose device will fail. In some cases you can do pretty well by using math to generate a prediction of the attack response and the other responses over time. Our modeling of strings is pretty good. However, it will not be realistic and a good ear will hear it an fake. This is because the response of the rest of the instrument, body etc, is missing. Some synthesized sounds are made from sampled acoustic pulses that are decomposed and rebuilt. This empirical approach is costly but can work well.
As for the envelope, you can simply "cut" or window the pure sine wave as you like and that will introduce harmonics into the spectrum due to the windowing effect. However these will NOT be based on the physics of the instrument you are trying to synthesize.
What you need to do depends on your answer to the question:
Are you trying to make a circuit that is capable of playing the notes in a scale, or a circuit that can mimic another instrument to some desired accuracy?