<?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[readsf~, play speed, sample rate, and [timer] base time]]></title><description><![CDATA[<p>Hi,<br />
ok, a lot in the title.<br />
I have trouble with a patch playing wav 44100 files. The files are exactly 10', verified mounting them on some DAWs.<br />
But:<br />
-if I use alsa @ 44100, [readsf] plays the files in 9'13'', too quickly<br />
-with portaudio:</p>
<pre><code>warning: requested samplerate 44100 not supported, using 48000.
</code></pre>
<p>but anyway I played the files: 10'3''</p>
<p>The patch will then run on a Bela board, who knows what will happen there...</p>
<p>The [timer] issue:<br />
I used it to measure playing time, but this object seems to be related to the samplerate, since I always measure 10'00''+/-some milliseconds.<br />
This is not fair, I spend two days figuring out what causes issue.<br />
Now I measure with [realtime].</p>
<p>How can I fix the play speed?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 08:19:50 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/14963.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Dec 2024 13:16:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 13:18:35 GMT]]></title><description><![CDATA[<p>Hi,<br />
ok, a lot in the title.<br />
I have trouble with a patch playing wav 44100 files. The files are exactly 10', verified mounting them on some DAWs.<br />
But:<br />
-if I use alsa @ 44100, [readsf] plays the files in 9'13'', too quickly<br />
-with portaudio:</p>
<pre><code>warning: requested samplerate 44100 not supported, using 48000.
</code></pre>
<p>but anyway I played the files: 10'3''</p>
<p>The patch will then run on a Bela board, who knows what will happen there...</p>
<p>The [timer] issue:<br />
I used it to measure playing time, but this object seems to be related to the samplerate, since I always measure 10'00''+/-some milliseconds.<br />
This is not fair, I spend two days figuring out what causes issue.<br />
Now I measure with [realtime].</p>
<p>How can I fix the play speed?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Thu, 12 Dec 2024 13:18:35 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 14:05:46 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> Looking at the warning it seems alsa will not run at 44100..... so Pd is probably running at 48K.<br />
Unless you can fix that (maybe simply in Pd media settings) I don't think you can use [readsf~]<br />
I remember that [sf-play2~] can autocorrect, if it is available for your system.......<br />
Otherwise you will need to load the file to an [array] using soundfiler and calculate the playback speed unless the file is too long for that.....<br />
.....or <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> posted an interesting solution........ <a href="https://forum.pdpatchrepo.info/topic/13518/readsf-varispeed/5" rel="nofollow">https://forum.pdpatchrepo.info/topic/13518/readsf-varispeed/5</a><br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/2</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 12 Dec 2024 14:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 15:59:31 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 class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> Looking at the warning it seems alsa will not run at 44100..... so Pd is probably running at 48K.</p>
</blockquote>
<p>The message appears with portaudio, not alsa. But you're right, I suspect Pd to follow something @ 48k (Pulseaudio? Alsa?), although [samplerate~] indicates 44100.</p>
<p>I can't use most of externals on Bela, and since the patch will be running for a veeeery long time, I have to keep it light.<br />
I don't really understand why a simple and so common object doesn't work...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/3</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Thu, 12 Dec 2024 15:59:31 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 16:40:32 GMT]]></title><description><![CDATA[<p>The Bela runs on 44100 only, so your audio files should play fine, unless you've already tried this on a Bela.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/4</guid><dc:creator><![CDATA[alexandros]]></dc:creator><pubDate>Thu, 12 Dec 2024 16:40:32 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 16:44:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> I think <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a>'s solution is plain vanilla....... apart from [readsf~] which you seem to have working...... but maybe not on the Bela.<br />
It shouldn't be too heavy.</p>
<p>[readsf~] is working properly.<br />
The problem is that if Pd is processing 48000 samples per second then a file recorded with 44100 samples per second will play too fast.<br />
If you can get Pd to run at 44100 [readsf~] will work..... if it can be loaded on the Bela.<br />
Maybe that is the first thing to check, and if it will work then you could maybe resample the files at 48K.. and use those.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/5</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 12 Dec 2024 16:44:00 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 12 Dec 2024 17:54:06 GMT]]></title><description><![CDATA[<p>Ok, pulseaudio or something in between is probably guilty:<br />
I made this patch to test and it unsync on my regular linux system. It could be the 44100/48000, but the weird thing is it doesn't unsync the same manner with alsa or portaudio.<br />
On my sound production system (lowlatency, and with Jackd), it remains perfectly synchronized.<br />
I'll try tomorrow on the Bela, hopefully it will be ok...<br />
<a href="/uploads/files/1734026013869-test_timervsrealtime.pd">TEST_timerVSrealtime.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/6</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Thu, 12 Dec 2024 17:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Fri, 13 Dec 2024 02:46:28 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>I remember that [sf-play2~] can autocorrect, if it is available for your system.......</p>
</blockquote>
<p>[sf-play2~] is an abstraction based on cyclone/play -- which probably rules it out for Bela.</p>
<p>In the same pack, however, there's [sf-varispeed2~] which is (I think) pure vanilla.</p>
<p><a href="https://github.com/jamshark70/hjh-abs" rel="nofollow">https://github.com/jamshark70/hjh-abs</a></p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a></p>
<blockquote>
<p>I don't really understand why a simple and so common object doesn't work...</p>
</blockquote>
<p>FWIW in SuperCollider you'd run into the same issue. The difference is that SC makes it easier by providing a unit generator, BufRateScale, that you can just plug into a Phasor or PlayBuf and get the right speed.</p>
<p>In Pd vanilla, you have to get the file sample rate from [soundfiler] and the system sample rate from [samplerate~] (and there's an interesting caveat about that, noted in the help file), and divide them on your own: playspeed = file_sr / system_sr.</p>
<p>I made [sf-play2~] and [sf-varispeed2~] and their supporting abstractions because I agree -- generally users shouldn't have to think about this. The abstractions do exactly what I just described, only behind the scenes.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/7</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Fri, 13 Dec 2024 02:46:28 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Fri, 13 Dec 2024 15:37:50 GMT]]></title><description><![CDATA[<p>I seems to work on Bela too... ouf<br />
<img src="/uploads/files/1734104218031-tests_timervsrealtime.png" alt="tests_timerVSrealtime.png" class="img-responsive img-markdown" /></p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/alexandros">@alexandros</a> said:</p>
<blockquote>
<p>The Bela runs on 44100 only.</p>
</blockquote>
<p>that is why I use 44100. So there is definitely something wrong with pulseaudio.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/8</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Fri, 13 Dec 2024 15:37:50 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Fri, 13 Dec 2024 15:40:40 GMT]]></title><description><![CDATA[<p>but anyway I'll figure out how I could use [sf-varispeed2~] since I need to fine tune and resync. I have to guarantee the installation for 5 years (!!).</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/9</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Fri, 13 Dec 2024 15:40:40 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Fri, 13 Dec 2024 21:11:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> The only way Pulse could be the culprit is if you are running jack/portaudio through Pulse, but that is generally not done since Pulse has too much latency for realtime audio. I can't speak of portaudio (never used it) but with jack the general setup is to either have Pulse as a client of jack or have jack kill Pulse when it starts and restart Pulse when it shuts down. I would guess that the later is your setup, Pulse configures your audio card and jack is not great at doing that so just accepts what Pulse set it at. You might be able to get jack to set it properly or configure Pulse to use 44.1. Some soundcards jack just can not configure as far as I can tell so if you are using Pulse and having jack kill Pulse you need to either configure the soundcard manually or do it in Pulse before starting jack, I have to do this with my laptop, jack can not select between headphone and speaker outs and will use which ever is enabled when it starts.</p>
<p>Edit: I suppose it could also be the case that your soundcard is 48k only?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/10</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Fri, 13 Dec 2024 21:11:34 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Sat, 14 Dec 2024 01:39:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> said:</p>
<blockquote>
<p>but anyway I'll figure out how I could use [sf-varispeed2~] since I need to fine tune and resync. I have to guarantee the installation for 5 years (!!).</p>
</blockquote>
<p>BUT... the bad news... I just noticed that you said the files are 10 minutes. <code>sf-varispeed(2)~</code> depends on loading the file into an array, where the Pd-canonical way to stream it out is by feeding sample indices to <code>tabread4~</code>. (This is under the hood of <code>sf-varispeed~</code>.)</p>
<p>32-bit floats are precise up to about six minutes or so. There's nothing Pd can do about that (except if you build a 64-bit version -- not sure how that would run on a Bela). This isn't Pd's fault btw -- SuperCollider's BufRd has the same limitation.</p>
<p>So I guess your choices are:</p>
<ul>
<li>[sf-varispeed2~] and split the files across multiple buffers, trying somehow to hide the seams. (Or, split the files and work out your own play mechanism that crossfades over the seams.)</li>
<li>OR: Sample-rate-convert the files. You could have, on your dev computer, a &quot;myfile-0-44100.wav&quot; and a &quot;myfile-0-48000.wav&quot; (and myfile-1, myfile-2 etc.) and then select the file by a numeric index and sample rate:</li>
</ul>
<p><img src="/uploads/files/1734140310528-pd-sample-rate-select-file.png" alt="pd-sample-rate-select-file.png" class="img-responsive img-markdown" /></p>
<p>Then when you move the patch over to the Bela, just copy the -44100 file and the patch will still find it according to the sample rate.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a></p>
<blockquote>
<p>Edit: I suppose it could also be the case that your soundcard is 48k only?</p>
</blockquote>
<p>That could be -- it's the case on my current laptop. If I request qjackctl* to start at 44.1 kHz, it will not do that for the built-in sound card -- 48 kHz only.</p>
<ul>
<li>I know, I know... planning to upgrade to Ubuntu Studio 24.04 over the winter holiday... then hello pipewire.</li>
</ul>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/11</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 14 Dec 2024 01:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Sat, 14 Dec 2024 03:13:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>I know, I know... planning to upgrade to Ubuntu Studio 24.04 over the winter holiday... then hello pipewire.</p>
</blockquote>
<p>Might want to check the pd github, there is at least one pd killing bug when using Pipewire's Jack, saw it yesterday but did not look into it since I have also let updating my system slide and don't feel like updating quite yet.</p>
<p>Edit: never mind, you use plug data. But might be of interest to OP in case he decides to update so I will leave it.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/12</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sat, 14 Dec 2024 03:13:01 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Wed, 18 Dec 2024 08:58:22 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p>Might want to check the pd github, there is at least one pd killing bug when using Pipewire's Jack, saw it yesterday but did not look into it since I have also let updating my system slide and don't feel like updating quite yet.</p>
</blockquote>
<p>The only bug report I see is that it fails when you toggle &quot;use callbacks&quot; -- so it looks like the old joke, &quot;'Doc, it hurts when I move my arm like that!' -- so don't move your arm like that.&quot;</p>
<p>Btw I use both Pd-next and plugdata -- I'm not at all a fan of the Tcl/Tk interface, though, so I tend to reach for plugdata first. But if I'm making an abstraction that I know people will use in vanilla, then it makes more sense to build it in vanilla so that it looks nicer in that environment.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/13</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Wed, 18 Dec 2024 08:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Wed, 18 Dec 2024 13:32:09 GMT]]></title><description><![CDATA[<p>thank you for all your infos and suggestions.</p>
<p>The thing is: I play back field recordings recorded twelve hours before. I divided the recording into 10m slices. The playbacks have to be on time +/-1 or 2 seconds. For example the church bells ringing at midnight have to be played back on time at noon. The installation is permanent, so I need to resync if the offset - the junction between the files - moves.</p>
<p>I finally use the simple [sfplay~]. I made 12 hours tests and it is not so bad: it moves +/- 1sec, but finally keep sync with tenths minutes  +/-2sec.</p>
<p>I noticed a strange behavior: sometimes I start the patch and it reads the files too quickly (they finishes after 9' and some seconds). But after restarting the patch it is ok again...<br />
I'll provide more tests soon</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/14</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Wed, 18 Dec 2024 13:32:09 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Wed, 18 Dec 2024 16:02:26 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rph-r">@rph-r</a> If your installation can be connected to the internet, and bela can push the data to Pd, then you can re-sync without errors. [zexy/time] would work but maybe not on the bela.<br />
If no internet then an old phone with a free sim card and a hotspot.<br />
The computer would need to be set to automatically update time from an internet time server.<br />
Otherwise the computer time will always drift..... and by a lot even over a month..<br />
David.<br />
P.S there might be a way to get the time into the bela from a GPS module..... then you don't need the sim card........ <a href="https://forum.arduino.cc/t/time-and-date-from-gps/686778" rel="nofollow">https://forum.arduino.cc/t/time-and-date-from-gps/686778</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/15</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Wed, 18 Dec 2024 16:02:26 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 19 Dec 2024 10:22:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> This point is solved, I actually wrote an object. I was using [shell]  with <em>date</em> command but it was generating errors in the sound stream, like xruns. You can already try it (linux and Bela versions), but I will rewrite it soon to be easier portable.<br />
And yes, the Bela is connected to internet and automatically sync the time. Syncing is not a big deal, but syncing without glitch is another story...<br />
x86 Linux version here<br />
<a href="/uploads/files/1734603597073-ahora.pd_linux">ahora.pd_linux</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/16</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/16</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Thu, 19 Dec 2024 10:22:40 GMT</pubDate></item><item><title><![CDATA[Reply to readsf~, play speed, sample rate, and [timer] base time on Thu, 19 Dec 2024 10:27:02 GMT]]></title><description><![CDATA[<p>and Bela, written with xenomai wrappers, otherwise it generates errors also.<br />
<a href="/uploads/files/1734603987096-ahora.pd_linux">ahora.pd_linux</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/17</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14963/readsf-play-speed-sample-rate-and-timer-base-time/17</guid><dc:creator><![CDATA[rph-r]]></dc:creator><pubDate>Thu, 19 Dec 2024 10:27:02 GMT</pubDate></item></channel></rss>