monoboolean add = OR?

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

monoboolean add = OR?

Postby oddson on Sun May 04, 2008 12:32 am

Can anyone confirm without me having to build test code that adding two monoboolean streams to a single input will give an 'OR' result into the receiving module?
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Postby MyCo on Sun May 04, 2008 4:37 am

Streamboolean are just streams with a different symbol. So if you can convert streams to streamboolean and vice versa without loosing its value.

When you add 2 monoboolean your result is added like normal. But if you only check with "equal zero" or "greater zero" you can use it as OR and you could use multiplication as AND (not supported by rule checking, you have to force a link).
User avatar
MyCo
smaniac
 
Posts: 1016
Joined: Mon Dec 19, 2005 1:43 am
Location: Germany

Postby oddson on Sun May 04, 2008 6:45 am

:o :S My first reaction is 'that can't be right' but a cursory test says it is.
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Postby rl on Mon May 05, 2008 2:40 am

I can't check that right now, since I'm far away from my SM capable machine. But in case monobool's are treated as int's it should be possible, but only for or-ing int's with single bits set like in 1 2 4 8 16,... Note that e.g. 3 + 1 = 4 but 3 OR 1 is 3

____________________
Temporarily greetings from San Francisco. The city of open wireless lan connections
User avatar
rl
dsp wiz
 
Posts: 1494
Joined: Mon Feb 07, 2005 10:24 pm
Location: de.earth.universe.known

Postby MyCo on Mon May 05, 2008 5:16 am

they are treated as floats, like normal streams. So there is only one way to boolean compare, which is the comparing with zero.
User avatar
MyCo
smaniac
 
Posts: 1016
Joined: Mon Dec 19, 2005 1:43 am
Location: Germany


Return to Sound

Who is online

Users browsing this forum: No registered users and 2 guests