<?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[Looking for advice on using phasor~ to randomize tabread4~ playback]]></title><description><![CDATA[<p>Hi, I am trying to come up with a strategy to use phasor~ to control a tabread4~ object to play a sound file.<br />
Ideally, I would want to have the file play randomly forward or backwards. Once the file has been played once I want the phasor~ to stop ( go to frequency 0).</p>
<p>I am including a patch and a soundfile I am using for testing.</p>
<p>I am using a snapshot~ to see when the phasor~ has played through the file once and stop towards the end. This changes for forward or backward playback. This doesn't seem like the best way to do this so any suggestions with that would be appreciated.</p>
<p>Also, I want the file to play from a random start point, which I am doing by randomizing the phase of the phazor~. I don't think this is the best Idea either. I was trying to add a random amount after the phasor~ using {+~ 0] but it was changing the pitch of the playback. I want the pitch to not change.</p>
<p>If anyone has ideas to improve this patch please let me know.</p>
<p>thanks, Nick<br />
<a href="/uploads/files/1743285078000-test.zip">test.zip</a></p>
<p><img src="/uploads/files/1743284787298-screenshot.jpg" alt="screenshot.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 00:52:44 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15073.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Mar 2025 21:51:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sat, 29 Mar 2025 21:51:23 GMT]]></title><description><![CDATA[<p>Hi, I am trying to come up with a strategy to use phasor~ to control a tabread4~ object to play a sound file.<br />
Ideally, I would want to have the file play randomly forward or backwards. Once the file has been played once I want the phasor~ to stop ( go to frequency 0).</p>
<p>I am including a patch and a soundfile I am using for testing.</p>
<p>I am using a snapshot~ to see when the phasor~ has played through the file once and stop towards the end. This changes for forward or backward playback. This doesn't seem like the best way to do this so any suggestions with that would be appreciated.</p>
<p>Also, I want the file to play from a random start point, which I am doing by randomizing the phase of the phazor~. I don't think this is the best Idea either. I was trying to add a random amount after the phasor~ using {+~ 0] but it was changing the pitch of the playback. I want the pitch to not change.</p>
<p>If anyone has ideas to improve this patch please let me know.</p>
<p>thanks, Nick<br />
<a href="/uploads/files/1743285078000-test.zip">test.zip</a></p>
<p><img src="/uploads/files/1743284787298-screenshot.jpg" alt="screenshot.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback</guid><dc:creator><![CDATA[nicnut]]></dc:creator><pubDate>Sat, 29 Mar 2025 21:51:23 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sat, 29 Mar 2025 22:38:33 GMT]]></title><description><![CDATA[<p>If the goal is to play it one-shot and then stop, wouldn't line~ be better?</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/2</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 29 Mar 2025 22:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sun, 30 Mar 2025 00:56:33 GMT]]></title><description><![CDATA[<p>Hi ddw_music.</p>
<p>Yes line~ would be better, but one thing I am doing is also playing the file for longer periods of time, by lowering  the phaser~ frequency, and doing some math the transpose the pitch of the playback that I would like to keep. With line~ I don't know how to separate the pitch and the playback speed. If there is a way to do that using line~ then that is an option as well.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/3</guid><dc:creator><![CDATA[nicnut]]></dc:creator><pubDate>Sun, 30 Mar 2025 00:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sun, 30 Mar 2025 06:23:51 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/nicnut">@nicnut</a> said:</p>
<blockquote>
<p>Yes line~ would be better, but one thing I am doing is also playing the file for longer periods of time, by lowering  the phaser~ frequency, and doing some math the transpose the pitch of the playback that I would like to keep. With line~ I don't know how to separate the pitch and the playback speed.</p>
</blockquote>
<p>If I understand you right, separating pitch and playback speed would require pitch shifting...?</p>
<p>With phasor~, you can play the audio faster or slower, and the pitch will be higher or lower accordingly.</p>
<p>With line~, you can play the audio faster or slower, with the same result.</p>
<p>To take a concrete example -- if you want to play 0-10 seconds in the audio file, you'd use a phasor~ frequency of 0.1 and map the phasor's 0-1 range onto 0 .. (samplerate*10) samples. If instead, the phasor~ frequency were 0.05, then it would play 10 seconds of audio within 20 seconds = half speed, one octave down.</p>
<p>With line~, if you send it messages &quot;0, $1 10000&quot; where $1 = samplerate*10, then it would play the same 10 seconds' worth of audio, in 10 seconds.</p>
<p>To change the rate, you'd only need to change the amount of time: 10000 / 0.5 (half speed) = 20000. 10 seconds of audio, over 20 seconds -- <em>exactly the same</em> as the phasor~ 0.05 result.</p>
<p>frequency = 1 / time, time = 1 / frequency. Whatever you multiply phasor~ frequency by, just divide line~ time by the same amount.</p>
<p><img src="/uploads/files/1743315513783-pd-slow-file.png" alt="pd-slow-file.png" class="img-responsive img-markdown" /></p>
<p>(line~ doesn't support changing rate in the middle though. There's another possible trick for that but perhaps not simpler than phasor~.)</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/4</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sun, 30 Mar 2025 06:23:51 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sun, 30 Mar 2025 16:38:59 GMT]]></title><description><![CDATA[<p>Hi ddw_music, thanks for taking the time to look into this.</p>
<p>I am attaching a simplified version of my patch.<br />
If I pick the transposition first, then choose the phasor~ frequency second I can separate the pitch and the time, which is something I want to keep. I understand that making the time faster or slower changes the pitch. For  what I am doing I want to keep the pitch the same but change the phasor speed.</p>
<p>I tried using [&lt;~] and [&gt;~] to stop the phasor~ but Pd crashed. I might need to look into that more. So I switched to using snapshot~ with [&lt;] and [.&gt;]. I don't know how to separate pitch and time using line~.</p>
<p><img src="/uploads/files/1743352429711-pitch-time.jpg" alt="pitch-time.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/5</guid><dc:creator><![CDATA[nicnut]]></dc:creator><pubDate>Sun, 30 Mar 2025 16:38:59 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Sun, 30 Mar 2025 22:58:21 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/nicnut">@nicnut</a> said:</p>
<blockquote>
<p>If I pick the transposition first, then choose the phasor~ frequency second I can separate the pitch and the time</p>
</blockquote>
<p>What do you mean by &quot;separate the pitch and the time&quot;? (Asking because often, computer-logic problems become easier after stating the problem in a more precise way.)</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/6</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sun, 30 Mar 2025 22:58:21 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Mon, 31 Mar 2025 01:43:27 GMT]]></title><description><![CDATA[<p>HI,</p>
<p>Ok, sorry to not be more specific. If you look at the screenshot in my last post there is a patch. There is a number box labeled &quot;transpose.&quot; The first step is to put a value in there, 1 being the original pitch, .5 is an octave down, 2 is an octave up, etc.<br />
After that you can change the frequency of the phasor in the other number box labled &quot;change phasor frequency without changing pitch.&quot;  This way, I can make the phasor frequency, say .5  and the transposition 2, which I don't think I can do using line~ with tabread4~.</p>
<p>Does  this make more sense? thanks,</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/7</guid><dc:creator><![CDATA[nicnut]]></dc:creator><pubDate>Mon, 31 Mar 2025 01:43:27 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Mon, 31 Mar 2025 09:29:21 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/nicnut">@nicnut</a> said:</p>
<blockquote>
<p>There is a number box labeled &quot;transpose.&quot; The first step is to put a value in there, 1 being the original pitch, .5 is an octave down, 2 is an octave up, etc.</p>
</blockquote>
<p>Here, you'd need to calculate the phasor frequency corresponding to normal playback speed, which is 1 / dur, where dur is the soundfile duration in seconds. Soundfile duration = soundfile size in samples / soundfile sample rate, so the phasor~ frequency can be expressed as soundfile sample rate / soundfile size in samples. Then you multiply this by a transpose factor, ok.</p>
<p>But I don't see you accounting for the soundfile's size or sample rate, so you have no guarantee of actually hitting normal playback speed.</p>
<blockquote>
<p>After that you can change the frequency of the phasor in the other number box labled &quot;change phasor frequency without changing pitch.&quot;</p>
</blockquote>
<p>If you change the phasor frequency here, you will also change the transposition.</p>
<blockquote>
<p>This way, I can make the phasor frequency, say .5  and the transposition 2,</p>
</blockquote>
<p>Making the eventual playback speed 1 (assuming it was 1 to begin with), undoing the transposition.</p>
<blockquote>
<p>which I don't think I can do using line~ with tabread4~.</p>
</blockquote>
<p>The bad news is, you can't do this with phasor either.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/8</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 31 Mar 2025 09:29:21 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Mon, 31 Mar 2025 15:48:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ddw_music, I think in our going back and forth I resolved my problem, so thank you for the banter. You are of course right that line~ and phaser~ can't separate pitch and time.</p>
<p>But I just had a revelation that I can't believe I never though of before. If I multiply the output of line~ by a number I can separate pitch and time.</p>
<p>I am including a screenshot of a patch I just tested this out on, and it works.<br />
So, now that I have this figured out hopefully I can do the math and hopefully solve the rest, which is what would happen if I want to do random speeds, or start playback in the middle of the soundfile, but maintain the pitch.</p>
<p><img src="/uploads/files/1743435585253-line_speed.jpg" alt="line_speed.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/9</guid><dc:creator><![CDATA[nicnut]]></dc:creator><pubDate>Mon, 31 Mar 2025 15:48:01 GMT</pubDate></item><item><title><![CDATA[Reply to Looking for advice on using phasor~ to randomize tabread4~ playback on Mon, 31 Mar 2025 23:16:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/nicnut">@nicnut</a> said:</p>
<blockquote>
<p>But I just had a revelation that I can't believe I never though of before. If I multiply the output of line~ by a number I can separate pitch and time.</p>
</blockquote>
<p>Ah ok, so what you meant is to separate pitch and the duration of playback -- sometimes use only part of the buffer.</p>
<p>Another solution (I'd say a more standard solution) is to use the phasor~ or line~ to handle pitch and playback start (I still think line~ is easier for your use case here), and use an envelope to choke the audio after the desired duration. Then it doesn't matter if the playback index keeps moving -- when the envelope closes, the sound is over.</p>
<p>One of my &quot;audio engineering 101&quot; bullet points is: every sound in nature has an envelope, so your patch should use an envelope too.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15073/looking-for-advice-on-using-phasor-to-randomize-tabread4-playback/10</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 31 Mar 2025 23:16:34 GMT</pubDate></item></channel></rss>