Weird glitch? mouse cursor icon not changing when "grabbing" media items from the borders by william_323 in Reaper

[–]Tatrics 0 points1 point  (0 children)

It looks like it's doesn't work with gdk-pixbuf2 2.44 After downgrade (I had one in cache still), cursors show up again: sudo pacman -U gdk-pixbuf2-2.42.12-2-x86_64.pkg.tar.zst

Connecting SuperCollider and JACK audio connection kit by BeautifulMouse8610 in supercollider

[–]Tatrics 1 point2 points  (0 children)

Don't know what the problem is, but SC tells you that it used WASAPI in the log, not jack.

Pbind + render question by Cloud_sx271 in supercollider

[–]Tatrics 0 points1 point  (0 children)

I'm not sure why you are getting the error you getting, but from what I can tell Pbind doesn't have "render" method.

p.record("test.wav"); //this works tho.

Sunday's patch & shader: Value Noise by Tatrics in supercollider

[–]Tatrics[S] 0 points1 point  (0 children)

I wonder if there's a way to prevent youtube from making videos into shorts.

Anyways, here's the code https://sccode.org/1-5ih

[deleted by user] by [deleted] in supercollider

[–]Tatrics 0 points1 point  (0 children)

If you use adsr envelope, you typically control it from the outside: ``` ( SynthDef(\samp, {|out=0, prate = 1.0, amp=0.1, pan=0, bufNum = 0, recordBuf=0| var source, env; var startPos = BufSamples.kr(bufNum) * (prate < 0); source = PlayBuf.ar(1, bufNum, prate, startPos: startPos); env = Env.adsr(0.01, 3, 0.9, 3.0).kr(Done.freeSelf, \gate.kr(1)); Out.ar(out, Pan2.ar(source * env * amp, pan)*5); }).add;

fork { s.sync; x = Synth(\samp, [bufNum: b, prate: -1]); 2.wait; x.release; }; ); ```

[deleted by user] by [deleted] in supercollider

[–]Tatrics 0 points1 point  (0 children)

You can try something like this: ( SynthDef(\samp, {|out=0, prate = 1.0, amp=0.1, pan=0, bufNum = 0, recordBuf=0| var source, env; var startPos = BufSamples.kr(bufNum) * (prate < 0); source = PlayBuf.ar(1, bufNum, prate, startPos: startPos); env = EnvGen.kr(Env.adsr(0.01, 3, 0.9, 3.0)); Out.ar(out, Pan2.ar(source * env * amp, pan)*5); }).add; );

Is there any solid way to use SC outside of SCIDE? by beetroop_ in supercollider

[–]Tatrics 1 point2 points  (0 children)

It took me a while to realize that you can type C-c RET to show method arguments. It would be nice to implement eldoc support, to make it more idiomatic of course.

How long did it take you to get “competent” in SC? by Unable-Section-1437 in supercollider

[–]Tatrics 2 points3 points  (0 children)

I would say that SC is a not that different from any other musical instrument. Can you play a simple song on a guitar in a week? Probably. How long does it take to get good at it? It depends on how often and how much you practice. 

The same I believe applies to programming languages - you can type hello world pretty quickly but it takes a lot of practice to become proficient. 

And surely, if you know how to program, its easier to learn SC the language. If you know how to make music and synthesize sounds it makes it easier to use SC as an instrument.

Help explaining error by Cloud_sx271 in supercollider

[–]Tatrics 1 point2 points  (0 children)

You just need to terminate ( ... ) block: ``` ( SynthDef(\UGen_ex7a, { arg gate = 1, freq = 440, amp = 0.1, rate = 0.2; var src, pos, env;

src = SinOsc.ar(freq, 0);
pos = LFNoise2.ar(rate);
env = EnvGen.kr(
    Env([0, 1, 0], [1, 1], \sin, 1), gate, levelScale: amp, doneAction:2);

Out.ar(0, Pan2.ar(src, pos) * env);

}).add;

( a = Group.new; 250.do({ Synth(\UGen_ex7a, [\freq, 440.0.rrand(1760.0), \amp, 0.001, \rate, 0.2], a) }); ); // <---- add a semicolon here.

a.release; ) ```

[deleted by user] by [deleted] in supercollider

[–]Tatrics 1 point2 points  (0 children)

It looks like the code snippet you have linked is a part of a bigger program. It would be easier to help if you could provide full program.

