Display a PolyBoolean

For general discussions related to SynthMaker.

Moderators: electrogear, exonerate

Display a PolyBoolean

Postby sonata31 on Tue Feb 21, 2012 6:46 am

How to display the output of a PolyBoolean?
sonata31
essemer
 
Posts: 17
Joined: Thu Mar 01, 2007 12:48 pm
Location: Toulouse - France

Re: Display a PolyBoolean

Postby CoreStyler on Tue Feb 21, 2012 8:24 am

i think you can't. but maybe is possible through an output code in stream (0-1).
http://www.thecorestylerz.net
Sound Design, synth development and websites building...
Image
SM COMMUNITY IS MOVING TO
www.synthmakers.net
User avatar
CoreStyler
essemilian
 
Posts: 476
Joined: Sun May 23, 2010 1:25 pm

Re: Display a PolyBoolean

Postby sonata31 on Tue Feb 21, 2012 1:25 pm

What can we connect a PolyBoolean?
How to use it?
sonata31
essemer
 
Posts: 17
Joined: Thu Mar 01, 2007 12:48 pm
Location: Toulouse - France

Re: Display a PolyBoolean

Postby Xtinct on Tue Feb 21, 2012 1:56 pm

Heres an example displaying the bool output
bool to poly.osm
You do not have the required permissions to view the files attached to this post.
Xtinct
essemilian
 
Posts: 226
Joined: Thu Feb 10, 2011 11:06 pm

Re: Display a PolyBoolean

Postby CoreStyler on Tue Feb 21, 2012 4:29 pm

Xtinct wrote:Heres an example displaying the bool output
bool to poly.osm


Exactly what i was thinking... if input < 1 or >1 then bool T or F
http://www.thecorestylerz.net
Sound Design, synth development and websites building...
Image
SM COMMUNITY IS MOVING TO
www.synthmakers.net
User avatar
CoreStyler
essemilian
 
Posts: 476
Joined: Sun May 23, 2010 1:25 pm

Re: Display a PolyBoolean

Postby sonata31 on Wed Feb 22, 2012 8:39 am

Thank You for you example
sonata31
essemer
 
Posts: 17
Joined: Thu Mar 01, 2007 12:48 pm
Location: Toulouse - France

Re: Display a PolyBoolean

Postby trogluddite on Wed Feb 22, 2012 4:20 pm

Can be done even more economically...
Streambool to Stream.osm

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
Code: Select all
a = a & (x>0);
b = b & (x>0);
c = c & (x>0);

...you can do this instead...
Code: Select all
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.
You do not have the required permissions to view the files attached to this post.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3033
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests