[flocking-users] Play buffer from the beginning

roger pibernat rogerpibernat at gmail.com
Wed Jan 15 04:52:42 EST 2014


Hi again,

I'm trying to set the speed of a buffer before playing it with

  var synth = flock.synth({
        synthDef: {
            ugen: "flock.ugen.playBuffer",
            buffer: {
                id: "chord",
                url: "data/audio/piano-C3.wav"
            }
        }
 });
 function playSynth()
    {
        synth.set("speed", 0.5);
        synth.play();
    }

but it's not working.  Is this the right syntax?


Roger

(+34) 639 81 26 71
http://www.rogerpibernat.com
http:// <http://doodledeedoo.wordpress.com/>www.wucollective.com


On Mon, Jan 13, 2014 at 2:58 PM, roger pibernat <rogerpibernat at gmail.com>wrote:

> Hi there,
>
> I've been trying to play a buffer from the beginning every time I hit a
> button, but I can't reset it.  If I stop it and hit play again, it keeps
> running where it stopped.  I'm using readBuffer, because on the demo it
> works just fine.  How does it work?  Here's my code.
>
>     var synth = flock.synth({
>         synthDef: {
>             ugen: "flock.ugen.readBuffer",
>             buffer: {
>                 id: "chord",
>                 url: "data/audio/piano-C3.wav"
>             }
>             ,
>             phase: {
>                 ugen: "flock.ugen.lfSaw",
>                 freq: (1/4),
>                 mul: 0.5,
>                 add: 0.5
>             }
>         }
>     });
>
>     function playSynth()
>     {
>         console.log("playing synth");
>         synth.play();
>     }
>
>     function stopSynth()
>     {
>         console.log("stopping synth");
>         synth.pause();
>     }
>
> Thanks!
>
> Roger
>
> (+34) 639 81 26 71
> http://www.rogerpibernat.com
> http:// <http://doodledeedoo.wordpress.com/>www.wucollective.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idrc.ocad.ca/pipermail/flocking/attachments/20140115/e5f2a904/attachment.html>


More information about the flocking mailing list