<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 => 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). </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 "buf.rate" to 1.0 and "buf.pos" to 0, 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() + "aeiou.wav" => string filename;<br>
</div>
<div>if( me.args() ) me.arg(0) => filename;<br>
</div>
<div><br>
</div>
<div>SndBuf buf => dac;<br>
</div>
<div><br>
</div>
<div>filename => buf.read;<br>
</div>
<div><br>
</div>
<div>buf.length() => dur totalelengte;<br>
</div>
<div>buf.samples() => int samples;<br>
</div>
<div><br>
</div>
<div>samples => buf.pos;<br>
</div>
<div>-1.0 => buf.rate;<br>
</div>
<div><br>
</div>
<div>samples::ms => 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> <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> <<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>>
namens Perry Cook <<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>><br>
<b>Verzonden:</b> <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> <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><<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>><br>
<b>Onderwerp:</b> Re: [chuck-users] playing SndBuf backward</font>
<div> </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. 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>
> On Feb 12, 2020, at 9:00 AM, <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> wrote:<br>
> <br>
> Send chuck-users mailing list submissions to<br>
> <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>
> <br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
> or, via email, send a message with subject or body 'help' to<br>
> <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>
> <br>
> You can reach the person managing the list at<br>
> <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>
> <br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of chuck-users digest..."<br>
> <br>
> <br>
> Today's Topics:<br>
> <br>
> 1. Re: => now (herman verbaeten)<br>
> <br>
> ----------------------------------------------------------------------<br>
> <br>
> Message: 1<br>
> Date: Tue, 11 Feb 2020 18:11:09 +0000<br>
> From: herman verbaeten <<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>><br>
> To: ChucK Users Mailing List <<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>><br>
> Subject: Re: [chuck-users] => now<br>
> Message-ID:<br>
> <<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>><br>
> <br>
> Content-Type: text/plain; charset="iso-8859-1"<br>
> <br>
> Thanks again Mario,<br>
> <br>
> I have another question:<br>
> Can you recommend a procedure to address individual samples of a wave-file you read into the SndBuf.<br>
> I discovered a way to play a part of a wave file starting at a certain point using ".pos".<br>
> I also wonder if there's a way to play it backwards (reverse).<br>
> <br>
> Cheers,<br>
> <br>
> herman<br>
> </div>
</span></font></div>
<blockquote type="cite"><br>
</blockquote>
</div>
</body>
</html>