soul-lang / SOUL

The SOUL programming language and API
Other
1.71k stars 96 forks source link

Proposal: graph fan-in using multiplication #58

Closed goomtrex closed 3 years ago

goomtrex commented 3 years ago

The current fan-in syntax for connections is as follows:

connection source1, source2, source3 -> target1

This proposal concerns making the mixing operation explicit:

connection source1 + source2 + source3 -> target1
connection source1 * source2 * source3 -> target1

For example, supposing target1 is a frequency/phase input, addition would be used for FM/PM while multiplication would be used for envelope/LFO control (after mapping those controls using exp). A similar principle applies when combining volume/amplitude controls using addition/multiplication respectively.

It's possible to simulate multiplication for fanned inputs by mapping each input using log, but this becomes tricky with values like phase which can be positive/negative.

julianstorer commented 3 years ago

Hi there, and thanks for the suggestion!

We actually already have plans to make it possible to write exactly what you've got there - and a lot more - by allowing any kind of pure-functional expression to be written for the input to an endpoint. That would include the normal operators, and also calls to functions with no side-effects.

That's pretty near the top of our to-do-list!

BTW the reason that we chose commas rather than pluses for fan-in is because it gives a consistent syntax for fan-in and fan-out.