[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider: [7379] trunk/build/SCClassLibrary



Revision: 7379
          http://svn.sourceforge.net/supercollider/?rev=7379&view=rev
Author:   cruxxial
Date:     2008-02-23 14:11:50 -0800 (Sat, 23 Feb 2008)

Log Message:
-----------
fixing or implementing pattern-storeArgs for many patts.  see unit test in Common

Modified Paths:
--------------
    trunk/build/SCClassLibrary/Common/Streams/FilterPatterns.sc
    trunk/build/SCClassLibrary/Common/Streams/ListPatterns.sc
    trunk/build/SCClassLibrary/Common/Streams/Patterns.sc
    trunk/build/SCClassLibrary/Common/Streams/Pfx.sc
    trunk/build/SCClassLibrary/Common/Streams/Ppatmod.sc
    trunk/build/SCClassLibrary/Common/Streams/Pproto.sc
    trunk/build/SCClassLibrary/Common/Streams/Prewrite.sc
    trunk/build/SCClassLibrary/Common/Streams/RandomDistPatterns.sc
    trunk/build/SCClassLibrary/Common/Streams/TimePatterns.sc
    trunk/build/SCClassLibrary/JITLib/Patterns/Pdef.sc
    trunk/build/SCClassLibrary/JITLib/Patterns/Psym.sc
    trunk/build/SCClassLibrary/JITLib/Patterns/Pxfade.sc

Modified: trunk/build/SCClassLibrary/Common/Streams/FilterPatterns.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/FilterPatterns.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/FilterPatterns.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -249,9 +249,13 @@
 
 Pplayer : FilterPattern {
 	var <>playerPattern, <>subPattern;
+	// this is broken:
 	*new { arg playerPattern, subPattern;
+	// super new copy args puts it in pattern, playerPattern
+	// -cx
 		^super.newCopyArgs(playerPattern, subPattern)
 	}
+	storeArgs { ^[ playerPattern, subPattern ] }
 	embedInStream { arg event;
 		var player, inevent;
 		var playerStream = playerPattern.asStream;
@@ -561,7 +565,7 @@
 	*new { arg pattern, connected = true;
 		^super.new(pattern).connected_(connected)
 	}
-	
+	storeArgs { ^[ pattern, connected ] }
 	embedInStream { arg inval;
 		var clutchStream = connected.asStream;
 		var stream = pattern.asStream;
@@ -625,6 +629,7 @@
 	*new { arg pattern, key, printStream, prefix; 
 		^super.newCopyArgs(pattern, key, printStream, prefix) 
 	}
+	storeArgs { ^[ pattern, key, printStream, prefix ] }
 	asStream {
 		^pattern.asStream.trace(key, printStream, prefix)
 	}
@@ -634,7 +639,7 @@
 Pclump : FilterPattern {
 	var <>n;
 	*new { arg n, pattern;
-		^super.newCopyArgs(pattern, n) 
+		^super.new(pattern).n_(n)
 	}
 	embedInStream { arg event;
 		var next, list, nval;
@@ -655,13 +660,10 @@
 			event = list.yield;
 		}
 	}
+	storeArgs { ^[ n, pattern ] }
 }
 
-Pflatten : FilterPattern {
-	var <>n;
-	*new { arg n, pattern;
-		^super.newCopyArgs(pattern, n) 
-	}
+Pflatten : Pclump {
 	embedInStream { arg event;
 		var next, nval;
 		var stream = pattern.asStream;
@@ -729,6 +731,7 @@
 			}
 		}
 	}
+	storeArgs { ^[proportion,pattern] }
 }
 
 Pavaroh : FilterPattern {

Modified: trunk/build/SCClassLibrary/Common/Streams/ListPatterns.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/ListPatterns.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/ListPatterns.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -3,6 +3,7 @@
 	*new { arg listPat, indexPat, repeats=1;
 		^super.newCopyArgs(listPat, indexPat, repeats)
 	}
+	storeArgs { ^[listPat,indexPat,repeats] }
 	embedInStream { arg inval;
 		var indexStream, index, item, itemCount;
 		var listStream = listPat.asStream;

Modified: trunk/build/SCClassLibrary/Common/Streams/Patterns.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/Patterns.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/Patterns.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -186,6 +186,9 @@
 	*new { arg pattern, scale, stepsPerOctave=12; 
 		^super.new('degreeToKey', pattern, [scale, stepsPerOctave])
 	}
+	// this is not reversible
+	// but it would save as something that played the same
+	//storeArgs { ^[ pattern, scale, stepsPerOctave ] }
 }
 
 Pchain : Pattern {
@@ -551,10 +554,10 @@
 
 PstepNfunc : Pattern {
 	var <function, <>patterns;
-	*new { arg func, patterns;
-		^super.newCopyArgs(func, patterns)
+	*new { arg function, patterns;
+		^super.newCopyArgs(function, patterns)
 	}
-	
+	storeArgs { ^[function,patterns] }
 	embedInStream { arg inval;
 		var val;		
 		var size = patterns.size;
@@ -595,6 +598,7 @@
 	*new { arg repeats=inf;
 		^super.newCopyArgs(repeats)
 	}
+	storeArgs { ^[repeats] }
 	embedInStream { arg inval;
 		var start = thisThread.beats;
 		repeats.value.do { inval = (thisThread.beats - start).yield };
@@ -609,6 +613,7 @@
 	*new { arg pattern, func;
 		^super.new(pattern).func_(func)
 	}
+	storeArgs { ^[ pattern, func ] }
 	asStream {
 		var rout = Routine(pattern.embedInStream(_));
 		rout.exceptionHandler = { |error|\xCA
@@ -642,7 +647,7 @@
 	*new { |condition, iftrue, iffalse, default|
 		^super.newCopyArgs(condition, iftrue, iffalse, default)
 	}
-	storeArgs { ^[condition, iftrue, iffalse] }
+	storeArgs { ^[condition, iftrue, iffalse,default] }
 	asStream {
 		var	condStream = condition.asStream,
 			trueStream = iftrue.asStream,

Modified: trunk/build/SCClassLibrary/Common/Streams/Pfx.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/Pfx.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/Pfx.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -91,7 +91,8 @@
 		^super.new(pattern).dur_(dur).numChannels_(numChannels).rate_(rate).fadeTime_(fadeTime)
 	}
 	
-
+	storeArgs { ^[ pattern, dur, fadeTime, numChannels, rate ] }
+	
 	embedInStream { arg inevent;
 		var server, groupID, linkID, bus, ingroup, cleanup;
 		var patterns, event, freeBus, stream;

Modified: trunk/build/SCClassLibrary/Common/Streams/Ppatmod.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/Ppatmod.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/Ppatmod.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -58,6 +58,7 @@
 	*new { arg envir, pattern, independent=true;
 		^super.newCopyArgs(envir, pattern, independent)
 	}
+	storeArgs { ^[envir,pattern,independent] }
 	embedInStream { arg inval;
 		if(independent) 
 			{ Event.new(8, nil, envir) }

Modified: trunk/build/SCClassLibrary/Common/Streams/Pproto.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/Pproto.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/Pproto.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -6,7 +6,7 @@
 	*new { | makeFunction, pattern, cleanupFunc|
 		^super.newCopyArgs( makeFunction, pattern, cleanupFunc)
 	}
-		
+	storeArgs { ^[makeFunction,pattern,cleanupFunc] }	
 	embedInStream { | event |
 		var stream,  ev, evType;			
 		var cleanup, cleanupList, eventCleanupFunc;

Modified: trunk/build/SCClassLibrary/Common/Streams/Prewrite.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/Prewrite.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/Prewrite.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -3,6 +3,7 @@
 	*new { arg pattern, dict, levels;
 		^super.new(pattern).dict_(dict).levels_(levels)
 	}
+	storeArgs { ^[ pattern, dict, levels ] }
 	rewriteList { arg list, inval, level;
 		var newlist;
 		if (level == 0, { 

Modified: trunk/build/SCClassLibrary/Common/Streams/RandomDistPatterns.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/RandomDistPatterns.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/RandomDistPatterns.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -140,7 +140,7 @@
 	*new { arg lo=0.0001, hi=1.0, length=inf;
 		^super.newCopyArgs(lo, hi, length)
 	}
-	
+	storeArgs { ^[ lo, hi, length ] }
 	embedInStream { arg inval;
 		var loStr = lo.asStream;
 		var hiStr = hi.asStream;

Modified: trunk/build/SCClassLibrary/Common/Streams/TimePatterns.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Streams/TimePatterns.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/Common/Streams/TimePatterns.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -30,7 +30,7 @@
 		^inval;
 	}
 	storeArgs {
-		^[list, repeats, durs]
+		^[list, durs, repeats]
 	}	
 }
 

Modified: trunk/build/SCClassLibrary/JITLib/Patterns/Pdef.sc
===================================================================
--- trunk/build/SCClassLibrary/JITLib/Patterns/Pdef.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/JITLib/Patterns/Pdef.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -792,7 +792,7 @@
 	*new { arg dict, which, repeats=inf, default;
 		^super.newCopyArgs(dict, which, repeats, default);
 	}
-	
+	storeArgs { ^[dict,which,repeats,default ] }
 	embedInStream { arg inval;
 		var keyStream, key;
 		keyStream = which.asStream;

Modified: trunk/build/SCClassLibrary/JITLib/Patterns/Psym.sc
===================================================================
--- trunk/build/SCClassLibrary/JITLib/Patterns/Psym.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/JITLib/Patterns/Psym.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -4,6 +4,7 @@
 	*new { arg pattern, dict;
 		^super.new(pattern).dict_(dict)
 	}
+	storeArgs { ^[pattern,dict] }
 	
 	lookupClass { ^Pdef }
 	lookUp { arg key;
@@ -53,7 +54,7 @@
 	*new { arg pattern, dict, quant, dur, tolerance = 0.001;
 		^super.newCopyArgs(pattern, dict, quant, dur, tolerance)
 	}
-	
+	storeArgs { ^[ pattern, dict, quant, dur, tolerance ] }
 	embedInStream { arg inval;
 		var str, outval, pat, quantVal, quantStr, durVal, durStr;
 		str = pattern.asStream;

Modified: trunk/build/SCClassLibrary/JITLib/Patterns/Pxfade.sc
===================================================================
--- trunk/build/SCClassLibrary/JITLib/Patterns/Pxfade.sc	2008-02-23 19:31:34 UTC (rev 7378)
+++ trunk/build/SCClassLibrary/JITLib/Patterns/Pxfade.sc	2008-02-23 22:11:50 UTC (rev 7379)
@@ -28,6 +28,7 @@
 				}
 			}
 	}
+	storeArgs { ^[ pattern, fadeTime, holdTime, tolerance ] }
 }
 
 PfadeOut : PfadeIn {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.