<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div dir="ltr"><span></span>In my experience, in SndBuf, to play the file backwards from the end requires</div>
<div dir="ltr">file.samples() - 1 =&gt; file.pos; file.rate(-1.);</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">If the size of the file is, for example, 1000 samples, the first sample is located at 0 and the last sample bit is 999 (not 1000).&nbsp;</div>
<div dir="ltr">On my machine, at least, if I set the position beyond the end of the file, it won't play backward.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">However, when using LiSa, the starting position is 1::samp, and the ending point is 1000::samp</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><span></span>davd</div>
<div dir="ltr"><br>
<span>David Loberg Code</span><br>
<span>School of Music</span><br>
<span>Western Michigan University</span><br>
<span></span><br>
<blockquote type="cite"><br>
</blockquote>
<blockquote type="cite"><br>
</blockquote>
<div style="font-size: 12pt; -webkit-text-size-adjust: auto; font-family: Calibri, Helvetica, sans-serif;">
Sorry PRC it doesn't work: When i set &quot;buf.rate&quot; to 1.0 and&nbsp; &quot;buf.pos&quot;&nbsp; to 0,&nbsp; it does but not the other way around....</div>
<div style="font-size: 12pt; -webkit-text-size-adjust: auto; font-family: Calibri, Helvetica, sans-serif;">
<br>
</div>
<div style="font-size: 12pt; -webkit-text-size-adjust: auto; font-family: Calibri, Helvetica, sans-serif;">
<br>
</div>
<div style="font-size: 12pt; -webkit-text-size-adjust: auto; font-family: Calibri, Helvetica, sans-serif;">
<div>me.sourceDir() &#43; &quot;aeiou.wav&quot; =&gt; string filename;<br>
</div>
<div>if( me.args() ) me.arg(0) =&gt; filename;<br>
</div>
<div><br>
</div>
<div>SndBuf buf =&gt; dac;<br>
</div>
<div><br>
</div>
<div>filename =&gt; buf.read;<br>
</div>
<div><br>
</div>
<div>buf.length() =&gt; dur totalelengte;<br>
</div>
<div>buf.samples() =&gt; int samples;<br>
</div>
<div><br>
</div>
<div>samples =&gt; buf.pos;<br>
</div>
<div>-1.0 =&gt; buf.rate;<br>
</div>
<div><br>
</div>
<div>samples::ms =&gt; now;<br>
</div>
<br>
</div>
<hr tabindex="-1" style="-webkit-text-size-adjust: auto; display: inline-block; width: 315.546875px;">
<span style="-webkit-text-size-adjust: auto; background-color: rgb(255, 255, 255);"></span>
<div id="divRplyFwdMsg" dir="ltr" style="-webkit-text-size-adjust: auto;"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>Van:</b>&nbsp;<a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0" style="color: currentcolor;">chuck-users-bounces@lists.cs.princeton.edu</a>&nbsp;&lt;<a href="mailto:chuck-users-bounces@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="1" style="color: currentcolor;">chuck-users-bounces@lists.cs.princeton.edu</a>&gt;
 namens Perry Cook &lt;<a href="mailto:prc@cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2" style="color: currentcolor;">prc@cs.princeton.edu</a>&gt;<br>
<b>Verzonden:</b>&nbsp;<a href="x-apple-data-detectors://3" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="calendar-event" x-apple-data-detectors-result="3" style="color: currentcolor; text-decoration-color: rgba(127, 127, 127, 0.380392);">woensdag
 12 februari 2020 20:58</a><br>
<b>Aan:</b>&nbsp;<a href="mailto:chuck-users@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="4" style="color: currentcolor;">chuck-users@lists.cs.princeton.edu</a>&lt;<a href="mailto:chuck-users@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="5" style="color: currentcolor;">chuck-users@lists.cs.princeton.edu</a>&gt;<br>
<b>Onderwerp:</b>&nbsp;Re: [chuck-users] playing SndBuf backward</font>
<div>&nbsp;</div>
</div>
<div class="BodyFragment" style="-webkit-text-size-adjust: auto;"><font size="2"><span style="font-size: 11pt;">
<div class="PlainText">You can set the .pos to wherever you like, and set the .rate to a negative number.&nbsp; The sample will happily play backward to zero and stick there (unless you have .loop set).<br>
<br>
PRC<br>
<br>
Sent from my iPad<br>
<br>
&gt; On Feb 12, 2020, at 9:00 AM,&nbsp;<a href="mailto:chuck-users-request@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="7" style="color: currentcolor;">chuck-users-request@lists.cs.princeton.edu</a>&nbsp;wrote:<br>
&gt;&nbsp;<br>
&gt; Send chuck-users mailing list submissions to<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:chuck-users@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="8" style="color: currentcolor;">chuck-users@lists.cs.princeton.edu</a><br>
&gt;&nbsp;<br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
&gt; or, via email, send a message with subject or body 'help' to<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:chuck-users-request@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="10" style="color: currentcolor;">chuck-users-request@lists.cs.princeton.edu</a><br>
&gt;&nbsp;<br>
&gt; You can reach the person managing the list at<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:chuck-users-owner@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="11" style="color: currentcolor;">chuck-users-owner@lists.cs.princeton.edu</a><br>
&gt;&nbsp;<br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of chuck-users digest...&quot;<br>
&gt;&nbsp;<br>
&gt;&nbsp;<br>
&gt; Today's Topics:<br>
&gt;&nbsp;<br>
&gt;&nbsp;&nbsp; 1. Re: =&gt; now (herman verbaeten)<br>
&gt;&nbsp;<br>
&gt; ----------------------------------------------------------------------<br>
&gt;&nbsp;<br>
&gt; Message: 1<br>
&gt; Date: Tue, 11 Feb 2020 18:11:09 &#43;0000<br>
&gt; From: herman verbaeten &lt;<a href="mailto:hverb54@hotmail.com" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="14" style="color: currentcolor;">hverb54@hotmail.com</a>&gt;<br>
&gt; To: ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="15" style="color: currentcolor;">chuck-users@lists.cs.princeton.edu</a>&gt;<br>
&gt; Subject: Re: [chuck-users] =&gt; now<br>
&gt; Message-ID:<br>
&gt;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:AM0PR08MB389035F6190B1D2C897C097BA5180@AM0PR08MB3890.eurprd08.prod.outlook.com" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="16" style="color: currentcolor;">AM0PR08MB389035F6190B1D2C897C097BA5180@AM0PR08MB3890.eurprd08.prod.outlook.com</a>&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
&gt;&nbsp;<br>
&gt; Thanks again Mario,<br>
&gt;&nbsp;<br>
&gt; I have another question:<br>
&gt; Can you recommend a procedure to address individual samples of a wave-file you read into the SndBuf.<br>
&gt; I discovered a way to play a part of a wave file starting at a certain point using &quot;.pos&quot;.<br>
&gt; I also wonder if there's a way to play it backwards (reverse).<br>
&gt;&nbsp;<br>
&gt; Cheers,<br>
&gt;&nbsp;<br>
&gt; herman<br>
&gt;&nbsp;</div>
</span></font></div>
<blockquote type="cite"><br>
</blockquote>
</div>
</body>
</html>