Yeah, a threshold~ set to 1 is never triggered (or very rarely). <br>So there&#39;s no perfect answer to the question it seems...<br><br>Pierre<br><br><div class="gmail_quote">2011/9/20 Roman Haefeli <span dir="ltr">&lt;<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Tue, 2011-09-20 at 09:43 +0200, Pierre Massat wrote:<br>
&gt; I m curious to know which object you would recommend instead of<br>
&gt; threshold~ (the delay way is obviously not feasible as soon as you<br>
&gt; need to change the speed of phasor~ during palyback).<br>
<br>
</div>Yeah, [threshold~] seems feasible, but this approach suffers from a few<br>
issues. As I said before, the bang comes only on block boundaries and is<br>
at least one block late, so it&#39;s not very precise. Also, a [phasor~]<br>
probably never reaches exactly 1 (or 0) and it is less likely the higher<br>
the frequency is. So you would need values like 0.001 or 0.999 for the<br>
[threshold~] which again makes it a bit more imprecise.<br>
<br>
You can also use the [vline~] approach and change the speed in the<br>
middle of the playback, though it needs a bit of patching to accomplish<br>
that. You need a delay, that is triggered at the time of the speed<br>
change. The delay value can be used to calculate the current position of<br>
the play head. Then you can use that value as a start point for a new<br>
message to [vline~].<br>
<font color="#888888"><br>
Roman<br>
</font><div><div></div><div class="h5"><br>
<br>
&gt; 2011/9/20 Roman Haefeli &lt;<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>&gt;<br>
&gt;         On Mon, 2011-09-19 at 14:00 -0700, Jonathan Wilkes wrote:<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; &gt;________________________________<br>
&gt;         &gt; &gt;From: tim vets &lt;<a href="mailto:timvets@gmail.com">timvets@gmail.com</a>&gt;<br>
&gt;         &gt; &gt;To: Pierre Massat &lt;<a href="mailto:pimassat@gmail.com">pimassat@gmail.com</a>&gt;; James Dunn<br>
&gt;         &lt;<a href="mailto:james@4thharmonic.com">james@4thharmonic.com</a>&gt;; pd-list &lt;<a href="mailto:pd-list@iem.at">pd-list@iem.at</a>&gt;<br>
&gt;         &gt; &gt;Sent: Monday, September 19, 2011 4:08 PM<br>
&gt;         &gt; &gt;Subject: Re: [PD] stop sample playback when phasor~ reset?<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt;When you use phasor~, you normally already know how long it<br>
&gt;         will take for the sound to be finished playing (because you<br>
&gt;         set its frequency to play it back at the proper speed)<br>
&gt;         &gt; &gt;Store the information about the sound loaded (or recorded)<br>
&gt;         and use that to stop the playback after one play duration.<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt;[del &lt;time&gt;]<br>
&gt;         &gt; &gt;|<br>
&gt;         &gt; &gt;[t  b  b]<br>
&gt;         &gt; &gt;|        |<br>
&gt;         &gt; &gt;[0(     [0(<br>
&gt;         &gt; &gt;[        |<br>
&gt;         &gt; &gt;[phasor]<br>
&gt;         &gt;<br>
&gt;         &gt; What&#39;s the benefit of this over a line~ based approach?<br>
&gt;         &gt;<br>
&gt;<br>
&gt;         [line~] is inferior to [phasor~] in that it only starts a ramp<br>
&gt;         on block<br>
&gt;         boundaries. Using [vline~] seems to me most flexible in terms<br>
&gt;         of sample<br>
&gt;         playback as it can start a ramp even in-between samples.<br>
&gt;<br>
&gt;         Using [threshold~] or any other method to detect the reset of<br>
&gt;         [phasor~]<br>
&gt;         is not feasible, because of two reasons:<br>
&gt;          * [threshold] (but also [snapshot~]) output the bang only at<br>
&gt;         block<br>
&gt;         bounaries, so the detection is not very precise<br>
&gt;          * Whenever the the audio domain (a signal) causes an event in<br>
&gt;         the<br>
&gt;         message domain (that&#39;s what [threshold~] and [snapshot~] are<br>
&gt;         for), the<br>
&gt;         event is at least one block late.<br>
&gt;<br>
&gt;         There is still one advantage of [phasor~] over [vline~]: The<br>
&gt;         speed of<br>
&gt;         the [phasor~] can be changed at signal rate, so one can create<br>
&gt;         continuous pitch changes when playing the sample. That&#39;s not<br>
&gt;         possible<br>
&gt;         with [vline~].<br>
&gt;<br>
&gt;         Roman<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br>