% makeCsharp.m   Make a wav file with 3 second of Csharp above A220
% P.Conrad for CISC106 

sampleRate = 44100;
bitsPerSample = 16;
volume = 0.9;  % volume should be a number between [0,1) (< 1)

frequencyOfA = 440;
numHalfSteps = 4;
frequencyOfCSharp = frequencyOfA * 2^(numHalfSteps/12);
frequencyOfE = frequencyOfA * 2^(7/12);

Asamples = volume * sineWavVector(sampleRate,frequencyOfA,3);
CsharpSamples = volume * sineWavVector(sampleRate,frequencyOfCSharp,3);
Esamples = volume * sineWavVector(sampleRate,frequencyOfE,3);

samples = (Asamples + CsharpSamples + Esamples)/3;

wavwrite(samples,sampleRate,bitsPerSample,'AMajorChord.wav');

system('chmod 755 AMajorChord.wav');
