Commits

dan mackinlay committed 7110c6a

start of debugging the wacky argument mapping

Comments (0)

Files changed (2)

 ~control.playGroup;
 ~control.server;
 ~control.outBus;
-~ind = PSSynthDefPhenome([0.5, 0.5, 0.5]);
+~ind = PSSynthDefPhenome.newRandom;
 ~control.playIndividual(~ind);
 ~ind.identityHash;
 ~ind.chromosome;
 /* TODO:
 
 * provide a way to unwarp as well as warp chromosomes, and look up values of either. 
+* work out why I get multiple values of the synth args when I wrap the chromosome.
 
-*/
+*/
+

phenosynth/phenomes.sc

   play {|out, group|
     var mappedArgs;
     mappedArgs = this.chromosomeAsSynthArgs;
+    (['MAPPED'] ++ mappedArgs).postln;
     ^Synth.new(
       this.class.synthdef,
       args: [\out, out] ++ mappedArgs,
     )
   }
   chromosomeAsSynthArgs {
-    ^all {: [keySpec[0], keySpec[1].map(val)],
+    ^(all {: [keySpec[0], keySpec[1].map(val)],
       keySpec <- this.class.map.asSortedArray,
       val <- chromosome
-    };
+    }).flat;
   }
 }