samer@34: function y=addsynth(N,A,F,phi) samer@34: % addsynth - Additive synthesis samer@34: % samer@34: % addsynth :: samer@34: % N:natural ~'size of buffers to produce', samer@34: % seq([[K]]) ~'sequence of amplitudes for each component', samer@34: % seq([[K]]) ~'sequence of frequencies of sine waves to generate', samer@34: % [[K]] ~'initial phases' samer@34: % -> seq([[1,N]]) ~'sum of components'. samer@34: samer@34: phi=repmat_to(phi,size(F)); samer@36: y=zipwith(@(a,x)a'*x,A,blockdata(msine,N,phi,F)); samer@34: