Code covered by the BSD License  

Highlights from
Flauta

Flauta

by

 

flauta en matlab

DoRe.m
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%          Dr. Miguel Aurelio Duarte Villaseor
%          Docente en el ITS de Poza Rica
%          Poza rica, Veracruz, Mxico. Marzo de 2013
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%Descripcin: saca varios tonos por la bocina,
%se puede definir: amplitud y duracion

amplitud=20;
duracion=0.5; %en segundos
Fs=0.00001;
t=[0:Fs:duracion];

Do=261.626;
Do=amplitud*sin(2*pi*Do*t);
Do1=277.183;
Do1=amplitud*sin(2*pi*Do1*t);
Re=293.665;
Re=amplitud*sin(2*pi*Re*t);
Re1=311.127;
Re1=amplitud*sin(2*pi*Re1*t);
Mi=329.628;
Mi=amplitud*sin(2*pi*Mi*t);
Fa=349.228;
Fa=amplitud*sin(2*pi*Fa*t);
Fa1=369.994;
Fa1=amplitud*sin(2*pi*Fa1*t);
Sol=391.995;
Sol=amplitud*sin(2*pi*Sol*t);
Sol1=415.305;
Sol1=amplitud*sin(2*pi*Sol1*t);
La=440;
La=amplitud*sin(2*pi*La*t);
La1=466.164;
La1=amplitud*sin(2*pi*La1*t);
Si=493.883;
Si=amplitud*sin(2*pi*Si*t);

% sound(Do,1/Fs);
% pause(0.2)
% sound(Do1,1/Fs);
% pause(0.2)
% sound(Re,1/Fs);
% pause(0.2)
% sound(Re1,1/Fs);
% pause(0.2)
% sound(Mi,1/Fs);
% pause(0.2)
% sound(Fa,1/Fs);
% pause(0.2)
% sound(Fa1,1/Fs);
% pause(0.2)
% sound(Sol,1/Fs);
% pause(0.2)
% sound(Sol1,1/Fs);
% pause(0.2)
% sound(La,1/Fs);
% pause(0.2)
% sound(La1,1/Fs);
% pause(0.2)
% sound(Si,1/Fs);
% pause(0.2)

%ejemplo de como unidos forman una tonada (flauta de pan)
%primero para las notas sostenidas le doy ms tiempo
t2=[0:Fs:duracion*2];
Sol2=391.995;
Sol2=amplitud*sin(2*pi*Sol2*t2);
Fa12=369.994;
Fa12=amplitud*sin(2*pi*Fa12*t);
Do2=261.626;
Do2=amplitud*sin(2*pi*Do2*t);

sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(La,1/Fs);
sound(Si,1/Fs);
sound(Si,1/Fs);
sound(Sol2,1/Fs);
pause(0.3)
sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(La,1/Fs);
sound(Si,1/Fs);
sound(Si,1/Fs);
sound(Fa12,1/Fs);
pause(0.3)
sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(Sol,1/Fs);
sound(Fa1,1/Fs);
sound(Re,1/Fs);
sound(Do2,1/Fs);
sound(Re,1/Fs);

Contact us