Parsing array into interpretable string for genetic algorithm

Two thoughts on this:

.) Following Brian’s question: if you want to have different data in an Array and then produce a SynthDef therewith, you might want to wrap UGens in Functions, then you can take them over. See these discussions: {}.play on a UGen stored in variable?
https://www.listarc.bham.ac.uk/lists/sc-users-2012/msg22935.html

.) You could also use the preProcessor method for Strings (more hassle)
https://www.listarc.bham.ac.uk/lists/sc-users-2016/msg52531.html

.) You could also poke around with the ‘interpret’ method, but this is also often a complication.

I suppose the first approach could fit your demands. Here an example how to integrate operators like ‘+’ and ‘*’:

// in your application x,y could be items of an array

x = { |a, b| BinaryOpUGen('+', a, b) };

y = { |a, b| BinaryOpUGen('*', a, b) };



u = { x.(LFTri.ar(200), LFTri.ar(163)) * 0.1 }.play  

u.release

v = { y.(LFTri.ar(200), LFTri.ar(163)) * 0.1 }.play  

v.release
1 Like