sonata31 ·
How to display the output of a PolyBoolean?
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
sonata31 ·
How to display the output of a PolyBoolean?
CoreStyler ·
i think you can't. but maybe is possible through an output code in stream (0-1).
sonata31 ·
What can we connect a PolyBoolean? How to use it?
Xtinct ·
Heres an example displaying the bool output
CoreStyler ·
Xtinct wrote: Heres an example displaying the bool output
Exactly what i was thinking... if input < 1 or >1 then bool T or F
sonata31 ·
Thank You for you example
trogluddite ·
Can be done even more economically...
CoreStyler wrote: Exactly what i was thinking... if input < 1 or >1 then bool T or F
This is not quite how Stream Booleans work... From code/assembly, you may be familiar with the idea of comparisons making a bitmask... e.g. (x>0) & value ;result is zero if x<=0 or you get value if x>0.
If false, a comparison yields zero (all bits to 0)- if it is true you get a value where all bits are set to one. The true result (all bits 1), doesn't really represent any particular number - it is just convenient so that you can use bitwise logic (e.g. & value) to mask or unmask the bits in other variables and numbers. StreamBools (poly or mono) carry these bitmasks rather than true numbers, and let you pass them around your schematic to avoid the need for extra comparisons later on - so in my example schematic, I can use a streamboolin (instead of streamin) and then just a single & to turn the value into zero or one. (naturally, there is a 'streamboolout equivalent).
Within code blocks, you can use a similar idea to "share" a comparison between lots of statements. e.g. instead of
a = a & (x>0); b = b & (x>0); c = c & (x>0);
...you can do this instead...
bigx = (x>0); /store the bitmask a = a & bigx; b = b & bigx; c = c & bigx;
An extra line of code, but you save the CPU of repeating the comparison - and in assembly this can be even more economical, as the bitmask can be kept in a register rather than a variable.
Note that this is very different to "green" booleans - they are either zero or one (you can see this if you connect a green bool to a float or integer). If you convert a float or integer direct to green boolean, then any non-zero value counts as true.
Wrote something here? To have a post removed or your name hidden, write to [email protected].