<?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[vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed]]></title><description><![CDATA[<p>Hello all,</p>
<p>I'm having a hard time to achieve the following:</p>
<p>I have an audio signal that is 1 for 14 samples  then  0,  when it's &quot;1&quot;  I'd like to output a &quot;1&quot; signal, then the next sample I'd like to output zero, in order to know at which sample the change occurred.</p>
<p>I want to avoid using  &quot;block~&quot; to set audio block to 1 in a subpatch, and don't want to use externals.</p>
<p>Anyone has a clue about how to achieve this ?</p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed</link><generator>RSS for Node</generator><lastBuildDate>Wed, 06 May 2026 17:31:58 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15871.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 05 May 2026 12:28:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Tue, 05 May 2026 12:28:15 GMT]]></title><description><![CDATA[<p>Hello all,</p>
<p>I'm having a hard time to achieve the following:</p>
<p>I have an audio signal that is 1 for 14 samples  then  0,  when it's &quot;1&quot;  I'd like to output a &quot;1&quot; signal, then the next sample I'd like to output zero, in order to know at which sample the change occurred.</p>
<p>I want to avoid using  &quot;block~&quot; to set audio block to 1 in a subpatch, and don't want to use externals.</p>
<p>Anyone has a clue about how to achieve this ?</p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Tue, 05 May 2026 12:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Tue, 05 May 2026 13:32:41 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> When you say &quot;1&quot; signal do you mean float 1?<br />
Even with [block~ 1] you will not get the control rate data until the end of the 64 sample Pd block.<br />
You can visualize it with an array after the fact......... a lot of discussion of samplewise stuff here......... <a href="https://forum.puredata.info/topic/13317/looking-for-velvet-noise-generator/69" rel="nofollow">https://forum.puredata.info/topic/13317/looking-for-velvet-noise-generator/69</a><br />
and also using [print~]<br />
Both Vanilla.</p>
<p>No time at the moment but you could play with [env~ 2 1] which should give you the data... again after the fact.......<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/2</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 05 May 2026 13:32:41 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Tue, 05 May 2026 21:24:14 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> said:</p>
<blockquote>
<p><a href="https://forum.puredata.info/topic/13317/looking-for-velvet-noise-generator/69" rel="nofollow">https://forum.puredata.info/topic/13317/looking-for-velvet-noise-generator/69</a></p>
</blockquote>
<p>Hello, thank you,</p>
<p>&quot;env~&quot; outputs a float, I think my question is confusing.</p>
<p>I'll try to be more precise, I'm analysing audio input signals, 4 audio inputs.<br />
They are mics placed around a snare drumhead, each time there's an attack I generate<br />
a signal that is 1 for all mics.</p>
<p>This signal is long, a few samples long, and I was scratching my head to find a way to turn it only into a 1 sample long impulse. It would make my life much easier.</p>
<p>all this stays at signal rate, then once a hit on the snare was detected on all 4 mics, I'll get the difference in samples in between them in order to know the position on the drumhead where the hit occurred.</p>
<p>thanks for the link to discussion, I'll read more into it to see if I can extract infos that could help. Any link to other posts about samplewise ways of doing things in general is welcome!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/3</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Tue, 05 May 2026 21:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Wed, 06 May 2026 01:13:08 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> David asked all the questions I would've asked and now I get the benefit of added clarity <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" />. I wonder if this thing I made for <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/eeight">@eeight</a> has any useful ideas for you, especially the stuff up to the [rzero~] and [clip~] inclusive? <a href="https://forum.pdpatchrepo.info/topic/13739/sync-in-ms-between-2-audio-signals/6" rel="nofollow">https://forum.pdpatchrepo.info/topic/13739/sync-in-ms-between-2-audio-signals/6</a></p>
<p>Maybe if you just take the impulses on the leading edges and compare their timings (uh, somehow), that will give you the info you need. I'm hand waving because I don't know how you'd determine which impulse was first.</p>
<p>Edit: I think the premise of your project is that the sound of the bead of the stick hitting the batter head is dominant. I wonder if that's true for a snare drum.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/4</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Wed, 06 May 2026 01:13:08 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Wed, 06 May 2026 07:13:53 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> said:</p>
<blockquote>
<p>This signal is long, a few samples long, and I was scratching my head to find a way to turn it only into a 1 sample long impulse. It would make my life much easier.</p>
</blockquote>
<p>i'm really not sure if i understand - but if it was only about that, a simple clipped derivative should be enough?</p>
<pre><code>[rzero~ 1]
|
[max~]
</code></pre>
<p>but based on the rest of the discussion, it sounds like you want to know which mic received the first input? i assume that it's not enough to have this per block though - since some mics might have a rising edge in the block after the mic that detected first? (EDIT: when handling things on control rate)</p>
<p>EDIT: it should be doable though to only trigger one impulse each time after a defined &quot;cooldown&quot; period (not sure about the proper word here) on signal rate.</p>
<p>EDIT2: and if it's about counting samples from the first hit to the others and then triangulating - that should also be achievable. let me know whether i understand correctly first. <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/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/5</guid><dc:creator><![CDATA[ben.wes]]></dc:creator><pubDate>Wed, 06 May 2026 07:13:53 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Wed, 06 May 2026 09:52:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> said:</p>
<blockquote>
<p><a href="https://forum.pdpatchrepo.info/topic/13739/sync-in-ms-between-2-audio-signals/6" rel="nofollow">https://forum.pdpatchrepo.info/topic/13739/sync-in-ms-between-2-audio-signals/6</a></p>
</blockquote>
<p>Hello,</p>
<p>your &quot;metronome timer&quot; patch contains the answer to my question, great !<br />
( quite impressed by the reactivity on this forum )</p>
<p><img src="/uploads/files/1778061123786-screenshot-2026-05-06-at-09.13.36.png" alt="Screenshot 2026-05-06 at 09.13.36.png" class="img-responsive img-markdown" /></p>
<p>I would have never thought of &quot;rpole&quot;, &quot;rzero&quot;, never used those it's a bit hard to understand how it works. The patch is well commented but still if you could detail a tiny bit the part where you take the impulse that would be lovely.</p>
<p>For knowing which one arrived first, I made a sample counter, but still I have to find out how to reset it when first mic is getting the signal. ( So being able to have only impulses might help me go further )</p>
<p>At least I know where to ask if I'm stuck again <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/smiley.png" title="smiley" alt=":smiley:" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/6</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Wed, 06 May 2026 09:52:10 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Wed, 06 May 2026 10:53:16 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/y0g1">@y0g1</a> The formula for [rzero~] in help means &quot;the output is the difference between the current input and (the previous input times the current coefficient).&quot;  Since the coefficient is always 1, it's just the difference between the last two inputs. So since the input is just a square wave toggling between 0 and 1, the output is going to be 1 on the rising edge, -1 on the falling edge, and 0 otherwise. By clipping it to 0..1, I just take the rising edge pulse.</p>
<p>&quot;Convert to negative pulse&quot; means instead of sitting at 0 with the occasional 1 pulse, it now sits at 1 with the occasional 0 pulse.</p>
<p>The formula for [rpole~ 1] in help means &quot;&quot;the output is the sum of the current input plus (the previous output times the current coefficient).&quot; When both the input and coefficient are 0, the output is 0, and when they're both 1, it increments by 1 each sample (i.e. counts samples).</p>
<p>By now you probably know how to understand the formula for [rzero_rev~ 0], let me know if you don't. The reason you need it is so that [samphold~] grabs the highest previous count, not the reset value.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/7</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Wed, 06 May 2026 10:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla method working like &quot;threshold~&quot; but triggering in between blocks, help needed on Wed, 06 May 2026 15:26:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> Thank you for the detailed explanations! I feel smarter than yesterday.</p>
<p>Though I noticed my signal is in fact a succession of 1 and 0, over a period of a dozen of samples, any advice about how to &quot;debounce&quot;, I'd like my signal to be one , then 0 for 4410 samples ( ignoring all the next &quot;1&quot; ).</p>
<p>I hope it's clear, I can precise things, but I'd need to get my head out of it for an hour to do so... I'm way out of my comfort zone dealing with sample accuracy...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15871/vanilla-method-working-like-threshold-but-triggering-in-between-blocks-help-needed/8</guid><dc:creator><![CDATA[y0g1]]></dc:creator><pubDate>Wed, 06 May 2026 15:26:00 GMT</pubDate></item></channel></rss>