<div><div dir="auto">You can get the samplerate and file length of your file by sending a read message to soundfiler and not specifying a table to write to. From that you can calculate the expected play time. </div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 20 Nov 2019 at 04:42, Jakob Laue <<a href="mailto:jakkesprinter@web.de">jakkesprinter@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div>Hey all,</div>

<div>I want to play a wav-file with [readsf~] and I want to loop the wav-file.</div>

<div>This can easily be done by connecting [readsf~]'s right outlet it its inlet.</div>

<div>The problem is that I have a metronome in my patch which is the master of the tempo.</div>

<div>The [readsf~] object will get out of sync with the metronome when it loops the same file over a longer period of time.</div>

<div>That's why I want to constantly check the position of the wav-file that [readsf~] is currently at, when it plays the wav-file.</div>

<div>By this, I can restart/loop the wav-file in sync with the metronome, as soon as it has almost reached its end.</div>

<div>Do you have an idea how I could do that?</div>

<div> </div>

<div>In a former version of my patch, I did this successfully when I was using [tabread4~] as my file-playing-object, but I needed to switch to [readsf~] in order to implement dynamic loading of wav-files.</div>

<div> </div>

<div> </div>

<div>Thanks, Jakob</div></div></div>



_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div></div>