% accord de differents intervalles
%---------------------------------

clear all; close all;

Fe = 22050; h = 1/Fe;
T =  5; th = 0:h:T;

% accord de l'unisson Fa-3
%-------------------------
f = 349.2;
a = 2; b = .2;
am = [1000 10 5 2 1 .1];
figure(1);
x1 = ajuste(f,Fe,T,am,0,1);
x2 = ajuste(f,Fe,T,am,a,b);
x = x1+x2;
figure(2);
plot(x);
x = .98*x/(max(abs(x)));
sound(x,Fe);
%wavwrite(x,Fe,'../SONS/202accorduniss.wav');
pause(T+1)

% accord de l'octave Fa-2 Fa-3
%-----------------------------
f = 174.6;
a = 2; b = .2;
am = [2000 1000 50 2 1 .1];
figure(1);
x1 = ajuste(f,Fe,T,am,0,1);
x2 = ajuste(2*f,Fe,T,am,a,b);
x = x1+x2;
figure(2);
plot(x);
x = .98*x/(max(abs(x)));
sound(x,Fe);
%wavwrite(x,Fe,'../SONS/203accordoctav.wav');
pause(T+1)

% accord de la quinte Fa-2 Do-3
%------------------------------
a = -1; b = .2;
am = [2000 1000 500 2 1 .1];
figure(1);
x1 = ajuste(f,Fe,T,am,0,1);
x2 = ajuste(1.5*f,Fe,T,am,a,b);
x = x1+x2;
figure(2);
plot(x);
x = .98*x/(max(abs(x)));
sound(x,Fe);
%wavwrite(x,Fe,'../SONS/204accordquint.wav');
pause(T+1)

% accord de la tierce Fa-2 La-2
%------------------------------
a = -1; b = .2;
am = [2000 1000 500 800 600 .1];
figure(1);
x1 = ajuste(f,Fe,T,am,0,1);
x2 = ajuste(2^(1/3)*f,Fe,T,am,a,b);
x = x1+x2;
figure(2);
plot(x);
x = .98*x/(max(abs(x)));
sound(x,Fe);
%wavwrite(x,Fe,'../SONS/205accordtierc.wav');
