Commits

dan mackinlay committed f70aca0

track individual ages

Comments (0)

Files changed (3)

phenosynth/controllers.sc

   actuallyPlay {|indDict|
     q.push({
       indDict.phenome.play(out:indDict.playBus, group:playGroup);
+      indDict.phenome.clockOn;
     });
   }
   freeIndividual {|phenome|
       Synth(this.class.listenSynth,
         this.getListenSynthArgs(indDict),
         listenGroup);
+      indDict.phenome.clockOn;
       //re-route some output to the master input
       Synth(\jack, [\in, indDict.playBus, \out, outBus], listenGroup);
     });

phenosynth/islands.sc

Empty file added.

phenosynth/phenomes.sc

 PSPhenome {
   var <chromosome;
   var <>fitness=0;
-  var <age;
+  var <logicalAge=0;
+  var <birthTime;
   
   *new{|chromosome|
     ^super.new.init(chromosome);
   play {|out|
     NotYetImplementedError.new.throw;
   }
+  clockOn {
+    birthTime = Date.gmtime.rawSeconds;
+  }
+  wallClockAge {
+    ^Date.gmtime.rawSeconds - birthTime
+  }
 }
 
 PSSynthDefPhenome : PSPhenome{