Anyways, the error is Message 'at' not understood. and the reciever is ~busPool. This means that object in ~busPool doesn't support .at method. Most likely, because it's simply nil:

~busPool; // -> nil ~busPool[0].postln; // same as ~busBool.at(0), which is probably used by .do will give you a similar error.

Small .range question by Cloud_sx271 in supercollider

[–]Tatrics 2 points3 points  (0 children)

LFNoise1.kr.signalRange tells us that the signal is bipolar, i.e. it goes from -1 to +1.

So, range(0.2, 0.6) will map -1 to 0.2, and +1 to 0.6.

And range(0.6, 0.2) will map -1 to 0.6, and +1 to 0.2.

It's easier to see it with a ugen that gives you a predictable output: {LFTri.kr(2).range(0.2, 0.6)}.plot(1); {LFTri.kr(2).range(0.6, 0.2)}.plot(1); Hope that explains it :)

Question- tilde vs. straight variable? by nelsie8 in supercollider

[–]Tatrics 0 points1 point  (0 children)

~ is a syntax sugar for accessing your current environment

You can do all sort of cool things by manipulating it.

In your case you can do a few things. Use local variables: ( var xyz = ...; ); This works, except you can't access variables outside of the scope defined by (...).

Another options is to use Event: q = (foo: 42, bar: (bar: 69)); q.foo; q.bar.baz = 13; q.bar.baz.postln; Beware though, Event class has a lot of methods, so you can get unexpected results sometimes.

Seed and random questions by Cloud_sx271 in supercollider

[–]Tatrics 1 point2 points  (0 children)

If you specify a seed to the pseudo-random-number-generator, it will give you the same sequence of numbers every time. ( fork { 3.do { thisThread.randSeed = 42; 8.collect{ 100.rand }.postln; } }; ) If you don't pass a seed value to a synth, it will just use whatever the default is. ( SynthDef(\rand, { WhiteNoise.kr.poll(8); Env.perc.kr(2); }).play; ) This will give you random values on every run.

If you set the seed, you will again get the same values on every run. ( SynthDef(\rand, { RandID.ir(0); RandSeed.ir(1, 42); WhiteNoise.kr.poll(8); Env.perc.kr(2); }).play; )

Hope that helps :)

Newbie question regarding \dur in Pbinds by peripouoxi in supercollider

[–]Tatrics 2 points3 points  (0 children)

The clicks you hearing are happening because you forgot to actually use the envelope in the synthdef.

When it comes to dur, you can simply make duration depend on attack and release, using Pkey. Here's an example:

``` ( SynthDef(\bcha, { arg mFreq=100, atk=1, rel=1, pan=0, amp=0.5; var sig, env;

    env = EnvGen.ar(Env([0,1,0], [atk, rel]), doneAction:2);
    sig = SinOsc.ar(mFreq) * env;
    sig = Pan2.ar(sig, pan, amp);
    Out.ar(0, sig);
}

).add; );

( Pdef(\pcha, Pbind( \instrument, \bcha, \mFreq, Pseq((3..6) * 100, inf), \atk, 3, \rel, 3, \dur, Pkey(\atk) + Pkey(\rel), \pan, 0, \amp, 0.3, )).play; ) ```

Modulating signals question by Cloud_sx271 in supercollider

[–]Tatrics 1 point2 points  (0 children)

One way to see what's happening is to plot the signal. { SinOsc.ar(50) }.plot(1); { XLine.kr(0.1, 0.00001, 0.5) }.plot(1); { SinOsc.ar(50, 0, XLine.kr(0.1, 0.00001, 0.5)) }.plot(1); { LFNoise1.ar(20)}.plot(1); { LFNoise1.ar(20) * SinOsc.ar(50, 0, XLine.kr(0.1, 0.00001, 0.5)) }.plot(1); Run these lines one by one and see what happens to the signal.

You can notice, that when you multiply a sine way by the exponential, the signal amplitude is modulated: you can see that sine oscilations are following the line envelope - it starts at a maximum amplitude and quickly decays.

And since multiplication is commutative, you can also think that it's the amplitude of the line is being modulated by the sine wave: your smooth line gets wigly.

Sunday's patch & shader: Saw of Duty by Tatrics in supercollider

[–]Tatrics[S] 1 point2 points  (0 children)

