The class project for Com Sci 295 is an open project. It is open in two senses.
The goal of the project is to evaluate intuitively the quality of several common models for synthesizing sound, by simulating a small number of musical instruments with some of those models, interpolating between the qualities of instruments using the Loris tool library, and listening carefully to the results. With each synthesis model, the idea is to discover its natural good and bad qualities. So, there's no point in trying to perfect the instrument simulation with each model. Rather, we want to find the best simulation that uses the model in an intuitively natural fashion.
I haven't updated beyond this point. The remainder reflects the spring 2002 project. [O'D]
We will simulate the sound of the trumpet using 4 or 5 different synthesis models. In each case, we will create a simulation that can play individual notes of a second or two at a moderate articulation and dynamic, for each pitch of the chromatic scale over the normal range of the instrument. The 5 types of synthesis are:
You should accomplish step 1 by Monday, 9 April 2002.
You should accomplish Step 2 by Thursday 18 April.
mxv
, but if I were doing
it now, I'd use DAP) to select a 726-sample period from a
low horn note, resampled it to 1024 samples (using the phony
sample rate 44100*1024/726=62201), and saved it as a
wav
file. Then, I used the
``GEN01
''
routine in Csound to read it in as a wave table, and
played a 3-octave scale. Here are my files:
horn_sample_1.orc
horn_sample_1.sco
horn_period_1024.wav
(temporarily missing---I'll retrieve it soon)You should do this step quickly, by Thursday 25 April. It won't produce much in the way of interesting new sounds---it's mostly just a programming step to position you for step 4, which has the most interesting listening exercises.
Here is my preliminary work with the horn from 1999. You should be able to update it with trumpet data.
adsyn_horn.sco
.
horn_period_1.wav
.
Since the Fourier Transform function in Scilab does not
require the number of samples to be a power of 2, I did not resample
the period.plot_spectrum
and arg
to help. They are
in the file
fourier_demo.sci
described with the
lecture notes.
adsyn_horn_1.orc
,
performing additive synthesis with 18 partials. The higher partials
appear to be so small that they probably don't have much audible
impact. I ignored the phase information, and used only the
magnitudes from the Fourier Transform.adsyn_horn_2.orc
,
with conditional code to avoid aliasing problems.adsyn_horn_3.orc
,
using the measured phase of each partialI structured the Csound orchestra files fairly carefully for
convenient experimentation with different variations. I normalized the
size of the envelope kenv
to 1, so that the amplitude
value from the note is mentioned only once. To avoid scaling the
amplitude of each individual partial, I divided by the sum of all the
partial amplitudes (391.34) in the final calculuation of
aout
. You should be able to do lots of interesting
experiments just by changing the numbers in my orchestra files, and
possibly adding or deleting lines to handle more or fewer partials,
but without changing the basic structure in any way.
This step is the most complicated and labor intensive in the project. You should have a basic structure to work with by Monday 6 May. Then you can spend another 1-2 weeks refining and experimenting.
linseg
for different partials. Start with the minimum number of partials
that produced reasonably satisfying results in step 2.adsyn_horn.sco
,
the same as the one I used in step 3.horn_mf_B2.wav
.
adsyn_horn_se_1.orc
,
performing additive synthesis with 6 partials, using a separate
amplitude envelope for each partial, and leaving all the phases at
the default.Usually, the next recommended step is to add a filter to shape the spectra of notes at different pitches and eliminate the chipmunk effect. Many instruments have low notes that sound far too buzzy or nasal when shifted up to high pitches with the same relative strengths of different partials. To get a useful estimate of the right spectral profile for this filter, you need to compare spectra of several notes across the whole range of the trumpet. Greg Sandell's SHARC project has some average spectra that you can use for this purpose. You can compute your own averages using the FT function in Scilab. Or you can use some more sophisticated software that my Ph.D. student, Ilia Bisnovatyi, created. If you would like to work on a formant filter for the trumpet, please post questions and comments, and I will help you work out your methods in more detail. Since the chipmunk effect is not very dramatic in the trumpet, I expect a greater interest in the noise component.
In the best harmonic additive synthesis that we've achieved so far, we are still missing a certain high-frequency nasal or buzzy quality in some of the recorded notes. We have some indication that part of this quality can be produced by adding more of the higher harmonics. But some of those higher harmonics seem to stand out too much in the synthesized sound.
I suspect that there is a broadband noisy component to typical trumpet notes, derived physically from the hissing of air through the instrument. Such a noisy component might produce the buzzy quality that we've observed, and it might also soften the impact of higher partials by masking them.
Analyzing the noise component is a bit challenging. The basic idea is to take a very accurate harmonic synthesis, subtract it from the recorded note, and analyze the difference. If the harmonic synthesis is accurate enough, the remainder is essentially the noise component. Unfortunately, since the noise component is spread over a large range of frequencies, it can be perceptually loud even though it is numerically small. So the harmonic synthesis may need to be numerically accurate even beyond the requirements of perceptual accuracy.
I suggest that you take a substantial number of periods (perhaps 10, perhaps 100) from the sustain portion of a chosen trumpet note. Try to find a segment with very little amplitude or frequency variation. I think that there is very little frequency variation overall, but amplitude may be a problem. Set the endpoints of your segment carefully to get a precise integer number of periods.
Take a Fourier transform of your chosen segment, and find the peaks corresponding to harmonic partials. Zero them (or set them to some arbitrary very small value, in case division by 0 becomes a problem) by just reassigning their values in the spectrum vector. Look at the remaining part of the spectrum. If it has a fairly flat magnitude, and random-looking phase values, then you have a reasonable basis for estimating a noise component.
Complication: any amplitude modulation in the sequence of periods will spread out the harmonic peaks. You may have to remove a few frequency bins to each side of each peak in order to squelch the harmonic component. If the AM sidebands spread so far that they mask the noise component even halfway between harmonic peaks, then we'll have to try something more sophisticated. I'll reserve comment on that something until someone reports on an attempt with the simpler approach.
Why not analyze a single period, to avoid the AM sidebands? The analysis of a single period only provides the harmonic partials, and loses the indication of noise. Why not perform a higher frequency-resolution analysis of a single period, by padding with 0s? That gives you an analysis of a pulse containing a single period. The sharp turning on and off of that pulse amounts to a very severe sort of AM. Each harmonic partial generates a sinc-shaped spectral component, which will mask the evidence of a low-amplitude noise.
Variation: from a visual inspection of a trumpet recording, it appears that noise content might occur in very short pulses around the fundamental frequency. It makes sense that such pulses could result from turbulence in the air flowing through the reed, since the reed opens for one or a small number of very short pulses each period. It's not clear how best to try to analyze this possibility. You could select the apparent pulse regions by eyeball, and compute spectra. But they are so short that I'm not optimistic about getting useful results. You could work constructively: make a reasonable guess, compute such a sequence of pulses, and listen to the result.
![]() | |