<?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[Loading a random wav file from a folder]]></title><description><![CDATA[<p>Hello,</p>
<p>Not sure if this is possible but I'd like to use a bang object to select a folder and then once a folder is set, I'd like to use another bang to pick a random file from the folder to send to readsf~. I'm using PD vanilla on MacOSX. I'm sure I'll need an external, but not sure which. [shell] and [folder_list] do not seem to work. Can I do this?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 11:29:10 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/14487.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Oct 2023 02:13:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Loading a random wav file from a folder on Tue, 10 Oct 2023 02:13:19 GMT]]></title><description><![CDATA[<p>Hello,</p>
<p>Not sure if this is possible but I'd like to use a bang object to select a folder and then once a folder is set, I'd like to use another bang to pick a random file from the folder to send to readsf~. I'm using PD vanilla on MacOSX. I'm sure I'll need an external, but not sure which. [shell] and [folder_list] do not seem to work. Can I do this?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder</guid><dc:creator><![CDATA[endy]]></dc:creator><pubDate>Tue, 10 Oct 2023 02:13:19 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Tue, 10 Oct 2023 07:51:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/endy">@endy</a> If your tracks are numbered...... 1.wav, 2.wav etc. then it is easy without externals.<br />
I built this years ago...... <a href="/uploads/files/1696917247008-random_shuffle_cart.zip">random_shuffle_cart.zip</a> and it used externals to solve the problem of accessing and playing by filename for any filename in any folder.<br />
Numbers needed to be assigned to the tracks so it required a little dynamic patching...... although [text] could be used instead..... but it is nice to see the list of files and which one is playing.<br />
The external libraries required..... tof... and ext13.<br />
cart5.pd is the main patch.</p>
<p>You can use [openpanel] instead of [tof/folderpanel]</p>
<p>There are new tools though in Pd Vanilla...... have a look at the [file] object.<br />
It will be possible to use that to replace those externals and make the patch Vanilla.</p>
<p>[folder_list] can be replaced by [file glob]<br />
And then [ext13/strippath] is unnecessary.</p>
<p>Anyway....... I started so I will finish.<br />
Here is the Vanilla version......... <a href="/uploads/files/1696924253006-cart5-vanilla.zip">cart5-vanilla.zip</a></p>
<p>David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/2</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 10 Oct 2023 07:51:00 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Tue, 10 Oct 2023 17:04:26 GMT]]></title><description><![CDATA[<p>Vanilla random-sound-file-from-dir.pd<br />
<a href="https://forum.pdpatchrepo.info/topic/14417/installation-patch-and-help-with-pathnames/3" rel="nofollow">https://forum.pdpatchrepo.info/topic/14417/installation-patch-and-help-with-pathnames/3</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/3</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Tue, 10 Oct 2023 17:04:26 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Wed, 11 Oct 2023 13:09:09 GMT]]></title><description><![CDATA[<p>Thanks guys. <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/lacuna">@lacuna</a> I'm attempting to integrate your randomizer with a fileplayer I am working on where two random samples are played at once and there is an option to loop one or both samples. However I am fairly new to PD and not sure I have a good understanding of the looping mechanism. This attempt below in plugdata leads to a weird behavior where sometimes the loop works and sometimes it doesn't. And sometimes it works for both samples, sometimes it works for only one. Any insight into what I might be doing wrong here? Much, much appreciated if you (or anyone else) replies:</p>
<p><img src="/uploads/files/1697029725156-screenshot-2023-10-11-at-9.08.24-am.png" alt="Screenshot 2023-10-11 at 9.08.24 AM.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/4</guid><dc:creator><![CDATA[endy]]></dc:creator><pubDate>Wed, 11 Oct 2023 13:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Wed, 11 Oct 2023 21:53:36 GMT]]></title><description><![CDATA[<p>Now I don't have Pd, so can not try.<br />
But I fairly remember a bug (in Windows?) where .aiff files won't output a bang on the right outlet of [readsf~] when done, while .wav files do? Not sure.</p>
<p>I think the patch should loop, I can not see anything wrong.</p>
<p>Try to debug with [print pleaseplaythatfile] attached to [open $1, start(<br />
and [print done] to the right outlet of [readsf~].</p>
<p>If this is the case, you could start a timer to restart the sample when done.</p>
<p>or even more elegant:</p>
<hr />
<p>If the soundfiles are not very long, you could load them into arrays with [soundfiler] (i.e. loading from HD to RAM)<br />
and loop the array with [tabread~] or [tabread4~] or [tabosc~] or [tabplay~]</p>
<p>Each time you [open( a file with [readsf~] it loads from harddrive.</p>
<p>... Pd is fairly low-level and has some quirks.</p>
<p>(For beginners I recommend sticking to Vanilla:<br />
learn all its' objects little by little, read the helpfiles<br />
and dive a bit into the first few doc patches of Vanilla installation, but don't get confused by their names.)</p>
<p>Others prefer to start right away with libraries. I am sure there are looping samplers somewhere.<br />
PlugData comes with Cyclone, doesn't it? I think Cyclone probably has something easy?</p>
<hr />
<p>A cleanup (only visually and not related to the issue):<br />
Delete the cable from<br />
[text get $0-dirfiles] to [open $1, start(<br />
because on hot inlet [symbol] saves and outputs immediately.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/5</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Wed, 11 Oct 2023 21:53:36 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Mon, 27 Apr 2026 12:52:48 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> thanks for your patch, it is a really helpful start point for what i am trying to accomplish. my aim is to have it playing two tracks, instead of just one, avoiding duplicates.</p>
<p>the behaviour i am looking for is:</p>
<ul>
<li>the patch loads the tracklist from one folder;</li>
<li>every random bang is picking** two different tracks**, avoiding duplicates (trackA must always be different than trackB, with the tracks already played going offline);</li>
<li>tracks are sent to two different stereo outlet;</li>
</ul>
<p>I am trying to understand the logic behind your cart5-vanilla. any help would be very much appreciated <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/pray.png" title="pray" alt=":pray:" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/6</guid><dc:creator><![CDATA[user478]]></dc:creator><pubDate>Mon, 27 Apr 2026 12:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Mon, 27 Apr 2026 13:59:14 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/user478">@user478</a> It is a bit complex as it developed over time as requests were added..... so it could do with some simplification.<br />
It uses dynamic patching to generate the tracklist window from the filenames read in the chosen folder.<br />
And uses arguments for each [tracklist-button] to differentiate them.<br />
I don't really know how to start to explain that...... but you could read this pinned tutorial....... <a href="https://forum.pdpatchrepo.info/topic/9774/pure-data-noob/4" rel="nofollow">https://forum.pdpatchrepo.info/topic/9774/pure-data-noob/4</a> ...... which should help once you get your head around the concept.</p>
<p>You can have random numbers without repeats easily using an external object..... [urn]<br />
Obviously it will need a second player.... [readsf~]<br />
[urn] will need to be banged twice and the two numbers sent to the separate players....<br />
These are notes to myself for when I get a chance to modify the patch.</p>
<p>However.....<br />
Currently the patch moves on to the next random file as the previous one ends.  But if two are playing then presumably it will need to wait until both are finished (different lengths) before sending the next pair?<br />
If not then a playlist can be generated at the start by [urn] for each [readsf~] to play through.... is that what you wish to happen..... then there would be no breaks between track playback on each audio output..?<br />
[list] objects..... [list] and [list split] would be needed for that... and a little flip-flop router for the separation of the pairs.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/7</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Mon, 27 Apr 2026 13:59:14 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Mon, 27 Apr 2026 14:07:29 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> thanks for replying, very much appreciated.</p>
<p>My idea starts from experiencing playing my impros through 2 different instances of VLC, so basically they are coupling randomically generating impredictable densities. Due to this, even if a track in the &quot;deckA&quot; is still playing, i would love the &quot;deckB&quot; to act indipendently, still considering it doesn't need to acquire the track that is already played by the &quot;deckA&quot;, following the flow till tracks are over.</p>
<p>note to your cart5: if i stay in the same instance of the patch, i noticed that each time i change folder the counter of the playlist increases, even if the previous tracks are erased by the new upload.<br />
This makes the counter conside +n tracks from the new folder, and it goes affecting the random right inlet (which i now swapped with a rand.u to avoid repetitions, which is kinda working).</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/8</guid><dc:creator><![CDATA[user478]]></dc:creator><pubDate>Mon, 27 Apr 2026 14:07:29 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Mon, 27 Apr 2026 14:26:21 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/user478">@user478</a> Strange.  The counter doesn't increase for me.  Are you sure you have not deleted a cord in the patch?<br />
The b at the top left of this screenshot should send 0 into the counter to reset it as a new folder is loaded.....<br />
David.<br />
<img src="/uploads/files/1777299970856-capture.jpg" alt="Capture.JPG" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/9</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Mon, 27 Apr 2026 14:26:21 GMT</pubDate></item><item><title><![CDATA[Reply to Loading a random wav file from a folder on Mon, 27 Apr 2026 14:44:58 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> thanks, the cord from the bang disappeared hahah</p>
<p>much appreciated!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14487/loading-a-random-wav-file-from-a-folder/10</guid><dc:creator><![CDATA[user478]]></dc:creator><pubDate>Mon, 27 Apr 2026 14:44:58 GMT</pubDate></item></channel></rss>