lichen-community-systems / Flocking

Flocking - Creative audio synthesis for the Web
GNU General Public License v2.0
695 stars 60 forks source link

flock.band should handle a broader range of synths... #190

Open the-t-in-rtf opened 7 years ago

the-t-in-rtf commented 7 years ago

As we discussed, the flock.band grade's getSynths method looks for child components that have the flock.synth grade. This notably excludes the polyphonic synth, which does not extend flock.synth. It would be better to:

1) Target children with the flock.noteTarget grade instead 2) Make the target grade(s) an option in flock.band. 3) Remove the existing function in favor of an invoker that uses fluid.queryIoCSelector.

I will submit a quick PR that addresses this.

the-t-in-rtf commented 7 years ago

I am starting by taking care of points 2 and 3 and confirming all tests still run. I will then make the primary change and rerun the tests.

the-t-in-rtf commented 7 years ago

With the new invoker, we could also trivially set the default option to an array of grades that includes both flock.synth and flock.noteTarget.

the-t-in-rtf commented 7 years ago

It turns out I was optimistic about fluid.queryIoCSelector, which only supports a single grade. If we want to support an array of values, we'd need to add a function that iterates through them and compiles an array of distinct offerings.