Two examples of frequency manipulation

Let us play



We are going to use our sample to play a four sound minor chord (with minor seventh). Since this a rather "dirty" sound, we use a hundred frequencies from the sample. If you want something cleaner, try decreasing the number of frequencies numf.

Here is the script; save it to a file and execute.

[freqs,amps] = sampleSound(extract,100,Fs);
numf = 100;
x= synth(0,freqs,amps,numf,L,Fs,0.5);
sound(x,Fs)

x2 = synth(3,freqs,amps,numf,L,Fs,0.5); % minor third
z = [x;x2];
sound(z,Fs);

x3 = synth(7,freqs,amps,numf,L,Fs,0.5); % fifth
z = [x;x2;x3];
sound(z,Fs);

x4 = synth(10,freqs,amps,numf,L,Fs,0.5); % minor seventh
z = [x;x2;x3;x4];
sound(z,Fs);

% play chord
z = x+x2+x3+x4; % minor chord with seventh
sound(z,Fs);

If you want a more classical chord, remove x4 (the seventh).