Interesting methods

This commit is contained in:
2023-12-28 13:27:43 +01:00
parent 2954990a27
commit 343b3cd614
3 changed files with 12 additions and 23 deletions

8
Classes/BuboFunction.sc Normal file
View File

@ -0,0 +1,8 @@
+ Function {
f {
arg repeats=inf;
^Pfunc(this, inf)
}
}

View File

@ -3,8 +3,9 @@
/*
* Interface with Bank.sc to return a sample faster
*/
sample {
arg sampleNumber = 2;
^Bank(this)[sampleNumber];
sp {
arg sampleNumber = 0, repeats=inf;
^Pindex(Bank(this), sampleNumber, repeats);
}
}

View File

@ -31,26 +31,6 @@ f.vardel = {
d.sampler = z;
);
(
z = SynthDef.new(\revsampler, {
arg buf, out=0, rate=1, amp=1, pan=0, attack=0.01, release=1, loop=1;
var sig;
var env = EnvGen.ar(Env.perc(attack, release, doneAction: 2));
var startPos = 0;
sig = PlayBuf.ar(
numChannels: 1,
bufnum: buf,
rate:BufRateScale.kr(buf) * rate,
trigger: 1, startPos:startPos,
loop:loop, doneAction: 2);
sig = sig * amp;
sig = Pan2.ar(sig * env, pan);
Out.ar(out, sig);
}).add;
d.revsampler = z;
);
(
z = SynthDef(\sinfb, {
arg freq = 440, atk = 0.01, sus = 0, rel = 1, fb = 0, amp = 0.3, out = 0, pan=0;