<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<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>
<span></span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Van:</b> chuck-users-bounces@lists.cs.princeton.edu <chuck-users-bounces@lists.cs.princeton.edu> namens Perry Cook <prc@cs.princeton.edu><br>
<b>Verzonden:</b> woensdag 12 februari 2020 20:58<br>
<b>Aan:</b> chuck-users@lists.cs.princeton.edu <chuck-users@lists.cs.princeton.edu><br>
<b>Onderwerp:</b> Re: [chuck-users] playing SndBuf backward</font>
<div> </div>
</div>
<div class="BodyFragment"><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, chuck-users-request@lists.cs.princeton.edu wrote:<br>
> <br>
> Send chuck-users mailing list submissions to<br>
> chuck-users@lists.cs.princeton.edu<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>
> chuck-users-request@lists.cs.princeton.edu<br>
> <br>
> You can reach the person managing the list at<br>
> chuck-users-owner@lists.cs.princeton.edu<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 <hverb54@hotmail.com><br>
> To: ChucK Users Mailing List <chuck-users@lists.cs.princeton.edu><br>
> Subject: Re: [chuck-users] => now<br>
> Message-ID:<br>
> <AM0PR08MB389035F6190B1D2C897C097BA5180@AM0PR08MB3890.eurprd08.prod.outlook.com><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>
> <br>
> <br>
> <br>
> _______________________________<br>
<br>
<br>
_______________________________________________<br>
chuck-users mailing list<br>
chuck-users@lists.cs.princeton.edu<br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</div>
</span></font></div>
</div>
</body>
</html>