function y = orgue(f,t,Fe)
%        y = orgue(f,t,Fe)
% orgue de synthese
%-------------------------

h = 1/Fe;
th = 0:h:t;
nt = length(th);

% harmoniques
nh = 6; N = 1:nh;
eft = N.^(-2);
harm = N;

% plein-jeux
nj = 10;
jeux = [1  2   3   4   5   6  8  10  12  16];
ej = [80 100 30  100  20  20 100  5  5  20];
% ajout des harmoniques
y = zeros(1,nt);
for j = 1:nj
    fh = jeux(j)*harm*f;
    ef = ej(j)*eft;
    for k = 1:nh
        z = cos(fh(k)*(2*pi*th + .003*sin(pi*th)));
        y = y + ef(k)*z;   
    end
end

% enveloppe
tr = [0 .07 t*.93 t];
yr = [0 1 .7 0];
env = envelop(tr,yr,Fe);
y = y.*env;
y = y/(max(abs(y)));

% ajout du souffle
tr = t*[0 .1 .2 .8 1];
yr = [0 1 .7 .5 0];
env = envelop(tr,yr,Fe);
br = bruitc(1.5*f,Fe,nt);

br = br.*env;
br = br/(max(abs(br)));

y = br/20+y;
y = .98*y/(max(abs(y)));





