<p dir="ltr">There is also disis_phasor~ that does exactly what you mentioned (it is available as a separate download as well as part of pd-l2ork). Namely, it has 2 outlets with the right one firing a bang whenever ramp is complete. This, however is only accurate to the nearest vector size (default 64 samples).</p>

<div class="gmail_quote">On Mar 5, 2014 3:27 AM, &quot;Roman Haefeli&quot; &lt;<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 2013-05-08 at 22:00 +0100, Ed Kelly wrote:<br>
&gt; Hi Lists(s),<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m rewriting phasor~ and unifying it with metro so that a pulse is<br>
&gt; generated from the boundaries of each ramp - so that bars of music can<br>
&gt; be read using tabread~ objects with a sample-accurate metro.<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m sure someone will say this can already be done,<br>
<br>
Yes!<br>
<br>
&gt;  but it has to be dropped into the Ninja Jamm patch, so there isn&#39;t<br>
&gt; really time to rewrite the rest of the patch.<br>
<br>
Frankly, I am pretty sure, just using what Pd provides is too easy to<br>
use and likely less time consuming than writing your custom external.<br>
(Or I am totally missing the point of this adventure).<br>
<br>
<br>
&gt; I don&#39;t fully understand the way phasor~ wraps, but I have the object<br>
&gt; firing out bar numbers correctly. I&#39;m putting clocks in for 16ths and<br>
&gt; 24ths of the beat, initiated on each wrap. I need to minimise CPU, so<br>
&gt; what I want to know is this:<br>
&gt;<br>
&gt;<br>
&gt; Does phasor~ always start from 0 and go to 1, i.e. is there always a<br>
&gt; signal value of 0 at the start of the ramp and a signal value of 1 at<br>
&gt; the end? As I write this, my common sense tells me it should be &quot;yes&quot;<br>
&gt; but I want to make sure. I suppose I should just try it really...<br>
<br>
No, it&#39;s not the case. A [phasor~] ramp virtually starts always at 0 and<br>
ends at 1 - true, but most of the time the wrapping point doesn&#39;t lie<br>
exactly on sample boundaries. This means the sample values around the<br>
wrapping point are almost never 1 or 0, respectively.<br>
<br>
Trying to derive precise timing from the audio domain is a moot exercise<br>
anyway, in my opinion. The best you can get from this approach is sample<br>
precision and analyzing all samples of a signal is relatively<br>
expensive.<br>
<br>
If you truly care about CPU consumption and a proper design from the<br>
start, use [metro] - which is as precise as 32-bit floats can be - and<br>
[vline~] - which actually uses the  precise timing from [metro] (as<br>
opposed to [line~] that doesn&#39;t).<br>
<br>
With this combo [metro]/[vline~] you can rebuild [phasor~] with the<br>
additional benefit of giving you more-than-sample-exact bangs at the<br>
wrapping points. The only drawback compared to [phasor~] is that the<br>
latter allows to control the frequency with a signal and the<br>
[metro]/[vline~] based phasor obviously doesn&#39;t.<br>
<br>
I&#39;ll be glad to help you build the [phasor~] replacement that has an<br>
additional bang outlet, if you need it.<br>
<br>
Roman<br>
<br>
<br>
<br>
<br>
<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 -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>