A PlayBuf that loops and fades

I’m writing an implementation of XPlayBuf, that can loop, cross-fade on trigger, and fade on loop boundaries.

It mostly follows the spec at https://github.com/supercollider/supercollider/wiki/PlayBuf-2017, with a few important features missing for now (no UnitTest yet, no .kr yet, only two fade shapes for now, no loops across buffer extremes yet, no resetPos).

If you want to join, comment, or just give it a try, it’s at https://github.com/elgiano/xplaybuf

9 Likes

This is one of my favourite custom SuperCollider plugins of all time. So extremely useful!!

1 Like

tried this, but i hear no crossfade between start and end? maybe i’m doing something wrong? or maybe it hasnt been implemented yet?

(
s.waitForBoot{
    b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav")
};
)

{ XPlayBuf.ar(1, b, rate: 1, trigger: 1, startPos:0.5, loopDur:1.5, loop:1, fadeTime: 0, xFadeTime: 1) }.play;

Hello!

It should be implemented, and actually on my system (linux) I hear your example clearly crossfading (just to be clear: the end of the loop fades out while the beginning of a new loop fades in).

did you install this version from github? and for which OS?

yes, the version i installed is 0.1.2 for mac os.
I’m on a M1 mac and i rebuilt the extension on my own. It’s the first time i recompile an ugen, so maybe i did something wrong (although it semt like the build process was clean). In any case, all other features of the ugen are working properly…

Ok, thanks! I might have created some confusion with branches, did you perhaps build the main branch? main was still on 0.1.1, while 0.1.2 was on a branch called feature/xloopbuf.

Now I’ve merged them, so that if you pull the latest main you’re going to build 0.1.2.

And I’ve also updated the releases: you now can download a pre-compiled version for M1 as well, so you don’t need to build from source if that was the only reason.

Let me know if this works for you!

2 Likes

Thank you very much!
now it’s working flawlessly using the macOS12 precompiled ugen!

1 Like