Gtcode
Gtcode
clc;
x=1;
while x==1,
x=isempty (input ('Press enter to start program or press zero to quit.
'));
ghighE=1318.1505;
gB=987.7669;
gG=658.9911;
gD=587.3297;
gA=440;
glowE=329.6277;
guitar=[ghighE,gB,gG,gD,gA,glowE];
if x==1,
p=input ('Which string are you adjusting? 1=e 2=B 3=G 4=D 5=A 6=E');
w=guitar (p)
yw=isempty (input ('Press enter to record input signal or 0 to start
over. '));
while yw==1,
% record input signal
%
load chirp;
load gong;
%
[y Fs] = wavread(filename);
%Fs=44100;
T=0:1:Fs/2-1;
if p==6
for i=400:size(J,1)
J(i,1)=0;
end
else
for i=1500:size(J,1)
J(i,1)=0;
end
end
%Plotting
if p==6
axis([ 200 500 -0.01 0.01])
for i=400:size(J,1)
J(i,1)=0;
end
elseif p==5
if yw==1,
continue;
else x=1;
end
end
end
end