diff dsp/synth/sonify.m @ 36:9e7be347b3a0

Renamed sequence classes to avoid clashes with seq methods; Fixed default slicing dimension while retaining behaviour of window.m; Updated use of sequences in dsp/synth.
author samer
date Thu, 24 Jan 2013 14:51:23 +0000
parents c75bb62b90a9
children beb8a3f4a345
line wrap: on
line diff
--- a/dsp/synth/sonify.m	Mon Jan 21 11:01:45 2013 +0000
+++ b/dsp/synth/sonify.m	Thu Jan 24 14:51:23 2013 +0000
@@ -36,10 +36,10 @@
 	num2hz=@(n)nan2x(0,fm*2.^((n+tr)/12));
 
 	if isscalar(D), D=dm*D;
-	else D=fndata(@(d)dm*d,dd(D),'compose',1); % D=dm*D with optimisation
+	else D=map(@(d)dm*d,dd(D)); % D=dm*D with optimisation
 	end
-	C=fndata(@(n)(n+tr)/12,dd(S),'compose',1); % chroma values
-	F=fndata(num2hz,dd(S),'compose',1);   % convert to normalised frequencies
+	C=map(@(n)(n+tr)/12,dd(S)); % chroma values
+	F=map(num2hz,dd(S));   % convert to normalised frequencies
 
 	% cutoff for band-limited waveform generation
 	if isempty(opts.bl_cutoff)
@@ -55,7 +55,7 @@
 		case 'blsquare'
 			% cumsum within each buffer: doesn't drift but makes
 			% audible clicks between buffers.
-			Y=fndata(@(t)0.5*cumsum(t),blockdata(bpblit,D,0,cutoff,F));
+			Y=map(@(t)0.5*cumsum(t),blockdata(bpblit,D,0,cutoff,F));
 		case 'blsquare2'
 			% this version does cumsum across the sequence to remove 
 			% discontinuities but requires high-pass filter to stop drift.
@@ -71,13 +71,13 @@
 
 	% if supplied apply envelope to shape each note
 	if nargin>2 && ~isempty(env),
-		ad=fndata(env,Y,'sizecheck',1);
+		ad=map(env,Y);
 	else
 		ad=Y;
 	end
 
 	% rebuffer to constant size
 	if ~isempty(opts.buffer)
-		ad=windowdata(ad,ceil(opts.buffer*opts.fs));
+		ad=window(ad,ceil(opts.buffer*opts.fs));
 	end