Hello,
I'd like to write a custom "inject" function that works on parallel input
streams and turns them into a 1-dim signal (a bit like `sum` or `prod` but with
a custom concatenation function).
As an example, I made "dsBus2int", which, assuming a parallel binary-stream
(e.g. `(1, 0, 0, 1)`, assembles an integer via a left-shift operation.
The current version assumes a fixed input dimensionality (6, in this case):
```
import("stdfaust.lib");
dsBus2int_6 = si.bus(6) : \(x0, x1, x2, x3, x4, x5).(left_shift((x0, x1, x2,
x3, x4, x5))) with {
left_shift((x, xs)) = left_shift(xs) & ((x > 0) << 1) ;
left_shift(x) = x > 0;
};
process = (1, 0, 0, 1, 1, 1) : dsBus2int_6;
```
Now I'd like to write a version that takes an N-dimensional stream (N < 32)
with the interface
```
process = insignal : dsBus2int(N) with {
N = 12;
insignal = si.nus(N); // or something else...
};
```
What I need to do, is to turn the parallel composed items of `si.bus(N)` into a
list that can be processed by the `left_shift` recursive expression without the
step of explicitly declaring the parameter-list `x0, x1, ...` in the lambda
expression...
anyone has an idea on how to do that?
all the best and thanks in advance!
Till
--
Till Bovermann
https://tai-studio.org | http://lfsaw.de | https://www.instagram.com/_lfsaw/
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users