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