From 343b3cd61475f3457d4f24921a72fc90cc2ecdd0 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Thu, 28 Dec 2023 13:27:43 +0100 Subject: [PATCH] Interesting methods --- Classes/BuboFunction.sc | 8 ++++++++ Classes/BuboString.sc | 7 ++++--- Classes/Configuration/Synthdefs.scd | 20 -------------------- 3 files changed, 12 insertions(+), 23 deletions(-) create mode 100644 Classes/BuboFunction.sc diff --git a/Classes/BuboFunction.sc b/Classes/BuboFunction.sc new file mode 100644 index 0000000..78408ca --- /dev/null +++ b/Classes/BuboFunction.sc @@ -0,0 +1,8 @@ ++ Function { + + f { + arg repeats=inf; + ^Pfunc(this, inf) + } + +} diff --git a/Classes/BuboString.sc b/Classes/BuboString.sc index beb72ad..4fe3830 100644 --- a/Classes/BuboString.sc +++ b/Classes/BuboString.sc @@ -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); } + } diff --git a/Classes/Configuration/Synthdefs.scd b/Classes/Configuration/Synthdefs.scd index fcb5f5d..5e5bf9b 100644 --- a/Classes/Configuration/Synthdefs.scd +++ b/Classes/Configuration/Synthdefs.scd @@ -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;