Page 1 of 1
Which kind of "recursive" trick is this in FlowStone?
Posted: Tue Jan 12, 2016 4:11 pm
by Nowhk
Watching and learning FS within complex project, I usually see "tricks" like this:

- trick.png (4.18 KiB) Viewed 9653 times
and I don't understand what in fact it does. If I try to "emulate" with greens, I get weird results:

- trick-green.png (12.36 KiB) Viewed 9653 times
- 0 is 0 (ok)
- when I write 1, I got 21.
- when I write 2, I got 42.
- when I write 3, I got 63.
why this results? What's the math over it? Also (most important): why if I put 0, it turn back to 0 instead of just "sum" 0? I don't know if greens are correct (red line), but seems to trigger values.
Can you help me to understand this magic? Thanks!
P.s. I'm a programmer, but really: FlowStone is really mysterious!!!
Re: Which kind of "recursive" trick is this in FlowStone?
Posted: Tue Jan 12, 2016 4:43 pm
by Nowhk
It seems it append the sum of the two values at the end. For example, using 8. Its 8+8 (16) first, than append 8. The result in fact is 168. But using 11, it does 22 and append 11 from the second digit, so 231. Bug?
On Double its different. It seems to works correctly; here I got 10000:

- Immagine.png (28.73 KiB) Viewed 9647 times
and when "step" return to 0, the value remains on 10000, it doesn't change back to 0. That's strange and different from green...
Re: Which kind of "recursive" trick is this in FlowStone?
Posted: Sat Jan 16, 2016 2:14 am
by nix
Heya Nowhk,
If you take away the stream doubles, it will still work and make it a bit simpler.
It is a samplerate counter.
So the figure(usually 1) is fed back and added.
Usually it would be called feedback, and not recursion.
This is the version in primitives of your coded counter.
The float version throws the infinite loop cpu failsafe.
It has no particular speed to count at defined, while the stream one has the specified samplerate.
Cheers man, Nick
Re: Which kind of "recursive" trick is this in FlowStone?
Posted: Sat Jan 16, 2016 9:42 am
by Nowhk
nix wrote:Heya Nowhk,
If you take away the stream doubles, it will still work and make it a bit simpler.
It is a samplerate counter.
So the figure(usually 1) is fed back and added.
Usually it would be called feedback, and not recursion.
This is the version in primitives of your coded counter.
I see, thank you. Watching the Sampler schematic, I got how it changes the "speed" making the step high or low (pitch). Absolutly not sure why it needs Int result and Frac one, maybe interpolation. But when Ive opened that module I got scared

pos, weight, strange moltiplication...
nix wrote:The float version throws the infinite loop cpu failsafe.
Ah so its a sort of warning to tell us "be carefull, green are not good for feedback". But why 8 generate 168?
nix wrote:It has no particular speed to count at defined, while the stream one has the specified samplerate.
God bless streams in FlowStone: fast and sync

I'm starting to get it...