% flute.m % Created by: Tasha Vanesian % Used to create a flute sound. % The harmonics of a flute are nearly impossible % to see on a linear scale past the second harmonic. % I had to zoom in by a power of 1000 to get the first % three harmonics. fD587 = notegennophase(587.329535834815, 0.000125, 1, 2.54, .245, .009, .00001); fenv = fD587.*((sin(10*pi*[0:0.000125:1]) + 100.2) * 0.1).*((sin(3*pi*[0:0.000125:1]) + 50.2) * 0.1); fenv2 = fD587.*abs(sin(pi*[0:0.000125:1])); % fenv3 sounds best, but more like a recorder than a flute. fenv3 = sinenvelope(fD587, 0.000125,1); fenv4 = fD587.*((sin(10*pi*[0:0.000125:1]) + 100.2) * 0.01).*abs(sin(2*pi*[0:0.000125:1])+sin(2*pi*[0:0.000125:1]+ pi/4)+100);