Hi Derek!<br><br>Your approch is exactly what I need!<br><br>I didn't know the [==~] and [avg~] objects, but they make exactly what I want.<br><br>Thanks for the suggestion!<br><br>Saludos!<br><br><br><div><span class="gmail_quote">
2008/1/20, Derek Holzer <<a href="mailto:derek@umatic.nl">derek@umatic.nl</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Raul,<br><br>you will want to investigate the binary operations and mathematical<br>operations for signals. In this case, you want to know when the<br>[phasor~] reaches 1:<br><br>[==~]<br><br>and this will output a signal of 1 (= HIGH), otherwise a zero (= LOW).
<br>You can use [snapshot~] to covert this to a float. [avg~] is supposed to<br>do this as well, but it doesn't do anything on my OSX PD Extended-0.39<br>installation.<br><br>Thomas Mayer's squarewave converter that he posted using [>~
0.5] and<br>[-~ 0.5] is a similar idea, giving you also HIGH and LOW values, but you<br>might still need to convert to float for the next part.<br><br>Once the result of you binary operation is a float, you can use a<br>counter-like structure to count the HI levels, and some other math
<br>operations to count (alternately 1,2 and 1). I don't have time to patch<br>the whole thing myself, but hopefully you will see what I mean.<br><br>best,<br>d.<br><br>raul diaz wrote:<br>> Hi list!<br>><br>> I need to convert a phasor into a square wave in this way:
<br>><br>> phasor:<br>><br>> / / / / / /<br>> / | / | / | / | / | / |<br>> / | / | / | / | / | / |<br>> / |/ |/ |/ |/ |/ |
<br>><br>> square (2:1):<br>> ________ _________ _<br>> | | | | |<br>> | | | | |<br>> | |____| |____|
<br>><br>><br>> so, a relation HIGH:LOW holds a high or a low value (1 or 0) a indicate<br>> number of cycles.<br>> I need this conversion in order to make a masking, so square doesn't<br>> have to be an audio signal necessarily (could be a number upload each
<br>> phasor cycle).<br>><br>> What could be the best implementation for that scheme?<br>><br>> Saludos!<br>><br>> --<br>> Raul Diaz Poblete<br>> *************************<br>> <a href="mailto:raul.lete@gmail.com">
raul.lete@gmail.com</a> <mailto:<a href="mailto:raul.lete@gmail.com">raul.lete@gmail.com</a>><br>> Barcelona [Spain]<br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> <a href="mailto:PD-list@iem.at">PD-list@iem.at</a> mailing list<br>> UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list">
http://lists.puredata.info/listinfo/pd-list</a><br><br>--<br>derek holzer ::: <a href="http://www.umatic.nl">http://www.umatic.nl</a> ::: <a href="http://blog.myspace.com/macumbista">http://blog.myspace.com/macumbista</a>
<br>---Oblique Strategy # 165:<br>"Use an old idea"<br></blockquote></div><br><br clear="all"><br>-- <br>Raul Diaz Poblete<br>*************************<br><a href="mailto:raul.lete@gmail.com">raul.lete@gmail.com
</a><br>Barcelona [Spain]