Page 1 of 1

Stream Array-Reader/Control-Law

Posted: Thu Sep 24, 2020 9:37 pm
by trogluddite
Following from the discussions in this thread, here are some modules which can be used to implement custom control-laws, transfer-curves, etc. within mono, mono4, or poly audio streams, by using a float array as a look-up table.

control_law_V002.fsm
(257.75 KiB) Downloaded 1287 times

The principle is the same for all them: The stream input value determines which value(s) to fetch from the float array. Lookup is interpolated so that output values "glide" smoothly from one array element to the next. The valid range of input values is set by "min" and "max" properties, which then spans all of the entries in the array, no matter the size of the array (i.e. the minimum input value looks up the first item in the array, and the maximum input value looks up the last item in the array).

Input values are constrained internally so that you can't fall off the ends of the array. Output values are not constrained at all - it is assumed that the Array only contains valid output values.

There are three versions, all implemented in optimised assembly...
- Sample rate: Lookup happens at every single sample. Can be used mono, mono4, or poly.
- Hopped: Lookup happens every 16 samples (look inside for how to change the hop interval).
- Note On: Strictly for poly streams; lookup only happens at the start of a new note (kinda!).
Where further optimisations might be possible (e.g. for pure mono use), this is noted within the code inside the modules.

Re: Stream Array-Reader/Control-Law

Posted: Fri Sep 25, 2020 8:31 am
by Spogg
Absolutely brilliant and useful set of tools trog!

What I especially like, if I’ve got this right, is that any graph-drawing module which gives out a float array can feed into this system. In this way one could make a visual representation of any transfer curve. I might even use this in my current project (at a very early stage currently).

Thank you so much! :D