abclib icon indicating copy to clipboard operation
abclib copied to clipboard

Function coding

Open sletz opened this issue 2 years ago • 0 comments

We've just updated the Contributing page here. This section may be of interest:

Functions with several parameters should better be written by putting the more constant parameters (like control, setup...) at the beginning of the parameter list, and audio signals to be processed at the end. This allows to do partial-application. So prefer the following clip(low, high, x) = min(max(x, low), high); form where clip(-1, 1) partially applied version can be used later on in different contexts, better than clip(x, low, high) = min(max(x, low), high); version.

(for exemple here: https://github.com/alainbonardi/abclib/blob/master/faustCodes/library/mm.lib#L72)

sletz avatar Feb 27 '22 12:02 sletz