These are chat archives for supercollider/supercollider

28th
Feb 2017
Nathan Ho
@snappizz
Feb 28 2017 17:15
Feb 28 2017 19:14
can you guys help me to further refine this piece of supercollider, both in terms of synthesis, and in terms of code?
(
s.options.memSize= 8192*20;
s.reboot;
)
({
var in, del1, del2, del3, del4, del5, del6, del7, del8;
in = Compander.ar(SoundIn.ar(0), SoundIn.ar(0), thresh: 0.01, slopeBelow: 10, slopeAbove: 1, clampTime: 0.1, relaxTime: 0.1);
del1 = Pan2.ar(CombC.ar(in, 3, 3, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del2 = Pan2.ar(CombC.ar(del1, 1, 1, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del3 = Pan2.ar(CombC.ar(del2, 2, 2, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del4 = Pan2.ar(CombC.ar(del3, 1 , 1, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del5 = Pan2.ar(CombC.ar(del4, 3, 3, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del6 = Pan2.ar(CombC.ar(del5, 1, 1, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del7 = Pan2.ar(CombC.ar(del6, 2, 2, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
del8 = Pan2.ar(CombC.ar(del7, 1 , 1, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
(in + del1 + del2 + del3 + del4 + del5 + del6 + del7)!2;
}.play;
);
by refining it I mean:
optimizing the synthesis routine (to get more complex sounds, that may range from harsher more rhythmic and lushier, aperiodic, irregular sounds, also aggressive, while at the same time going into more beautiful, more harmonies, regular and periodic sounds, maybe combining these two universes in the same synthdef would be a great thing), so if there could be some sort of layering counterpoint within the code itself it could be a great thing
another thing is the following: optimizing code syntax, currently this is only a function, if this can sit into a single two or three lines of sequential piece of code, that can basically cosist of a bus/proxyspace/environment, which can work recursively which I can encapsulate into an high level supercollider class abstraction, such as the first class implementation examples in Scott Wilson book, that would be the ideal (although the stage of encapsulation would be done later on)
Brian Heim
@brianlheim
Feb 28 2017 19:26
hey @tiagmoraismorgado, I think you'd be more likely to get helpful feedback on things like this on the sc-users mailing list or the SC Facebook group. Not saying you can't post it here, but this chat is mostly frequented by developers and is not as active as those other two venues
Feb 28 2017 19:28
ok
anyway if you can help me with this, you can always pm me
and furthermore this code is a refination of examples I contributed to sc help documentation
Nathan Ho
@snappizz
Feb 28 2017 19:29
``````(
{
var snd;
snd = Compander.ar(SoundIn.ar(0), SoundIn.ar(0), thresh: 0.01, slopeBelow: 10, slopeAbove: 1, clampTime: 0.1, relaxTime: 0.1);
[3, 1, 2, 1, 3, 1, 2, 1].collect { |delay|
snd = Pan2.ar(CombC.ar(snd, delay, delay, 1), LFDNoise0.kr(rrand(0.01, 0.5)));
snd;
}.sum ! 2;
}.play;
)``````
Feb 28 2017 19:29
so the output of this code could be used for supercollider examples
thanks nathan
Nathan Ho
@snappizz
Feb 28 2017 19:30
sclang is a programming language, and programming languages are there to save us from repetitive tasks. so it's always a good idea to try to reduce code duplication
One decently active chatroom for sc users is #supercollider on livecode.slack.com
Feb 28 2017 19:32
yeah
i have to use that
there was also used to be a chatroom in freenode
but these days it's not very populated
Nathan Ho
@snappizz
Feb 28 2017 19:32
by the way, are you trying to write a reverb here?
Feb 28 2017 19:38
no
long delay line
similar to what you can hear in Karlheinz essl sequitur pieces
Nathan Ho
@snappizz
Feb 28 2017 19:39
damnit, I'm at a library and forgot my headphones
well, i'll check it out after i get home
Feb 28 2017 19:44
but I want to elaborate this concept further
I don't want to do just what Karlheinz does here, with all the respect for the high standards of his work
Nathan Ho
@snappizz
Feb 28 2017 19:45
IMO the most flexible and interesting way to play with delay fx in SC is to put everything in one big loop using LocalIn/LocalOut
start with `snd = snd + (LocalIn.ar(2) * fb); snd = DelayC.ar(snd, 1, 1); LocalOut.ar(snd);` then throw other stuff into the feedback path
Feb 28 2017 21:08

@snappizz

~myBuffer=Buffer.alloc(s, s.sampleRate * 4);
{RecordBuf.ar(SoundIn.ar(0), ~myBuffer)}.scope

(
{
Mix.new(Array.fill(32,
{
var trate, dur, snd;
trate = rrand(0.10, 20);
dur = rrand(0.0001, 0.5);
snd=TGrains.ar(2, Impulse.ar(trate), ~myBuffer, [0.125, 0.25, 0.5, 1, 2, 4, 8].choose** WhiteNoise.kr([0.125, 0.25, 0.5, 1, 2, 4, 8].choose).round(1), [LFDNoise0, LFDNoise1, LFDNoise3].choose.kr(rrand(0.01, 0.5), mul: BufDur.kr(~myBuffer)), dur, WhiteNoise.kr(2), 1, [1, 2, 4].choose);
Mix.new([snd, CombC.ar(snd, [3, 6].choose, [3, 6].choose)]);
}
)
)
}.scope(zoom: 4);
)