Music and Acoustics: From Instrument to Computer

This second set of practical applications focuses on creating a synthetic sound imitating an acoustic music instrument, as well as on a few experiments on timbre. The last part can only be done if you have completed Study problem 2.6.5.
We are going to write a MATLAB function for the purpose of creating sounds by additive synthesis (the summing of sines, see also Chapter 6) and the use of an envelope to control the intensity in time. Additive synthesis requires the synthad.m function, previously used in the practical applications of Chapter 1.
Create a function with the header
function s = instrument(f1,T,Fe)
Remember that the file's name is then instrument.m (you can replace the word instrument with whatever word you like). We first create a sound of the form
Because the instrument we are dealing with is programmed, the number of harmonics or partials np, their amplitudes ? k and their 'normalized' frequencies hk, are all defined by you in the function itself. the frequency of partial number k is then f 1 h k. In theory (due to the 'normalization' effect), we have h 1 = 1 ( h 1 = 0.5 for a bell), and f 1 h 1 = f 1( f 1/2 for a...