<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[adaptation of max&#x27;s phasor~ behaviour for puredata]]></title><description><![CDATA[<p>Another adaptation I'm struggling with:</p>
<p><img src="/uploads/files/1778234295549-screenshot-2026-05-08-at-11.57.04.png" alt="Screenshot 2026-05-08 at 11.57.04.png" class="img-responsive img-markdown" /></p>
<p>Here &quot;phasor~&quot;'s phase is reset when receiving a non zero signal.<br />
The use case is resetting a sample counter.</p>
<p>Phasor~in puredata doesn't act the same,<br />
Does anyone have a clue how to make a vanilla  adaptation ?</p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 07:56:01 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15878.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 May 2026 10:02:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 10:05:33 GMT]]></title><description><![CDATA[<p>Another adaptation I'm struggling with:</p>
<p><img src="/uploads/files/1778234295549-screenshot-2026-05-08-at-11.57.04.png" alt="Screenshot 2026-05-08 at 11.57.04.png" class="img-responsive img-markdown" /></p>
<p>Here &quot;phasor~&quot;'s phase is reset when receiving a non zero signal.<br />
The use case is resetting a sample counter.</p>
<p>Phasor~in puredata doesn't act the same,<br />
Does anyone have a clue how to make a vanilla  adaptation ?</p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Fri, 08 May 2026 10:05:33 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 16:24:46 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> Assuming the sample frequency is 44.1khz, the phasor frequency is fixed at 1, and you don't need to support any other feature than what you mentioned above, try <code>[fexpr~ if($x != 0, 0, ($y + 1) % 44100)]</code> to replace both the phasor and following multiplication.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/3</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Fri, 08 May 2026 16:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 17:29:19 GMT]]></title><description><![CDATA[<p>Thanks a lot, again!</p>
<p>I just had to invert things:</p>
<p>fexpr~ if($x != 0, <strong>($y + 1) % 44100, 0</strong>)</p>
<p>beautiful.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/4</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Fri, 08 May 2026 17:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 17:46:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> said:</p>
<blockquote>
<p>&quot;phasor~&quot;'s phase is reset when receiving a non zero signal.</p>
</blockquote>
<p>If this was a test in college I'd be there during office hours arguing that the question was misleading <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/5</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Fri, 08 May 2026 17:46:09 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 18:06:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/laughing.png" title="laughing" alt=":laughing:" /></p>
<p>I try to be precise when asking for things, but when I post I've been struggling for a long time, smoke is coming out of my ears, I end up with confusing messages....</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/6</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Fri, 08 May 2026 18:06:40 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Fri, 08 May 2026 22:28:26 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> said:</p>
<blockquote>
<p>Here &quot;phasor~&quot;'s phase is reset when receiving a non zero signal.<br />
The use case is resetting a sample counter.</p>
<p>Phasor~in puredata doesn't act the same,<br />
Does anyone have a clue how to make a vanilla  adaptation ?</p>
</blockquote>
<p>I forget who is the pd forum user who taught me this trick, but, here's a neat way to have a signal reset a phasor:</p>
<pre><code>[phasor~]
|  \
|  [samphold~]
|  |
[-~]
|
[wrap~]
</code></pre>
<p>Then the reset trigger goes into the right inlet of samphold~ (but IIRC it should be inverted, because samphold samples its input signal when its trigger signal <em>decreases</em>, see its help file).</p>
<p>Always works (think about it a minute, and it becomes clear why).</p>
<p>Btw phasor * sample rate is not safe as a sample counter, due to floating point rounding error. (Maybe ok for one second.) In pd vanilla, [rpole~ 1] can serve as an accumulator but resetting it at signal rate is a bit trickier. I'm not at the computer now but I could track that down later. Or use cyclone's count~.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/7</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Fri, 08 May 2026 22:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 08:21:16 GMT]]></title><description><![CDATA[<p>This is as close as I could get with rpole~.</p>
<p>The limitation here is that using a phasor~ for reset, the period is not 100% exact -- 10 seconds should range from 0 to 479999 samples, but I actually get 479991.</p>
<p><img src="/uploads/files/1778314621379-pd-rpole-counter.png" alt="pd-rpole-counter.png" class="img-responsive img-markdown" /></p>
<p>To reset rpole~, both the input and the coefficient need to drop to zero for exactly one sample. That's the point of taking the slope of the phasor, scaling it up by a ridiculous amount, and clipping. If there's another way to do this in pd vanilla that will cycle after exactly the right number of samples, it could be substituted here, but I don't know what that technique is.</p>
<p>(FWIW, the [count~] object from Cyclone is exactly correct.)</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/8</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 09 May 2026 08:21:16 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 08:54:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> , even better, I guess this would be more cpu friendly ?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/9</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Sat, 09 May 2026 08:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 08:57:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> ,</p>
<pre><code>Maybe ok for one second
</code></pre>
<p>I count only 256 samples, I assume it will be precise then ?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/10</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Sat, 09 May 2026 08:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 11:55:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> My friend who uses Max/MSP just explained to me that phasor~ resets when the right input signal <strong><em>changes</em></strong> to a non-zero value, which means that in my fexpr~ version the test should be &quot;$x != 0 &amp;&amp; $x != $x[-1]&quot;</p>
<p>Edit: argh, I even misunderstood my friend. <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lacuna">@lacuna</a> is correct below--it's when the signal changes to a non-zero value <strong><em>from zero</em></strong></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/11</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Sat, 09 May 2026 11:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 11:22:13 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a></p>
<blockquote>
<p>resets when the right input signal changes to a non-zero value</p>
</blockquote>
<p>$x!=0 &amp;&amp; $x[-1]==0</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/12</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Sat, 09 May 2026 11:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 12:47:37 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> wrote:</p>
<blockquote>
<p>cpu friendly ?</p>
</blockquote>
<p>I doubt that this simple checking and accumulating is very expensive.<br />
(in the other thread, in the screenshot I see many [fexpr~] that you could replace with [expr~] or other Vanilla objects.)</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> wrote:</p>
<blockquote>
<p>should range from 0 to 479999 samples, but I actually get 479991.</p>
</blockquote>
<p>Oh, this is very bad news! I always thought that phasor~ frequency would be spot on.<br />
(There are very few people who understand [phasor~]s code, here is a thread <a href="https://forum.pdpatchrepo.info/topic/14523/90-second-limit-on-audio-buffers" rel="nofollow">https://forum.pdpatchrepo.info/topic/14523/90-second-limit-on-audio-buffers</a>)<br />
Ok, this means in Pd-world a sample-counter made with phasor~ would be bad design.</p>
<p>Here is one more patch, this circles between 0 and 255 and stops and resets when input sig == 0.</p>
<p><img src="/uploads/files/1778326932871-rpole-reset2.gif" alt="rpole~reset2.gif" class="img-responsive img-markdown" /> <a href="/uploads/files/1778326932860-rpole-reset2.pd">rpole~reset2.pd</a></p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> wrote:</p>
<blockquote>
<p>signal changes to a non-zero value</p>
</blockquote>
<p>This would require to add or subtract sth like the [rzero~ 1] [*~ 1e+32][clip~] trick in the inlet.</p>
<p>Edit: Now I realize that in case it stops at counting 0, it never restarts. Adding a [+~ 1] in the feedback-path should fix this.<br />
2nd Edit: But then it's not cicling anymore...hmmm don't know how to fix this. Maybe instead [rzero~ 1] [*~1e+32][clip~] trick on the inlet to get one sample going.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/13</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Sat, 09 May 2026 12:47:37 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 12:59:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> wrote:</p>
<blockquote>
<p>phasor~ for reset, the period is not 100% exact</p>
</blockquote>
<p>Now I remember long time ago there has been a thread about very slow &lt;1Hz [osc~] LFO being off.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> wrote:</p>
<blockquote>
<p>I count only 256 samples, I assume it will be precise then ?</p>
</blockquote>
<p>Probably yes.</p>
<p><a href="/uploads/files/1778331344683-phasor-is-off.pd">phasor~is-off.pd</a><br />
<img src="/uploads/files/1778331535233-phasor-is-off.png" alt="phasor~is-off.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/14</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Sat, 09 May 2026 12:59:01 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 13:32:53 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lacuna">@lacuna</a> [phasor~] only resets at block boundaries..... <a href="https://forum.pdpatchrepo.info/topic/3699/phasor-with-sample-accurate-phase-reset" rel="nofollow">https://forum.pdpatchrepo.info/topic/3699/phasor-with-sample-accurate-phase-reset</a><br />
So this might be what you need...... <a href="/uploads/files/1778333153252-vphasor.zip">vphasor~.zip</a><br />
I think this was the previous discussion...... <a href="https://forum.pdpatchrepo.info/topic/12865/samphold-noise-phasor-noise-round-off-error-or/3" rel="nofollow">https://forum.pdpatchrepo.info/topic/12865/samphold-noise-phasor-noise-round-off-error-or/3</a><br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/15</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Sat, 09 May 2026 13:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 13:44:17 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lacuna">@lacuna</a></p>
<p>Well, I think the counter being off isn't an issue, in the end it's off for the 4 mics and I end up with  correct inter-onset values. ( I hope so )</p>
<p>The patch evolved and has fewer uncertainties ( the screenshot I posted in the previous thread was wrong in many ways... )</p>
<p>I gave up using Lowpass to filter onsets, I went on trying to reproduce some &quot;Gen~&quot;  code with &quot;fexpr~&quot; ( as I understood a few things about expressions reading all the different answers I got on the forum.</p>
<p>I got better results ( I've been provided a 4 tracks recording, and a list off all inter onsets produced by the max patch so I can compare ) I spent a few hours <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/expressionless.png" title="expressionless" alt=":expressionless:" /> trying to have the exact behaviour of :</p>
<p><img src="/uploads/files/1778334097000-screenshot-2026-05-09-at-15.38.51.png" alt="Screenshot 2026-05-09 at 15.38.51.png" class="img-responsive img-markdown" /></p>
<p>in a fexpr object.</p>
<p>Question, does anyone think this Gen~ code can be transposed to fexpr~ ?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/16</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/16</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Sat, 09 May 2026 13:44:17 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sat, 09 May 2026 13:47:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> Cheers !</p>
<p>I never knew this topic would go that deep...<br />
I'll try and improve my onset detection / detrending, then see if I need the counter to be that accurate ( my guess is &quot;no&quot; )</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/17</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/17</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Sat, 09 May 2026 13:47:10 GMT</pubDate></item><item><title><![CDATA[Reply to adaptation of max&#x27;s phasor~ behaviour for puredata on Sun, 10 May 2026 08:55:22 GMT]]></title><description><![CDATA[<p>I think I achieved replicating this in puredata ,I'm also pretty sure this can be done way more efficiently...!</p>
<p>Here's a screenshot &amp; the patch attached.</p>
<p><img src="/uploads/files/1778403302840-screenshot-2026-05-10-at-10.51.19.png" alt="Screenshot 2026-05-10 at 10.51.19.png" class="img-responsive img-markdown" /></p>
<p><a href="/uploads/files/1778403254534-gendetrendtest.pd">genDetrendTest.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/18</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15878/adaptation-of-max-s-phasor-behaviour-for-puredata/18</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Sun, 10 May 2026 08:55:22 GMT</pubDate></item></channel></rss>