Commits

dan mackinlay committed 1b6b11b

I no longer get multiple values of the synth args when I wrap the chromosome.

  • Participants
  • Parent commits 7110c6a

Comments (0)

Files changed (2)

 /* 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

     )
   }
   chromosomeAsSynthArgs {
-    ^(all {: [keySpec[0], keySpec[1].map(val)],
-      keySpec <- this.class.map.asSortedArray,
-      val <- chromosome
+/*    This list comprehension is not especially clear now, is it?
+    What it does is zip together the key, map spec and value 
+    lists into one, then iterates over this, returning mapped values
+    associated with their keys as a synth expects*/
+    ^(all {: [keySpecVal[0], keySpecVal[1].map(keySpecVal[2])],
+      keySpecVal <- (this.class.map.asSortedArray +++ chromosome)
     }).flat;
   }
 }