% quelques sons sinusoidaux bout a bout
%--------------------------------------

clear all; close all;

Fe = 22050; h = 1/Fe;
f0 = 220; T =  1.5;

N = 13;
fr = f0*(1:N);
am = 1;

x = [];
for k = 1:N
    % creation d'une enveloppe 
    tr = T*[0 .02 .98 1];
    yr = [0 1 1 0];
    env = envelop(tr,yr,Fe);
    th = 0:h:T;
    % mise bout a bout de sinus
    y = sin(2*pi*fr(k)*th).*env;
    x = [x, am*y];
    T = T*.8;
    am = am*.8;
end

sound(x,Fe);
%wavwrite(x,Fe,'../SONS/101sinus.wav');