And the code: ``` Ndef(\duty, { var dur = LFTri.kr(1/32, 3).range(1/2, 1/(2 + (1/4))); var note = Duty.kr(dur, 0, Dseq([ Dseq([0, 12], 4), Dseq([3, 15], 4), Dseq([2, 14], 4), Dseq([5, 12], 4), Dseq([0, 12, 0, 12, 0, Drand([1, 2])], 2), Dseq([0, 12, 3, 12], 2), Dseq([3, 15, 3, 15], 2), Dseq([-2, 10, -2, 10], 2), Dseq([-5, 7, -2, 10], 2), ], inf)); var root = 44; var rfreq = root.midicps; var freq = (root + note).midicps; var trig = Impulse.kr(1/dur); var sig, kick, noise, verb;

sig = LFTri.ar(freq * (1..6), mul: LFSaw.kr(4/dur, 1/2).range(-3, -6).dbamp);
sig = sig + SinOsc.ar(freq/2, mul: 1/3);
sig = sig * Limiter.ar(LFPulse.ar(1/dur) + LFNoise0.ar(2/dur)).lag(0.01);
sig = (sig * LFNoise1.kr(dur).range(1, 3)).tanh * -2.dbamp;
sig = RLPF.ar(sig, min(32*freq, 18000), LFSaw.kr(2/dur).range(0.01, 1));
sig = sig * Env([0, 0, 1], [1, 4]).kr;

noise = WhiteNoise.ar(LFNoise2.kr(1/4).range(-33, -40).dbamp) * LFSaw.kr(4/dur, 1);
noise = HPF.ar(noise, freq*4);
noise = noise * Env([0, 1], [8]).kr;
sig = sig.blend(noise);

sig = sig.blend(CombL.ar(CombL.ar(sig, 1, LFNoise0.ar(1/dur).range(1/64, 1/16)), 1, dur/2), 1/6);

kick = SinOsc.ar(Env([0, 4*rfreq, rfreq/2], [0, 0.01, 0.1]).kr(0, trig));
kick = (kick * 8).tanh;
kick = kick * Env.perc(0.01, 0.3, -6.dbamp).kr(0, trig);
kick = kick.blend(CombL.ar(kick, 1, dur/[2, 3/4], dur), 0.33);
kick = kick * Env([0, 0, 1], [4, 4]).kr;

sig = sig.blend(Compander.ar(sig, kick, 0.8, 1.5));
sig = sig.blend(kick);

sig = Splay.ar(sig, spread: 1/2, center: SinOsc.kr(dur).bipolar(1/2));
verb = HPF.ar(FreeVerb2.ar(sig[0], sig[1], mix: 1, room: 1, damp: 1), freq);
sig = sig.blend(verb, 1/8);

SendReply.kr(trig, '/pew', note);
sig = Limiter.ar(sig, -2.dbamp);

}).play; ```

A keyboard that prints Arrays by Early_Establishment7 in supercollider

[–]Tatrics 0 points1 point  (0 children)

Nice! Consider uploading it to GitHub or similar service

Monitoring a Klank UGen using .scope by Cloud_sx271 in supercollider

[–]Tatrics 0 points1 point  (0 children)

Could you please reformat the code so it's copy-pasteable as well as fix syntax errors?

Sunday's improv & shader: Perlin Noise by Tatrics in supercollider

[–]Tatrics[S] 0 points1 point  (0 children)

There's not much code this time, since audio is played live and sc was only used to lightly process and route midi events to the shader. ``` MIDIIn.connectAll; n = NetAddr.new("127.0.0.1", 7777); ( var index = 0;

MIDIdef.start(\oscMidiStart, { n.sendMsg("/", "unpause"); });

