<?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[play a random file on button press]]></title><description><![CDATA[<p>I'm using Raspberry Pi  and an Arduino to read button presses.</p>
<p>I have a folder with 10 or so WAV files.<br />
I would like that when button is pressed a random file will be playing from the beginning to end. Only when file finished a new press will active a new random file.</p>
<p>How can I implement that with PD?</p>
<p>Thanks</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 06:17:56 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15016.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Feb 2025 06:37:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 06:37:37 GMT]]></title><description><![CDATA[<p>I'm using Raspberry Pi  and an Arduino to read button presses.</p>
<p>I have a folder with 10 or so WAV files.<br />
I would like that when button is pressed a random file will be playing from the beginning to end. Only when file finished a new press will active a new random file.</p>
<p>How can I implement that with PD?</p>
<p>Thanks</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 06:37:37 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 07:26:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> This...... <a href="/uploads/files/1738653803719-random_shuffle_cart.zip">random_shuffle_cart.zip</a> ... should work.  The vanilla [cart5-vanilla] needs at least Pd 0.52 I think for [file].<br />
You can simplify it maybe, especially if you give your wav files names 0.wav, 1.wav etc., but it will give you some ideas.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/2</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 04 Feb 2025 07:26:40 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 08:04:44 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> I'm getting those errors<img src="/uploads/files/1738656282095-capture.jpg" alt="Capture.JPG" class="img-responsive img-markdown" /> :</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/3</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 08:04:44 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 08:15:58 GMT]]></title><description><![CDATA[<p>Any idea what is wrong with my patch?</p>
<p><a href="/uploads/files/1738656956500-1685864476416-main3.pd">1685864476416-main3.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/4</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 08:15:58 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 08:23:12 GMT]]></title><description><![CDATA[<p>btw- is there an object that output random numbers without repetition?  same as urn in Max?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/5</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 08:23:12 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 08:41:21 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> For vanilla Pd you need to open cart5-vanilla.pd.<br />
You can use [change] after [random] to avoid repeats, but need a mechanism to ask [random] for a new value when a repeat is rejected.<br />
No time to look at your patch until this evening but someone will probably reply....<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/6</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 04 Feb 2025 08:41:21 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 09:31:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> I did not implement the file playing, just the random file stuff but I think this should do you assuming you are using a somewhat recent pd. Added a toggle to delete the file from the list if you want it to never play the file a second time, wasn't sure if you wanted to avoid repeats or avoid ever playing a file twice.<br />
<a href="/uploads/files/1738661366699-rnd-file.pd">rnd-file.pd</a><br />
<img src="/uploads/files/1738661377227-untitled.jpg" alt="Untitled.jpg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/7</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Tue, 04 Feb 2025 09:31:09 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 10:13:08 GMT]]></title><description><![CDATA[<p>Thanks for suggestion!<br />
I use urn pd version and it works fine!!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/8</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 10:13:08 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 13:12:52 GMT]]></title><description><![CDATA[<p>Small question - sf-play~ cannot read mp3 files?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/9</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 13:12:52 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 15:16:54 GMT]]></title><description><![CDATA[<p>for some reason the object [file] is grayd out on my pd on my Pi. Where can I download it?<br />
my pure data version is 0.51.4</p>
<p><img src="/uploads/files/1738682212640-pxl_20250204_151444914.mp.jpeg" alt="PXL_20250204_151444914.MP.jpeg" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/10</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 15:16:54 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 16:45:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> You need 0.52 for [file] and as it is built into Pd it cannot be added to 0.51 unless you can find some external to do the job.<br />
In the zip I posted above cart5.pd was built with extended, and there are externals from the hcs and ext13 libraries that you might find available for Linux Pd 64bit.<br />
hcs/folder_list and ext13/strippath<br />
Or maybe it's a good time for an upgrade?<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/11</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 04 Feb 2025 16:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 17:03:31 GMT]]></title><description><![CDATA[<p>this is how you can change file names    in gem and vanilla -  if you name them with numbers its very easy   you just plug the random number into $1.</p>
<p><img src="/uploads/files/1738688587961-screenshot_2025-02-04_17-01-43.png" alt="Screenshot_2025-02-04_17-01-43.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/12</guid><dc:creator><![CDATA[willblackhurst]]></dc:creator><pubDate>Tue, 04 Feb 2025 17:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 17:10:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> What is the latest version PD for Raspberry pi2?<br />
I re install pd on my Pi2 and the version I got is 0.51.4</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/13</guid><dc:creator><![CDATA[KMETE]]></dc:creator><pubDate>Tue, 04 Feb 2025 17:10:09 GMT</pubDate></item><item><title><![CDATA[Reply to play a random file on button press on Tue, 04 Feb 2025 19:48:11 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kmete">@KMETE</a> RPI2 is 64-bit so you should be able to install the latest Pd...... but if there is no package for your OS then you will have to compile it...... which I understand is easy in Linux.<br />
First on the list here for compilation...... <a href="https://puredata.info/downloads/pure-data" rel="nofollow">https://puredata.info/downloads/pure-data</a> ..... if there is not a good package further down the list.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15016/play-a-random-file-on-button-press/14</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 04 Feb 2025 19:48:11 GMT</pubDate></item></channel></rss>