Hi Perry,
Thanks and sorry for all the trouble.
In the meanwhile i posted another mail to the mailinglist (answered by d.loberg.code@wmich.edu)
And he said that in SndBuf , in order to play backward, you have to put de pos to -1 total lenght. Suppose your file has 1000 samples. Then you have to start from 1000 - 1 = 999.
This effectively works. In LiSa on the contrary you can start at 1000.
Cheers,
herman
________________________________
Van: chuck-users-bounces@lists.cs.princeton.edu
On Feb 12, 2020, at 1:30 PM, 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: playing SndBuf backward (Perry Cook) 2. Error in book "Programming for Musicians and digital artists by Ge Wang" ? (herman verbaeten) 3. playing SndBuf backward (herman verbaeten)
----------------------------------------------------------------------
Message: 1 Date: Wed, 12 Feb 2020 12:58:36 -0800 From: Perry Cook
To: chuck-users@lists.cs.princeton.edu Subject: Re: [chuck-users] playing SndBuf backward Message-ID: <6DBAE4AC-7E7E-413D-8059-8CB929B9AC78@cs.princeton.edu> Content-Type: text/plain; charset=utf-8 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
_______________________________
------------------------------
Message: 2 Date: Wed, 12 Feb 2020 21:15:51 +0000 From: herman verbaeten
To: chuck mailing list Subject: [chuck-users] Error in book "Programming for Musicians and digital artists by Ge Wang" ? Message-ID: Content-Type: text/plain; charset="iso-8859-1"
Hi,
I was looking in your book and copied listing 4.3 " Playing a sound file backward" But it didn't work. Hopefully i did everything correctly. It did perform the first (forward) part but during the reverse part i heard nothing. Can you please help me....
Kind regards,
Herman
// copy Listing 4.3 Playing a sound file backward // from Programming for Musicians and digital artists by Ge Wang
me.sourceDir() + "sample.wav" => string filename; if( me.args() ) me.arg(0) => filename;
// the patch SndBuf mySound => dac;
// load the file in buf filename => mySound.read;
mySound.samples() => int numSamples;
0 => mySound.pos; // this was ok numSamples::samp => now;
numSamples => mySound.pos; // This was not heard. Athough the program stayed in VM. -1.0 => mySound.rate; numSamples::samp => now;