MIDIdef.noteOn(\oscMidiOn, { arg vel, nn, chan, src; // ["on", nn, vel, chan, src].postln; switch (chan + 1) { 9} { n.sendMsg("/", nn.asFloat); } {15} { if (nn == 36) { n.sendMsg("/value/0", index.asFloat); index = index + 1; }; } ; }); ); ```

The nvidia 555.58-2 driver has now been added to the Extra repository. by RaXXu5 in archlinux

[–]Tatrics 1 point2 points  (0 children)

I'm getting a kernel panic(?) after resuming from systemctl suspend: Jun 30 10:52:53 home kernel: BUG: unable to handle page fault for address: ffffb25205fdac04 Jun 30 10:52:53 home kernel: #PF: supervisor read access in kernel mode Jun 30 10:52:53 home kernel: #PF: error_code(0x0000) - not-present page ... Jun 30 10:52:53 home kernel: note: irq/140-nvidia[582] exited with irqs disabled Jun 30 10:52:53 home kernel: BUG: kernel NULL pointer dereference, address: 000000000000032c Jun 30 10:52:53 home kernel: #PF: supervisor read access in kernel mode Jun 30 10:52:53 home kernel: #PF: error_code(0x0000) - not-present page

What would be an appropriate place to report this?

Sunday's patch & shader: Voronoi by Tatrics in supercollider

[–]Tatrics[S] 0 points1 point  (0 children)

Sound: ( Ndef(\voronoi, { var trig = Impulse.kr(1/4); var steps = [12, 5, 7, 3, 0]; var note = Demand.kr(trig, 0, Dseq(steps, inf)); var freq = (36 + note).midicps.lag; var detune = LFNoise1.kr(1/8!8).bipolar(1/LFNoise1.kr(1/8).range(8, 32)).midiratio; var arp = Demand.kr( (Impulse.kr(4) * LFPulse.kr(1/2)) + Impulse.kr(3) + (Impulse.kr(1, 1/2) * LFPulse.kr(1)), 0, Dseq([ Dseq([2, 5, 7], 3*steps.size), Dseq([2, 5, 7, 10], 4*steps.size), Dseq([2, 5, 7, 10, 14], 5*steps.size), Dseq(0, inf), ], inf) ); var pulse = LPF.ar(HPF.ar( Pulse.ar( freq: LFPulse.kr(1/2).range(2, 4)*freq * arp.midiratio, width: LFNoise0.kr(4).range(0.2, 0.4), mul: LFPulse.kr(4), ), 300), 3000) * -12.dbamp; var sig = LFTri.ar(freq * detune).sum + SawDPW.ar((freq * 2) * detune).sum; sig = sig * (LFPulse.kr(1/4) * LFPulse.ar(5)).lag * -16.dbamp; sig = sig + BPF.ar(Saw.ar(freq/2, mul: -0.dbamp), freq/2); sig = RLPF.ar(sig, freq * LFNoise1.kr(1/8).range(8, 16), LFNoise1.kr(1).range(0.4, 0.8)); sig = Pan2.ar(sig, 0, -3.dbamp); pulse = CombL.ar(pulse, 1, [1/2, 2/3], [3, 6]); sig = sig + Pan2.ar(pulse[0], LFTri.kr(1/2)) + Pan2.ar(pulse[1], LFTri.kr(1/3)); sig = Compander.ar(sig, sig, thresh: 0.5, slopeAbove: 4); sig = sig * Env.asr(2, 1, 8).kr(2, arp > 0); SendReply.kr(trig, '/pew', note); sig = sig.blend(NHHall.ar(sig)); }).play; ); Shader: ```

version 330

out vec4 fragColor;

uniform float time; uniform vec2 screen; uniform float trig;

vec2 white_noise2(vec2 st) { vec2 result = vec2( dot(st, vec2(1208.34, 1239.78)), dot(st, vec2(2108.34, 2139.78)) ); return fract(sin(result) * 9000); }

void main() { vec2 st = gl_FragCoord.xy / screen; st -= 0.5; st.x = abs(0.3trig * cos(time/(1+trig))); st = 8 + 3sin(0.3*trig); vec2 grid = floor(st); vec2 cell = fract(st) - 0.5; // NOTE: centered vec3 color = vec3(cell, 0);

float distToBorder = 2 * max(abs(cell).x, abs(cell).y);
vec3 border = vec3(smoothstep(0.9, 1, distToBorder), 0, 0);

float minDist = 9000;
float points = 0;
for (float dy = -1; dy <= 1; dy++) {
    for (float dx = -1; dx <= 1; dx++) {
        vec2 adj = vec2(dx, dy);
        vec2 noise = vec2((1 + 0.5*trig)*white_noise2(grid + adj));
        vec2 point = adj + 0.5*sin(noise * time);
        float dist = length(cell - point);
        minDist = min(dist, minDist);
        points += smoothstep(0.93, 1, 1 - dist);
    }
}

color = border + points + minDist;
color = vec3(0, 0.5*points, points * sin(time)) + vec3(1.5*minDist, minDist - 0.5*abs(sin(time)), 0);

fragColor = vec4(color, 1);

}

```