diff --git "a/data/sft/pool.jsonl" "b/data/sft/pool.jsonl"
--- "a/data/sft/pool.jsonl"
+++ "b/data/sft/pool.jsonl"
@@ -1,18 +1,4 @@
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 02-plucked-string.scd -- a waveguide string, plucked\n//\n// The technique: a burst of noise is fed into a delay line whose feedback is\n// filtered. The filter makes high frequencies decay faster than low ones, which\n// is exactly what a real string does, and the delay length is the pitch.\n// `Pluck` is that waveguide in one UGen.\n//\n// Play:\n// ~pluck.value(220) // A3\n// ~pluck.value(440, 0.2) // A4, quieter\n(\nSynthDef(\\exPluck, { |out = 0, freq = 220, amp = 0.4, decay = 6, coef = 0.4, pan = 0|\n var exc, sig, env;\n // The pluck: a short burst of noise. `coef` is the string's damping - a\n // higher value is a duller, shorter note.\n exc = WhiteNoise.ar(1) * EnvGen.kr(Env.perc(0.0005, 0.02));\n sig = Pluck.ar(exc, Impulse.ar(0), 0.05, freq.reciprocal, decay, coef);\n // A little body: the string alone is thin, so a gentle low shelf stays.\n sig = sig + LPF.ar(sig, 400);\n env = EnvGen.kr(Env([0, 1, 1, 0], [0.001, decay * 0.8, decay * 0.4], [\\lin, \\lin, -4]), doneAction: 2);\n Out.ar(out, Pan2.ar(LeakDC.ar(sig * env * amp), pan));\n}).add;\n~pluck = { |hz = 220, level = 0.4, damp = 0.4| Synth(\\exPluck, [\\freq, hz, \\amp, level, \\coef, damp]) };\n)\n// ~pluck.value(220);\n```"}, {"role": "assistant", "content": "02-plucked-string.scd -- a waveguide string, plucked The technique: a burst of noise is fed into a delay line whose feedback is filtered. The filter makes high frequencies decay faster than low ones, which is exactly what a real string does, and the delay length is the pitch. `Pluck` is that waveguide in one UGen. Play: ~pluck.value(220) // A3 ~pluck.value(440, 0.2) // A4, quieter."}], "family": "D3", "source_id": "local:02-plucked-string.scd", "aug": "patch", "prompt_tokens": 640, "answer_tokens": 156}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 03-fm-bell.scd -- an FM bell: the falling index is the strike\n//\n// The technique: one sine (the modulator) is added to the frequency of another\n// (the carrier). How far it pushes is the INDEX, and the index decides how many\n// sidebands appear around the carrier: a high index is a bright, clangy attack,\n// an index of 0 is a bare sine. So an index envelope that falls from 6 to 0 is\n// the whole bell - the strike is the entire spectrum and the tail is one quiet\n// partial.\n//\n// The ratio is 3.5 on purpose. A ratio of 3 would put every sideband back on\n// the harmonic series and you would hear a horn or an organ; a non-integer\n// ratio leaves the partials where no common multiple lines them up, which is\n// what the ear calls metal. Try `ratio` 2.7 or 4.13 as well.\n//\n// Play:\n// ~fmBell.value(440) // A4 bell, 6 s tail\n// ~fmBell.value(220, 0.25) // a lower, quieter bell\n(\nSynthDef(\\exFMBell, { |out = 0, freq = 440, amp = 0.65, index = 6, decay = 6, ratio = 3.5, pan = 0|\n var modFreq, bend, mod, car, env, sig;\n modFreq = freq * ratio;\n // Full brightness at the strike, down to 12% in 12 ms, then a slow glide to\n // nothing over the rest of the tail. This cont\n```"}, {"role": "assistant", "content": "03-fm-bell.scd -- an FM bell: the falling index is the strike The technique: one sine (the modulator) is added to the frequency of another (the carrier). How far it pushes is the INDEX, and the index decides how many sidebands appear around the carrier: a high index is a bright, clangy attack, an index of 0 is a bare sine. So an index envelope that falls from 6 to 0 is the whole bell - the strike is the entire spectrum and the tail is one quiet partial. The ratio is 3.5 on purpose. A ratio of 3."}], "family": "D3", "source_id": "local:03-fm-bell.scd", "aug": "patch", "prompt_tokens": 530, "answer_tokens": 183}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 04-plucked-karplus.scd -- a Karplus-Strong string on a plain comb\n//\n// The technique: a short burst of noise goes into a delay line with feedback (a\n// comb). The delay time is the pitch - delay 1/freq seconds and the burst\n// repeats freq times a second - and the comb's decay time is how long the\n// echoes take to fall 60 dB, which is how long the string rings. Shorten the\n// burst and it is a pluck; leave it on and it becomes a bowed drone.\n//\n// The low-pass is the string's damping: a bare comb is a buzz, because every\n// partial dies at the same rate, so the filter sits across the output and takes\n// the top away. `bright` is that cutoff - 2500 is nylon, 800 is a muted\n// thumb, 6000 is a harpsichord.\n//\n// Play:\n// ~karplus.value(330) // E4, ringing for 4 s\n// ~karplus.value(110, 0.35, 8) // low and long\n(\nSynthDef(\\exKarplus, { |out = 0, freq = 330, amp = 0.4, decay = 4, bright = 2500, pan = 0|\n var burst, exc, string, sig, env;\n // The pluck: 20 ms of noise, already darkened by the string's damping.\n burst = LPF.ar(WhiteNoise.ar(1), bright);\n // A comb gives back only a fraction of what is fed into it (its copies\n // overlap and partly cancel), so the b\n```"}, {"role": "assistant", "content": "04-plucked-karplus.scd -- a Karplus-Strong string on a plain comb The technique: a short burst of noise goes into a delay line with feedback (a comb). The delay time is the pitch - delay 1/freq seconds and the burst repeats freq times a second - and the comb's decay time is how long the echoes take to fall 60 dB, which is how long the string rings. Shorten the burst and it is a pluck; leave it on and it becomes a bowed drone. The low-pass is the string's damping: a bare comb is a buzz, because e."}], "family": "D3", "source_id": "local:04-plucked-karplus.scd", "aug": "patch", "prompt_tokens": 528, "answer_tokens": 182}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 05-drum-kick.scd -- a kick: a pitch sweep, and a click on top of it\n//\n// The technique: two things happen in the first 40 ms. A sine starts four times\n// too high and falls to its target pitch, and that fast downward sweep is the\n// beater hitting the skin - it is what the ear hears as \"thump\" and not as a\n// bass note. A very short burst of high-passed noise sits on top of it for the\n// beater itself. After that there is only an amplitude envelope, and it is the\n// decay time that decides whether this is a techno kick or a heartbeat.\n//\n// The sweep is exponential (Env curve \\exp) for a reason: a linear sweep sounds\n// like a synth falling over, an exponential one sounds like a drum.\n//\n// Play:\n// ~kick.value(48) // 48 Hz, ~0.5 s\n// ~kick.value(38, 0.9, 1.2) // lower and longer\n(\nSynthDef(\\exKick, { |out = 0, freq = 48, amp = 0.9, pitchAmount = 4, decay = 0.5, click = 0.15, pan = 0|\n var pitch, body, thump, beater, sig;\n // The contour: pitchAmount x freq down to freq in 45 ms.\n pitch = EnvGen.kr(Env([pitchAmount, 1], [0.045], \\exp));\n body = SinOsc.ar(freq * pitch);\n // `doneAction: 2` is on the THUMP's envelope, not the beater's: the thump is\n // the\n```"}, {"role": "assistant", "content": "05-drum-kick.scd -- a kick: a pitch sweep, and a click on top of it The technique: two things happen in the first 40 ms. A sine starts four times too high and falls to its target pitch, and that fast downward sweep is the beater hitting the skin - it is what the ear hears as \"thump\" and not as a bass note. A very short burst of high-passed noise sits on top of it for the beater itself. After that there is only an amplitude envelope, and it is the decay time that decides whether this is a techno."}], "family": "D3", "source_id": "local:05-drum-kick.scd", "aug": "patch", "prompt_tokens": 559, "answer_tokens": 173}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 06-drum-snare.scd -- a snare: one tuned drum, plus a band of noise\n//\n// The technique: a snare is two sounds at once. The head is a drum - two tuned\n// sine modes (the fundamental and a shallow shell's first overtone, 180 and\n// 330 Hz here) with a decay measured in tens of milliseconds - and the wires\n// stretched under it are noise, band-passed around 3 kHz so that it reads as\n// wires rather than as a hiss. Neither half is a snare.\n//\n// The BALANCE between the two is the character, which is what `toneLevel` and\n// `noiseLevel` are for. The two layers are also tuned independently: 200 Hz\n// with 4 kHz is a piccolo, 150 Hz with 2.2 kHz is a fat rock snare, and pushing\n// `noiseLevel` alone gives you a drum machine clap.\n//\n// Play:\n// ~snare.value // the default crack\n// ~snare.value(150, 0.9, 0.09) // lower and much shorter\n(\nSynthDef(\\exSnare, { |out = 0, amp = 0.8, decay = 0.18, noiseLevel = 0.5, toneLevel = 0.5, freq = 180, snareHz = 3000, pan = 0|\n var head, headEnv, wires, wireEnv, sig;\n // Two modes. 1.83 is the shell's overtone, not a harmonic of it.\n head = SinOsc.ar(freq) + (SinOsc.ar(freq * 1.83) * 0.7);\n headEnv = EnvGen.kr(Env.perc\n```"}, {"role": "assistant", "content": "06-drum-snare.scd -- a snare: one tuned drum, plus a band of noise The technique: a snare is two sounds at once. The head is a drum - two tuned sine modes (the fundamental and a shallow shell's first overtone, 180 and 330 Hz here) with a decay measured in tens of milliseconds - and the wires stretched under it are noise, band-passed around 3 kHz so that it reads as wires rather than as a hiss. Neither half is a snare. The BALANCE between the two is the character, which is what `toneLevel` and `n."}], "family": "D3", "source_id": "local:06-drum-snare.scd", "aug": "patch", "prompt_tokens": 577, "answer_tokens": 191}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 07-drum-hat.scd -- a hi-hat: six inharmonic squares, high-passed hard\n//\n// The technique: metal is not noise. A hat is six square waves at deliberately\n// inharmonic frequencies (301, 353, 421, 487, 611, 887 Hz - no two of them\n// share a common multiple), summed and then high-passed. The squares are what\n// give the dense, ringy spectrum; the high-pass at 7 kHz is what throws away\n// the body and leaves the \"tss\". Drop `hp` to 3 kHz and it becomes a clang.\n//\n// The high-pass costs nearly all of the level - what is left above 7 kHz is the\n// 25th and higher harmonics of each square - so the sum is scaled up rather\n// than down before the filter. The cutoff also falls as the sound decays, so\n// the first millisecond is the brightest thing in the file. `open = 1`\n// stretches the decay into an open hat without touching anything else.\n//\n// Play:\n// ~hat.value(0) // closed, 60 ms\n// ~hat.value(1, 0.4) // open hat, ~0.6 s\n(\nSynthDef(\\exHat, { |out = 0, amp = 0.5, decay = 0.06, open = 0, hp = 7000, pan = 0|\n var metal, sum, cut, env, sig;\n metal = #[301, 353, 421, 487, 611, 887];\n // Pulse width 0.5 is a square wave, and Pulse is band-limited, so the s\n```"}, {"role": "assistant", "content": "07-drum-hat.scd -- a hi-hat: six inharmonic squares, high-passed hard The technique: metal is not noise. A hat is six square waves at deliberately inharmonic frequencies (301, 353, 421, 487, 611, 887 Hz - no two of them share a common multiple), summed and then high-passed. The squares are what give the dense, ringy spectrum; the high-pass at 7 kHz is what throws away the body and leaves the \"tss\". Drop `hp` to 3 kHz and it becomes a clang. The high-pass costs nearly all of the level - what is l."}], "family": "D3", "source_id": "local:07-drum-hat.scd", "aug": "patch", "prompt_tokens": 544, "answer_tokens": 200}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 12-grain-cloud.scd -- a granular cloud over a live internal source\n//\n// The technique: granular synthesis is many very short windows over a source.\n// Here the source is an oscillator inside the synth rather than a sample, and\n// `Impulse.kr(rate)` triggers one window per grain. Each grain reads its own\n// pitch, which the cloud jitters around `baseFreq`.\n//\n// `rate` and `grainDur` together decide what you hear: if the grains overlap\n// you get a texture, if they are sparse and short you get clicks, and if the\n// rate lines up with `baseFreq` the cloud locks into a tone.\n//\n// Play:\n// ~grains.value(20, 0.05) // sparse, dry grains\n// ~grains.value(200, 0.12) // dense and continuous\n(\nSynthDef(\\exGrains, { |out = 0, amp = 0.3, rate = 20, grainDur = 0.05, baseFreq = 220, spread = 0.5, gate = 1|\n var trig, pitchMul, src, window, sig, env;\n // One trigger per grain.\n trig = Impulse.kr(rate);\n // A new random pitch interval per grain, held for the grain.\n pitchMul = (LFNoise0.kr(rate) * spread).midiratio;\n src = SinOsc.ar(baseFreq * pitchMul) + (PinkNoise.ar(0.25));\n // The window: a percussive envelope, one per grain, never ending the node.\n window = EnvGen.kr(Env\n```"}, {"role": "assistant", "content": "12-grain-cloud.scd -- a granular cloud over a live internal source The technique: granular synthesis is many very short windows over a source. Here the source is an oscillator inside the synth rather than a sample, and `Impulse.kr(rate)` triggers one window per grain. Each grain reads its own pitch, which the cloud jitters around `baseFreq`. `rate` and `grainDur` together decide what you hear: if the grains overlap you get a texture, if they are sparse and short you get clicks, and if the rate l."}], "family": "D3", "source_id": "local:12-grain-cloud.scd", "aug": "patch", "prompt_tokens": 559, "answer_tokens": 173}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 14-fm-noise-texture.scd -- wind and water: noise through a moving filter\n//\n// The technique: filtered noise plus a moving filter is the basis of most\n// environmental sound. There is no pitch here at all - the ear reads the\n// filter's centre frequency, its Q and how fast both move, and nothing else.\n//\n// `rq` is the reciprocal of Q: a small `rq` is a narrow, whistling resonance\n// (wind), a large one is a wide, breathing band (water). `motion` scales how\n// far the slow LFO travels from `cutoff`.\n//\n// Play:\n// ~texture.value() // a wide, watery band\n// ~texture.value(1600, 0.15) // narrow and high: wind through a gap\n(\nSynthDef(\\exTexture, { |out = 0, amp = 0.25, cutoff = 800, rq = 0.4, gate = 1, motion = 1|\n var src, lfo, band, breath, env, sig;\n // Pink noise: equal energy per octave, which is what most natural noise is.\n src = PinkNoise.ar(1) + (BrownNoise.ar(0.5));\n // A slow random walk, not a sine: wind does not move periodically.\n lfo = LFNoise1.kr(0.2) * motion;\n band = RLPF.ar(src, (cutoff * (2 ** (lfo * 1.2))).clip(60, 12000), rq.clip(0.05, 1));\n // Amplitude breathes on its own, at its own rate, so the two never lock.\n breath = (LFNoise1.\n```"}, {"role": "assistant", "content": "14-fm-noise-texture.scd -- wind and water: noise through a moving filter The technique: filtered noise plus a moving filter is the basis of most environmental sound. There is no pitch here at all - the ear reads the filter's centre frequency, its Q and how fast both move, and nothing else. `rq` is the reciprocal of Q: a small `rq` is a narrow, whistling resonance (wind), a large one is a wide, breathing band (water). `motion` scales how far the slow LFO travels from `cutoff`. Play: ~texture.valu."}], "family": "D3", "source_id": "local:14-fm-noise-texture.scd", "aug": "patch", "prompt_tokens": 555, "answer_tokens": 184}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 15-bitcrush.scd -- amplitude quantisation plus sample-rate reduction\n//\n// The technique: two separate artefacts, often confused. BITCRUSH is amplitude\n// quantisation - `.round(step)` snaps every sample to a grid, and the error the\n// snapping leaves behind is the harsh, granular buzz. DOWNSAMPLE is holding a\n// value: `Latch` samples the source once per `Impulse` and keeps that value, so\n// a low `downsample` rate samples the waveform at a low sample rate.\n//\n// Bitcrush adds hiss and grit to quiet passages; downsampling adds aliasing\n// tones that track the pitch. Try them separately to hear the difference.\n//\n// Play:\n// ~crush.value(220, 4, 8) // coarse quantisation, moderate hold\n// ~crush.value(220, 2, 40) // almost square, and ringing with aliases\n(\nSynthDef(\\exCrush, { |out = 0, freq = 220, amp = 0.3, bits = 4, downsample = 8, gate = 1|\n var steps, src, quant, rate, held, env, sig;\n // `bits` 4 means 2 ** (4 - 1) = 8 levels per side. The floor on `bits` keeps\n // the divisor away from zero at absurd settings.\n steps = 2 ** (bits.clip(1, 12) - 1);\n src = (SinOsc.ar(freq) + (SinOsc.ar(freq * 2.01) * 0.3)) * 0.7;\n // Amplitude quantisation: snap to the nea\n```"}, {"role": "assistant", "content": "15-bitcrush.scd -- amplitude quantisation plus sample-rate reduction The technique: two separate artefacts, often confused. BITCRUSH is amplitude quantisation - `.round(step)` snaps every sample to a grid, and the error the snapping leaves behind is the harsh, granular buzz. DOWNSAMPLE is holding a value: `Latch` samples the source once per `Impulse` and keeps that value, so a low `downsample` rate samples the waveform at a low sample rate. Bitcrush adds hiss and grit to quiet passages; downsamp."}], "family": "D3", "source_id": "local:15-bitcrush.scd", "aug": "patch", "prompt_tokens": 561, "answer_tokens": 194}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// 16-theremin.scd -- a continuous, hand-moved lead line\n//\n// The technique: pitch slides instead of being selected, and there is no\n// percussive transient at all. The absence of an attack is what makes this\n// read as a bowed or sung instrument rather than a plucked one: a pluck is\n// defined by the click of its onset, and here the envelope takes 300 ms to\n// arrive, so the ear hears a note already in progress.\n//\n// `glide` is how far the pitch slides IN SEMITONES and how long it takes; the\n// vibrato is always present, because a hand is never perfectly still.\n//\n// Play:\n// ~theremin.value(440) // a little slide down onto A4\n// ~theremin.value(220, 0.3, 1, 12) // a full octave slide, wide vibrato\n//\n// To play it live, hold the node and slide the pitch:\n// ~lead = Synth(\\exTheremin, [\\freq, 440, \\glide, 7]); ~lead.set(\\freq, 660);\n(\nSynthDef(\\exTheremin, { |out = 0, freq = 440, amp = 0.25, gate = 1, vibrato = 0.3, glide = 0.3|\n var slideTime, base, vib, sig, env;\n // The slide: `glide` semitones above the target, falling onto it over a time\n // that grows with the interval. The pitch is read off `Line` in the exponent,\n // so the slide is even in PITCH rath\n```"}, {"role": "assistant", "content": "16-theremin.scd -- a continuous, hand-moved lead line The technique: pitch slides instead of being selected, and there is no percussive transient at all. The absence of an attack is what makes this read as a bowed or sung instrument rather than a plucked one: a pluck is defined by the click of its onset, and here the envelope takes 300 ms to arrive, so the ear hears a note already in progress. `glide` is how far the pitch slides IN SEMITONES and how long it takes; the vibrato is always present,."}], "family": "D3", "source_id": "local:16-theremin.scd", "aug": "patch", "prompt_tokens": 544, "answer_tokens": 176}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//Boot Alga with the AlgaProxySpace being pushed as currentEnvironment\np = AlgaProxySpace.boot;\n\n//A simple node\n~a = { SinOsc.ar(100) };\n\n(\n//Use it as FM input for another node\n~b.play(chans:2);\n~b.interpTime = 2;\n~b.playTime = 0.5;\n~b = { SinOsc.ar(\\freq.ar(440)) }; ~b.from(~a, \\freq, scale: [220, 440]);\n);\n\n//Replace\n~a = { SinOsc.ar(440) };\n\n//New connection as usual\n~b.from({ LFNoise1.ar(100) }, \\freq, time: 3, scale: [330, 660])\n\n//Reset state\np.clear(time:2);\n\n//AlgaPattern\n~c.playTime = 3;\n~c.play(chans:2);\n~c = (def: { SinOsc.ar * EnvPerc.ar }, dur: 0.5)\n\n//Replace the pattern\n~c = { Saw.ar * EnvPerc.ar * 0.7 }\n\n//Clear\n~c.clear(time:2);\n\n//AlgaPattern: differential\n~d.interpTime = 3\n~d.playTime = 2\n~d.sched = 1;\n~d.play(chans:2)\n\n//Change the 'freq:' parameter to your liking and re-evaluate.\n//The AlgaProxySpace will only consider the \"differential\" changes to the definition\n(\n~d = (\n def: { SinOsc.ar(\\freq.kr(440)) * EnvPerc.ar },\n dur: 0.5,\n freq: Pseq([440, 880], inf)\n)\n)\n```"}, {"role": "assistant", "content": "Boot Alga with the AlgaProxySpace being pushed as currentEnvironment."}], "family": "D3", "source_id": "quarks:AlgaLib/Examples/Extras/AlgaProxySpace.scd", "aug": "patch", "prompt_tokens": 581, "answer_tokens": 26}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//This example requires the FluCoMa tools to be installed from::\n//https://www.flucoma.org/download/\n\n(\nAlga.boot({\n //Sine oscillator with frequency modulation\n a = AN({ SinOsc.ar(\\freq.kr(10) + \\fm.ar(0)) }).play(chans:2);\n\n //Sine oscillator\n b = AN({ SinOsc.ar(\\freq.kr(440)) });\n\n //Pitch analyser\n c = AN({ FluidPitch.kr(\\in.ar) });\n\n //Patch first oscillator into the pitch analyser.\n a >> c;\n\n //Patch the pitch analyser into the \\freq input of the second oscillator\n c >>.freq b;\n\n //Create feedback: patch b's output to a's \\fm input, mapping -1 / 1 to -200 / 300\n a.from(b, \\fm, scale:[-200, 300], time:0.5);\n});\n);\n\n//Try with different scalings (change the values)\na.from(b, \\fm, scale:[-1432, 679], time:3);\n\n//Try new base frequencies (change the value)\na.from(100, \\freq, time:2);\n\n//Bye bye\n(\na.clear({\n b.clear;\n c.clear;\n}, time:3)\n);\n```"}, {"role": "assistant", "content": "This example requires the FluCoMa tools to be installed from https://www.flucoma.org/download/."}], "family": "D3", "source_id": "quarks:AlgaLib/Examples/Extras/Alga_Flucoma_1.scd", "aug": "patch", "prompt_tokens": 461, "answer_tokens": 40}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//This example requires the FluCoMa tools to be installed from::\n//https://www.flucoma.org/download/\n\n(\nAlga.boot({\n //Sine oscillator with frequency modulation\n a = AN({ SinOsc.ar(\\freq.kr(10) + \\fm.ar(0)) }).play(chans:2);\n\n //Sine oscillator\n b = AN({ SinOsc.ar(\\freq.kr(440)) });\n\n //Loudness analyser\n c = AN({ FluidLoudness.kr(\\in.ar).dbamp });\n\n //Patch first oscillator into the pitch analyser.\n a >> c;\n\n //Patch the loudness analyser into the \\freq input of the second oscillator\n b.from(c, \\freq, scale:[0, 1, 10, 2000]);\n\n //Create feedback: patch b's output to a's \\fm input, mapping -1 / 1 to -200 / 300\n a.from(b, \\fm, scale:[-200, 300], time:0.5);\n});\n);\n\n//Change mapping for the loudness (change the values)\nb.from(c, \\freq, scale:[0, 1, -123, 210], time:6);\n\n//Try with different scalings (change the values)\na.from(b, \\fm, scale:[-1432, 679], time:3);\n\n//Try new base frequencies (change the value)\na.from(100, \\freq, time:2);\n\n//Bye bye\n(\na.clear({\n b.clear;\n c.clear;\n}, time:3)\n);\n```"}, {"role": "assistant", "content": "This example requires the FluCoMa tools to be installed from https://www.flucoma.org/download/."}], "family": "D3", "source_id": "quarks:AlgaLib/Examples/Extras/Alga_Flucoma_2.scd", "aug": "patch", "prompt_tokens": 528, "answer_tokens": 40}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//Using a second pattern as a \"player\" to trigger custom sequences and have\n//interpolation working with Pif, etc...\n(\nAlga.boot({\n ~freqStream = Pseq([440, 880], inf).asStream;\n\n ~pattern = AP((\n def: { SinOsc.ar(\\freq.kr + \\freq2.kr) * EnvPerc.ar },\n dur: \\manual,\n freq: Pfunc { ~freq },\n freq2: Pif(Pfunc { ~freq == 440 }, Pfunc { ~freq * 2 }, 0),\n time: Pfunc { (\"pattern - \" ++ ~pattern.clock.seconds.asString).postln; }\n )).play;\n\n ~player = AP((\n def: { EnvPerc.ar(release: SampleDur.ir) },\n dur: Pwhite(0.2, 0.7),\n trig: Pfunc {\n //This avoids overlaps caused by changing \\dur in the player!\n var time = ~player.clock.seconds;\n if(time != ~time, {\n ~freq = ~freqStream.next;\n ~pattern.();\n });\n ~time = time;\n },\n time: Pfunc { (\"player - \" ++ ~player.clock.seconds.asString).postln; }\n ))\n})\n);\n\n//Interpolation still works\n~pattern.from(Pfunc { ~freq * 0.5 }, \\freq, time: 5)\n~pattern.from(Pfunc { ~freq * 2 }, \\freq2, time: 5)\n\n//Thanks to ~time, there's no double trigger caused by rescheduling!\n~player.from(0.5, \\dur, sched: AlgaStep(3))\n```"}, {"role": "assistant", "content": "Using a second pattern as a \"player\" to trigger custom sequences and have interpolation working with Pif, etc..."}], "family": "D3", "source_id": "quarks:AlgaLib/Tests/PatternPlayer.scd", "aug": "patch", "prompt_tokens": 615, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//Boot Alga with the AlgaProxySpace being pushed as currentEnvironment\np = AlgaProxySpace.boot;\n\n//A simple node\n~a = { SinOsc.ar(100) };\n\n//Use it as FM input for another node\n~b.play(chans:2);\n~b.interpTime = 2;\n~b.playTime = 0.5;\n~b = { SinOsc.ar(\\freq.ar(~a).range(200, 400)) };\n\n//Replace\n~a = { SinOsc.ar(440) };\n\n//New connection as usual\n~b.from({ LFNoise1.ar(100) }, \\freq, time:3)\n\n//Reset state\np.clear(time:2);\n\n//AlgaPattern\n~c.playTime = 3;\n~c.play(chans:2);\n~c = (def: { SinOsc.ar * EnvPerc.ar }, dur: 0.5)\n\n//Replace the pattern\n~c = { Saw.ar * EnvPerc.ar * 0.7 }\n\n//Clear\n~c.clear(time:2);\n\n//AlgaPattern: differential\n~d.interpTime = 3\n~d.playTime = 2\n~d.sched = 1;\n~d.play(chans:2)\n\n//Change the 'freq:' parameter to your liking and re-evaluate.\n//The AlgaProxySpace will only consider the \"differential\" changes to the definition\n(\n~d = (\n def: { SinOsc.ar(\\freq.kr(440)) * EnvPerc.ar },\n dur: 0.5,\n freq: Pseq([440, 880], inf)\n)\n)\n```"}, {"role": "assistant", "content": "Boot Alga with the AlgaProxySpace being pushed as currentEnvironment."}], "family": "D3", "source_id": "quarks:AlgaLib/Tests/TestAlgaProxySpace.scd", "aug": "patch", "prompt_tokens": 550, "answer_tokens": 26}
{"conversations": [{"role": "user", "content": "What is `AllGui` in SuperCollider?"}, {"role": "assistant", "content": "AllGui — Overview of many globally stored objects AllGui shows many of the global storage locations in SC3: Category: JITGui."}], "family": "A", "source_id": "quarks:AllGui/HelpSource/Classes/AllGui.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 48}
{"conversations": [{"role": "user", "content": "Explain `AllGui` in SuperCollider briefly."}, {"role": "assistant", "content": "AllGui — Overview of many globally stored objects AllGui shows many of the global storage locations in SC3: Category: JITGui."}], "family": "A", "source_id": "quarks:AllGui/HelpSource/Classes/AllGui.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 48}
{"conversations": [{"role": "user", "content": "What does `AllGui.globalNames` do?"}, {"role": "assistant", "content": "the interpreter global variables as a list of"}], "family": "B", "source_id": "quarks:AllGui/HelpSource/Classes/AllGui.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 11}
@@ -29,7 +15,6 @@
{"conversations": [{"role": "user", "content": "What does `GlobalsGui.new` do? What arguments does it take?"}, {"role": "assistant", "content": "make a Arguments: numItems — the number of slots for items in a-z; parent — a parent (window or view) in which to display the GlobalsGui; bounds — the bounds within which to display it.."}], "family": "B", "source_id": "quarks:AllGui/HelpSource/Classes/GlobalsGui.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 72}
{"conversations": [{"role": "user", "content": "What is `ArdourOSC` in SuperCollider?"}, {"role": "assistant", "content": "ArdourOSC — Bindings that allow SuperCollider code to control Ardour Audio Workstation Control of all the commands found in the Ardour GUI. See source code to see all available methods."}], "family": "A", "source_id": "quarks:ArdourOSC/HelpSource/ArdourOSC.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 61}
{"conversations": [{"role": "user", "content": "Explain `ArdourOSC` in SuperCollider briefly."}, {"role": "assistant", "content": "ArdourOSC — Bindings that allow SuperCollider code to control Ardour Audio Workstation Control of all the commands found in the Ardour GUI. See source code to see all available methods."}], "family": "A", "source_id": "quarks:ArdourOSC/HelpSource/ArdourOSC.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 61}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// für dieses Programm brauchen wir eine Klasse, die im user support directory in den Extrensions abgelegt werden muss.\n\n// bitte zuerst datei kopieren, dann die Pfade durch eigene ersetzen\n\n\n(\nvar soundFilePath = \"../example-data/afguide-first.wav\".resolveRelative;\nvar labelFilePath = \"../example-data/afguide-first.txt\".resolveRelative;\ns.waitForBoot { ~labels = LabeledSoundFile.read(soundFilePath, labelFilePath) }\n);\n\n// bibliothek holen\nloadRelative(\"wortwahl-library.scd\");\n\n\n~sage.(\"the missile knows where it is at all times it knows this because it knows where it isn't by subtracting where it is from where it isn't or where it isn't from where it is whichever is greater it obtains a difference or deviation\");\n\n~sage.(\"the missile knows where it is at all times it knows this because it knows where it isn't by subtracting where it is from where it isn't or where it isn't from where it is whichever is greater it obtains a difference or deviation\".split($ ).scramble.join($ ));\n\n~unterbreche.(\"because because\");\n\n~verspreche.value(\"isn't\"); ~verspreche.value(\"knows\"); ~verspreche.value(\"is\");\n\n~verspreche.value(\"because because * \");\n\n\n~verspreche.value(\"isn't\"); ~verspreche.value(\n```"}, {"role": "assistant", "content": "für dieses Programm brauchen wir eine Klasse, die im user support directory in den Extrensions abgelegt werden muss. bitte zuerst datei kopieren, dann die Pfade durch eigene ersetzen."}], "family": "D3", "source_id": "quarks:AudacityLabels/FreieWortwahl/FreieWortwahl.scd", "aug": "patch", "prompt_tokens": 543, "answer_tokens": 82}
{"conversations": [{"role": "user", "content": "What is `AudacityLabels` in SuperCollider?"}, {"role": "assistant", "content": "AudacityLabels — Import labels from Audacity The Audacity open source sound editor, supports the marking and naming of soundfile regions (name, start, end), which may overlap with each other and which may be exported in a simple file format. This class imports such files and converts the information into a lookup dictionary of Events. If no label name has been given, the label index (an Integer) is used as a key instead. The events can then Category: Files."}], "family": "A", "source_id": "quarks:AudacityLabels/HelpSource/Classes/AudacityLabels.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 143}
{"conversations": [{"role": "user", "content": "Explain `AudacityLabels` in SuperCollider briefly."}, {"role": "assistant", "content": "AudacityLabels — Import labels from Audacity The Audacity open source sound editor, supports the marking and naming of soundfile regions (name, start, end), which may overlap with each other and which may be exported in a simple file format. This class imports such files and converts the information into a lookup dictionary of Events. If no label name has been given, the label index (an Integer) is used as a key instead. The events can then Category: Files."}], "family": "A", "source_id": "quarks:AudacityLabels/HelpSource/Classes/AudacityLabels.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 143}
{"conversations": [{"role": "user", "content": "What does `AudacityLabels.read` do? What arguments does it take?"}, {"role": "assistant", "content": "Create a new instance an read labels into the Arguments: labelPath — Path to the file that contains the label information."}], "family": "B", "source_id": "quarks:AudacityLabels/HelpSource/Classes/AudacityLabels.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 37}
@@ -633,7 +618,6 @@
{"conversations": [{"role": "user", "content": "What is `KDTree` in SuperCollider?"}, {"role": "assistant", "content": "KDTree — kd-tree data structure for efficient spatial search A kd-tree is a data structure for storing points in a Euclidean space. It is not optimised for data that changes (insertions/deletions) but is very efficient at spatial queries such as nearest-neighbour search. See http://en.wikipedia.org/wiki/Kd_tree Category: Collections > Unordered."}], "family": "A", "source_id": "quarks:KDTree/HelpSource/Classes/KDTree.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 127}
{"conversations": [{"role": "user", "content": "Explain `KDTree` in SuperCollider briefly."}, {"role": "assistant", "content": "KDTree — kd-tree data structure for efficient spatial search A kd-tree is a data structure for storing points in a Euclidean space. It is not optimised for data that changes (insertions/deletions) but is very efficient at spatial queries such as nearest-neighbour search. See http://en.wikipedia.org/wiki/Kd_tree Category: Collections > Unordered."}], "family": "A", "source_id": "quarks:KDTree/HelpSource/Classes/KDTree.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 127}
{"conversations": [{"role": "user", "content": "What does `KDTree.new` do?"}, {"role": "assistant", "content": "Create a new KDTree from an array of data. See example code"}], "family": "B", "source_id": "quarks:KDTree/HelpSource/Classes/KDTree.schelp", "aug": "none", "prompt_tokens": 29, "answer_tokens": 17}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// UnitTest.reset; UnitTestScript(\"Log\", thisProcess.nowExecutingPath).runScript;\n{\n |test|\n var logString = \"This is a test.\";\n\n Log(\\unittestlog).level = \\debug;\n\n Log(\\unittestlog).debug(logString);\n test.assertEquals(Log(\\unittestlog).lines.last.string, logString);\n test.assertEquals(Log(\\unittestlog).lines.last.level, \\debug);\n\n Log(\\unittestlog).info(logString);\n test.assertEquals(Log(\\unittestlog).lines.last.string, logString);\n test.assertEquals(Log(\\unittestlog).lines.last.level, \\info);\n\n Log(\\unittestlog).warning(logString);\n test.assertEquals(Log(\\unittestlog).lines.last.string, logString);\n test.assertEquals(Log(\\unittestlog).lines.last.level, \\warning);\n\n Log(\\unittestlog).error(logString);\n test.assertEquals(Log(\\unittestlog).lines.last.string, logString);\n test.assertEquals(Log(\\unittestlog).lines.last.level, \\error);\n\n Log(\\unittestlog).critical(logString);\n test.assertEquals(Log(\\unittestlog).lines.last.string, logString);\n test.assertEquals(Log(\\unittestlog).lines.last.level, \\critical);\n\n ~formatterHit = false;\n Log(\\unittestlog).formatter = { ~formatterHit = true };\n Log(\\unittestlog).info(logString);\n\n test.assert(~formatterHit, \"formatte\n```"}, {"role": "assistant", "content": "UnitTest.reset; UnitTestScript(\"Log\", thisProcess.nowExecutingPath).runScript;."}], "family": "D3", "source_id": "quarks:Log/Test/Log_unittest.scd", "aug": "patch", "prompt_tokens": 599, "answer_tokens": 34}
{"conversations": [{"role": "user", "content": "What is `Maths` in SuperCollider?"}, {"role": "assistant", "content": "Maths — Function Generator A Faust implementation of the MakeNoise Maths EuroRack module. Creates a logarithmic to exponential curve function that can be triggered or can oscillate. The function starts at 0, goes to 1, and returns to 0 on each iteration or loop. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "quarks:Maths/HelpSource/Maths.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 106}
{"conversations": [{"role": "user", "content": "Explain `Maths` in SuperCollider briefly."}, {"role": "assistant", "content": "Maths — Function Generator A Faust implementation of the MakeNoise Maths EuroRack module. Creates a logarithmic to exponential curve function that can be triggered or can oscillate. The function starts at 0, goes to 1, and returns to 0 on each iteration or loop. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "quarks:Maths/HelpSource/Maths.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 106}
{"conversations": [{"role": "user", "content": "What does `Maths.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Function Generator Arguments: riseDur — Duration of the signal's rise from 0.001 to 10 minutes.; fallDur — Duration of the signal's fall from 0.001 to 10 minutes.; logExp — 0 is a logarithmic curve, 1 is an exponential curve. 0.5 is linear.; loop — If 1, the function loops. If 0, the function does not loop. The cycle will start over upon receiving a value of 1.; plugged — 0 is normal operation, using internal cycle to create the input. When \"plugged\" it only reactions to tiggers coming from the trig input.; trig — An input trigger will trigger the function to happen once if loop is set to 0.."}], "family": "B", "source_id": "quarks:Maths/HelpSource/Maths.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 206}
@@ -652,7 +636,6 @@
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\na = {LFTri.ar(50+(1000*Maths2.ar(10, 10, 0.5, 1)[0]), 0, 0.1)}.play //notice how I am taking the [0]th channel of the Maths and ignoring the [1st channel.\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\na = {LFTri.ar(50+(1000*Maths2.ar(10, 10, 0.5, 1)[0]), 0, 0.1)}.play //notice how I am taking the [0]th channel of the Maths and ignoring the [1]st channel.\n```"}], "family": "E", "source_id": "quarks:Maths/HelpSource/Maths2.schelp", "aug": "mut:missing_paren", "prompt_tokens": 133, "answer_tokens": 132}
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\na = {LFTri.ar(100+(1000*Maths2.ar(MouseX.kr, MouseY.kr, 0.2, 1, 0, 1, LFPulse.ar(2))[0]), 0, 0.1}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\na = {LFTri.ar(100+(1000*Maths2.ar(MouseX.kr, MouseY.kr, 0.2, 1, 0, 1, LFPulse.ar(2))[0]), 0, 0.1)}.play\n```"}], "family": "E", "source_id": "quarks:Maths/HelpSource/Maths2.schelp", "aug": "mut:missing_paren", "prompt_tokens": 122, "answer_tokens": 121}
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\na = {\n var dur;\n\n dur = 0.1;\n\n LFTri.ar(100+(1000*Maths2.ar(dur/2, dur/2, 0.99, 1, 0, 1, LFNoise0.ar(1/dur).range(0,1))[0]), 0, 0.1)\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\na = {\n var dur;\n\n dur = 0.1;\n\n LFTri.ar(100+(1000*Maths2.ar(dur/2, dur/2, 0.99, 1, 0, 1, LFNoise0.ar(1/dur).range(0,1))[0]), 0, 0.1)\n}.play\n)\n```"}], "family": "E", "source_id": "quarks:Maths/HelpSource/Maths2.schelp", "aug": "mut:missing_paren", "prompt_tokens": 149, "answer_tokens": 149}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Test relative setting on UC4:\n\n// on the device, select grp1,\n// then go into edit mode: hold \\shift, press \\edit_setup\n// select enc1 on knob 1, change ctlmode to Ccr2,\n// hold until running bars go away -> all encoders are now relative\n\n// then test here:\nm = MKtl(\\uc4, \"*uc4\");\nm.trace;\nm.gui;\n\n// add a spec to uc4, for relative use:\n// ccr2 is up 58 ... 63 down / 65 .. 70 up,\n// so use this for good resolution on gui elements\nm.addSpec(\\knRel, [56, 72, \\lin, 1, 64]);\nm.elAt(\\kn, \\1).do(_.deviceSpec_(m.getSpec(\\knRel)));\n\n~ckeys = [\\a, \\b,\\c, \\d, \\e, \\f];\n~ckeys.do (Spec.add(_, \\amp));\nm.specs;\n// a silly sound\nNdef(\\a, {\n (VarSaw.ar((1..6) * 48.midicps, 0, 0.1)\n * ~ckeys.collect(_.kr(0)).lag(0.1)).mean;\n}).play;\n\n\nNdef(\\a).gui(6);\n\n// make the action fot the encoders:\n// - moving knob above 0 will raise level in rel steps,\n// - below middle will lower it\n\n~ckeys = Ndef(\\a).controlKeys;\nm.elAt(\\kn, \\1).action = { |el|\n RelSet(\n Ndef(\\a),\n ~ckeys[el.indexInGroup].postln,\n ((el.value - 0.5) * 0.06).postln,\n \\amp\n )\n};\n\n// now try that it works by moving knobs\n// ...\n// then set Ndef to random values\nNdef(\\a).set(* ~ckeys.collect ([_, 1.0.linrand]).flat);\n\n// a\n```"}, {"role": "assistant", "content": "Test relative setting on UC4: on the device, select grp1, then go into edit mode: hold \\shift, press \\edit_setup select enc1 on knob 1, change ctlmode to Ccr2, hold until running bars go away -> all encoders are now relative then test here:."}], "family": "D3", "source_id": "quarks:Modality-toolkit/Modality/DeviceExamples/Uc4_RelSet_example.scd", "aug": "patch", "prompt_tokens": 666, "answer_tokens": 91}
{"conversations": [{"role": "user", "content": "What is `MAbstractElement` in SuperCollider?"}, {"role": "assistant", "content": "MAbstractElement — Base class for MKtl controller elements. Abstract class for MKtl controller elements and groups. It provides the common interface that individual MKtlElements (which represent single sliders, buttons, etc) and MKtlElementGroups share. Category: Libraries > Modality, Control."}], "family": "A", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MAbstractElement.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 105}
{"conversations": [{"role": "user", "content": "Explain `MAbstractElement` in SuperCollider briefly."}, {"role": "assistant", "content": "MAbstractElement — Base class for MKtl controller elements. Abstract class for MKtl controller elements and groups. It provides the common interface that individual MKtlElements (which represent single sliders, buttons, etc) and MKtlElementGroups share. Category: Libraries > Modality, Control."}], "family": "A", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MAbstractElement.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 105}
{"conversations": [{"role": "user", "content": "What does `MAbstractElement.new` do?"}, {"role": "assistant", "content": "create a new instance, with a name, and the MKtl it will belong"}], "family": "B", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MAbstractElement.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 21}
@@ -760,8 +743,6 @@
{"conversations": [{"role": "user", "content": "What does `MKtlElement.asStream` do?"}, {"role": "assistant", "content": "pattern support - convert MKtlElement to a"}], "family": "B", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MKtlElement.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 15}
{"conversations": [{"role": "user", "content": "What does `MKtlElement.embedInStream` do?"}, {"role": "assistant", "content": "pattern support - embed MKtlElement in a stream. `// examples for direct pattern"}], "family": "B", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MKtlElement.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 27}
{"conversations": [{"role": "user", "content": "What does `MKtlElement.elemDesc` do?"}, {"role": "assistant", "content": "An Event or dictionary with a description of the element. Typically contains a deviceSpec, a type,"}], "family": "B", "source_id": "quarks:Modality-toolkit/Modality/HelpSource/Classes/MKtlElement.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 30}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// test element completeness for midi:\n\n// use an existing source device, e.g. on mac, \"IAC Driver\"\n~midisrc = MIDIClient.sources[0].device;\n\n// make all midi descs and mktls for them\n~descs = MKtlDesc.loadDescs.select { |d| d.protocol == \\midi };\n~mktls = ~descs.collect { |d|\n MKtl(d.name.asSymbol, d).openDeviceVia(~midisrc);\n};\n\n~descs.do { |d, i|\n var ddsize = d.elementsDict.size;\n var mktl = ~mktls[i];\n var mksize = mktl.elementsDict.size;\n var res = if (ddsize == mksize) { \"OK.\" } { \"wrong!!\" };\n \"% desc: % dict/mktl: % == % \\n\".postf(res, d.name, ddsize, mksize);\n mktl.free;\n};\"\";\n\n\n// tests with an individual desc\nm = MKtl(\\x, \"*oxy*\");\n// use an existing source device, e.g. on mac, \"IAC Driver\"\nx = MIDIClient.sources[0].device;\nm.openDeviceVia(x);\nm.device.midiKeyToElemDict.size;\nm.desc.elementsDict.size;\nm.device.midiKeyToElemDict.keys(SortedList).printAll;\"\";\nm.desc.elementsDict.keys(SortedList).printAll;\"\";\nm.desc.openFile;\n```"}, {"role": "assistant", "content": "test element completeness for midi: use an existing source device, e.g. on mac, \"IAC Driver\"."}], "family": "D3", "source_id": "quarks:Modality-toolkit/Modality/Tests/5_TestMidiElementCompleteness.scd", "aug": "patch", "prompt_tokens": 567, "answer_tokens": 33}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n/// Mapping data\n\n/// What is mapping?\n\n/// the relationship between incoming data and resulting sound of the parameters\n\n/// most simple mapping - button on/off\n\nk = MKtl( 'rnnd0' );\nk.gui;\n\ns.boot;\n\nSynthDef( \\testSynth, { |out=0,on=0| Out.ar( out, SinOsc.ar( 440, 0, on * 0.1 ) ) } ).add;\nx = Synth.new( \\testSynth );\n\nk.elementAt( \\bt, 1 ).action = { |but| x.set( \\on, but.value ) };\n\n// button press turns the sound on\n// button release turns sound off\n\n// reset all\nk.reset; x.free;\n\n// slightly more complex - continuous control\nSynthDef( \\testSynth2, { |out=0,on=0,amp=0| Out.ar( out, SinOsc.ar( 440, 0, on * amp ) ) } ).add;\nx = Synth.new( \\testSynth2 );\n\nk.elementAt( \\bt, 1 ).action = { |but| x.set( \\on, but.value ) };\nk.elementAt( \\throt, \\r ).action = { |el| x.set( \\amp, el.value ); };\n\n// this is slightly bumpy, so we add a lag on the amp control:\n\nx.free;\n\nSynthDef( \\testSynth2, { |out=0,on=0,amp=0| Out.ar( out, SinOsc.ar( 440, 0, on * amp.lag( 0.1 ) ) ) } ).add;\nx = Synth.new( \\testSynth2 );\n\n// we can also add a lag on the on/off control to get an envelope:\n\nx.free;\n\nSynthDef( \\testSynth2, { |out=0,on=0,amp=0| Out.ar( out, SinOsc.ar( 440, 0, on.lag(0.01,0.5) * amp.lag( 0.1 \n```"}, {"role": "assistant", "content": "Mapping data What is mapping? the relationship between incoming data and resulting sound of the parameters most simple mapping - button on/off."}], "family": "D3", "source_id": "quarks:ModalityWorkshop/modalities-sonic-expression/2_mapping.scd", "aug": "patch", "prompt_tokens": 673, "answer_tokens": 40}
{"conversations": [{"role": "user", "content": "What is `AbsApp` in SuperCollider?"}, {"role": "assistant", "content": "AbsApp — Abstract super class for the various MxApp scripting objects Each of the app objects is an code interface for an implementation class. Category: Mx."}], "family": "A", "source_id": "quarks:Mx/HelpSource/Classes/AbsApp.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 51}
{"conversations": [{"role": "user", "content": "Explain `AbsApp` in SuperCollider briefly."}, {"role": "assistant", "content": "AbsApp — Abstract super class for the various MxApp scripting objects Each of the app objects is an code interface for an implementation class. Category: Mx."}], "family": "A", "source_id": "quarks:Mx/HelpSource/Classes/AbsApp.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 51}
{"conversations": [{"role": "user", "content": "What does `AbsApp.new` do? What arguments does it take?"}, {"role": "assistant", "content": "These objects are created by accessing them from the Mx. You do not create them manually. `x = Mx.new.app; // Arguments: model; mxapp."}], "family": "B", "source_id": "quarks:Mx/HelpSource/Classes/AbsApp.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 45}
@@ -1134,11 +1115,6 @@
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// crucial-library - sends midi clock and song position pointer\n// x.add( MIDIClockOut(\"IAC Driver\", \"IAC Bus 1\") )\n\nMxUnit.register('MIDIClockOut',\n(\n make: { arg mco;\n ~source = mco;\n MxUnit(mco, [], [])\n },\n spawnToBundle: { arg b;\n b.addFunction({~source.start}.inEnvir)\n },\n stopToBundle: { arg b;\n b.addFunction({~source.stop}.inEnvir)\n }\n /*,\n gotoBeat: { arg beat, atBeat, bundle;\n [beat, atBeat, bundle].debug;\n ~source.gotoBeatAtBeat(beat, atBeat)\n }*/\n\n));\n```"}, {"role": "assistant", "content": "crucial-library - sends midi clock and song position pointer x.add( MIDIClockOut(\"IAC Driver\", \"IAC Bus 1\") )."}], "family": "D3", "source_id": "quarks:Mx/drivers/MIDIClockOut.scd", "aug": "patch", "prompt_tokens": 299, "answer_tokens": 48}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// if NTMI.helloSnd is not already defined in startup file, do this:\nfork {\n NTMI.numChans.do { |i|\n { LFDNoise3.ar(\n XLine.kr(\n exprand(2000, 5000),\n exprand(2000, 20000),\n 0.25, doneAction: 2),\n 0.1\n )\n }.play(outbus: i);\n 0.25.wait;\n };\n}\n```"}, {"role": "assistant", "content": "if NTMI.helloSnd is not already defined in startup file, do this:."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/0_helloSound.scd", "aug": "patch", "prompt_tokens": 173, "answer_tokens": 25}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// NTMI.zoom sets all the influx'es inScalers AND RandomOrbit's excursion from current state.\n\nNTMI.zoom = NTMI.zoom?1;\n\n// tune this for jitter on zoom pot on NTMI\nSpec.add(\\zoom, [0, 1, \\lin, 0.025]);\n\nNTMI.setZoom = {|ev, val|\n val = \\zoom.asSpec.constrain(val);\n // \"global ZOOM f. RandomOrbits and Influxes: %\\n\".postf(val);\n NTMI.zoom = val;\n\n NTMI.inphlux.inScaler = NTMI.zoom;\n \"zoom: %\\n\".postf(NTMI.zoom);\n // return value\n val\n};\n// increment / decrement\nNTMI.incZoom = {|ev, inc=0.1|\n NTMI.setZoom((NTMI.zoom + inc));\n};\n```"}, {"role": "assistant", "content": "NTMI.zoom sets all the influx'es inScalers AND RandomOrbit's excursion from current state."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/3_interfaces/0c_influxZOOM_modes.scd", "aug": "patch", "prompt_tokens": 356, "answer_tokens": 39}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// RandomOrbit chordal keyboard example:\n//\n// 6 keys with two states - this is the maximum for macOS keyboards\n// - if pressed within chordTime, the bits accumulate, then fire as one change\n// - if all released to 0 within chordTime, the chord number before releases is held\n\n/// for nufo, update to 8 pads\n/// make sure pads release fast enough and evenly enough\n/// so that holding last random chord works!\n\n\n(\nNTMI.ro = NTMI.ro ? ();\nNTMI.ro.bits = 0 ! 6;\nNTMI.ro.letterKeys = \"weruio\"; // macOS only allows 6 keys at the same time\nNTMI.ro.powers = [1, 2, 4, 8, 16, 32];\nNTMI.ro.num = { |ro| (ro.powers * ro.bits).sum };\nNTMI.ro.firstval = 1;\nNTMI.ro.collecting = false;\nNTMI.ro.lastval = 1;\nNTMI.ro.str = { |ro| NTMI.ro.bits.join + \"->\" + NTMI.ro.num };\n\nNTMI.ro.chordTime = 0.03;\nNTMI.ro.font = Font(Font.defaultMonoFace, 21);\nNTMI.ro.bigFont = Font(Font.defaultMonoFace, 34);\n\nNTMI.ro.getPressed = { |dict, index, value|\n if (NTMI.ro.collecting.not) {\n \"collecting ...\".postln;\n NTMI.ro.firstval = NTMI.ro.num;\n NTMI.ro.collecting = true;\n defer { NTMI.ro.uv.refresh };\n };\n NTMI.ro.bits[index] = value;\n // use Tdef to unschedule if already\n NTMI.ro.endTask.stop.play;\n};\n\n\nN\n```"}, {"role": "assistant", "content": "RandomOrbit chordal keyboard example: 6 keys with two states - this is the maximum for macOS keyboards - if pressed within chordTime, the bits accumulate, then fire as one change - if all released to 0 within chordTime, the chord number before releases is held for nufo, update to 8 pads make sure pads release fast enough and evenly enough so that holding last random chord works!."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/3_interfaces/5b_RandomOrbit_switcher.scd", "aug": "patch", "prompt_tokens": 642, "answer_tokens": 123}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// nonstandard synthesis hoelzl style\n// hh beijing 2005-\n// made quad/MC 2019\nq=q?();\nq.numChans = q.numChans ? 2;\n\nNdef(\\allArm).addSpec(\\topfreq, [20, 100000, \\exp, 1]);\nNdef(\\allArm).addSpec(\\filtfreq, [8, 100000, \\exp, 1]);\nNdef(\\allArm).addSpec(\\divefreq, [0.05, 20, \\exp, 0.01]);\n\n// basic mapping notes\nNdef(\\allArm).addHalo(\\gamePadMap, (\n joyLX: \\topfreq,\n joyLY: \\divefreq,\n joyRX: \\filtfreq,\n joyRY: \\amp)\n);\n\n\nNdef(\\allArm, { arg amp=0, divefreq=0.2, topfreq= 10000, filtfreq=20;\n var mintime, source;\n mintime = (LFDNoise0.kr(20! q.numChans, 0.5, 1) * topfreq).reciprocal;\n source = LeakDC.ar(\n CombN.ar(\n Decay.ar(\n Dust.ar(0.6 ! q.numChans, 1) + BrownNoise.ar(0.0005),\n 0.2,\n WhiteNoise.ar(1 ! q.numChans) * LFDNoise0.kr(0.4, 0.5, 0.5)\n ),\n 2.2,\n (SinOsc.kr(divefreq, 0.2, 0.7, 0.7)\n + LFDNoise3.kr(divefreq * 2.6, 0.4, 0.0)).max(mintime).min(2.2),\n 1\n )\n );\n Sanitize.ar(\n Limiter.ar(\n OnePole.ar(([ HPF.ar(source, filtfreq), LPF.ar(source, filtfreq, 4) ].sum * amp).distort, 0.2),\n 0.7\n )\n );\n});\n\n/* tests\nNdef(\\allArm).gui;\nNdef(\\allArm).play;\n\nNdef(\\allArm).vol_(0.1);\nNdef(\\allArm).set(\\filtfreq\n```"}, {"role": "assistant", "content": "nonstandard synthesis hoelzl style hh beijing 2005- made quad/MC 2019."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/allArm.scd", "aug": "patch", "prompt_tokens": 741, "answer_tokens": 31}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Blip thru Formlet, pseudo-vocal synthesis.\n// hh&adc, since beijing 2005\n// 2019 made quad/MC\n\n// keywords: vocal, voice, formants\n\n/*\nNdef(\\formSing).gui;\nNdef(\\formSing).play;\nNdef(\\formSing).getHalo(\\stepFdev).value;\n*/\nNdef(\\formSing).addSpec(\\root, [20, 500, 6]);\nNdef(\\formSing).addSpec(\\formfrq, [50, 5000, \\exp]);\nNdef(\\formSing).addSpec(\\harm, [1, 256, \\exp]);\nNdef(\\formSing).addSpec(\\formLag, [0.01, 100, \\exp]);\nNdef(\\formSing).addSpec(\\ndiv, [0.01, 1, \\exp]);\nNdef(\\formSing).addSpec(\\fdev, [0, 24, \\amp]);\nNdef(\\formSing).addSpec(\\round, [0, 3, \\amp, 0.05]);\n\n(\n// modulating formant frequency\nNdef(\\formSing, { arg amp=0, root=150, formfrq=500, harm=20, fdev=2, ndiv = 0.2, formLag=0.1, round = 1.5;\n var freqCompare = 1; // ((formfrq / root).log2).abs.min(1).linexp(0, 1, 0.25, 1);\n var in = Blip.ar(\n root.lag(formLag) * LFNoise0.kr(root * ndiv ! q.numChans, fdev.max(0.01) ).midiratio,\n harm.lag(formLag), // .max(formfrq / root * 0.25),\n 0.1\n ) * GrayNoise.ar(0.1 ! q.numChans, 1);\n\n Limiter.ar(Formlet.ar(in, formfrq.lag(formLag), 0.005, 0.02) * (freqCompare * amp.lag(0.1)))\n .softclip;\n});\n);\n```"}, {"role": "assistant", "content": "Blip thru Formlet, pseudo-vocal synthesis. hh&adc, since beijing 2005 2019 made quad/MC keywords: vocal, voice, formants."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/formSing.scd", "aug": "patch", "prompt_tokens": 674, "answer_tokens": 57}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// simple varsaw modulation network, adc&hh 2014\n// maybe add kr/lofreq VarSaws as strobes on the output?\n\n/* listening to \\varsawFB: \"Klatschen die alle?\" - \"nein, das klingt nur so\" - \"Und was klingt so wie grüne Augen, wie grünes Gras?\" (JH)\n*/\n\nNdef(\\varsawFB).addSpec(\\minFreq, [1, 20000, \\exp]);\nNdef(\\varsawFB).addSpec(\\maxFreq, \\widefreq);\nNdef(\\varsawFB).addSpec(\\width, [0.001, 0.999]);\nNdef(\\varsawFB).addSpec(\\lagFreq, [200, 20000, \\exp]);\nNdef(\\varsawFB).addSpec(\\freqDev, [0, 1, \\amp]);\nNdef(\\varsawFB).addSpec(\\freqRate, [0.01, 100, \\exp]);\nNdef(\\varsawFB).addSpec(\\dens, [0.2, 1, 2]);\n\n// VarSaw, strobe variant:\n(\nNdef(\\varsawFB, { |amp = 0.25, width = 0.5,\n lagFreq = 1000, minFreq = 0.1, maxFreq = 10000,\n freqDev = 0.25, freqRate = 0.3, dens=0.9|\n // 8 VarSaws controlling each others frequencies\n var num = 13;\n var saws = [];\n var mod = LocalIn.ar(1);\n var freq = mod.exprange(minFreq, maxFreq);\n var ampcomp = AmpComp.kr(freq, 100).min(1) * amp;\n var strobe;\n width = (width * 2 - 1) ** 0.25 + 1 * 0.5;\n\n num.do { |i|\n var num1 = num - 1;\n var freqMod = (2 ** LFDNoise3.kr(freqRate, freqDev));\n var saw = VarSaw.ar(freq * freqMod, Rand(), width);\n // fil\n```"}, {"role": "assistant", "content": "simple varsaw modulation network, adc&hh 2014 maybe add kr/lofreq VarSaws as strobes on the output?."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/varsawFB.scd", "aug": "patch", "prompt_tokens": 714, "answer_tokens": 43}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// nonstandard synthesis hoelzl style\n// hh beijing 2005-\n// made quad/MC 2019\nq=q?();\nq.numChans = q.numChans ? 2;\n\nNdef(\\allArm, { arg amp=0, divefreq=0.2, topfreq= 10000, filtfreq=20;\n var mintime, source;\n mintime = (LFDNoise0.kr(20! q.numChans, 0.5, 1) * topfreq).reciprocal;\n source = LeakDC.ar(\n CombN.ar(\n Decay.ar(\n Dust.ar(0.6 ! q.numChans, 1) + BrownNoise.ar(0.0005),\n 0.2,\n WhiteNoise.ar(1 ! q.numChans) * LFDNoise0.kr(0.4, 0.5, 0.5)\n ),\n 2.2,\n (SinOsc.kr(divefreq, 0.2, 0.7, 0.7)\n + LFDNoise3.kr(divefreq * 2.6, 0.4, 0.0)).max(mintime).min(2.2),\n 1\n )\n );\n Sanitize.ar(\n Limiter.ar(\n OnePole.ar(([ HPF.ar(source, filtfreq), LPF.ar(source, filtfreq, 4) ].sum * amp).distort, 0.2),\n 0.7\n )\n );\n});\n\nNdef(\\allArm).addSpec(\\topfreq, [20, 100000, \\exp, 1]);\nNdef(\\allArm).addSpec(\\filtfreq, [8, 100000, \\exp, 1]);\nNdef(\\allArm).addSpec(\\divefreq, [0.05, 20, \\exp, 0.01]);\n\n// basic mapping notes\nNdef(\\allArm).addHalo(\\gamePadMap, (\n joyLX: \\topfreq,\n joyLY: \\divefreq,\n joyRX: \\filtfreq,\n joyRY: \\amp)\n);\n\nfork { s.sync; 0.1.wait; Ndef(\\allArm).end };\n\nNdef(\\allArm);\n\n/* tests\nNdef(\\allArm).gui;\nNdef(\\allAr\n```"}, {"role": "assistant", "content": "nonstandard synthesis hoelzl style hh beijing 2005- made quad/MC 2019."}], "family": "D3", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/backupsORIGs/allArm_ORIG.scd", "aug": "patch", "prompt_tokens": 740, "answer_tokens": 31}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n/// measuring lastUpdateTime from MKtls,\n/// to display which interfaces were recently active\n~time = ();\n~time.actives = [ MKtl(\\ntmi), MKtl(\\uc4), MKtl(\\ferrari) ];\n~time.times = ();\n~time.spec = [1000, 1, \\exp].asSpec;\n~time.actives.do { |mk| ~time.times.addSpec(mk.name, ~time.spec) };\n\n~time.egui = EnvirGui(~time.times);\n\n~time.times.getSpec\n\n~time.skip.stop.free;\n~time.skip = SkipJack({\n ~time.actives.do { |mk|\n ~time.times.put(mk.name, mk.timeSinceLast)\n }\n});\n~time.skip.dt = 0.5;\n\nMKtl(\\ntmi).elAt(\\battery).action.cs;\n\nl = List.new(1024);\nMKtl(\\ntmi).elAt(\\battery).action = { |el|\n var val = el.deviceValue;\n // l.add(val);\n // val.postln;\n // if (val > 0) { val.postln };\n};\n\nl.postcs;\n```"}, {"role": "assistant", "content": "measuring lastUpdateTime from MKtls, to display which interfaces were recently active."}], "family": "D3", "source_id": "quarks:NTMI/Work/Sketches/timeMktl.scd", "aug": "patch", "prompt_tokens": 443, "answer_tokens": 29}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// q.zoom sets all the influx'es inScalers AND RandomOrbit's excursion from current state.\n\nq.zoom = q.zoom?1;\n\nq.setZoom = {|ev, val|\n val = val.clip(0.05, 1.0).round(0.05);\n // \"global ZOOM f. RandomOrbits and Influxes: %\\n\".postf(val);\n q.zoom = val;\n // do external funcs here\n try{ q.prez.ezs.value = q.zoom };\n q.inphlux.inScaler = q.zoom;\n // return value\n val\n};\n// increment / decrement\nq.incZoom = {|ev, inc=0.1|\n q.setZoom((q.zoom + inc));\n};\n\n\n// set it to poti on ana in 8 (it was 7, not worked)\nMKtl(\\xosc).elAt('inA').at(7).action.add(\\setZoom, {|el|\n var val = el.value.clip(0.05, 1).round(0.05);\n if (val != q.zoom) {\n \"zoom from xosc: %\\n\".postf(val);\n q.setZoom(val)\n };\n});\n```"}, {"role": "assistant", "content": "q.zoom sets all the influx'es inScalers AND RandomOrbit's excursion from current state."}], "family": "D3", "source_id": "quarks:NTMI/Work/xosc_backup/6_influxZOOM_in_out.scd", "aug": "patch", "prompt_tokens": 436, "answer_tokens": 36}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n////////////// xosc nufo is unused by now ///////////\n// OSCdef(\\xoscAlive, { |msg, time|\n// if (NTMI.nufo.lastInTime == 0 or: { NTMI.nufo.timeSinceLast > 10 }) {\n// Tdef(\\allLEDs).play;\n// };\n// NTMI.nufo.deviceName = \\xosc;\n// NTMI.nufo.lastInTime = time;\n// }, \"/imu\").permanent_(true);\n```"}, {"role": "assistant", "content": "xosc nufo is unused by now /////////// OSCdef(\\xoscAlive, { |msg, time| if (NTMI.nufo.lastInTime == 0 or: { NTMI.nufo.timeSinceLast > 10 }) { Tdef(\\allLEDs).play; }; NTMI.nufo.deviceName = \\xosc; NTMI.nufo.lastInTime = time; }, \"/imu\").permanent_(true);."}], "family": "D3", "source_id": "quarks:NTMI/Work/xosc_backup/xosc_ballet.scd", "aug": "patch", "prompt_tokens": 215, "answer_tokens": 149}
@@ -1262,7 +1238,6 @@
{"conversations": [{"role": "user", "content": "What does `OpenObject.openProxies` do?"}, {"role": "assistant", "content": "Register the proxy classes Tdef, Ndef, Pdef, Pdefn, Ndef and Fdef (convenience"}], "family": "B", "source_id": "quarks:OpenObject/HelpSource/Classes/OpenObject.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 32}
{"conversations": [{"role": "user", "content": "What does `OpenObject.openInterpreter` do? What arguments does it take?"}, {"role": "assistant", "content": "Open the interpreter for external access. Do this only if you know what you are Arguments: addr — Address from which the messages come. `nil` means any. If a replyID (an Integer) is given, sends back a reply: The results are sent back to the sender under the OSC command `\"/oo_reply\" replyID val1 val2 …` `\"/oo_i\" string`."}], "family": "B", "source_id": "quarks:OpenObject/HelpSource/Classes/OpenObject.schelp", "aug": "none", "prompt_tokens": 43, "answer_tokens": 113}
{"conversations": [{"role": "user", "content": "What does `OpenObject.avoidTheWorst` do?"}, {"role": "assistant", "content": "A Boolean to de/activate a layer of extra protection. By default this is true and will block strings that contain `unixCmd`, `systemCmd`, `Pipe` and `File`. To turn off the protection set this to false."}], "family": "B", "source_id": "quarks:OpenObject/HelpSource/Classes/OpenObject.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 74}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// example for granulating a soundfile using gui built in MaxMSP.\n// see attached file 'oo_soundfiles.maxpat'.\n// SuperCollider listens on port 57120, so messages must be sent to this port.\n\n(\ns.waitForBoot{\n var func, buffers, synth;\n SynthDef(\\granulate, {|buf, out= 0, gate= 1,\n vol= 0,//overal volume in db (0 = unity gain)\n atk= 0.01, rel= 1,//cross fade times when changing buffer\n posMin= 0, posMax= 1, posRate= 1,//buffer offset boundaries and rate of chage\n panMin= -1, panMax= 1, panRate= 1,//panning boundaries and rate of change\n pchMin= 0.9, pchMax= 1.1, pchRate= 1,//playback speed boundaries and rate of chage\n trgMin= 0.005, trgMax= 0.5, trgRate= 1,//trigger density\n durMin= 0.005, durMax= 0.5, durRate= 1//duration boundaries and rate of change\n |\n var env= EnvGen.kr(Env.asr(atk, 1, rel), gate, doneAction:2);\n var pos= LFDNoise1.kr(posRate).range(posMin, posMax);\n var pan= LFDNoise1.kr(panRate).range(panMin, panMax);\n var pch= LFDNoise1.kr(pchRate).range(pchMin, pchMax);\n var trg= Impulse.kr(1/LFDNoise1.kr(trgRate).exprange(trgMin.max(0.001), trgMax.max(0.001)));\n var dur= LFDNoise1.kr(durRate).exprange(durMin.max(0.001), durMax);\n \n```"}, {"role": "assistant", "content": "example for granulating a soundfile using gui built in MaxMSP. see attached file 'oo_soundfiles.maxpat'. SuperCollider listens on port 57120, so messages must be sent to this port."}], "family": "D3", "source_id": "quarks:OpenObject/examples2/oo_soundfiles.scd", "aug": "patch", "prompt_tokens": 647, "answer_tokens": 71}
{"conversations": [{"role": "user", "content": "What is `PV_Control` in SuperCollider?"}, {"role": "assistant", "content": "PV_Control — Tracks Magnitudes and Reduces Output of Bins Tracks the Magnitudes of N bins of an FFT and Reduces Output of those Bins whose magnitude exceeds a threshold for a finite period. Category: UGens > FFT."}], "family": "A", "source_id": "quarks:PV_Control/HelpSource/PV_Control.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 93}
{"conversations": [{"role": "user", "content": "Explain `PV_Control` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Control — Tracks Magnitudes and Reduces Output of Bins Tracks the Magnitudes of N bins of an FFT and Reduces Output of those Bins whose magnitude exceeds a threshold for a finite period. Category: UGens > FFT."}], "family": "A", "source_id": "quarks:PV_Control/HelpSource/PV_Control.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 93}
{"conversations": [{"role": "user", "content": "What does `PV_Control.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Tracks Magnitudes and Reduces Output of Bins Arguments: buffer0 — Buffer created by the FFT when analysing the incoming signal.; buffer1 — Buffer to which PV_Control writes the alterations to be made to the magnitude of each bin. These values are scaled to be sent to MidEQ UGens, which will reduce the magnitude of the bins being attenuated. thresh=0.6, mulFactor=0.8, limiter=10, attackReleaseFrames=50, sustainZeroFrames= 100, waitGoFra; thresh — Magnitude is summed over time and multiplied by mulFactor. When a bin accumulates magnitude that crosses this threshold, it will be zeroed out. Lower numbers == quicker detection of feedback.; mulFactor — Summed amplitude over time is multiplied by this number. Lower numbers == quicker detection of feedback.; limiter — Limits the maximum magnitude of each of the bins.; attackReleaseFrames — The number of frames the algorithm takes to ramp the magnitude of the bin down from 1*mag to 0*mag.; sustainZeroFrames — The number of frames the bin is held to a magnitude of 0.; waitGoFrames — The number of frames algorithm waits before it starts to duck the incoming signal.."}], "family": "B", "source_id": "quarks:PV_Control/HelpSource/PV_Control.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 426}
@@ -1370,10 +1345,6 @@
{"conversations": [{"role": "user", "content": "Explain `SynthFile` in SuperCollider briefly."}, {"role": "assistant", "content": "SynthFile — Write synth objects into File A tool for automatially spatialising Ndefs. Category: Libraries > Radicles."}], "family": "A", "source_id": "quarks:Radicles/HelpSource/Classes/SynthFile.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 49}
{"conversations": [{"role": "user", "content": "What does `SynthFile.read` do? What arguments does it take?"}, {"role": "assistant", "content": "Read file with classes and synth Arguments: Specify Radicles Class.; Key to identify synth object.."}], "family": "B", "source_id": "quarks:Radicles/HelpSource/Classes/SynthFile.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 38}
{"conversations": [{"role": "user", "content": "What does `SynthFile.write` do? What arguments does it take?"}, {"role": "assistant", "content": "Write synth object for spcecific class into Arguments: Specify Radicles Class.; Key to identify synth object.; Object to write into file.."}], "family": "B", "source_id": "quarks:Radicles/HelpSource/Classes/SynthFile.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 49}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Block.play called from SC code takes names as Strings or Symbols (6 Nov\n// 2026). Before, a String block name found no definition and nothing played\n// (the action still ran), and a String buffer name was read as an array of\n// buffers, one per letter (an error in BStore.addAll).\n\n~radPlayForm = {|blockName, buffer|\n var cond = Condition(false);\n Block.play(1, blockName, buffer, action: { cond.test = true; cond.signal });\n cond.wait;\n 0.3.wait;\n};\n\n~radTest.(\"play-string-names\",\n setup: [\"start 2\"],\n code: { ~radPlayForm.(\"play\", \"marilyn1\") },\n check: {\n var live = Block.liveBlocks[0];\n case\n { live.isNil } { \"nothing playing\" }\n { live[1] != \\play } { \"block \" ++ live[1].cs }\n { live[2] != [\\play, \\audio, \\marilyn1] } { \"buffer \" ++ live[2].cs }\n { Ndef(\\block1).source.isNil } { \"no source\" }\n { true }\n }\n);\n\n~radTest.(\"play-string-block-no-buffer\",\n setup: [\"start 2\"],\n code: { ~radPlayForm.(\"sine\") },\n check: {\n var live = Block.liveBlocks[0];\n (live.notNil and: { live[1] == \\sine } and: { Ndef(\\block1).get(\\freq) == 440 }) or: { \"live \" ++ live.cs }\n }\n);\n\n~radTest.(\"play-symbol-names\",\n setup: [\"start 2\"],\n code: { ~radPlayForm.(\\pl\n```"}, {"role": "assistant", "content": "Block.play called from SC code takes names as Strings or Symbols (6 Nov 2026). Before, a String block name found no definition and nothing played (the action still ran), and a String buffer name was read as an array of buffers, one per letter (an error in BStore.addAll)."}], "family": "D3", "source_id": "quarks:Radicles/Tests/cases/block-play-forms.scd", "aug": "patch", "prompt_tokens": 625, "answer_tokens": 92}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Issue #51: commands that arrive while a block is still loading (buffer and\n// server sync), before its function goes into the Ndef. Sending two commands\n// back to back with no wait hits that window every time.\n\n~radBufIDs = { (BStore.bstoreIDs ? []).collect(_.cs) };\n\n// st while loading cancels the start: nothing goes into the Ndef and the\n// buffer it was loading is freed\n~radTest.(\"stop-while-loading\",\n setup: [\"start 2\"],\n code: {\n Radicles.cW.callFunc(\"pl 1 drums1\");\n Radicles.cW.callFunc(\"st 1\");\n 3.wait;\n },\n check: {\n (Ndef('block1').source.isNil and: { Block.liveBlocks[0].isNil } and: { ~radBufIDs.().isEmpty })\n or: { \"source: \" ++ Ndef('block1').source.cs ++ \", live: \" ++ Block.liveBlocks[0].cs\n ++ \", buffers: \" ++ ~radBufIDs.() }\n }\n);\n\n// a second pl while the first is still loading wins cleanly: only the second\n// goes into the Ndef, and the first one's buffer is freed\n~radTest.(\"second-play-wins-while-loading\",\n setup: [\"start 2\"],\n code: {\n Radicles.cW.callFunc(\"pl 1 drums1\");\n Radicles.cW.callFunc(\"pl 1 marilyn1\");\n 4.wait;\n },\n check: {\n var bufs = ~radBufIDs.();\n (Block.liveBlocks[0].notNil and: { bufs.size == 1 } and\n```"}, {"role": "assistant", "content": "Issue #51: commands that arrive while a block is still loading (buffer and server sync), before its function goes into the Ndef. Sending two commands back to back with no wait hits that window every time."}], "family": "D3", "source_id": "quarks:Radicles/Tests/cases/block-start-race.scd", "aug": "patch", "prompt_tokens": 612, "answer_tokens": 66}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// The call window's parser: how a typed word becomes a number, a range, an\n// array or a name.\n\n~radParserClean = {\n (RadUnit.presetRoot +/+ \"filter/*/radtest_*.scd\").pathMatch.do{|path| File.delete(path) };\n};\n\n// a name with a dash is a name: it was taken for a range (warm-shift ->\n// [warm, shift]) and the command failed (review, 18 Nov 2026)\n~radTest.(\"dash-name-preset\",\n setup: [\"start 2\", \"fx t 1 pch\", \"fxset t 1 1 pitchRatio 0.5\"],\n cmds: [\"fxsave t 1 1 radtest_warm-shift\", \"fxset t 1 1 pitchRatio 2\", [\"fxload t 1 1 radtest_warm-shift\", 3]],\n check: {\n case\n { File.exists(RadUnit.presetPath(\\filter, \\pch, 'radtest_warm-shift')).not } { \"the preset was not saved\" }\n { Ndef(\\filterTrack_1_1).get(\\pitchRatio) != 0.5 } { \"pitchRatio \" ++ Ndef(\\filterTrack_1_1).get(\\pitchRatio) }\n { true }\n },\n teardown: ~radParserClean\n);\n\n// a name with a dash and digits (kick-01), and one that starts with a digit\n~radTest.(\"dash-name-digits\",\n setup: [\"start 2\", \"fx t 1 pch\"],\n cmds: [\"fxsave t 1 1 radtest_kick-01\", \"fxsave t 1 1 radtest_2-b\"],\n check: {\n ['radtest_kick-01', 'radtest_2-b'].every{|name| File.exists(RadUnit.presetPath(\\filter, \\pch, name)) }\n or: { \"p\n```"}, {"role": "assistant", "content": "The call window's parser: how a typed word becomes a number, a range, an array or a name."}], "family": "D3", "source_id": "quarks:Radicles/Tests/cases/parser.scd", "aug": "patch", "prompt_tokens": 641, "answer_tokens": 29}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Fixes from the 18 Nov 2026 review.\n\n// the document's strip at an address, values refreshed from the running system\n~radStripNow = {|name| RadUnit.refresh(RadDoc.current.copy).at(name) ? () };\n// the strips among names whose value key has no modulator, as a String, or true\n~radModsOn = {|names, key|\n var missing = names.reject{|name|\n (~radStripNow.(name)[\\mods] !? {|mods| mods[key] }).notNil };\n missing.isEmpty or: { \"no \" ++ key ++ \" modulator on \" ++ missing.cs }\n};\n\n// a range of mixer positions modulates every strip in it, not only the last\n// one (vol, pan, trim with a dash range and a modulator). Typed in the call\n// window this always worked: there the command runs on the GUI thread, where\n// defer runs at once. It went wrong when the command ran on another thread\n// (a controller or a scheduled command): the deferred calls ran after the\n// loop and all saw the last track. So these run the command from SystemClock.\n~radOffGuiThread = {|cmd, wait = 3|\n fork({ Radicles.cW.callFunc(cmd) }, SystemClock);\n wait.wait;\n};\n\n~radTest.(\"range-mod-vol\",\n setup: [\"start 3\"],\n code: { ~radOffGuiThread.(\"vol 1-3 sin\") },\n check: { ~radModsOn.([\\track1, \\track2, \\track3], \\vo\n```"}, {"role": "assistant", "content": "Fixes from the 18 Nov 2026 review. the document's strip at an address, values refreshed from the running system."}], "family": "D3", "source_id": "quarks:Radicles/Tests/cases/review-fixes.scd", "aug": "patch", "prompt_tokens": 565, "answer_tokens": 34}
{"conversations": [{"role": "user", "content": "What is `Rational` in SuperCollider?"}, {"role": "assistant", "content": "Rational — Rational number A rational number. Alternative syntax: `x %/ y` Category: Math."}], "family": "A", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 32}
{"conversations": [{"role": "user", "content": "Explain `Rational` in SuperCollider briefly."}, {"role": "assistant", "content": "Rational — Rational number A rational number. Alternative syntax: `x %/ y` Category: Math."}], "family": "A", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 32}
{"conversations": [{"role": "user", "content": "What does `Rational.new` do?"}, {"role": "assistant", "content": "Rational also accepts Floats and Strings in its `new` instantiation method. This class will always reduce a rational expression to its lowest terms (e.g. `3 %/ 2` instead of `6 %/ 4`). `Rational(6,4) // -> 3 %/"}], "family": "B", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "none", "prompt_tokens": 27, "answer_tokens": 75}
@@ -1391,72 +1362,27 @@
{"conversations": [{"role": "user", "content": "What does `Rational.mod` do?"}, {"role": "assistant", "content": "Remainder, taking the sign of the divisor as sclang's does. `(1 %/ 3).mod(1 %/ 7) // -> 1 %/"}], "family": "B", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "none", "prompt_tokens": 27, "answer_tokens": 40}
{"conversations": [{"role": "user", "content": "What does `Rational.wrap` do?"}, {"role": "assistant", "content": "Map into a range, wrapping or reflecting. These follow"}], "family": "B", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "none", "prompt_tokens": 29, "answer_tokens": 16}
{"conversations": [{"role": "user", "content": "What does `Rational.do` do?"}, {"role": "assistant", "content": "Iterate as a number, counting exactly as the equivalent Float does. `(7 %/ 2).floor.do { |i| i.postln }; // 0, 1,"}], "family": "B", "source_id": "quarks:Rational/HelpSource/Rational.schelp", "aug": "none", "prompt_tokens": 28, "answer_tokens": 51}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// a SynthDef that has mouse controlled modulation;\n // will sound different based on mousepos at server!\n(\nSynthDef(\\xxy, {|out, sustain = 1, freq = 440|\n var env, son;\n env = Line.ar(1, 0, sustain, doneAction: 2);\n son = SinOsc.ar(\n freq * [1, 1.2, 1.5, 1.7] + (env % (1 - env *0.1) * 1000), \n SinOsc.ar(40) * MouseX.kr(0, 40) * (1 - env)\n ).sum;\n Out.ar(out, son * env * 0.1);\n}).share;\n);\n\n // repeat it \n(\nTdef(\\x, { \n loop { \n 0.5.wait; \n (instrument: \\xxy, freq: 600, server: r.servers.choose).play\n }\n}).play\n);\n\n // get a mouse value from sending machine, \n // and use it to control freq - other mousecontrol\n // is still measured at receiving server\n(\nTdef(\\x, { \n var getmouse = GetMouseX(200, 10000, \\exponential, server: r.servers[\\adc]);\n loop { \n \n 0.5.wait; \n (instrument: \\xxy, freq: getmouse.value.postln, server: r.servers.choose).play\n }\n}).play\n);\n\n // make sound modulation more drastic\n // can do this while task runs!\n(\nSynthDef(\\xxy, {|out, sustain = 1, freq = 440|\n var env, son;\n env = Line.ar(1, 0, sustain, doneAction: 2);\n son = SinOsc.ar(freq * [1, 1.2, 1.5, 1.7] + (env % (1 - env *0.1) * 1000), SinOsc.ar(40) * ExpRand(1, 10\n```"}, {"role": "assistant", "content": "a SynthDef that has mouse controlled modulation; will sound different based on mousepos at server!."}], "family": "D3", "source_id": "quarks:Republic/moredoc/AnotherSynth_randMouse.scd", "aug": "patch", "prompt_tokens": 618, "answer_tokens": 31}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\JPverb;\n~description = \"A mono reverb\";\n~channelLayout = \\mono;\n\n~function = { |in, t60 = 1, damp = 0, size = 1, earlyDiff = 0.707, modDepth = 0.1, modFreq = 2, low = 1, mid = 1, high = 1, lowcut = 500, highcut = 2000|\n\n var sig = JPverb.ar(\n in: In.ar(in),\n t60: t60,\n damp: damp,\n\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/JPverb.scd", "aug": "patch", "prompt_tokens": 536, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\Limiter;\n~description = \"A simple limiter\";\n~channelLayout = \\mono;\n\n~function = { arg in, level=0.7, dur=0.01, outputDB=0;\n outputDB.dbamp * Limiter.ar(In.ar(in), level, dur);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/Limiter.scd", "aug": "patch", "prompt_tokens": 474, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\envFollow;\n~description = \"Send a trigger based on envelope threshold\";\n~channelLayout = \\mono;\n\n~function = { arg in, triggerLevel=0.2, debounce=1 ;\n var mic = In.ar(in),\n amplitude = Amplitude.kr(mic),\n env = EnvFollow.kr(mic, 0.999),\n trig = amplitude > triggerLevel,\n timer = Timer.kr(trig),\n \n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/envFollow.scd", "aug": "patch", "prompt_tokens": 542, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\freeverb;\n~description = \"A very simple reverb\";\n~channelLayout = \\mono;\n~function = { arg in, mix=1.0, room=0.5, damp=0.5, outputDB=0;\n outputDB.dbamp * FreeVerb.ar(In.ar(in), mix, room, damp);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/freeverb.scd", "aug": "patch", "prompt_tokens": 489, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\gverb;\n~description = \"A simple reverb based on the GVerb UGen\";\n~channelLayout = \\mono;\n~function = { arg in, roomsize=50, revtime=3, damping=0.5, inputbw=0.5, spreadEffect=15, drylevel=1, earlylevel=0.7, taillevel=0.5, maxroomsize=300, outputDB=0;\n outputDB.dbamp * Mix.fill(1,GVerb.ar(\n I\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/gverb.scd", "aug": "patch", "prompt_tokens": 537, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\hallverb;\n~description = \"A mono reverb effect based on the NHHall UGen\";\n~channelLayout = \\mono;\n\n~function = { |in, outputDB=0, rt60=1, lowFq=200, lowRatio=0.5, hiFq=4000, hiRatio=0.5, earlyDiffusion=0.5, lateDiffusion=0.5, modRate=0.3, modDepth=0.3|\n\n // make a mono-to-mono reverb out of NHHall\n \n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/hallverb.scd", "aug": "patch", "prompt_tokens": 547, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\lowPass12;\n~description = \"A 12db/oct Low Pass Filter\";\n~channelLayout = \\mono;\n\n~function = { |in, cutoff=10000, rq=1, outputDB=0|\n var input, sig;\n\n input = In.ar(in);\n cutoff = cutoff.clip(20.0, 18000.0);\n rq = rq.clip(0.01, 1.0);\n sig = BLowPass.ar(input, cutoff.lag, rq.lag);\n sig * outputDB.\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/lowPass12.scd", "aug": "patch", "prompt_tokens": 547, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\lowPass24;\n~description = \"A 24db/oct Low Pass Filter\";\n~channelLayout = \\mono;\n\n~function = { |in, cutoff=10000, rq=1, outputDB=0|\n var input, sig;\n\n input = In.ar(in);\n cutoff = cutoff.clip(20.0, 18000.0);\n rq = rq.clip(0.01, 1.0);\n sig = BLowPass4.ar(input, cutoff.lag, rq.lag);\n sig * outputDB\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/lowPass24.scd", "aug": "patch", "prompt_tokens": 547, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\moogVCF;\n~description = \"A Moog-style Low Pass Filter\";\n~channelLayout = \\mono;\n\n~function = { |in, cutoff=100, res=1, outputDB=0|\n var input, sig;\n\n input = In.ar(in);\n cutoff = cutoff.clip(20.0, 18000.0);\n res = res.clip(0.0, 4.0);\n sig = MoogFF.ar(input, cutoff.lag, res.lag);\n sig * outputDB.d\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/effects/moogVCF.scd", "aug": "patch", "prompt_tokens": 545, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\BeamCardio;\n~description = \"Filters along a specifed direction (hyper cardioid pattern). Az from -180 to 180, ele from -90 to 90. Hyper cardioid pattern from 1 to 3.\";\n\n~function = {|in = 0, order = 1, beamCardioAziDeg = 0, beamCardioEleDeg = 0, beamCardioCardOrder = 1 |\nHOABeamHCard2Hoa.ar(order, in, beamCardioAziDeg * pi / 180, beamCardioEleDeg * pi / 180, beamCardioCardOrder);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/BeamCardio.scd", "aug": "patch", "prompt_tokens": 491, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\BeamDirac;\n~description = \"Filters along a specifed direction (truncated Dirac). Az from -180 to 180, ele from -90 to 90\";\n\n~function = {|in = 0, order = 1, beamDiracAziDeg = 0, beamDiracEleDeg = 0, beamDiracLevelDeg = 0 |\nHOABeamDirac2Hoa.ar(order, in, beamDiracAziDeg * pi / 180.0, beamDiracEleDeg * pi / 180.0, beamDiracLevelDeg * pi / 180.0);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/BeamDirac.scd", "aug": "patch", "prompt_tokens": 490, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\HOABinaural;\n~description = \"Binaural decoder using the HOABinaural class from SC-HOA\";\n\n~function = { |in = 0, order|\n HOABinaural.ar(\n order: order,\n in: in\n );\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/HOABinaural.scd", "aug": "patch", "prompt_tokens": 371, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\Identity;\n~description = \"Output the Ambisonics stream to outputs channels, useful for NRT rendering\";\n\n~function = {|in = 0|\nin;\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/Identity.scd", "aug": "patch", "prompt_tokens": 356, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\Mirror;\n~description = \"Mirror soundfield\";\n\n~function = {|in = 0, order = 1, mirrorFrontBack = 0, mirrorLeftRight = 0, mirrorUpDown = 0 |\nHOATransMirror.ar(order, in, mirrorFrontBack, mirrorLeftRight, mirrorUpDown);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/Mirror.scd", "aug": "patch", "prompt_tokens": 409, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\Rotate;\n~description = \"Rotate the sound field (args in degree from -180 to 180)\";\n\n~function = { |in = 0, order = 1, rotatePitchDeg = 0, rotateRollDeg = 0, rotateYawDeg = 0|\n\n // Rotating the scene is done from the perspective of the listener\n // rotation follows the right-hand rule of rotation:\n // * Positive pitch means the listener tilts head upwards\n // * Positive roll means the listener tilts head to the right\n // * Positive yaw means the listener turns head to the left\n\n HOATransRotateXYZ.ar(\n order: order,\n in: \n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/Rotate.scd", "aug": "patch", "prompt_tokens": 507, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\RotateAz;\n~description = \"Rotation around the z-axis (angle from -180 to 180)\";\n\n~function = { |in = 0, order = 1, rotateAziDeg = 0|\n\n // Rotating the scene is done from the perspective of the listener\n // rotation follows the right-hand rule of rotation:\n // * Positive azimuth means the listener turns head to the left\n\n HOATransRotateAz.ar(\n order: order,\n in: in,\n az: rotateAziDeg.degrad\n );\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/hoa/RotateAz.scd", "aug": "patch", "prompt_tokens": 469, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n// cartesianControl mapper defination: manipulate the position of the spatializer through the specification of 3D points in the Cartesian coordinate system.\n\n~name = \\cartesianControl;\n\n~function = {\n// arguments, corresponding to required spatializer parameters:\n| aziDeg = 0, eleDeg = 0, gainDB = -99, delayMs = 1, lpHz = 15000, hpHz = 5, spread = 0.01, distance = 1, nfIndex = 0,\n\n coordinateX = 0, coordinateY = 0, coordinateZ = 0,\n\n refDistance = 1, maxDistance = 10000, rolloffFactor = 1|\n\n var cartesian3dPoint, newDistance, inverseDisMode\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/mappers/cartesianControl.scd", "aug": "patch", "prompt_tokens": 522, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n~name = \\defaultMapper;\n\n// default mapper does nothing. It could have been named 'identity'\n~function = { |aziDeg = 0, eleDeg = 0, gainDB = -99, delayMs = 1, lpHz = 15000, hpHz = 5, spread = 0.01, nfIndex = 0|\n [[aziDeg, eleDeg, gainDB, delayMs, lpHz, hpHz, spread, nfIndex]];\n };\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/mappers/defaultMapper.scd", "aug": "patch", "prompt_tokens": 441, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n// example mapper is adding a two parameters, aziDegShift and eleDegShift, that affect\n// aziDeg and eleDeg sent to the spatializer\n\n~name = \\exampleMapper;\n~function = {\n // arguments, starting with required spatializer parameters:\n | aziDeg = 0, eleDeg = 0, gainDB = -99, delayMs = 1, lpHz = 15000, hpHz = 5, spread = 0.01,\n // and can get new trailing parameters:\n aziDegShift = 0, eleDegShift = 0 |\n // computing value to be sent to the spatializer:\n var newAzi, newEle;\n newAzi = aziDeg + aziDegShift;\n newEle = eleDeg + eleDegShift;\n //\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/mappers/exampleMapper.scd", "aug": "patch", "prompt_tokens": 548, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n// this example mapper preprocesses the standard spatializer input arguments by scaling the gain as a function of the ndIndex parameter\n// outputs arguments for a [ nearField, farField ] pair of spatializers\n\n(\n~name = \\nearFarField1;\n~function = {\n // arguments, corresponding to required spatializer parameters:\n | aziDeg = 0, eleDeg = 0, gainDB = -99, delayMs = 1, lpHz = 15000, hpHz = 5, spread = 0.01, distance = 0.01, nfIndex = 0|\n\n var nfGain, ffGain, nfGainDB, ffGainDB;\n\n nfGain = gainDB.dbamp * nfIndex;\n ffGain = gainDB.dbamp * (1 - \n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/mappers/nearFarField1.scd", "aug": "patch", "prompt_tokens": 549, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n// example mapper is adding a two parameters, aziDegShift and eleDegShift, that affect\n// aziDeg and eleDeg sent to the spatializer\n\n~name = \\randOffsets1;\n~function = {\n // arguments, starting with required spatializer parameters:\n | aziDeg = 0, eleDeg = 0, gainDB = -99, delayMs = 1, lpHz = 15000, hpHz = 5, spread = 0.01,\n\n // and can get new trailing parameters:\n\n cloudAziScale = 1, cloudElevScale = 0 | // cloud...Scale range from 0 to one\n\n // computing value to be sent to the spatializer:\n // extra state for random particle variati\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/mappers/randOffsets1.scd", "aug": "patch", "prompt_tokens": 519, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Monitoring/analysis plugin definition\n\n Each monitoring/analyser plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n ~setup: optional function that will set up the plugin before server boots\n\n It should not return any audio\n\n envAndPitch: track envelope and pitch. Sends a message with:\n - hasFreq: bool\n - env: float\n - freq: float\n*/\n\n~name = \\envAndPitch;\n~description = \"Send a stream of amplitu\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/monitoring/envAndPitch.scd", "aug": "patch", "prompt_tokens": 505, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Monitoring/analysis plugin definition\n\n Each monitoring/analyser plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n ~setup: optional function that will set up the plugin before server boots\n\n It should not return any audio\n*/\n\n~name = \\envFollow;\n~description = \"Send amplitude envelope stream\";\n\n~function = { |in, envFollow_rate = 10, envFollow_decay = 0.92|\n var env, trig;\n\n env = EnvFollow.kr(in\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/monitoring/envFollow.scd", "aug": "patch", "prompt_tokens": 518, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Monitoring/analysis plugin definition\n\n Each monitoring/analyser plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n ~setup: optional function that will set up the plugin before server boots\n\n It should not return any audio\n*/\n\n~name = \\envTrigger;\n~description = \"Send a trigger based on envelope threshold\";\n\n~function = { arg in, envTrigger_triggerLevel=0.2, envTrigger_debounce=1 ;\n var mic = in,\n \n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/monitoring/envTrigger.scd", "aug": "patch", "prompt_tokens": 514, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\delay;\n~description = \"Simple delay line\";\n~channelLayout = \\mono;\n~function = {|in = 0, del = 0.5|\n DelayC.ar(in, 2, del);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/postprocessors/delay.scd", "aug": "patch", "prompt_tokens": 364, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\envfol;\n~description = \"Envelope follower (audio rate)\";\n~channelLayout = \\mono;\n~function = {|in = 0, decaycoeff = 0.99, amp = 10.0, lpf = 20 |\n var env, out;\n in.scope;\n env = LPF.ar(PeakFollower.ar(in), lpf, mul: 50, add:-1);\n env.scope;\n env;\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/postprocessors/envfol.scd", "aug": "patch", "prompt_tokens": 438, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n~name = \\lebedev50binaural;\n~description = \"A 50 channel Lebedev grid decoded to binaural\";\n~channelLayout = \\mono;\n\n~function = { |in=0|\n var sig = Lebedev50BinauralDecoder.ar(in);\n // Lebedev50BinauralDecoder has an inverted azimuth\n // swap the signals so that +90 degrees is heard on the right\n [sig[1], sig[0]]\n};\n\n~setup = { |satie|\n Lebedev50BinauralDecoder.loadHrirFilters(satie.config.server);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/postprocessors/lebedev50binaural.scd", "aug": "patch", "prompt_tokens": 495, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\limiter;\n~description = \"hard limiter\";\n~channelLayout = \\mono;\n~function = {|in = 0, limitDB = 0 |\nvar limit = limitDB.dbamp;\nLimiter.ar(in, limit);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/postprocessors/limiter.scd", "aug": "patch", "prompt_tokens": 372, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\sub;\n~description = \"Dedicate a channel to subwoofer signal. Ideally use with monoSpat spatializer\";\n~channelLayout = \\mono;\n~function = { |in = 0, sub_gainDB = -99, sub_lpHz = 200|\n LPF.ar(in, sub_lpHz.clip(5.0, 18000)) * sub_gainDB.dbamp\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/postprocessors/sub.scd", "aug": "patch", "prompt_tokens": 422, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n~grainProcess = Environment.make({ |self|\n\n ~name;\n ~group;\n ~routine;\n\n ~interval = 0.5;\n ~attMin = 0.001;\n ~attMax = 0.05;\n ~relMin = 0.001;\n ~relMax = 0.02;\n ~startPos = 0.0;\n ~durMin = 0.001;\n ~durMax = 0.03;\n ~rateMin = 0.94;\n ~rateMax = 1.03;\n ~trimDB = -10;\n ~aziDeg = 0;\n ~eleDeg = 0;\n ~bufnum;\n\n ~makeRoutine = { |self|\n self.routine = Routine {\n loop {\n self.satieInstance.makeKamikaze(\n synthDefName: \\grainBufASR,\n group: self.group,\n synthArgs: [\n \\bufnum, self.bufnum,\n \\rate, rrand(self.rateMin, self.rateMax),\n \\startPos, self.startPos + rand(1.0) - self.durMax,\n \\gainDB, rrand(-25, -18),\n \\trimDB, self.trimDB,\n \\att, rrand(self.attMin, self.attMax),\n \\\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/processes/grainProcess.scd", "aug": "patch", "prompt_tokens": 623, "answer_tokens": 151}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\AcnSn3dIn;\n~description = \"A live ambisonic input (ACN_SN3D)\";\n~channelLayout = \\ambi;\n\n~function = { |order=1, t_trig = 0, bus = 0|\n var env = EnvGen.kr(Env([0,1], [1]), t_trig);\n var chans = Array.series(\n size: (order + 1).pow(2).asInteger,\n start: bus,\n step: 1\n );\n var input = SoundIn.ar(chans) * env;\n HOAConverterAcnSn3d2AcnN3d.ar(order, input);\n};\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/AcnSn3dIn.scd", "aug": "patch", "prompt_tokens": 417, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\DustDust;\n~description = \"just some synthetic dust\";\n~channelLayout = \\mono;\n\n~function = {| density1 = 1, density2 = 10, trimDB = 0 |\n trimDB.dbamp * (Dust.ar(density1) + (0.5 * Dust2.ar(density2)))};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/DustDust.scd", "aug": "patch", "prompt_tokens": 493, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\FuMaIn;\n~description = \"A live ambisonic input (ACN_FuMa)\";\n~channelLayout = \\ambi;\n\n~function = { |order = 1, t_trig = 0, bus = 0|\n var env = EnvGen.kr(Env([0,1], [1]), t_trig);\n var chans = Array.series(\n size: (order + 1).pow(2).asInteger,\n start: bus,\n step: 1\n );\n var input = SoundIn.ar(chans, env);\n HOAConverterFuma2AcnN3d.ar(order, input);\n}\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/FuMaIn.scd", "aug": "patch", "prompt_tokens": 408, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n*/\n\n// SynthDef by Victor Comby\n\n\n~name = \\Gravity;\n~description = \"Random Filtered Impacts\";\n~channelLayout = \\mono;\n~function = { |amp = 0.5, lfospeed = 4, lfospeedmin = 0.1, lfospeedmax = 5|\n var sig, sig2, sig3, sig4, sig5, sigfinal, sigx, rq, ffreq, filtfreqmax, filtfreqmin, sigchord;\n rq = LFNoise1.ar(8).ex\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/Gravity.scd", "aug": "patch", "prompt_tokens": 552, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n// SynthDef by Victor Comby, original idea by Eli Fieldsteel\n\n~name = \\Marimba;\n~description = \"Marimba-like, random pitch\";\n~channelLayout = \\mono;\n~function = { |pitch = 880, maxPartial = 4|\n var sig, rate, freq;\n freq = LFNoise1.kr(4).exprange(pitch, pitch*maxPartial).round(pitch);\n rate = LFNoise1.ar(2).range(2, 6);\n sig = Saw.ar(rate);\n sig = BPF.ar(sig, freq, 0.005);\n};\n\n\n~setup = {};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/Marimba.scd", "aug": "patch", "prompt_tokens": 502, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\MonoIn;\n~description = \"A direct input\";\n~channelLayout = \\mono;\n\n~function = {\n |gate = 0, bus = 0, attack = 0.02, susL = 0.9, release = 0.1, curve = -4|\n var env = Env.asr(attack, susL, release, curve);\n SoundIn.ar(bus, EnvGen.kr(env, gate));\n}\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/MonoIn.scd", "aug": "patch", "prompt_tokens": 437, "answer_tokens": 151}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\PinkSin;\n~description = \"Mix of pink noise and sine wave\";\n~channelLayout = \\mono;\n\n~function = {| sfreq = 200, amp = 1 |\n amp*(PinkNoise.ar() + FSinOsc.ar(sfreq))\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/PinkSin.scd", "aug": "patch", "prompt_tokens": 474, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n// based on tweet0353 by redFrik\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n\n~name = \\RezonPing;\n~description = \"Saw synth ping through resonating high-pass filter and delay line\";\n~channelLayout = \\mono;\n\n~function = { | freq = 440, rq = 1 |\n var snd;\n snd = sum({|i|\n var saw1, saw2, reson;\n saw1 = LFSaw.ar(1/9.round(1/8)**2*8);\n saw2 = Saw\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/RezonPing.scd", "aug": "patch", "prompt_tokens": 537, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n// based on tweet0355 by redFrik\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\SawMoog;\n~description = \"Saw synths through a Moog filter\";\n~channelLayout = \\mono;\n\n~function = {| gain = 3.5, freq = 7, amp = 0.5|\n var snd, noiz, out;\n var filtfreq;\n noiz = GrayNoise.ar(999);\n snd = LFSaw.ar(freq, 3/freq);\n snd = LFSaw.ar(snd)>0.05;\n\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/SawMoog.scd", "aug": "patch", "prompt_tokens": 548, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n// Original SynthDef : http://sccode.org/1-5ee by Andrew Brož\n\n~name = \\ShepardTone;\n~description = \"Infinite Ups and Downs\";\n~channelLayout = \\mono;\n\n~function = { |freq=440, dur=20, direction=1, amp=0.2|\n var partialCount = 4;\n var octRange = 2 ** (partialCount / 2);\n var cycle = 1 / (partialCount * dur);\n var width = if(direction >= 0, 1, 0);\n var sig = partialCount.collect { |n|\n var offset = n / partialCount;\n var phase = (3 * pi / 2) + (2 * pi * offset);\n var vol = SinOsc.kr(cycle, phase).range(0, 1);\n var ratio = VarSaw.kr(\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/ShepardTone.scd", "aug": "patch", "prompt_tokens": 567, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n*/\n\n// SynthDef by Victor Comby\n\n\n~name = \\SimpleKick;\n~description = \"A Kick generated from a fast pitch bended SinOsc, and a bit of white noise\";\n~channelLayout = \\mono;\n\n~function = {\n var kicksig, kickenv, transient, transienv, kickfinal, kickfreq;\n kickfreq = XLine.ar(500, 50, 0.08);\n kickenv = EnvGen.ar(En\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/SimpleKick.scd", "aug": "patch", "prompt_tokens": 534, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n*/\n\n\n~name = \\Tubie;\n~description = \"Currugated tube... kinda\";\n~channelLayout = \\mono;\n\n~function = {|freq = 200, freq_sc = 1, amp = 0.7, rq = 0.1, gain = 2.4|\n var snd;\n var saw1, pulse, reso, verb, out;\n pulse = Clipper8.ar(SinOsc.ar(SinOsc.ar(freq), mul: LFNoise1.kr(1/freq).range(15,25)), -0.5, 0.5);\n saw1 =\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/Tubie.scd", "aug": "patch", "prompt_tokens": 563, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n\n~name = \\ambiIn;\n~description = \"A live ambisonic input (ACN_N3D)\";\n~channelLayout = \\ambi;\n\n~function = { |order = 1, t_trig = 0, bus = 0|\n var env = EnvGen.kr(Env([0,1], [1]), t_trig);\n var chans = Array.series(\n size: (order + 1).pow(2).asInteger,\n start: bus,\n step: 1\n );\n SoundIn.ar(chans) * env;\n};\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/ambiIn.scd", "aug": "patch", "prompt_tokens": 378, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n~name = \\default;\n~description = \"...\";\n~channelLayout = \\mono;\n\n~function = { arg amp=1, lfoHz=10, trimDB = 0, t_gate=0, note=#[60,1];\n var signal, env;\n env = EnvGen.ar(Env.perc(0.01, 0.3, 0.5), gate: t_gate);\n //amp*(PinkNoise.ar(1)* LFPulse.ar(lfoHz) + (env*FSinOsc.ar((note[0]).midicps)));\n trimDB.dbamp*amp*(PinkNoise.ar(1)* LFPulse.ar(lfoHz));\n};\n\n/* for test of \"prop\" and \"event\" messages\na=~function.play;\na.set(\\tremelo, 20); // accessed via the \"prop\" message\na.set(\\amp, 2.reciprocal); // accessed via the \"prop\" message\na.set(\\not\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/default.scd", "aug": "patch", "prompt_tokens": 602, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n*/\n\n~name = \\dustyRez;\n~description = \"Dust through resonators \";\n~channelLayout = \\mono;\n\n~function = { |freq = 200, density = 10, attack=100, dec = 0.3, sus = 0.5, rel = 6, amp = 0.75, gate = 1|\n var env, envGen, dust, resonance;\n env = Env.adsr(attack, dec, sus, rel);\n envGen = EnvGen.kr(env, gate);\n dust = Dust.a\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/dustyRez.scd", "aug": "patch", "prompt_tokens": 543, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\emptySource;\n~description = \"dummy/template\";\n~channelLayout = \\mono;\n\n~function = {\n DC.ar(0);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/emptySource.scd", "aug": "patch", "prompt_tokens": 440, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~channelLayout: (symbol) \\mono or other, channel layout affects use with spatializers\n ~function: the actual definition of the plugin\n\n*/\n~name = \\fbOscRez; // ripped from http://sccode.org/1-5ah#c814 and slightly enhanced\n~description = \"Feedback oscilator with resonant filter infinite drone\";\n~channelLayout = \\mono;\n~function = {|freq = 440, fundamental = 110, amp = 0.1, gate = 1, att = 2.0, dec = 0.3, sus = 0.5, rel = 1,vibFreq=7, vibAmp=0,vibAdd=0.5,lpfFreq = 0.5, lpfRes = 0.5|\n var snd, env;\n lpfFreq = lpfFreq * (freq * 3) + fundamental;\n lpfRes = 1 - lpfRes * 0.9 + 0.1;\n env = EnvGen.ar(Env.adsr(a\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/fbOscRez.scd", "aug": "patch", "prompt_tokens": 608, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n// based on SATIE's own sndBuffer plugin but adding an envelope\n\n~name = \\grainBufASR;\n\n// note: bufnum must be first arg !!\n~description = \"Play a buffer with an envelope\";\n~channelLayout = \\mono;\n\n\n~function = { | bufnum = 0, startPos=0, rate = 1, gate = 1, att = 0.01, rel = 0.1, dur=1, tone=1, loop = 0, trimDB=0, amp=1 |\n var lpassFq, sig, env;\n\n tone = abs (tone);\n tone = tone.clip(0,1);\n startPos = startPos.clip(0.0, 1.0);\n\n lpassFq = 100 + (tone**(0.7) * 21900) ; // used to cut highs when incidence is low\n env = Env.linen(att, dur, rel).kr(gate: g\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/grainBufASR.scd", "aug": "patch", "prompt_tokens": 588, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\saw;\n~description = \"A simple saw wave with low pass filter roll-off\";\n~channelLayout = \\mono;\n\n~function = {\n |\n frequency = 200,\n attack = 0.1,\n decay = 0.1,\n sustain = 1.0,\n release = 1,\n amplitude = 1.0,\n cutoff_freq = 100.0,\n gate = 1\n |\n var snd, env, envGen;\n snd = LPF.ar(Saw.ar(freq\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/saw.scd", "aug": "patch", "prompt_tokens": 535, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\sine;\n~description = \"A simple sine wave with low pass filter roll-off\";\n~channelLayout = \\mono;\n\n~function = {\n |\n frequency = 200,\n attack = 0.1,\n decay = 0.1,\n sustain = 1.0,\n release = 1,\n amplitude = 1.0,\n cutoff_freq = 100.0,\n gate = 1\n |\n var snd, env, envGen;\n snd = LPF.ar(FSinOsc.a\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sine.scd", "aug": "patch", "prompt_tokens": 534, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n//\n// ~name = \\sndFile;\n// ~function = { | bufnum = 0, loop = 0, startPos=0, rate = 1, t_trig=0 |\n// // DiskIn.ar(1, bufnum, loop = loop);\n// PlayBuf.ar(1, bufnum, rate, t_trig, startPos, loop);\n// };\n//\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n\n\n~name = \\sndBuffer;\n\n// note: bufnum must be first arg !!\n~description = \"Looped buffer playback\";\n~channelLayout = \\mono;\n\n\n~function = { |bufnum = 0, startPos = 0, rate = 1, tone=1, loop = 1, trimDB=0, attack = 0.1, dec = 0.3, sus = 0.5, rel = 1, amp = 1, gate = 0|\n\n var env, envGen, resonance, verb;\n var lpassFq, sig;\n\n tone = abs (tone);\n tone = \n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ~name = \\sndFile; ~function = { | bufnum = 0, loop = 0, startPos=0, rate = 1, t_trig=0 | // DiskIn.ar(1, bufnum, loop = loop); PlayB."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sndBuffer.scd", "aug": "patch", "prompt_tokens": 591, "answer_tokens": 217}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n//\n// ~name = \\sndFile;\n// ~function = { | bufnum = 0, loop = 0, startPos=0, rate = 1, t_trig=0 |\n// // DiskIn.ar(1, bufnum, loop = loop);\n// PlayBuf.ar(1, bufnum, rate, t_trig, startPos, loop);\n// };\n//\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n\n\n~name = \\sndBufferHOA;\n\n// note: bufnum must be first arg !!\n~description = \"Play a multichannel buffer\";\n~channelLayout = \\ambi;\n\n~function = { | order = 2, bufnum = 0, loop = 1, mul = 1|\n var buf;\n buf = DiskIn.ar(16, bufnum, loop: loop) * mul;\n};\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ~name = \\sndFile; ~function = { | bufnum = 0, loop = 0, startPos=0, rate = 1, t_trig=0 | // DiskIn.ar(1, bufnum, loop = loop); PlayB."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sndBufferHOA.scd", "aug": "patch", "prompt_tokens": 532, "answer_tokens": 217}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n//\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\sndFile;\n~description = \"Stream a soundfile from disk\";\n~channelLayout = \\mono;\n\n~function = { | bufnum = 0, loop = 0 |\n DiskIn.ar(1, bufnum, loop: loop);\n};\n\n/*\n~name = \\sndFile;\n~function = { | sfile = '/usr/share/sounds/alsa/Front_Center.wav' |\n var buf;\n var sf = sfile.asString;\n buf = Buffer.cueSoundFile(s, sf, 0, 1);\n DiskIn.ar(1, buf.bufnum);\n};\n\n*/\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sndFile.scd", "aug": "patch", "prompt_tokens": 497, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n//\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n\n~name = \\sndFile2;\n~description = \"A sound file player (stream from disk)\";\n~channelLayout = \\mono;\n\n~function = { |bufnum=0, loop=0, xfade=(-1)|\n var sig = DiskIn.ar(2, bufnum, loop: loop);\n XFade2.ar(sig[0], sig[1], xfade);\n};\n\n/*\n~name = \\sndFile;\n~function = { | sfile = '/usr/share/sounds/alsa/Front_Center.wav' |\n var buf;\n var sf = sfile.asString;\n buf = Buffer.cueSoundFile(s, sf, 0, 1);\n DiskIn.ar(1, buf.bufnum);\n};\n\n*/\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sndFile2.scd", "aug": "patch", "prompt_tokens": 539, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\sndFileHOA;\n\n// note: order must be first arg !!\n~description = \"Play a multichannel buffer\";\n~channelLayout = \\ambi;\n\n~function = { | order = 2, bufnum = 0, loop = 1, mul = 1|\n SynthDef.wrap(~diskins.at(order), prependArgs: [loop, bufnum]);\n};\n\n~setup = { |satieInstance|\n var orders = satieInstance.config.ambiOrders;\n ~diskins = Array.fill(6, {0});\n ~diskins.do({|i, index|\n var idx, numChannels, func;\n idx = index;\n numChannels = (idx + 1).pow(2).asInteger;\n func = { |loop, bufnum|\n DiskIn.ar(numChannels, bufnum, BufRateScale.kr(\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/sndFileHOA.scd", "aug": "patch", "prompt_tokens": 591, "answer_tokens": 151}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n~name = \\test_noise_burst;\n~description = \"A short burst of enveloped noise that goes well with Patterns\";\n~channelLayout = \\mono;\n\n~function = { arg amp=1, trimDB = 0, attack = 0.01, release = 0.3;\n var env;\n env = EnvGen.ar(Env.perc(attack, release, 0.5), doneAction: Done.freeSelf);\n trimDB.dbamp*amp*PinkNoise.ar(1);\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/test_noise_burst.scd", "aug": "patch", "prompt_tokens": 457, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\testee;\n~descrioption = \"a droney sound\";\n~channelLayout = \\mono;\n\n~function = {\nvar tri = Array.with(\n 1-LFTri.ar((SinOsc.kr(0.001)+1)*1000),\n 1-LFTri.ar((SinOsc.kr(0.002)+1)*750),\n 1-LFTri.ar(100),\n 1-LFTri.ar(55.1),\n );\n var triScale = 0.5;\n var triMix = tri[0] * tri[1] * tri[2] * tri\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/testee.scd", "aug": "patch", "prompt_tokens": 566, "answer_tokens": 181}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\testtone;\n~description = \"a standard test tone (sine)\";\n~channelLayout = \\mono;\n\n~function = {| sfreq = 200 |\n FSinOsc.ar(sfreq)\n};\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/testtone.scd", "aug": "patch", "prompt_tokens": 454, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Audio plugin definition\n\n Each audio plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~function: the actual definition of the plugin\n\n*/\n\n~name = \\triangleGrain;\n~description = \"A simple triangular envelope grain with position, rate, and duration parameters\";\n~channelLayout = \\mono;\n\n~function = { |bufnum=0, startPos=0, rate=1, dur=0.1, trimDB=0|\n var sig, env;\n\n startPos = startPos.clip(0.0, 1.0);\n\n env = EnvGen.ar(Env.triangle(dur), doneAction: Done.freeSelf);\n sig = PlayBuf.ar(1, bufnum, rate: BufRateScale.kr(bufnum) * rate, startPos: BufFrames.kr(bufnum) * startPos, loop: 1);\n sig * trimDB.dbamp;\n};\n```"}, {"role": "assistant", "content": "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see ."}], "family": "D3", "source_id": "quarks:SATIE/plugins/sources/triangleGrain.scd", "aug": "patch", "prompt_tokens": 546, "answer_tokens": 151}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\n/* Spatializer plugin definition\n\n Each spatializer plugin should define the following global variables:\n ~name: (symbol) name of the spatializer\n ~description: (string) a short description\n ~numChannels: (int) number of channels\n ~channelLayout: (symbol) layout for each channel, usually mono or ambi\n ~angles: Speaker array angles, if using VBAP call VBAPSpeakerArray\n ~function: the definition of the spatializer\n\n where function should use the following input arguments:\n\n in\n aziDeg +/- 180 degrees\n elevDeg +/- 90 degrees\n gainDB\n```"}, {"role": "assistant", "content": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a."}], "family": "D3", "source_id": "quarks:SATIE/plugins/spatializers/emptySpat.scd", "aug": "patch", "prompt_tokens": 509, "answer_tokens": 181}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Originally found at http://ecmc.rochester.edu/ecmc/docs/supercollider/scbook/Ch21_Interface_Investigations/ixi%20SC%20tutorial/ixi_SC_tutorial_10.html\n\nSynthDef(\"waveguideFlute\", { arg scl = 0.2, freq = 440, ipress = 0.9, ibreath = 0.09, ifeedbk1 = 0.4, ifeedbk2 = 0.4, dur = 1, gate = 1, amp = 2;\n\n var kenv1, kenv2, kenvibr, kvibr, sr, cr, block;\n var poly, signalOut, ifqc;\n var aflow1, asum1, asum2, afqc, atemp1, ax, apoly, asum3, avalue, atemp2, aflute1;\n var fdbckArray;\n\n sr = SampleRate.ir;\n cr = ControlRate.ir;\n block = cr.reciprocal;\n\n ifqc = freq;\n\n // noise envelope\n kenv1 = EnvGen.kr(Env.new(\n [ 0.0, 1.1 * ipress, ipress, ipress, 0.0 ], [ 0.06, 0.2, dur - 0.46, 0.2 ], 'linear' )\n );\n // overall envelope\n kenv2 = EnvGen.kr(Env.new(\n [ 0.0, amp, amp, 0.0 ], [ 0.1, dur - 0.02, 0.1 ], 'linear' ), doneAction: 2\n );\n // vibrato envelope\n kenvibr = EnvGen.kr(Env.new( [ 0.0, 0.0, 1, 1, 0.0 ], [ 0.5, 0.5, dur - 1.5, 0.5 ], 'linear') );\n\n // create air flow and vibrato\n aflow1 = LFClipNoise.ar( sr, kenv1 );\n kvibr = SinOsc.ar( 5, 0, 0.1 * kenvibr );\n\n asum1 = ( ibreath * aflow1 ) + kenv1 + kvibr;\n afqc = ifqc.reciprocal - ( asum1/20000 ) - ( 9/sr ) + ( \n```"}, {"role": "assistant", "content": "Originally found at http://ecmc.rochester.edu/ecmc/docs/supercollider/scbook/Ch21_Interface_Investigations/ixi%20SC%20tutorial/ixi_SC_tutorial_10.html."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/SynthDefs/winds/waveguideFlute.scd", "aug": "patch", "prompt_tokens": 733, "answer_tokens": 82}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//This is almost exactly the same as kick3.scd, they've been morphed into kik3.scd!\n\n\nSynthDef(\"kik\", { |basefreq = 50, ratio = 7, sweeptime = 0.05, preamp = 1, amp = 1, decay1 = 0.3, decay1L = 0.8, decay2 = 0.15, out|\n var fcurve = EnvGen.kr(Env([basefreq * ratio, basefreq], [sweeptime], \\exp)),\n env = EnvGen.kr(Env([1, decay1L, 0], [decay1, decay2], -4), doneAction: 2),\n sig = SinOsc.ar(fcurve, 0.5pi, preamp).distort * env * amp;\n Out.ar(out, sig ! 2)\n}).add;\n```"}, {"role": "assistant", "content": "This is almost exactly the same as kick3.scd, they've been morphed into kik3.scd!."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/in-process/Completed/kik.scd", "aug": "patch", "prompt_tokens": 298, "answer_tokens": 33}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// =========================\n// extra demos for \\glockenspiel\n// =========================\n\n(\n// made by Diya Menon\n// demo\nPbindef(\\dmglockenspiel,\n \\instrument, \"glockenspiel\",\n \\midinote, Pseq([\n [65, 68, 72, 75],\n 72, 72, 72, 70, 72, 70, 68,\n [61, 65, 70, 73, 77],\n 73, 73, 73, 72, 72, 70, 68], 2),\n \\amp, Pseq([0.015, 0.005, 0.005, 0.0075, 0.0075, 0.01, 0.01, 0.02], 4) * 3,\n \\dur, Pseq([0.3, 0.3, 0.3, 0.15, 0.15, 0.3, 0.15, 0.15], 4),\n \\rel, 3,\n \\exciterRel, 0.03,\n \\att, 0.0005,\n).play;\n)\n```"}, {"role": "assistant", "content": "========================= extra demos for \\glockenspiel =========================."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/pbind-demos/glockenspiel-demo-extras.scd", "aug": "patch", "prompt_tokens": 373, "answer_tokens": 62}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// ===========================\n// extra demos for pluck\n// ===========================\n\n\n(\n// Made by Meha Gupta\n// Inspired by Happy by Julia Michaels\nPbindef(\\dmpluck,\n \\instrument, \"pluck\",\n \\midinote, Pseq([\n Pseq([\n [57, 69, 73, 76],\n [57, 69, 73, 76],\n [57, 71, 73, 80],\n [52, 78, 76, 80],\n [52, 78, 76, 80],\n [59, 71, 75],\n [59, 71, 75]], 2),\n 64]),\n \\amp, Pseq([0.2, 0.1, 0.2, 0.2, 0.1, 0.1, 0.1], inf) * 0.5,\n \\dur, Pseq([Pn(Pseq([0.25, 0.75, 1, 0.5, 0.5, 0.5, 0.5]), 2), 1]),\n \\decay, Pseq([1, 3, 3, 2, 2, 3, 3, 1, 3, 3, 2, 2, 3, 3, 4]),\n).play;\n)\n```"}, {"role": "assistant", "content": "=========================== extra demos for pluck ===========================."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/pbind-demos/pluck-demo-extras.scd", "aug": "patch", "prompt_tokens": 425, "answer_tokens": 62}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// ===========================\n// extra demos for \\sawSynth\n// ===========================\n\n\n(\n// Made by Bruno Ruviaro\n// Demo\nPbindef(\\sawSynthL,\n \\instrument, \"sawSynth\",\n \\midinote, Pseq([34, 36, 36.7, 32.4, 40.12], inf),\n \\ctranspose, Pstutter(5, Prand([0, 0, 0, 0, 3, -1], inf)),\n \\amp, Pseq([0.125, 0.2, 0.25, 0.3, 0.4], inf),\n \\dur, Pwhite(0.14, 0.15, inf), //Pseq([0.5, 0.15, 0.5, 0.25, 1], inf),\n \\legato, 0.5,\n \\rel, Pwrand([0.1, 0.01], [0.9, 0.1], inf),\n \\hifreq, Pwhite(2000, 9000, inf)\n).play;\n);\n\n(\n// Made by Diya Menon\n// Demo\nPbindef(\\dmsawSynth,\n \\instrument, \"sawSynth\",\n \\midinote, Pseq([\n [52, 67, 71], 66, 67, 71,\n [40, 67, 71], 66, 67, 71,\n [76, 67, 71], 66, 67, 71,\n 69, 67, 66\n ]),\n \\amp, Pseq([\n Pseq([0.125, 0.2, 0.25, 0.3], 3),\n 0.32, 0.3, 0.28\n ]),\n \\dur, 0.6,\n \\legato, 0.5,\n \\rel, Pseq([\n Pseq([3, 1.5, 1.5, 1.5], 3),\n 0.5, 0.5, 1\n ])\n).play;\n)\n```"}, {"role": "assistant", "content": "=========================== extra demos for \\sawSynth ===========================."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/pbind-demos/sawSynth-demo-extras.scd", "aug": "patch", "prompt_tokens": 617, "answer_tokens": 65}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// ============================\n// extra demos for \\waveguideFlute\n// ============================\n\n\n(\n// Made by Meha Gupta\n// Inspired by The Village by Wrabel\nPbindef(\\dmwaveguideFlute,\n \\instrument, \"waveguideFlute\",\n \\midinote, Pseq([57, 60,\n [46, 62], [53, 62], [58, 62], [58, 64], [58, 62], [58, 60],\n [50, 57], [50, 57], [50, 57], [50, 60], [50, 57], [50, 53],\n [53, 55], [53, 55], [53, 55], [53, 57], [53, 55], [41, 53], 52]),\n \\amp, 0.3,\n \\dur, Pseq([0.25, 0.25, 0.5, 0.5, 0.25, 0.25, 0.25, 0.25,\n 0.5, 0.5, 0.25, 0.25, 0.25, 0.25,\n 0.5, 0.5, 0.25, 0.25, 0.25, 0.25, 1]),\n).play;\n)\n```"}, {"role": "assistant", "content": "============================ extra demos for \\waveguideFlute ============================."}], "family": "D3", "source_id": "quarks:SCLOrkSynths/pbind-demos/waveguideFlute-demo-extras.scd", "aug": "patch", "prompt_tokens": 432, "answer_tokens": 70}
{"conversations": [{"role": "user", "content": "What is `SFPlayer` in SuperCollider?"}, {"role": "assistant", "content": "SFPlayer — A soundfile player SFPlayer plays sound files directly from disk. It also has a convenient #-gui. Category: UGens > InOut, UGens > Buffer."}], "family": "A", "source_id": "quarks:SFPlayer/HelpSource/Classes/SFPlayer.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 65}
{"conversations": [{"role": "user", "content": "Explain `SFPlayer` in SuperCollider briefly."}, {"role": "assistant", "content": "SFPlayer — A soundfile player SFPlayer plays sound files directly from disk. It also has a convenient #-gui. Category: UGens > InOut, UGens > Buffer."}], "family": "A", "source_id": "quarks:SFPlayer/HelpSource/Classes/SFPlayer.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 65}
@@ -1641,8 +1567,6 @@
{"conversations": [{"role": "user", "content": "What does `Latency.lastTime` do?"}, {"role": "assistant", "content": "the most recent measurement: [outputIndex, latencyInSamples"}], "family": "B", "source_id": "quarks:SpeakersCorner/HelpSource/classes/Latency.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 22}
{"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// server has hardwareBufferSize 512 for this example.\ns.options.hardwareBufferSize = 512; s.reboot;\n// do something that sends messages with server latency\nPbind(\\degree, Pbrown(-14, 14, 3), \\dur, 1/8).play;\ns.latency;\ns.latency = 0.1; // tune down ...\ns.latency = 0.05;\ns.latency = 0.025;\ns.latency = 0.012; // ... until every message posts \"late 0.01....\" now\ns.latency = 0.018; // go back up -> fewer late messages\ns.latency = 0.021; // go back up until ...\ns.latency = 0.024; // late mess\n// …\n```"}, {"role": "assistant", "content": "server has hardwareBufferSize 512 for this example. do something that sends messages with server latency (Latency: Measure audio latency for multiple channels)"}], "family": "D", "source_id": "quarks:SpeakersCorner/HelpSource/classes/Latency.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 54}
{"conversations": [{"role": "user", "content": "What is `Latency`?"}, {"role": "assistant", "content": "Latency — Measure audio latency for multiple channels"}, {"role": "user", "content": "What does `Latency.testAudio` do?"}, {"role": "assistant", "content": "main method to measure audio latency"}, {"role": "user", "content": "Show me a working example."}, {"role": "assistant", "content": "```supercollider\n// server has hardwareBufferSize 512 for this example.\ns.options.hardwareBufferSize = 512; s.reboot;\n// do something that sends messages with server latency\nPbind(\\degree, Pbrown(-14, 14, 3), \\dur, 1/8).play;\ns.latency;\ns.latency = 0.1; // tune down ...\ns.latency = 0.05;\ns.latency = 0.025;\ns.latency = 0.012; // ... until every message posts \"late 0.01....\" now\ns.latency = 0.018; // go back up -> fewer late messages\ns.latency = 0.021; // go back up until ...\ns.latency = 0.024; // late messages are completely gone again\n\ns.latency = 0.03; // this works on many systems\n```"}], "family": "G", "source_id": "quarks:SpeakersCorner/HelpSource/classes/Latency.schelp", "aug": "none", "prompt_tokens": 122, "answer_tokens": 278}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Standalone project example 'myproj'\n\n// this loadfile loads everything else\n\nTask {\n // everything before server boots:\n q.load(\"01_setup/0_loadGlobalUtils.scd\");\n q.load(\"01_setup/1_serverConfig.scd\");\n q.load(\"01_setup/2_networkConfig.scd\");\n\n 0.5.wait;\n\n ServerBoot.add({\n \"// load my soundfiles into buffers when server boots:\".postln;\n q.buffers = \"soundfiles/*.aif\".pathMatch.do { |path|\n path.basename.postcs;\n Buffer.read(s, path);\n };\n s.sync;\n \"*** q.buffers loaded % files.\\n\".postf(q.buffers.size);\n });\n\n\n s.waitForBoot {\n\n Pbind('degree', Pseries([0, 2, 4], 1, 8), 'dur', 0.125).play;\n\n 0.5.wait;\n // load all patches that need a running server;\n q.load(\"02_processes/*.scd\");\n\n // load all controllers that need sound processes ready\n 0.5.wait;\n q.load(\"03_interfaces/*.scd\");\n\n // load masterFX and similar\n 0.5.wait;\n q.load(\"05_FX/*.scd\");\n\n 0.5.wait;\n // this one reboots the server whenever it dies\n q.load(\"LazarusServer.scd\");\n\n 0.5.wait;\n\n s.volume.volume = 0;\n\n Pbind('degree', Pseries([0, 2, 4], 1, 8), 'dur', 0.125).play;\n\n };\n\n}.play(AppClock);\n```"}, {"role": "assistant", "content": "Standalone project example 'myproj' this loadfile loads everything else."}], "family": "D3", "source_id": "quarks:Standalone/example_myproj/00_load_myproj.scd", "aug": "patch", "prompt_tokens": 616, "answer_tokens": 24}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Comprobar con (ya está implementado pero no testeado en otros SO)\nSynthiGME.isExtensionInstalled\nSynthiGME.isQuarkInstalled\nSynthiGME.getAppPath\n\n\n(\n~checkQuarkInstalled = { |quarkName|\n Quarks.installed.any ({ |quark|\n quark.name == quarkName\n })\n};\n);\n\n\n~checkQuarkInstalled.(\"SynthiGME\")\n\n\n// Ejemplo de uso\n(\nif (~checkQuarkInstalled.value(\"SynthiGME\")) {\n \"El quark SynthiGME está instalado.\".postln;\n} {\n \"El quark SynthiGME no está instalado.\".postln;\n};\n);\n\n\n\n////////////////////////////////////////\n\n\n\n(\n~isQuarkInstalled = { |quarkName|\n Quarks.installed.any { |quark|\n quark.name == quarkName\n }\n};\n\n~isExtensionInstalled = { |extensionName|\n var userExtensions = Platform.userExtensionDir +/+ extensionName +/+ \"SynthiGME.quark\";\n var systemExtensions = Platform.systemExtensionDir +/+ extensionName +/+ \"SynthiGME.quark\";\n\n File.exists(userExtensions).postln || File.exists(systemExtensions).postln;\n};\n);\n\n~isExtensionInstalled.(\"MiClase\")\n~isQuarkInstalled.(\"MiClase\")\n// hasta aquí funciona\n\n(\n~getResourcePath = { |name|\n if (~isQuarkInstalled.(name)) {\n var quarkPath = Quarks.quarkNameAsLocalPath(name);\n \"Quark encontrado\n```"}, {"role": "assistant", "content": "Comprobar con (ya está implementado pero no testeado en otros SO)."}], "family": "D3", "source_id": "quarks:SynthiGME/ignore/Desarrollo/Extension vs Quark/Deteccion de quark extension paths.scd", "aug": "patch", "prompt_tokens": 659, "answer_tokens": 29}
{"conversations": [{"role": "user", "content": "What is `TimeStretch` in SuperCollider?"}, {"role": "assistant", "content": "TimeStretch — Time Stretch TimeStretch is the 1952 Cadillac Fleetwood of extreme time stretching algorithms - a big, hulking, and slow beauty. All calculations and audio processing are done in the language, thus calculations move at a glacial pace. For a faster version that uses the server, but doesn't sound quite as good, check out TimeStretch2. Category: UGens > FFT."}], "family": "A", "source_id": "quarks:TimeStretch/supercollider/HelpSource/TimeStretch.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 135}
{"conversations": [{"role": "user", "content": "Explain `TimeStretch` in SuperCollider briefly."}, {"role": "assistant", "content": "TimeStretch — Time Stretch TimeStretch is the 1952 Cadillac Fleetwood of extreme time stretching algorithms - a big, hulking, and slow beauty. All calculations and audio processing are done in the language, thus calculations move at a glacial pace. For a faster version that uses the server, but doesn't sound quite as good, check out TimeStretch2. Category: UGens > FFT."}], "family": "A", "source_id": "quarks:TimeStretch/supercollider/HelpSource/TimeStretch.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 135}
{"conversations": [{"role": "user", "content": "What does `TimeStretch.stretchChan` do? What arguments does it take?"}, {"role": "assistant", "content": "Performs a stretch on a file channel and places the stretched file in the same folder as the Arguments: inFile — Path to the input file to be stretch. Can be a mono or stereo file.; durMult — How many times longer the outFile will be than the inFile. Goes waaaaay past 11 (try 100!). Must be an integer. Will round to the nearest integer if it receives a float.; chanNum — The Channel to stretch;; splits — By default, the algorithm will split audio data into 9 frequency \"octaves\", starting with the first octave below nyquist, then subsequent octaves down from there, leaving everything below the last split to the largest buffer. However, for files of transients, you may want to approach this differentl; filterOrder — By default (value = 129) the filter will be a brickwall fft bandpass filter separating frequency bands. However, by giving filterOrder a number 128 and below, the program switches to a Linkwitz-Riley filter with the order number provided.; fftType — By default (fftType=0) this will use a standard fft. However, if set to fftType=1, it will use the rfftTwo from the SignalBox Quark (which needs to be installed). This is about 50% faster.."}], "family": "B", "source_id": "quarks:TimeStretch/supercollider/HelpSource/TimeStretch.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 414}
@@ -2166,7 +2090,6 @@
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\\vowblend,{|freq = 100, b1 = 0.5, b2 = 0.5, b3 = 0.5, b4 = 0.5 bright = 0, pan = 0|\n var va = Vowel(\\a, \\bass),\n ve = Vowel(\\e, \\tenor),\n vi = Vowel(\\i, \\counterTenor),\n vo = Vowel(\\o, \\alto),\n vu = Vowel(\\u, \\soprano),\n sig;\n \n sig = Formants.ar(\n freq, \n va\n .blend(ve, b1)\n .blend(vi, b2)\n .blend(vo, b3)\n .blend(vu, b4)\n .brightenExp(bright, 1)\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\\vowblend,{|freq = 100, b1 = 0.5, b2 = 0.5, b3 = 0.5, b4 = 0.5 bright = 0, pan = 0|\n var va = Vowel(\\a, \\bass),\n ve = Vowel(\\e, \\tenor),\n vi = Vowel(\\i, \\counterTenor),\n vo = Vowel(\\o, \\alto),\n vu = Vowel(\\u, \\soprano),\n sig;\n \n sig = Formants.ar(\n freq, \n va\n .blend(ve, b1)\n .blend(vi, b2)\n .blend(vo, b3)\n .blend(vu, b4)\n .brightenExp(bright, 1) \n ) \n * EnvGen.kr(Env.perc, 3.0, doneAction: 2);\n\n Out.ar(0, Pan2.ar(sig, pan, 0.1));\n}).add\n);\n\n\n(\nTask({ 32.do({ arg i; \n Synth(\\vowblend, [ \n \\pan, i.linlin(0,32, -1, 1 ),\n \\freq, i.linlin(0,32, 30, 66 ).midicps,\n \\b1, 2.rand,\n \\b2, 2.rand, \n \\b3, 2.rand,\n \\b4, 2.rand, \n \\bright, 1.5.rand\n ]); \n 0.25.wait\n\n});}).play\n)\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 516}
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nx = SynthDef(\\test, {\n Out.ar(0, \n Formants.ar(420, Vowel(\\a).addControls(3)) * 0.01\n )\n}).play\n);\n\nx.inspect\n\nx.setn(*Vowel(\\i).asKeyValuePairs(3);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nx = SynthDef(\\test, {\n Out.ar(0, \n Formants.ar(420, Vowel(\\a).addControls(3)) * 0.01\n )\n}).play\n);\n\nx.inspect\n\nx.setn(*Vowel(\\i).asKeyValuePairs(3));\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 149, "answer_tokens": 148}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// The code below generates a series of test signals for each speaker of \n// the currently active setup. In the default settings this generates \n// short pink noise bursts, twice on each group of 8 speakers.\n\n(\nn = 8; // size of speaker groups\nz = 1/4; // duration per burst\nt = \\pinkNoise; // udef name for sound generation\nr = 2; // number of repeats per group\nx = UScore();\n\n(WFSSpeakerConf.default.speakerCount / n).ceil.do({ |i|\n var folder;\n folder = UScore( i * (r * (n + 1) * z) );\n x.add( folder );\n r.do({ |ii|\n n.do({ |iii|\n folder.add( UChain( ((ii * (n + 1)) + iii) * z, iii, z * (3/4), \n [ t, [ \\seed, 12345 ] ],\n [ \\wfsIndex, [ \\index, (i * 8) + iii, \\gain, 0 ] ]\n )\n );\n });\n });\n folder.name = ([1,n] + (i*8)).join(\"-\"); \n});\n\nx.gui;\n)\n```"}, {"role": "assistant", "content": "The code below generates a series of test signals for each speaker of the currently active setup. In the default settings this generates short pink noise bursts, twice on each group of 8 speakers."}], "family": "D3", "source_id": "quarks:WFSCollider-Class-Library/Examples/code examples/speaker test generator.scd", "aug": "patch", "prompt_tokens": 417, "answer_tokens": 58}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//algorithm described here:\n//http://blogs.msdn.com/b/devdev/archive/2005/09/01/459540.aspx\n\n\n\n(\n\nn = 3;\np = n.collect{ |i| (0@1).rotate(2pi*i/n) };\n~point = 0.5@0.5;\nw = ScaledUserView.window( \"WFSSpeakerConf\", \n Rect( 128, 64, 400, 400 ), \n Rect.aboutPoint( 0@0, 2, 2 );\n);\nw.keepRatio = true;\nw.drawFunc = { \n var fader, crossfades, lines;\n Pen.addArc( ~point.asPoint * (1 @ -1), 0.1/2, 0, 2pi ).fill; \n \n // draw corns as blue points\n \n // vector connecting edge k to edge k-1\n ~vecs = p.size.collect{ |i| p[i] - p[(i-1).wrap(0,p.size-1)] };\n //vector connecting edge k to point\n ~vecs2 = p.collect{ |x| ~point - x };\n // if crossproducts of vector connecting edge k-1 to k and vector connecting edge k to point \n // have all the same sign then it's inside.\n if( ~vecs.collect{ |v,i| ((v.x*~vecs2[i].y)-(v.y*~vecs2[i].x)).isPositive }.asSet.size < 2) {\n Pen.color = Color.blue;\n } {\n Pen.color = Color.red;\n };\n p.do({ |pt|\n Pen.addArc( pt.asPoint * (1 @ -1), 0.1/2, 0, 2pi ).fill; \n });\n \n\n\n};\nw.scale = 1;\nw.mouseDownAction = { |v, x,y| ~point = (x @ y.neg); };\nw.mouseMoveAction = { |v, x,y| ~point = (x @ y.neg); };\n);\n\n// a more weird convex polygon\np = [0@0, 1@0\n```"}, {"role": "assistant", "content": "algorithm described here: http://blogs.msdn.com/b/devdev/archive/2005/09/01/459540.aspx."}], "family": "D3", "source_id": "quarks:WFSCollider-Class-Library/Examples/developer tests/test polygon inside detection.scd", "aug": "patch", "prompt_tokens": 711, "answer_tokens": 49}
{"conversations": [{"role": "user", "content": "What is `ZArchive` in SuperCollider?"}, {"role": "assistant", "content": "ZArchive — Compressed binary file format for saving large datasets and SuperCollider objects A compressed binary safe archive format. Supports very large file sizes and is fairly fast. Category: Files."}], "family": "A", "source_id": "quarks:ZArchive/HelpSource/Classes/ZArchive.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 71}
{"conversations": [{"role": "user", "content": "Explain `ZArchive` in SuperCollider briefly."}, {"role": "assistant", "content": "ZArchive — Compressed binary file format for saving large datasets and SuperCollider objects A compressed binary safe archive format. Supports very large file sizes and is fairly fast. Category: Files."}], "family": "A", "source_id": "quarks:ZArchive/HelpSource/Classes/ZArchive.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 71}
{"conversations": [{"role": "user", "content": "What does `ZArchive.write` do? What arguments does it take?"}, {"role": "assistant", "content": "open an archive for Arguments: pathName — path that the file will be written to. Returns: a ZArchive"}], "family": "B", "source_id": "quarks:ZArchive/HelpSource/Classes/ZArchive.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 38}
@@ -4404,8 +4327,6 @@
{"conversations": [{"role": "user", "content": "What does `BusMeters.start` do?"}, {"role": "assistant", "content": "starts the meters' synth and starts updating the"}], "family": "B", "source_id": "quarks:crucialviews/HelpSource/Classes/BusMeters.schelp", "aug": "none", "prompt_tokens": 30, "answer_tokens": 15}
{"conversations": [{"role": "user", "content": "What does `BusMeters.stop` do?"}, {"role": "assistant", "content": "stops the meter's synth and stops updating the"}], "family": "B", "source_id": "quarks:crucialviews/HelpSource/Classes/BusMeters.schelp", "aug": "none", "prompt_tokens": 30, "answer_tokens": 17}
{"conversations": [{"role": "user", "content": "What does `BusMeters.remove` do?"}, {"role": "assistant", "content": "When the window or parent view is closed then .remove is called (standard for all views). This will .stop the meter synth and stop further"}], "family": "B", "source_id": "quarks:crucialviews/HelpSource/Classes/BusMeters.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 46}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// runs before initializing default midi responders\n// must make sure the right device is set up as the first port\n\nvar index;\n\nMIDIClient.initialized.not.if({\n // restricting connections breaks MIDIPort if there are more sources than given here\n // so I'm removing the restriction. Initialize to the number of reported devices.\n MIDIClient.init/*(MIDIPort.numPorts, MIDIPort.numPorts)*/;\n\n if(Library.at(\\chucklib, \\midiSearches).isNil) {\n Library.put(\\chucklib, \\midiSearches, #[\"ultralite\", \"828\", \"remote\"]);\n };\n\n block { |break|\n Library.at(\\chucklib, \\midiSearches).do({ |string|\n index = MIDIClient.sources.detectIndex({ |item|\n item.device.find(string, true).notNil\n });\n if(index.notNil) { break.(index) };\n });\n };\n\n index.notNil.if({\n ~srcInports = [index];\n }, {\n ~srcInports = nil;\n });\n\n ~srcInports.debug(\"Index of default MIDI device\");\n}, {\n \"MIDIClient already initialized.\".postln;\n});\n\n~srcInports ?? { [] };\n```"}, {"role": "assistant", "content": "runs before initializing default midi responders must make sure the right device is set up as the first port."}], "family": "D3", "source_id": "quarks:ddwChucklib/Prototypes/devPreMIDIcfg.scd", "aug": "patch", "prompt_tokens": 489, "answer_tokens": 30}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// This creates an instance of the DMX class (see the DMX quark):\nd = DMX.new;\n// create a DMX device (the argument is the serial path at which it can be reached; see SerialPort.devices)\ne = EntTecDMXUSBPro.new( \"/dev/ttyUSB0\" );\n// set the device for DMX\nd.device = e;\n\n\n// create an empty cue:\nc = DMXCue.new;\n// these are the work lights in one part of the room (DMX channels 98, 100, 102)\n([98,100,102]-1).do{ |it| c.put( it, 1 ); };\n\nd.currentCue = c;\nd.setCue;\n\n// create an empty cue for darkness:\nb = DMXCue.new;\n\n// b is darkness:\nd.currentCue = b;\nd.setCue;\n\n// these are the 9 dmx channels for a ring of lights:\n~dmxRing = [ 55, 52, 67, 68, 71, 72, 75, 61, 58 ];\n\n// this is the subcue we'll use for the ring of lights\n// subcues only set the channels that are explicitly set, not other channels\n~dmxRingCue = DMXSubCue.new;\n\n// this is the subcue we'll use for the light spot in the middle\n~dmxSpot = DMXSubCue.new;\n\n// these is one dmx channel for the spot:\n~dmxSpotL = 87;\n\n(\nTdef( \\dmxtest, { loop{\n // set all channels in the ring to zero:\n ~dmxRing.do{ |jt| ~dmxRingCue.put( jt, 0 ); };\n // set a random channel to 1\n ~dmxRingCue.put( ~dmxRing.choose, 1 );\n // fade to the updat\n```"}, {"role": "assistant", "content": "This creates an instance of the DMX class (see the DMX quark):."}], "family": "D3", "source_id": "quarks:dmx/Help/DMXExample.help.scd", "aug": "patch", "prompt_tokens": 617, "answer_tokens": 23}
{"conversations": [{"role": "user", "content": "What is `DIdev` in SuperCollider?"}, {"role": "assistant", "content": "DIdev — pseudo drate ugen, searches for numbers with integer distance from a source signal, optionally avoiding repetitions within a span DIdev / PIdef / PLIdev search for numbers with integer distance from a source signal / pattern up to a given deviation. Repetitions within a lookback span are avoided, DIdev / PIdef / PLIdev randomly choose from possible solutions. Intended for search within integer grids (pitches, indices etc.), however applications with non-integer sources are possible, see examples. Category: Libraries > miSCellaneous > Idev suite."}], "family": "A", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/DIdev.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 177}
{"conversations": [{"role": "user", "content": "Explain `DIdev` in SuperCollider briefly."}, {"role": "assistant", "content": "DIdev — pseudo drate ugen, searches for numbers with integer distance from a source signal, optionally avoiding repetitions within a span DIdev / PIdef / PLIdev search for numbers with integer distance from a source signal / pattern up to a given deviation. Repetitions within a lookback span are avoided, DIdev / PIdef / PLIdev randomly choose from possible solutions. Intended for search within integer grids (pitches, indices etc.), however applications with non-integer sources are possible, see examples. Category: Libraries > miSCellaneous > Idev suite."}], "family": "A", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/DIdev.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 177}
{"conversations": [{"role": "user", "content": "What does `DIdev.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Creates a new DIdev Arguments: in — The source signal, integer distances are calculated from the value of this signal with each trigger. Can be demand rate or other ugen.; maxLookBack — Integer, the maximum lookback span. Fixed, defaults to 3.; minLoDev — Integer, the minimum low deviation (must not be exceeded by any loDev value). Should be negative, cannot be modulated, defaults to -3.; maxHiDev — Integer, the maximum high deviation (must not be exceeded by any hiDev value). Should be positive, cannot be modulated, defaults to 3.; lookBack — Determines the current lookback span for avoiding repetitions. Can be modulated (demand rate or other ugen, no ar) but must not exceed maxLookBack. If no value is passed, then maxLookBack is taken.; loDev — Determines the current low deviation for the search. Can be modulated (demand rate or other ugen) but must not exceed minLoDev. If not specified, them minLoDev is taken.; hiDev — Determines the current high deviation for the search. Can be modulated (demand rate or other ugen) but must not exceed maxHiDev. If not specified, then maxHiDev is taken.; thr — Threshold for equality comparison. Can be modulated (demand rate or other ugen). Defaults to 1e-3.."}], "family": "B", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/DIdev.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 448}
@@ -5281,17 +5202,17 @@
{"conversations": [{"role": "user", "content": "What does `RedInterpolator.goto` do? What arguments does it take?"}, {"role": "assistant", "content": "Run the Arguments: target — The target value to go to.; dur — Duration in seconds.; curve — Curvature. If `nil` then linear. Can also be a SimpleNumber, a custom Function or an EaseOverview##Ease object (install the Ease quark with `Quarks.install(\"Ease\");`).."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedInterpolator.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 104}
{"conversations": [{"role": "user", "content": "What is `RedKCS` in SuperCollider?"}, {"role": "assistant", "content": "RedKCS — kansas city standard encoder/decoder for sclang and server audio frequency-shift keying (AFSK) as used by old computers to store data on cassette. See https://en.wikipedia.org/wiki/Kansas_City_standard Category: Red > redTools."}], "family": "A", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 101}
{"conversations": [{"role": "user", "content": "Explain `RedKCS` in SuperCollider briefly."}, {"role": "assistant", "content": "RedKCS — kansas city standard encoder/decoder for sclang and server audio frequency-shift keying (AFSK) as used by old computers to store data on cassette. See https://en.wikipedia.org/wiki/Kansas_City_standard Category: Red > redTools."}], "family": "A", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 101}
-{"conversations": [{"role": "user", "content": "What does `RedKCS.new` do? What arguments does it take?"}, {"role": "assistant", "content": "a new encoder/decoder using square or sine Arguments: sampleRate — defaults to the server's sample rate.; baudRate — can go lower and higher. lower can be interesting sound-wise. higher for faster transmission.; zeroFreq — in Hz. the standard specifies 1200 which mean that at 300 bauds there will be four pulses/cycles for marking a zero bit.; oneFreq — in Hz. the standard specifies 2400 which mean that at 300 bauds there will be eight pulses/cycles for marking a one bit.; addNewlineGap — optional. add ten extra NULL characters at the end of each line.; addCarriageReturn — optional. add an extra CODEChar.ret (ascii 13) for each CODEChar.nl (ascii 10).; leaderDur — in seconds. lead-in data (stream of 1).; trailerDur — in seconds. trailing data (stream of 1).."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 295}
+{"conversations": [{"role": "user", "content": "What does `RedKCS.new` do? What arguments does it take?"}, {"role": "assistant", "content": "a new encoder/decoder using square or sine Arguments: sampleRate — defaults to the server's sample rate.; baudRate — can go lower and higher. lower can be interesting sound-wise. higher for faster transmission.; zeroFreq — in Hz. the standard specifies 1200 which mean that at 300 bauds there will be four pulses/cycles for marking a zero bit.; oneFreq — in Hz. the standard specifies 2400 which mean that at 300 bauds there will be eight pulses/cycles for marking a one bit.; addNewlineGap — optional. add ten extra NULL characters at the end of each line.; addCarriageReturn — optional. add an extra Char.ret (ascii 13) for each Char.nl (ascii 10).; leaderDur — in seconds. lead-in data (stream of 1).; trailerDur — in seconds. trailing data (stream of 1).."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 287}
{"conversations": [{"role": "user", "content": "What does `RedKCS.encodeByte` do? What arguments does it take?"}, {"role": "assistant", "content": "convert an 8-bit value into an array of Arguments: byte — an Integer 0-255.. Returns: an array of samples. for square waves an Int8Array and for sines a FloatArray."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 43, "answer_tokens": 62}
{"conversations": [{"role": "user", "content": "What does `RedKCS.encodeString` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a string into an array of Arguments: str — a String.. Returns: a FloatArray of samples. either square waves or sines."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 46}
-{"conversations": [{"role": "user", "content": "What does `RedKCS.encodeStringAsBuffer` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a string into a buffer that can be played. NOTEit's easier to use the #-play method Arguments: server — defaults to CODEServer.default.; str — the string to be encoded.; action — a Function for what to do when the buffer is created.. Returns: the Buffer instance (if successful). note that the buffer will not be filled with samples yet - use the action function."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 46, "answer_tokens": 129}
+{"conversations": [{"role": "user", "content": "What does `RedKCS.encodeStringAsBuffer` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a string into a buffer that can be played. NOTEit's easier to use the #-play method Arguments: server — defaults to Server.default.; str — the string to be encoded.; action — a Function for what to do when the buffer is created.. Returns: the Buffer instance (if successful). note that the buffer will not be filled with samples yet - use the action function."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 46, "answer_tokens": 125}
{"conversations": [{"role": "user", "content": "What does `RedKCS.encodeStringAsSoundFile` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a string into a sound file (render to Arguments: str — the string to be encoded.; path — a string specifying where to save the resulting sound file.. Returns: a Boolean indicating if creating the file was successful."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 46, "answer_tokens": 70}
{"conversations": [{"role": "user", "content": "What does `RedKCS.decodeFloatArray` do? What arguments does it take?"}, {"role": "assistant", "content": "convert an array of sample values into an array of 8-bit Arguments: arr — a FloatArray.; rate — sample rate of the data. if not specified #-sampleRate will be used.; channels — might need to adapt this if the samples in the array are interleaved (stereo).. Returns: an Int8Array."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 45, "answer_tokens": 98}
{"conversations": [{"role": "user", "content": "What does `RedKCS.decodeBuffer` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a buffer of sample values into a Arguments: buf — the Buffer instance to decode.; raw — a Boolean indicating if output should be the raw bytes (Int8Array) or a String (with any NULL characters removed).; action — a Function that will be called when the decoding is finished. the string or array with raw bytes is passed in as the first argument.."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 118}
{"conversations": [{"role": "user", "content": "What does `RedKCS.decodeSoundFile` do? What arguments does it take?"}, {"role": "assistant", "content": "convert a sound file into a Arguments: path — a String pointing at the sound file to be decoded. mono or multi-channel does not matter - only the first (left) channel will be used.; raw — a Boolean indicating if output should be the raw bytes (Int8Array) or a String (with any NULL characters removed).. Returns: a String or an Int8Array. CODEnil if unsuccessful."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 132}
{"conversations": [{"role": "user", "content": "What does `RedKCS.play` do? What arguments does it take?"}, {"role": "assistant", "content": "start realtime generation using square or sine Arguments: target — the Group or Server to add the node to.; out — bus to play on.; amp — volume; addAction — a Symbol.."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 62}
{"conversations": [{"role": "user", "content": "What does `RedKCS.send` do? What arguments does it take?"}, {"role": "assistant", "content": "encode and generate sound in Arguments: str — the String to send.."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "What does `RedKCS.listen` do? What arguments does it take?"}, {"role": "assistant", "content": "start realtime Arguments: target — the Group or Server to add the node to.; action — a Function that will be called when and if the decoding is finished. a string is passed in as the first argument.; in — bus to listen to. use CODEs.options.numOutputBusChannels for the mic (same as CODESoundIn.ar(0)); thresh — internal analyser synth's amplitude threshold (+/-).; rq — internal analyser synth's bandpass filter bandwidth.; addAction — a Symbol. NOTEdefaults to \\addToTail because normally the internal analyser synth needs to be below any sound generating synths in the order of execution."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 224}
+{"conversations": [{"role": "user", "content": "What does `RedKCS.listen` do? What arguments does it take?"}, {"role": "assistant", "content": "start realtime Arguments: target — the Group or Server to add the node to.; action — a Function that will be called when and if the decoding is finished. a string is passed in as the first argument.; in — bus to listen to. use CODEs.options.numOutputBusChannels for the mic (same as SoundIn.ar(0)); thresh — internal analyser synth's amplitude threshold (+/-).; rq — internal analyser synth's bandpass filter bandwidth.; addAction — a Symbol. NOTEdefaults to \\addToTail because normally the internal analyser synth needs to be below any sound generating synths in the order of execution."}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 220}
{"conversations": [{"role": "user", "content": "What does `RedKCS.stopListening` do?"}, {"role": "assistant", "content": "free internal analyser synth and responder. also a `CmdPeriod` will clear"}], "family": "B", "source_id": "quarks:redSys/HelpSource/Classes/RedKCS.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 26}
{"conversations": [{"role": "user", "content": "What is `RedLFSR4` in SuperCollider?"}, {"role": "assistant", "content": "RedLFSR4 — 4-bit linear feedback shift register 4-bit fibonacci LFSR. see https://en.wikipedia.org/wiki/Linear_feedback_shift_register Category: Red > redUGens."}], "family": "A", "source_id": "quarks:redSys/HelpSource/Classes/RedLFSR4.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 85}
{"conversations": [{"role": "user", "content": "Explain `RedLFSR4` in SuperCollider briefly."}, {"role": "assistant", "content": "RedLFSR4 — 4-bit linear feedback shift register 4-bit fibonacci LFSR. see https://en.wikipedia.org/wiki/Linear_feedback_shift_register Category: Red > redUGens."}], "family": "A", "source_id": "quarks:redSys/HelpSource/Classes/RedLFSR4.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 85}
@@ -5680,39 +5601,10 @@
{"conversations": [{"role": "user", "content": "Explain `RedWorld2` in SuperCollider briefly."}, {"role": "assistant", "content": "RedWorld2 — world with soft walls See also RedWorld, RedWorld1, RedWorld3. Category: Red > redUniverse."}], "family": "A", "source_id": "quarks:redUniverse/HelpSource/Classes/RedWorld2.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 49}
{"conversations": [{"role": "user", "content": "What is `RedWorld3` in SuperCollider?"}, {"role": "assistant", "content": "RedWorld3 — world with hard walls See also RedWorld, RedWorld1, RedWorld2. Category: Red > redUniverse."}], "family": "A", "source_id": "quarks:redUniverse/HelpSource/Classes/RedWorld3.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 50}
{"conversations": [{"role": "user", "content": "Explain `RedWorld3` in SuperCollider briefly."}, {"role": "assistant", "content": "RedWorld3 — world with hard walls See also RedWorld, RedWorld1, RedWorld2. Category: Red > redUniverse."}], "family": "A", "source_id": "quarks:redUniverse/HelpSource/Classes/RedWorld3.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 50}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//very simple test. one single object within a world with gravity force\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 1;\n\n//--world\nw= RedWindow(\"vector test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[-0.4, 0.98]; //world xy gravity\nworld= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.25); //dim,grav,maxvel,damp\n\n//--objects\n{\n var loc= RedVector2D[250, 10]; //initial xy location\n var vel= RedVector2D[3.5, 0]; //initial velocity\n var acc= RedVector2D[1, 1].rand2; //initial acceleration\n RedObject(world, loc, vel, acc, 1, 10); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n Pen.strokeColor= Color.white;\n world.objects.do{|o| //iterate all objects in this world\n o.addForce(o.world.gravity); //add gravity\n o.update; //object update\n world.contain(o); //keep within world borders\n\n //--render\n Pen.strokeRect(Rect.aboutRedObject2D(o));\n }\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "very simple test. one single object within a world with gravity force."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/001-single.scd", "aug": "patch", "prompt_tokens": 524, "answer_tokens": 18}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//multiple objects within a world with gravity force\n//color and size depends on object's mass\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 80;\n\n//--world\nw= RedWindow(\"vector test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[-0.1, 0.98]; //world xy gravity\nworld= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.2); //dim,grav,maxvel,damp\n\n//--objects\n{\n var mass= 1.0.rrand(4); //random mass for each object\n RedObject(world, RedVector2D[width, 20].rand, 0, 0, mass, mass*5); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n world.objects.do{|o|\n o.addForce(world.gravity);\n o.update;\n world.contain(o);\n\n //--render\n Pen.strokeColor= Color.grey(o.mass/4);\n Pen.strokeRect(Rect.aboutRedObject2D(o));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "multiple objects within a world with gravity force color and size depends on object's mass."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/002-multiple.scd", "aug": "patch", "prompt_tokens": 464, "answer_tokens": 26}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//multiple objects with gravity + a 'wind' force blowing here and there\n\n(\nvar width= 300, height= 300, w, world, wgrav, n= 50,\nwind, cnt= 0, amp= 0.5, period= 400;\n\n//--world\nw= RedWindow(\"wind test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld3(RedVector2D[width, height], wgrav, 7, 0.01); //dim,grav,maxvel,damp\n//world= RedWorld(RedVector2D[width, height], wgrav, 5); //dim,grav,maxvel,damp\n\n//--objects\n{\n var loc= RedVector2D[width, 50].rand;\n var vel= RedVector2D[3, 3].rand;\n var mass= 0.5.rrand(4);\n RedObject(world, loc, vel, 0, mass, mass*5); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n cnt= cnt+1;\n wind= amp*sin(2pi*(cnt/period)); //wind blowing\n world.objects.do{|o|\n o.addForce(world.gravity);\n o.addForce(wind);\n o.update;\n world.contain(o);\n\n //--render\n Pen.strokeColor= Color.grey(o.mass/4);\n Pen.strokeRect(Rect.aboutRedObject2D(o));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "multiple objects with gravity + a 'wind' force blowing here and there."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/003-multiple_wind.scd", "aug": "patch", "prompt_tokens": 580, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//detect floor bounce test\n//with simple sound - freq, dur, amp, pan mapped to object properties\n\n(\ns.waitForBoot{\n var width= 300, height= 300, w, wgrav, world, n= 20;\n\n //--synthesis\n SynthDef(\\lightbulbs, {|out= 0, freq= 400, maxDur= 0.3, amp= 1, pan= 0|\n var e, z, freqs, amps, rings;\n freqs= Array.geom(4, freq, Rand(1.5, 2.5));\n amps= Array.geom(4, 0.5, Rand(0, 1));\n rings= Array.geom(4, maxDur, Rand(0, 1))*maxDur;\n e= EnvGen.ar(Env.perc(0.01, maxDur), 1, amp, doneAction:2);\n z= Klank.ar(`[freqs, amps, rings], Impulse.ar(0));\n Out.ar(out, Pan2.ar(z*e, pan));\n }).add;\n s.sync;\n\n //--world\n w= RedWindow(\"bounce test\", Rect(128, 64, width, height)).front;\n wgrav= RedVector2D[-0.1, 0.98];\n world= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.1); //dim,grav,maxvel,damp\n //world= RedWorld(RedVector2D[width, height], wgrav, 20, 0.9); //dim,grav,maxvel,damp\n\n //--objects\n {\n var loc= RedVector2D[width, 20].rand;\n var mass= 1.0.rrand(4);\n RedObject(world, loc, 0, 0, mass, mass*5); //world,loc,vel,acc,mass,size\n }.dup(n);\n\n //--loop\n w.draw{\n world.objects.do{|o|\n var osize, freq, amp, pan;\n o.addForce(world.gravity);\n \n```"}, {"role": "assistant", "content": "detect floor bounce test with simple sound - freq, dur, amp, pan mapped to object properties."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/004-multiple_synth.scd", "aug": "patch", "prompt_tokens": 695, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//detect border bounce test\n//with simple sound - freq, dur, amp, pan mapped to object properties\n//and some different graphics\n\n(\ns.waitForBoot{\n var width= 400, height= 400, w, wgrav, world, n= 25;\n\n //--synthesis\n SynthDef(\\lightbulbs, {|out= 0, freq= 400, maxDur= 0.3, amp= 1, pan= 0|\n var e, z, freqs, amps, rings;\n freqs= Array.geom(4, freq, Rand(1.5, 2.5));\n amps= Array.geom(4, 0.5, Rand(0, 1));\n rings= Array.geom(4, maxDur, Rand(0, 1))*maxDur;\n e= EnvGen.kr(Env.perc(0.01, maxDur), 1, amp, doneAction:2);\n z= Klank.ar(`[freqs, amps, rings], Impulse.ar(0));\n Out.ar(out, Pan2.ar(z*e, pan));\n }).add;\n s.sync;\n\n //--world\n w= RedWindow(\"bounce test\", Rect(128, 64, width, height)).front;\n w.background= Color.white;\n wgrav= RedVector2D[0, 0];\n world= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.1); //dim,grav,maxvel,damp\n\n //--objects\n {\n var loc= RedVector2D[width, height].rand; //random position\n var vel= RedVector2D[4, 4].rand2.round(2); //quantise velocities\n var mass= 2.rrand(14);\n RedObject(world, loc, vel, 0, mass, mass*5); //world,loc,vel,acc,mass,size\n }.dup(n);\n\n //--loop\n w.draw{\n Pen.strokeColor= Color.black;\n \n```"}, {"role": "assistant", "content": "detect border bounce test with simple sound - freq, dur, amp, pan mapped to object properties and some different graphics."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/005-multiple_synth.scd", "aug": "patch", "prompt_tokens": 675, "answer_tokens": 42}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//everybody attracts eachother - not clear each frame\n//bigger mass is indicated by more white colour\n\n(\nvar width= 640, height= 480, w, wgrav, world, n= 12;\n\n//--world\nw= RedWindow(\"attractor test4\", Rect(128, 64, width, height)).front;\nw.clearOnRefresh= false;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld(RedVector2D[width, height], wgrav, 5, 1); //dim,grav,maxvel,damp\n\n//--objects\n{\n var loc= RedVector2D[width, height].rand;\n var mass= 0.5.rrand(10);\n RedObject(world, loc, 0, RedVector2D[1, 1], mass, mass*5); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n world.objects.do{|o, i|\n world.objects.do{|oo, j|\n if(i!=j, {\n o.addForce(o.gravityForce(oo));\n if(o.loc.distance(oo.loc)<(o.size*2), {\n o.addForce(o.gravityForce(oo).neg);\n });\n });\n };\n o.update;\n world.contain(o);\n\n //--render\n Pen.fillColor= Color.hsv(0.4, 1-(o.mass/12), 1, o.mass/12);\n Pen.fillRect(Rect.aboutPoint(o.loc.asPoint, 0.5, 0.5));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "everybody attracts eachother - not clear each frame bigger mass is indicated by more white colour."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/013-attraction4.scd", "aug": "patch", "prompt_tokens": 595, "answer_tokens": 30}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//one object pushes away the other in a world without bounds\n//with mouse controlling repulsive object location\n\n(\nvar width= 300, height= 300, w, wgrav, world, rep, obj;\n\n//--world\nw= RedWindow(\"repulsive test1\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld3(RedVector2D[width, height], wgrav, 10); //dim,grav,maxvel,damp\n\n//--objects\nrep= RedObject(world, RedVector2D[100, 100], RedVector2D[0, 0], RedVector2D[0, 0], 105, 5);\nobj= RedObject(world, RedVector2D[130, 30], RedVector2D[1.5, 1], RedVector2D[0, 0], 1.5, 10);\n\n//--loop\nw.draw{\n rep.loc= w.mouse;\n obj.addForce(obj.gravityForce(rep).neg);\n obj.update;\n world.contain(obj);\n\n //--render\n Pen.strokeColor= Color.green;\n Pen.strokeRect(Rect.aboutRedObject2D(rep));\n Pen.strokeColor= Color.white;\n Pen.strokeRect(Rect.aboutRedObject2D(obj));\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "one object pushes away the other in a world without bounds with mouse controlling repulsive object location."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/015-repulsive.scd", "aug": "patch", "prompt_tokens": 523, "answer_tokens": 29}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//multiple objects are pushed away by a single\n//with mouse controlling repulsive object location\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 10,\nrep;\n\n//--world\nw= RedWindow(\"repulsive test2\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.1];\nworld= RedWorld(RedVector2D[width, height], wgrav, 5); //dim,grav,maxvel,damp\n\n//--objects\nrep= RedObject(world, RedVector2D[width/2, 100], nil, nil, 50, 5);\n{\n var loc= RedVector2D[width, height].rand;\n RedObject(world, loc, RedVector2D[1.5, 1.0].rand, RedVector2D[0, 0], 1.5, 10)\n}.dup(n); //world,loc,vel,acc,mass,size\n\n//--loop\nw.draw{\n Pen.strokeColor= Color.green;\n rep.loc= w.mouse;\n Pen.strokeRect(Rect.aboutRedObject2D(rep));\n Pen.strokeColor= Color.white;\n world.objects.do{|o|\n if(o!=rep, {\n o.addForce(o.gravityForce(rep).neg);\n o.addForce(world.gravity);\n o.update;\n world.contain(o);\n\n //--render\n Pen.addRect(Rect.aboutRedObject2D(o));\n });\n };\n Pen.stroke;\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "multiple objects are pushed away by a single with mouse controlling repulsive object location."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/016-repulsive2.scd", "aug": "patch", "prompt_tokens": 600, "answer_tokens": 29}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//discrete world - explosions\n//with mouse controlling repulsive object location\n\n(\nvar width= 640, height= 480, w, wgrav, world, n= 50,\nrep, pixelSize= 4, wn= width/n, hn= height/n;\n\n//--world\nw= RedWindow(\"discrete world - explosions\", Rect(128, 64, width, height)).front;\nworld= RedWorld3(RedVector2D[n, n], RedVector2D[0, 0.98], 3, 0.5); //dim,grav,maxvel,damp\n\n//--objects\nrep= RedObject(nil, RedVector2D[width/2, 100], nil, nil, 0.5, pixelSize);\nn.do{|x|\n n.do{|y|\n var loc= RedVector2D[0.gauss(2), 0.gauss(2)]+(n/2);\n RedObject(world, loc, RedVector2D[1.0.rand2, -2.0.rand], nil, 15, pixelSize); //world,loc,vel,acc,mass,size\n };\n};\n\n//--loop\nw.draw{\n Pen.smoothing_(false);\n Pen.strokeColor= Color.green;\n rep.loc= w.mouse/[wn, hn];\n Pen.strokeRect(Rect.aboutPoint(rep.loc.round.asPoint*[wn, hn], pixelSize, pixelSize));\n\n world.objects.do{|o|\n o.addForce(o.gravityForce(rep).neg); //repel\n o.addForce(o.world.gravity); //add gravity\n o.update;\n world.contain(o); //keep within world borders\n\n //--render\n Pen.fillColor= Color.hsv(o.mass/25%1, 1, 1, (o.vel.mag*0.5).min(1));\n Pen.fillRect(Rect.aboutPoint(o.loc.round.asPoint*[wn, hn], pixelSize, pixelSi\n```"}, {"role": "assistant", "content": "discrete world - explosions with mouse controlling repulsive object location."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/018-repulsive_discrete.scd", "aug": "patch", "prompt_tokens": 701, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//an area middle of the screen has friction - no gravity in this world\n\n(\nvar width= 300, height= 300, w, world, acc, vel, loc, obj, fric, ff;\n\n//--world\nw= RedWindow(\"friction test\", Rect(128, 64, width, height)).front;\nworld= RedWorld(RedVector2D[width, height], 0, 30, 0.8); //dim,grav,maxvel,damp\n\n//--objects\nacc= RedVector2D[0, 0];\nvel= RedVector2D[3.5, 10];\nloc= RedVector2D[250, 10];\nobj= RedObject(world, loc, vel, acc, 1.5, 10);\n\nfric= Rect(0, height*0.4, width, 40); //area with friction\nff= -0.5; //amount of friction\n\n//--loop\nw.draw{\n if(fric.containsPoint(obj.loc.asPoint), {\n if(obj.vel.mag>0 and:{obj.vel.mag>obj.frictionForce(ff).mag}, {\n obj.addForce(obj.frictionForce(ff));\n }, {\n obj.vel= obj.vel*0; //stop object\n });\n });\n obj.update;\n world.contain(obj);\n\n //--render\n Pen.fillColor= Color.red;\n Pen.fillRect(fric);\n Pen.strokeColor= Color.white;\n Pen.strokeRect(Rect.aboutRedObject2D(obj));\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "an area middle of the screen has friction - no gravity in this world."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/020-friction.scd", "aug": "patch", "prompt_tokens": 569, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//an area middle of the screen has super friction - no gravity in this world\n\n(\nvar width= 300, height= 300, w, world, acc, vel, loc, obj, fric, ff;\n\n//--world\nw= RedWindow(\"superfriction test\", Rect(128, 64, width, height)).front;\nworld= RedWorld(RedVector2D[width, height], 0, 30, 0.8); //dim,grav,maxvel,damp\n\n//--objects\nacc= RedVector2D[0, 0];\nvel= RedVector2D[1.5, 1.5];\nloc= RedVector2D[250, 50];\nobj= RedObject(world, loc, vel, acc, 1.5, 10);\n\nfric= Rect(0, height*0.4, width, 40); //area with super friction\nff= 0.5; //amount of friction\n\n//--loop\nw.draw{\n if(fric.containsPoint(obj.loc.asPoint), {\n if(obj.vel.mag>0 and:{obj.vel.mag>obj.frictionForce(ff).mag}, {\n obj.addForce(obj.frictionForce(ff));\n }, {\n obj.vel= obj.vel*0; //stop object\n });\n });\n obj.update;\n world.contain(obj);\n\n //--render\n Pen.fillColor= Color.green;\n Pen.fillRect(fric);\n Pen.strokeColor= Color.white;\n Pen.strokeRect(Rect.aboutRedObject2D(obj));\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "an area middle of the screen has super friction - no gravity in this world."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/021-superfriction.scd", "aug": "patch", "prompt_tokens": 578, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//an area middle of the screen has viscosity - no gravity in this world\n\n(\nvar width= 300, height= 300, w, world, acc, vel, loc, obj, visc, vv;\n\n//--world\nw= RedWindow(\"viscosity test\", Rect(128, 64, width, height)).front;\nworld= RedWorld(RedVector2D[width, height], 0, 30); //dim,grav,maxvel,damp\n\n//--objects\nacc= RedVector2D[0, 0];\nvel= RedVector2D[3.5, 30];\nloc= RedVector2D[250, 10];\nobj= RedObject(world, loc, vel, acc, 1.5, 10);\n\nvisc= Rect(0, height*0.4, width, 40); //area with viscosity\nvv= -0.13; //amount of viscosity\n\n//--loop\nw.draw{\n if(visc.containsPoint(obj.loc.asPoint), {\n obj.addForce(obj.viscosityForce(vv));\n });\n obj.update;\n world.contain(obj);\n\n //--render\n Pen.fillColor= Color.yellow;\n Pen.fillRect(visc);\n Pen.strokeColor= Color.white;\n Pen.strokeRect(Rect.aboutRedObject2D(obj));\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "an area middle of the screen has viscosity - no gravity in this world."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/022-viscosity.scd", "aug": "patch", "prompt_tokens": 508, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//center of mass of two objects\n//cyan (objB) has more mass initially\n\n(\nvar width= 300, height= 300, w, wgrav, world;\n\n//--world\nw= RedWindow(\"barycenter - 2 objects\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld3(RedVector2D[width, height], wgrav, 5, 0); //dim,grav,maxvel,damp\n\n//--objects\n~objA= RedObject(world, RedVector2D[width, height].rand, RedVector2D[0, 0], RedVector2D[0, 0], 5, 5); //world,loc,vel,acc,mass,size\n~objB= RedObject(world, RedVector2D[width, height].rand, RedVector2D[0, 0], RedVector2D[0, 0], 8, 8); //world,loc,vel,acc,mass,size\n\n//--loop\nw.draw{\n var bary;\n ~objA.addForce(~objA.gravityForce(~objB));\n ~objB.addForce(~objB.gravityForce(~objA));\n //~objA.addForce(world.gravity);\n //~objB.addForce(world.gravity);\n ~objA.update;\n ~objB.update;\n world.contain(~objA);\n world.contain(~objB);\n bary= ~objA.barycenter(~objB);\n\n //--render\n Pen.strokeColor= Color.magenta;\n Pen.strokeOval(Rect.aboutRedObject2D(~objA));\n Pen.strokeColor= Color.cyan;\n Pen.strokeOval(Rect.aboutRedObject2D(~objB));\n Pen.fillColor= Color.white;\n Pen.fillRect(Rect.aboutRedVector2D(bary, 1));\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n);\n\n\n~o\n```"}, {"role": "assistant", "content": "center of mass of two objects cyan (objB) has more mass initially."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/025-barycenter.scd", "aug": "patch", "prompt_tokens": 726, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//wave with objects\n//with sound - like a big mixer that mix partials. object's y position is amplitude\n\n(\ns.waitForBoot{\n var width= 300, height= 300, w, wgrav, world, n= 30,\n sys, synths;\n\n //--synthesis\n SynthDef(\\sine, {|out= 0, freq= 400, beat= 1, amp= 1, pan= 0|\n var z;\n z= Mix(SinOsc.ar(freq+[0, beat], 0, amp*0.5));\n Out.ar(out, Pan2.ar(z, pan));\n }).add;\n s.sync;\n\n //--world\n RedUniverse.clear;\n w= RedWindow(\"wave test synths\", Rect(128, 64, width, height)).front;\n wgrav= RedVector2D[0, 0.04];\n world= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.2); //dim,grav,maxvel,damp\n\n //--objects\n sys= RedWaveSystem(n, {|i| i}, 0, {1.0.rand}, 0.1);\n {|i|\n var loc= RedVector2D[width/n*i, height/2];\n sys.add(RedObject(world, loc, nil, nil, 1.5, 12)); //world,loc,vel,acc,mass,size\n }.dup(n);\n synths= {|i| Synth(\\sine, [\\beat, 0, \\amp, 0])}.dup(n);\n s.sync;\n\n //--loop\n w.draw{\n if(0.005.coin, {world.gravity= RedVector2D[0, -0.7.rrand(0.7)]; world.gravity.postln});\n sys.do{|o, i|\n var freq, amp, pan;\n o.loc= o.loc+RedVector[0, sys.wave.wrapAt(i)];\n o.addForce(o.world.gravity);\n freq= o.loc[0]/width*1000+200;\n amp= 1-(\n```"}, {"role": "assistant", "content": "wave with objects with sound - like a big mixer that mix partials. object's y position is amplitude."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/031-wave_synth.scd", "aug": "patch", "prompt_tokens": 718, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//example using the RedWaveSystem class. angluar velocity changes at random\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 50,\nsys, spook= 0;\n\n//--world\nw= RedWindow(\"wavesystem test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld(RedVector2D[width, height], wgrav, 20, 0.2); //dim,grav,maxvel,damp\n\n//--system\nsys= RedWaveSystem(n, {5.0.rand2}, {2pi.rand}, {0.5.rand}, 0.25);\n{|i|\n var loc= RedVector2D[width/n*i, height/2];\n sys.add(RedObject(world, loc, nil, 0, 1.5, 10)); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n //if(0.005.coin, {world.gravity= RedVector2D[0, -0.7.rrand(0.7)]; world.gravity.postln});\n if(0.005.coin, {sys.angularVel= 0.5.rand2});\n sys.do{|o, i|\n o.loc= o.loc+RedVector2D[0, sys.wave.wrapAt(i)];\n //o.vel= o.vel+RedVector2D[0, sys.wave.wrapAt(i)];\n //o.addForce(RedVector2D[0, sys.wave.wrapAt(i)]);\n };\n //sys.addForce(world.gravity);\n sys.update;\n\n //--render\n Pen.fillColor= Color.grey(1, 0.5);\n //Pen.strokeColor= Color.grey(1, 0.5);\n //Pen.moveTo(sys.objects[0].loc.asPoint);\n sys.do{|o, i|\n Pen.fillOval(Rect.aboutRedObject2D(o));\n //Pen.lineTo(o.loc.asPoint);\n };\n //Pen.stroke;\n};\n```"}, {"role": "assistant", "content": "example using the RedWaveSystem class. angluar velocity changes at random."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/034-wave-system.scd", "aug": "patch", "prompt_tokens": 743, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//everybody chase first boid. interesting exploring behaviour. slow down as approaching\n//mouse controls the first boid\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 5;\n\n//--world\nw= RedWindow(\"boids test1\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld(RedVector2D[width, height], wgrav, 10, 0.05); //dim,grav,maxvel,damp\n\n//--objects\n{\n var loc= RedVector2D[width, height].rand;\n var vel= RedVector2D[0.5, 0.5].rand2;\n var mass= 0.5.rrand(4);\n var obj= RedBoid(world, loc, vel, RedVector2D[0, 0], mass, mass*5)\n .maxForce_(1).wdistance_(3.rrand(13)).wchange_(0.75).wradius_(10.rrand(50));\n}.dup(n); //world,loc,vel,acc,mass,size\n\n//--loop\nw.draw{\n world.objects.do{|o, i|\n var trg;\n if(i!=0, {\n trg= o.addForceWander2D;\n o.addForceArrive(world.objects[0].loc);\n //--plot target for testing\n //Pen.strokeColor= Color.red;\n //Pen.strokeOval(Rect.aboutRedVector2D(trg, o.wradius));\n\n }, {\n world.objects[0].loc= w.mouse;\n });\n //o.addForce(world.gravity); //no gravity involved\n o.update;\n world.contain(o);\n\n //--render\n Pen.fillColor= Color.grey(1-(i/n), 0.5);\n Pen.fillOval(Rect.aboutRed\n```"}, {"role": "assistant", "content": "everybody chase first boid. interesting exploring behaviour. slow down as approaching mouse controls the first boid."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/050-boids.scd", "aug": "patch", "prompt_tokens": 666, "answer_tokens": 37}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//agents playing game-of-life. objects are neightbours if they touch\n//standard rule modified to also include: if no neighbours then become alive\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 40,\nrule, px= 0, py= 0;\n\n//--world\nw= RedWindow(\"agents test ca\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.08];\n//world= RedWorld(RedVector2D[width, height], wgrav, 10, 0.1); //dim,grav,maxvel,damp\nworld= RedWorld3(RedVector2D[width, height], wgrav, 10, 0.1); //dim,grav,maxvel,damp\n\n//--objects\nworld.objects= {|i|\n var loc= RedVector2D[px+15, py+15];\n var obj= RedAgent(world, loc, RedVector2D[0.5, 0.5].rand2, nil, 1, 10); //world,loc,vel,acc,mass,size\n obj.state= (\\cell: 2.rand, \\neighbours: 0);\n px= px+(obj.size*2-1);\n if(px>(width*0.9), {\n px= 0;\n py= py+(obj.size*2-1);\n });\n obj\n}.dup(n);\n\n//rule= #[[2, 3], [3]]; //rule \"23/3\" conways game of life\n//rule= #[[2, 3], [3, 6]]; //rule \"23/36\" highlife\nrule= #[[2, 3], [0, 3]]; //rule \"23/30\" modded conways game of life\n\n//--loop\nw.draw{\n world.objects.do{|o, i|\n var neighbours= 0;\n world.objects.do{|oo, j|\n if(i!=j, {\n if(o.loc.distance(oo.loc)<(o.size*2).min(oo.size*2), {\n \n```"}, {"role": "assistant", "content": "agents playing game-of-life. objects are neightbours if they touch standard rule modified to also include: if no neighbours then become alive."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/060-angents-gol.scd", "aug": "patch", "prompt_tokens": 699, "answer_tokens": 46}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//simple particlesystem.\n//with mouse controlling world gravity and system position\n\n(\nvar width= 300, height= 300, w, world,\nsys;\n\n//--world\nw= RedWindow(\"particlesystem test\", Rect(128, 64, width, height)).front;\nworld= RedWorld3(RedVector2D[width, height], 0, 20, -0.25); //dim,grav,maxvel,damp\n\n//--system\nsys= RedParticleSystem.new;\n\n//--loop\nw.draw{\n world.gravity= RedVector2D.newFrom(w.mouse/([width, height])-0.5);\n\n //--add new particles and update old\n sys.add(RedParticle(world, w.mouse+5.rand2, 0, RedVector2D[2.rand2, 10.rand], 1.5, 5.rand).age_(40.rrand(50)));\n sys.addForce(world.gravity);\n sys.update;\n\n //--render\n sys.do{|o| //iterate all particles in the system\n Pen.fillColor= Color.grey((o.age/50), 1);\n Pen.fillOval(Rect.aboutRedObject2D(o));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "simple particlesystem. with mouse controlling world gravity and system position."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/100-particle-system.scd", "aug": "patch", "prompt_tokens": 462, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//particlesystem.\n//with mouse controlling world gravity and system position\n//with simple grain sounds mapped to each particle.\n\n(\ns.waitForBoot{\n\n var width= 300, height= 300, w, world,\n sys, synths;\n\n //--synthesis\n SynthDef(\\sine, {|out= 0, freq= 400, fm= 1, beat= 1, amp= 0, pan= 0, gate= 1|\n var z, e;\n e= EnvGen.ar(Env.asr(0.01, 1, 0.02), gate, doneAction:2);\n z= SinOsc.ar(freq+SinOsc.ar(fm, 0, beat), 0, Lag.kr(amp, 0.1));\n Out.ar(out, Pan2.ar(z*e, pan));\n }).add;\n s.sync;\n synths= (); //keep track of synths with this dictionary\n\n //--world\n w= RedWindow(\"particlesystem test2\", Rect(128, 64, width, height)).front;\n world= RedWorld3(RedVector2D[width, height], 0, 20, 1.25); //dim,grav,maxvel,damp\n\n //--system\n sys= RedParticleSystem.new;\n sys.removeAction= {|o| synths.at(o.hash).release}; //free synth when particle dies\n\n //--loop\n w.draw{\n\n //--create a new particle and update the old ones\n var newPart= RedParticle(world, w.mouse+5.rand2, 0, RedVector2D[2.rand2, -10.rand], 1.5, 5.rand).age_(40.rrand(50));\n sys.add(newPart); //add it to the system\n synths.put(newPart.hash, Synth(\\sine)); //create a corresponding synth\n sys.addForce\n```"}, {"role": "assistant", "content": "particlesystem. with mouse controlling world gravity and system position with simple grain sounds mapped to each particle."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/101-particle-system_synth.scd", "aug": "patch", "prompt_tokens": 634, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//objects shoot out off each other. with friction and world damping to compensate.\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 18;\n\n//--world\nw= RedWindow(\"bounce test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[-0.1, 0.38];\nworld= RedWorld3(RedVector2D[width, height], wgrav, 20, 0.92); //dim,grav,maxvel,damp\n\n//--objects\n{|i|\n var mass= 1;\n RedObject(world, RedVector2D[i*20+10, 20], RedVector2D[0.001, 0.001], nil, mass, mass*5); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n Pen.strokeColor= Color.grey(0.75, 0.5);\n Pen.width= 2;\n world.objects.do{|o, i|\n o.addForce(world.gravity);\n o.addForce(o.frictionForce(-0.3));\n o.update;\n world.objects.do{|oo, j|\n if(i!=j, {\n if(o.contains(oo), {\n o.addForce(o.gravityForce(oo).neg*100);\n });\n });\n };\n world.contain(o);\n\n //--render\n Pen.addOval(Rect.aboutRedObject2D(o));\n };\n Pen.stroke;\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "objects shoot out off each other. with friction and world damping to compensate."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/110-bounce_objects.scd", "aug": "patch", "prompt_tokens": 568, "answer_tokens": 24}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//multiple objects within a world with gravity force and also collision detection\n//color and size depends on object's mass\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 20;\n\n//--world\nw= RedWindow(\"collision test\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[-0.1, 0.98]; //world xy gravity\nworld= RedWorld3(RedVector2D[width, height], wgrav, 10, 0.6); //dim,grav,maxvel,damp\n\n//--objects\n{\n var vel= RedVector2D[2.rand2, -5]; //random initial velocity for each object\n var mass= 0.5.rrand(4); //random mass for each object\n RedObject(world, RedVector2D[width, height].rand, vel, 0, mass, mass*5); //world,loc,vel,acc,mass,size\n}.dup(n);\n\n//--loop\nw.draw{\n Pen.width= 1;\n world.objects.do{|o, i|\n o.addForce(world.gravity);\n world.objects.do{|oo, j| if(i!=j, {o.collide(oo)})};\n //world.objects.copyToEnd(i+1).do{|oo| o.collide(oo)}; //faster but less accurate\n o.update;\n world.contain(o);\n\n //--render\n Pen.strokeColor= Color.grey(o.mass/4);\n Pen.strokeOval(Rect.aboutRedObject2D(o));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "multiple objects within a world with gravity force and also collision detection color and size depends on object's mass."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/120-collision_objects.scd", "aug": "patch", "prompt_tokens": 598, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//everybody wanders and chases first boid. with collision detection\n\n(\nvar width= 300, height= 300, w, wgrav, world, n= 10;\n\n//--world\nw= RedWindow(\"boids test3\", Rect(128, 64, width, height)).front;\nwgrav= RedVector2D[0, 0.98];\nworld= RedWorld(RedVector2D[width, height], wgrav, 10, 0.1); //dim,grav,maxvel,damp\nworld= RedWorld3(RedVector2D[width, height], 0, 10, 0.1); //dim,grav,maxvel,damp\n\n//--objects\n{\n var loc= RedVector2D[width, height].rand;\n var vel= RedVector2D[0.5, 5].rand2;\n var mass= 0.5.rrand(4);\n RedBoid(world, loc, vel, 0, mass, mass*5) //world,loc,vel,acc,mass,size\n .maxForce_(1.rrand(6));\n}.dup(n);\n\n//--loop\nw.draw{\n world.objects.do{|o, i|\n if(i!=0, {\n o.addForceWander2D;\n o.addForceSeek(world.objects[0].loc);\n }, {\n o.addForceWander2D;\n });\n o.addForce(world.gravity);\n world.objects.do{|oo, j| if(i!=j, {o.collide(oo)})};\n //world.objects.copyToEnd(i+1).do{|oo| o.collide(oo)}; //faster but less accurate\n o.update;\n world.contain(o);\n\n //--render\n Pen.fillColor= Color.grey(1-(i/n), 0.5);\n Pen.fillOval(Rect.aboutRedObject2D(o));\n };\n};\nw.play;\nCmdPeriod.doOnce({w.close});\n)\n```"}, {"role": "assistant", "content": "everybody wanders and chases first boid. with collision detection."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/121-collision_boids.scd", "aug": "patch", "prompt_tokens": 680, "answer_tokens": 22}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//listener position test\n//with mouse controlling listening position/mix\n//with sound: freq mapped to y, pan mapped to x, mass mapped to beating, amp and lowpass\n\n(\ns.waitForBoot{\n var width= 640, height= 480, w, world, n= 10, synths;\n\n //--world\n w= RedWindow(\"listening pos test\", Rect(128, 64, width, height)).front;\n world= RedWorld3(RedVector2D[width, height], damping:0.5); //dim,grav,maxvel,damp\n\n //--synthesis\n SynthDef(\\beating, {|out= 0, freq= 400, beat= 1, lp= 800, amp= 0, pan= 0|\n var z;\n z= RLPF.ar(Mix(LFSaw.ar(freq+[0, beat], 0, amp)), lp);\n Out.ar(out, Pan2.ar(z, pan));\n }).add;\n s.sync;\n\n //--objects\n {\n var loc= RedVector2D[width, height].rand; //initial xy location\n var mass= 1.rrand(10);\n RedAgent(world, loc, RedVector2D[0.001, 0.001].rand2, nil, mass, mass) //world,loc,vel,acc,mass,size\n .maxForce_(0.001)\n .wdistance_(10)\n .wchange_(0.9)\n .state_((\\synth: Synth(\\beating)))\n }.dup(n);\n s.sync;\n\n //--loop\n w.draw{\n Pen.width= 1;\n 4.do{|i|\n Pen.fillColor= Color.grey(0.4, i+1/(4));\n Pen.fillOval(Rect.aboutRedVector2D(w.mouse, (4-i)/3*50));\n };\n world.objects.do{|o, i| //iterate all objects in this wo\n```"}, {"role": "assistant", "content": "listener position test with mouse controlling listening position/mix with sound: freq mapped to y, pan mapped to x, mass mapped to beating, amp and lowpass."}], "family": "D3", "source_id": "quarks:redUniverse/HelpSource/Quarks/redUniverse/Examples/140-mouse_listening_synth.scd", "aug": "patch", "prompt_tokens": 671, "answer_tokens": 58}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//simulating growth - quite heavy on the cpu if you let it run for a while\n\n(\nvar width= 300, height= 300, w, wgrav, world, still= RedVector2D[0, 0],\nseeds= 1, //number of initial objects\nmaxFree= 200, //max number of free objects at a time\nmaxTotal= 600; //also decides when to stop\n\n//--world\nw= RedWindow(\"growth\", Rect(128, 64, width, height)).front;\nw.background= Color.white;\nwgrav= RedVector2D[0, 0]; //world xy gravity\nworld= RedWorld(RedVector2D[width, height], wgrav, 99, 0); //dim,grav,maxvel,damp\n\n//--interface\n~initSize= {1.1.rand}; //object size at creation\n~distance= 4; //collision min distance\n\n//--objects - the first one always in the middle\nRedObject(world, RedVector2D[width*0.5, height*0.5], still, 0, 1, ~initSize.value);\n{RedObject(world, RedVector2D[width.rand, height.rand], still, 0, 1, ~initSize.value)}.dup(seeds-1);\n\n//--loop\nw.draw{\n var free, frozen;\n //Pen.smoothing= false;\n Pen.strokeColor= Color.black;\n\n //--separate free and frozen objects\n free= world.objects.select{|o| o.vel!=still};\n frozen= world.objects.select{|o| o.vel==still};\n\n //-add more objects\n if(free.size GuiClasses."}], "family": "A", "source_id": "quarks:splines/HelpSource/Classes/AbstractSplineGui.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 78}
{"conversations": [{"role": "user", "content": "Explain `AbstractSplineGui` in SuperCollider briefly."}, {"role": "assistant", "content": "AbstractSplineGui — Parent class for SplineGui This abstract parent class creates the UserView itself. Of most interest are the getter/setter methods for the colors and fonts. Category: Splines > GuiClasses."}], "family": "A", "source_id": "quarks:splines/HelpSource/Classes/AbstractSplineGui.schelp", "aug": "para:1", "prompt_tokens": 44, "answer_tokens": 78}
{"conversations": [{"role": "user", "content": "What does `AbstractSplineGui.alpha` do?"}, {"role": "assistant", "content": "get/set view opacity of spline and its grid Returns: float"}], "family": "B", "source_id": "quarks:splines/HelpSource/Classes/AbstractSplineGui.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 26}
@@ -6617,7 +6508,6 @@
{"conversations": [{"role": "user", "content": "What is `WeaklyNonlinear2` in SuperCollider?"}, {"role": "assistant", "content": "WeaklyNonlinear2 — Weakly Nonlinear Oscillator Naive Euler ODE solver implementation of the Weakly Nonlinear Oscillator with external perturbation (see Strogatz, Steven H. (1994) Nonlinear Dynamics and Chaos. Addison-Wesley, Reading, MA. pp215 or Pikovsky, Arkady., Rosenblum, Michael., and Kurths, Jurgen. (2001). Synchronization. CUP: Cambridge. pp 189). Category: UGens > Generators > Chaotic //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/WeaklyNonlinear2.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 246}
{"conversations": [{"role": "user", "content": "Explain `WeaklyNonlinear2` in SuperCollider briefly."}, {"role": "assistant", "content": "WeaklyNonlinear2 — Weakly Nonlinear Oscillator Naive Euler ODE solver implementation of the Weakly Nonlinear Oscillator with external perturbation (see Strogatz, Steven H. (1994) Nonlinear Dynamics and Chaos. Addison-Wesley, Reading, MA. pp215 or Pikovsky, Arkady., Rosenblum, Michael., and Kurths, Jurgen. (2001). Synchronization. CUP: Cambridge. pp 189). Category: UGens > Generators > Chaotic //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/WeaklyNonlinear2.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 246}
{"conversations": [{"role": "user", "content": "What does `WeaklyNonlinear2.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Weakly Nonlinear Oscillator Arguments: input — audio rate input, acts as external force; reset — restart; ratex — update rate for x; ratey — update rate for y; freq — The equation constant w0 (linear oscillator's frequency when alone * 2pi); initx — reset value for u; inity — reset value for w."}], "family": "B", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/WeaklyNonlinear2.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 107}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// Some of these UGens are rather buggy and don't behave right...\n// look up the class files to see which arguments each of the synths have\n\ns =Server.local.boot\n\n{StkPluck.ar}.play(s)\n\n\n{StkMandolin.ar(mul:3)}.play(s) // prob\n\n\n{StkSaxofony.ar(mul:0.1)}.play(s)\n\n\n{StkBandedWG.ar(3000, instr:1, mul:3) }.play(s)\n\n\n{StkVoicForm.ar}.play(s) // prob\n // don't know why there is a glitch at start\n\n{StkClarinet.ar(mul:0.2)}.play(s)\n\n{StkBlowHole.ar(mul:7)}.play(s)\n\n{StkMoog.ar}.play(s) // prob\n\n{StkBeeThree.ar}.play(s) // prob\n\n// FIXED: undefined control number 7???\n// But doesn't sound right\n{StkModalBar.ar(40, 5, mul:6)}.play(s) // prob\n\n// This one throws an error that seems to need fixing!\n{StkFlute.ar(440, 35, 0.5, mul:1) }.play(s)\n\n// This one just posts \"Starting\" twice and doesn't do much afterwards\n{StkBowed.ar(vibgain:1) }.play(s)\n\n// NOT FIXED: this one corrupts memory!!\n// doesn't post the warning anymore, but still quits scsynth, when freed\n{StkShakers.ar(instr:11, mul:4)}.play(s)\n```"}, {"role": "assistant", "content": "Some of these UGens are rather buggy and don't behave right... look up the class files to see which arguments each of the synths have."}], "family": "D3", "source_id": "sc3-plugins:source/StkUGens/sc/STKtest.scd", "aug": "patch", "prompt_tokens": 564, "answer_tokens": 41}
{"conversations": [{"role": "user", "content": "What is `Summer` in SuperCollider?"}, {"role": "assistant", "content": "Summer — Pulse counter with floating point steps Summer, based on Stepper, but allowing floats as inputs, so that you can increment a sum with each step. Category: UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/SummerUGens/sc/HelpSource/Classes/Summer.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 60}
{"conversations": [{"role": "user", "content": "Explain `Summer` in SuperCollider briefly."}, {"role": "assistant", "content": "Summer — Pulse counter with floating point steps Summer, based on Stepper, but allowing floats as inputs, so that you can increment a sum with each step. Category: UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/SummerUGens/sc/HelpSource/Classes/Summer.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 60}
{"conversations": [{"role": "user", "content": "What does `Summer.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Pulse counter with floating point steps Arguments: trig — The trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive.; step — The step size. Can be a Float; reset — Resets the counter to `resetval` when triggered.; resetval — Value to which the counter is reset when it receives a reset trigger.."}], "family": "B", "source_id": "sc3-plugins:source/SummerUGens/sc/HelpSource/Classes/Summer.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 119}
@@ -6664,91 +6554,32 @@
{"conversations": [{"role": "user", "content": "Explain `VOSIM` in SuperCollider briefly."}, {"role": "assistant", "content": "VOSIM — vosim pulse generator Category: UGens > Generators."}], "family": "A", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 27}
{"conversations": [{"role": "user", "content": "What does `VOSIM.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "vosim pulse generator Arguments: trig — [ar kr] starts a vosim pulse when a transition from non-positive to positive occurs and no other vosim is still going. audio rate input will produce sample accurate triggering.; freq — [ar kr] the frequency of the squared sinewave.; nCycles — the number of squared sinewaves to use in one vosim pulse. nCycles gets checked when VOSIM receives a trigger.; decay — the decay factor.."}], "family": "B", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 155}
{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\nz = {VOSIM.ar(Impulse.ar(100), MouseX.kr(440, 880, 1), 3, 0.99)}.play;\n\nz.free;\n\n(\nz = { \n var p,t,f,n,d,a,l,x,y,z,x_,y_;\n p = TRand.ar(0.0,1.0,Impulse.ar(6.0));\n t = Impulse.ar(9*(1+(p>0.95)));\n f = TRand.ar([40.0,120.0,220.0],[440.0,990.0,880.0],t);\n n = TRand.ar(4.0,[8.0, 16.0, 32.0],t);\n d = TRand.ar([0.2,0.4,0.6\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\nz = {VOSIM.ar(Impulse.ar(100), MouseX.kr(440, 880, 1), 3, 0.99)}.play;\n\nz.free;\n\n(\nz = { \n var p,t,f,n,d,a,l,x,y,z,x_,y_;\n p = TRand.ar(0.0,1.0,Impulse.ar(6.0));\n t = Impulse.ar(9*(1+(p>0.95)));\n f = TRand.ar([40.0,120.0,220.0],[440.0,990.0,880.0],t);\n n = TRand.ar(4.0,[8.0, 16.0, 32.0],t);\n d = TRand.ar([0.2,0.4,0.6],[0.6, 0.8, 1.0],t);\n a = TRand.ar(0.0,[0.2, 0.6, 1.0],t);\n l = TRand.ar(-1.0,1.0,t);\n x = MouseX.kr(0.25,2.0);\n y = MouseY.kr(0.25,1.5);\n z = 9.0;\n x_ = x * LFNoise2.kr(z).range(0.25,2.0);\n y_ = y * LFNoise2.kr(z).range(0.25,2.0);\n Out.ar(0, Pan2.ar(Mix.ar(VOSIM.ar(t, f*x_, n, d*y_) * a),l,1));\n}.play;\n);\n\nz.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 515}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\sin, { arg out=0, gate=1, amp=0.1, pan=0, freq=200;\n var sig;\n sig = SinOsc.ar(freq);\n sig = sig * EnvGen.kr(\\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n}).add;\n);\n\n(\n// sequence Envs\n// need [] else it is inlined or does pattern multichannel expansion\nPdef(\\demo, \n Pbind(\n \\instrument, \\sin,\n \\degree, Pseq([0, Pwhite(0,7,1)],inf),\n \\legato, 0.5,\n \\adsr, Pseq([\n [ Env.adsr(1.1,0.1,0.8,1.01) ],\n [ Env.adsr(0.01,0.1,0.8,0.01) ],\n [ Env.adsr(0.01,1.1,0.3,0.01) ],\n ],inf),\n )\n).play;\n);\n\n(\n// interpolate using Pseg\n// need .asArray\nPdef(\\demo, \n Pbind(\n \\instrument, \\sin,\n \\degree, Pseq([0, Pwhite(0,7,1)],inf),\n \\legato, 0.5,\n \\adsr, Pseg(Pseq([\n [ Env.adsr(1.1,0.1,0.8,1.01).asArray ],\n [ Env.adsr(0.01,0.1,0.8,0.01).asArray ],\n [ Env.adsr(0.01,1.1,0.3,0.01).asArray ],\n ],inf),8),\n )\n).play;\n);\n```"}, {"role": "assistant", "content": "For a long time, I thought it was impossible to use Pseg to interpolate between Envs like it does with simple values, but I discovered it only needs .asArray."}], "family": "D3", "source_id": "sccode:1-5iP", "aug": "patch", "prompt_tokens": 614, "answer_tokens": 49}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\lofi, {\n var sig = Array.fill(3, { |n|\n SinOsc.ar(\n \\freq.kr(440) * (1 + 0.02.rand) * (n+1),\n mul: \\amp.kr(0.1) / (n*n+1))\n }).sum;\n var curve = Env.perc(0.1, \\dur.kr(3));\n var env = EnvGen.kr(curve, gate: Impulse.kr(\\rate.kr(1)));\n var env_baseline = LFNoise1.ar(1/3).range(0.1, 0.5);\n sig = sig + BrownNoise.ar(mul: -45.dbamp);\n sig = sig * env.linlin(0,1, env_baseline, 1);\n Out.ar(\\out.kr(0), sig!2);\n};\n).add;\n);\n\n(\n~root = 48;\n//~degrees = [0,0,4,5,7,7,9,12,16,19].scramble;\n~degrees = [0,0,4,5,7,7,9,11,14,19].scramble;\n~len = ~degrees.size;\n~coeff = 0.1;\n\n~len.collect(\n {|n|\n Synth.new(\\lofi,\n [\n \\freq: (~root + ~degrees[n]).midicps,\n \\amp: 0.4 / ~len,\n \\rate: (1 + (n * ~coeff)) * 0.1\n ]);\n });\n)\n```"}, {"role": "assistant", "content": "While playing with mimetikmusic's code, I stumbled on this nostalgic sound."}], "family": "D3", "source_id": "sccode:1-5iO", "aug": "patch", "prompt_tokens": 522, "answer_tokens": 29}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// MODES, SCALES, KEYS inside Pbinds\n\n// How to write Pbinds in a specific key, for example G minor\n// (using \\scale and \\degree inside Pbind)\n\n(\nPbind(\n \\scale, Scale.minor, // natural minor scale\n \\degree, Pseq([0, 1, 2, 3, 4, 5, 6s, 7, 8, 9, 10, 11]), // s for sharp, b for flats as needed\n \\root, 7, // 0 is C, 1 is C#, etc. For G minor, we put the root at 7 (seven semitones above C)\n \\dur, 1/2\n).play\n);\n\n// \\degree considers 0 to be the first scale degree.\n// If you prefer to think of 1 as the first scale degree (like in \"movable do\" solfege), simply add -1 to the end of the line.\n// The example below is in Eb Major\n(\nPbind(\n \\scale, Scale.major,\n \\degree, Pseq([1, 2, 3, 4, 5, 6, 7, 8]) - 1,\n \\root, 3, // Eb Major\n \\dur, 1/2\n).play\n);\n\n// F Mixolydian #4\n(\nPbind(\n \\scale, Scale.mixolydian,\n \\degree, Pseq([1, 2, 3, 4s, 5, 6, 7, 8], 3) - 1,\n \\root, 5, // F mixolydian with #4\n \\dur, 1/4\n).play\n);\n\nScale.directory;\n```"}, {"role": "assistant", "content": "Modes, scales, keys (tonal music) inside Pbinds. How to write a Pbind for example G minor or mixolydian #4 sing \\scale and \\degree."}], "family": "D3", "source_id": "sccode:1-5iE", "aug": "patch", "prompt_tokens": 498, "answer_tokens": 52}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nvar fundamental = 131;\nvar dur = 10;\nvar partials =\n[\n [1, 0.5, dur * 1],\n [1.02, 0.3, dur * 1],\n [1.01, 0.14, dur * 0.5],\n [2.44, 0.17, dur * 0.8],\n [3.31, 0.9, dur * 0.5],\n [5.1, 0.1, dur * 0.56],\n [5.9, 0.1, dur * 0.9],\n [11.01, 0.09, dur * 1],\n [13, 0.01, dur * 0.5],\n [15, 0.01, dur * 0.2],\n [16, 0.05, dur * 0.02],\n [19, 0.10, dur * 0.01],\n [20, 0.01, dur * 0.2],\n [24, 0.01, dur * 0.2],\n [4, 3, dur * 0.002] // attack\n];\n\nNdef(\\quickBell).fadeTime = 0;\nNdef(\\quickBell, {\n var snd, env;\n env = Env.perc(\n attackTime: 0.001,\n releaseTime: partials.flop.at(2),\n level: partials.flop.at(1)\n ).kr;\n // fundamental + inharmonics\n snd = SinOsc.ar(\n freq: fundamental * partials.flop.at(0);\n );\n snd = snd * env;\n snd = Splay.ar(snd);\n snd = Limiter.ar(snd);\n}).play;\n)\n```"}, {"role": "assistant", "content": "Example of additive synthesis with inharmonic partials generating a bell-like sound."}], "family": "D3", "source_id": "sccode:1-5iD", "aug": "patch", "prompt_tokens": 531, "answer_tokens": 27}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\"task_efef68ae-1aef-4dc3-9bc3-274765c62cb1\", {\n arg out=0, gate=1, freq=220, amp=0.3, tempo=1.0;\n var env, warmPad, vocalSim, tapeSat, analogFilt, wobble, pan, sig, time, dust;\n \n // Long evolving envelope\n env = EnvGen.kr(Env([0, 0.7, 1, 0.8, 0], [8, 25, 30, 15] / tempo, [2, -2, 3, -4]), gate, doneAction: 2);\n time = SinOsc.kr(0.02 * tempo);\n \n // Warm analog-style pad\n warmPad = Mix.ar([\n Saw.ar(freq * [0.99, 1.01, 1.503]) * 0.4,\n Pulse.ar(freq * [0.5, 0.752], LFNoise1.kr(0.3).range(0.3, 0.7)) * 0.3\n ]);\n \n // Simulated children's vocal formants\n vocalSim = Formant.ar(\n freq * [0.7, 0.9] + LFNoise1.kr(2).range(-5, 5),\n [800, 1200] + (time * 200),\n [100, 150],\n LFNoise1.kr(0.1).range(0.05, 0.15)\n );\n \n // Analog filter with slow modulation\n wobble = SinOsc.kr([0.07, 0.05] * tempo).range(0.3, 1.2);\n analogFilt = RLPF.ar(warmPad + vocalSim, \n (400 + (time * 600) + LFNoise1.kr(0.3).range(0, 300)) * wobble, \n 0.4 + LFNoise1.kr(0.2).range(0, 0.3)\n );\n \n // Tape saturation simulation\n tapeSat = (ana\n```"}, {"role": "assistant", "content": "warm ambient textures with filtered voices, analog-style processing, and evolving pads reminiscent of Boards of Canada."}], "family": "D3", "source_id": "sccode:1-5iA", "aug": "patch", "prompt_tokens": 673, "answer_tokens": 43}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nf = ();\nf.beatAndBar = {\n var t = currentEnvironment.clock; // t= TempoClock.new;\n var text = \"xB: \";\n\n var nBeatsPerBar = { arg n, beats, clock;\n var nBpb = clock.beatsPerBar * n;\n \"\" ++ n ++ text ++ (nBpb - (beats%(nBpb))).asInteger\n };\n\n t.play({arg beats, time, clock;\n ( //[\"beat: \" ++ (t.beatInBar + 1).asInteger] ++ //uncomment for beat in bar\n [1,2,4,8,16,32].collect( {|n,i| nBeatsPerBar.value(n, beats, clock)})\n ).postln;\n 1});\n \"beatAntBar\";\n}\n);\n\nf[\\beatAndBar].value;\n\n(\nf[\\beatAndBar].value;\nCmdPeriod.add(f[\\beatAndBar]);\n)\n```"}, {"role": "assistant", "content": "Prints beats to bars for a mutiple of bar.\r\nHow many beats left until next 1, 2, 4, 8, 16, 32, etc bar."}], "family": "D3", "source_id": "sccode:1-5ig", "aug": "patch", "prompt_tokens": 357, "answer_tokens": 46}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{ // even odd harmonics\n var baseFreq = 100;\n var numFreqs = 69;\n var vowel = Vowel(\\a, \\bass);\n var startFilterOrder = 4.0;\n var stopFilterOrders = [0.8, 0.65, 0.5, 0.35, 0.1];\n var freqs, evenFreqs, oddFreqs, amps, evenAmps, oddAmps, orders;\n var dur = 12;\n var evenAmpMod = SinOsc.kr(freq: 1).exprange(0.04, 1).sqrt;\n var oddAmpMod = SinOsc.kr(freq: 1, phase: pi).exprange(0.04, 1).sqrt;\n var ampEnv = Env.linen(attackTime: 0.01, sustainTime: dur, releaseTime: 0.2).kr(doneAction: 2);\n \n \n evenFreqs = ((1, 3 .. numFreqs) * baseFreq);\n oddFreqs = ((2, 4 .. numFreqs) * baseFreq);\n \n \n // there are 5 formants in each vowel, ergo 5 filter orders may be provided\n orders = stopFilterOrders.collect{|stop, i| \n XLine.kr(startFilterOrder, stop, dur * ( 4 + (2 * i)/dur))\n };\n \n evenAmps = vowel.ampAt(evenFreqs, orders ) * evenAmpMod;\n oddAmps = vowel.ampAt(oddFreqs, orders ) * oddAmpMod;\n \n \n freqs = evenFreqs ++ oddFreqs;\n amps = evenAmps ++ oddAmps;\n \n amps = amps.normalizeSum; // tame amplitudes\n \n DynKlang.ar(`[freqs, amps , nil] ) * 0.1 * ampEnv;\n}.play\n)\n```"}, {"role": "assistant", "content": "cleaned-up code for \"Figure 6\" of the paper \"A SUPERCOLLIDER CLASS FOR VOWEL SYNTHESIS\r\nAND ITS USE FOR SONIFICATION\" (doi: https://pub.uni-bielefeld.de/record/2277122 )."}], "family": "D3", "source_id": "sccode:1-5i5", "aug": "patch", "prompt_tokens": 640, "answer_tokens": 107}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Helper function to extract audio from a youtube video\n// and save it to a file\n// \n// Note:\n// - Linux/OSX/Unix only (uses .unixCmd)\n// - Needs yt-dlp to be installed\n// - The download procedure is synchronous\n\n(\n~ytdl = {|vid, filename, debug=false|\n var output;\n if (File.exists(filename)) {\n if (debug) {(filename + \"already present\").postln};\n filename;\n } {\n if (debug) {(\"downloading\" + vid + \"into\" + filename).postln};\n output = [\"yt-dlp\", \"--extract-audio\", \"--audio-format\", \"wav\",\n \"--output\", filename, vid].unixCmdGetStdOut;\n if (debug) {output.postln};\n filename;\n };\n};\n);\n\n// example usage\n(\n~rr = \"dQw4w9WgXcQ\";\n~file = \"/tmp/rr.wav\";\n\n(\"downloading:\" + ~file).postln;\n~ytdl.(~rr, ~file);\n(\"download complete:\" + ~file).postln;\n\n~buffer = Buffer.read(s, ~file);\n);\n\n(\n// BUFFER MUST BE STEREO!\nSynthDef(\\hellish, {\n |out, bufnum, descent=20, dist=7|\n var beat = 60/113;\n var cuts = [beat, beat/2, beat/3];\n var rates = Line.kr([-1,1,-1], [-1.5, 1.3, -1.2], descent);\n var frames = BufFrames.kr(bufnum);\n var lf = LFNoise0.ar(cuts).linlin(-1, 1, 0, frames);\n var snd = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum)/rates,\n Impulse.kr(cuts), sta\n```"}, {"role": "assistant", "content": "Helper function to extract audio from a youtube video, and save it to a file.\r\n\r\nNote: Linux/OSX/Unix only (uses .unixCmd), needs yt-dlp to be installed, the download procedure is synchronous."}], "family": "D3", "source_id": "sccode:1-5i3", "aug": "patch", "prompt_tokens": 685, "answer_tokens": 79}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n~remapConfig = IdentityDictionary[\n 0 -> 1,\n 1 -> 2,\n 2 -> 3,\n 3 -> 4,\n 4 -> 5,\n 5 -> 6,\n 6 -> 7,\n 7 -> 8,\n 8 -> 9,\n 9 -> 12,\n 10 -> 13,\n 11 -> 14,\n 12 -> 15,\n 13 -> 16,\n 14 -> 17\n];\n\n\n~generateRemapSynthDef = { |numInputChannels, numOutputChannels|\n SynthDef(\\remapOutputs, {\n var sig = In.ar(0, numInputChannels); \n var remapped = Array.fill(numOutputChannels, { Silent.ar(1) }); \n\n ~remapConfig.keysValuesDo { |src, dest|\n if (src < numInputChannels and: { dest < numOutputChannels }) {\n remapped[dest] = sig[src];\n }\n };\n\n ReplaceOut.ar(0, remapped);\n }).add;\n};\n\n~generateRemapSynthDef.(16, 18); \n);\n\n(\n~createRemapSynth = {\n ~remapSynth = Synth(\\remapOutputs, target: s.defaultGroup, addAction: \\addAfter);\n};\n\nServerTree.add( ~createRemapSynth);\n\n)\n```"}, {"role": "assistant", "content": "This code sets up a remapping system where input channels are mapped to output channels based on a predefined configuration. The remapping is done using a SynthDef that reads input signals, applies the remapping, and outputs the remapped signals. The ServerTree.add ensures that the remap synth is created and added to the server's node tree upon server startup and cmd-. and ctrl-.\r\n\r\nBased on discu."}], "family": "D3", "source_id": "sccode:1-5i0", "aug": "patch", "prompt_tokens": 478, "answer_tokens": 134}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~xox = {|str| str.collectAs({|l| switch(l.toLower,$x, {1}, $o, {Rest(1)})}, Array)};\n);\n\n\n(\nSynthDef(\\acid, { arg out, freq = 1000, gate = 1, pan = 1, cut = 4000, rez = 0.8, amp = 1, sustain = 1, release = 0.5;\n var sig, env;\n env = EnvGen.kr(Env.linen(0.01, sustain, sustain * release), gate, amp, doneAction: Done.freeSelf);\n sig = Pulse.ar([freq,freq*1.001], 0.5);\n sig = sig + Pulse.ar(freq*0.501, 0.01, [0,0.5]);\n sig = sig + Pulse.ar(freq*1.99, 0.11, [0.5,0]);\n sig = RLPF.ar(sig, cut, rez);\n sig = Pan2.ar(sig);\n sig = sig * env;\n\n Out.ar(out, sig);\n}).add;\n);\n\n(\nPbind(\n \\instrument, \\acid,\n \\dur, Pseq(~xox.(\"xxooxoxo\") * 8/120, inf),\n \\scale, Scale.minor,\n \\degree, Pseq([0,4,5,3,3], inf),\n \\cut, Pwhite(100, 1500),\n \\rez, Pwhite(0.1, 0.8),\n \\amp, -10.dbamp,\n).play;\n)\n```"}, {"role": "assistant", "content": "a simple helper function to write \\dur patterns in a XoX style i.e. Pseq(~xox.(\"xxooxoxo\") * 8/120, inf)."}], "family": "D3", "source_id": "sccode:1-5hZ", "aug": "patch", "prompt_tokens": 508, "answer_tokens": 46}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~freqgold = List[ 29.034441847481, 58.068883694963, 116.13776738993, 232.27553477985, 464.5510695597, 929.1021391194, 1858.2042782388, 3716.4085564776, 7432.8171129552, 14865.63422591, 29731.268451821 ];\n\n\n~getFirstFreq = { | array = #[0], seuil = 0 |\n var rfreq=0;\n var i=0;\n while({ (rfreq==0) && (i < array.size()) }, { if( array[i] >= seuil , { rfreq=array[i]; }, { } ); i = i+1 });\n rfreq.postln;\n if( rfreq == 0,\n { rfreq=array[array.size()-1] },\n { rfreq }\n )\n};\n\n\nSynthDef(\\synthexample, { |out, sustain = 1, amp = 0.5, bb = 5, threshold = 500|\n var env = Env.adsr(\\atk.ir(0.05), \\dec.ir(0.5), \\slev.ir(0.4), \\rel.ir (1) ).ar(Done.freeSelf, \\gate.kr (1));\n var modHz = XLine.kr(1, bb, 10);\n var mod = SinOsc.ar(modHz, mul: 3);\n var f = ~getFirstFreq.value(~freqgold, \\threshold);\n var sig = SinOsc.ar([f, f+mod], mul: 0.2 ) * amp * env;\n Out.ar(out, sig );\n}).add;\n\n\n(instrument: \\synthexample, atk: 0.01, rel: 40, amp: 0.5, bb: 2, threshold: 500).play;\n```"}, {"role": "assistant", "content": "In this code, I have a list of frequencies. \r\nWhen I am calling \\synthexample, I provide some parameters, the usual ones (amp, etc) and other like bb and threshold.\r\nThe bb parameter is taken into account and works.\r\nAnd the threshold parameter is passed to a function which goal is to pick a frequency on a list of frequencies that is greater or equal to the threshold value. \r\nThe problem is that t."}], "family": "D3", "source_id": "sccode:1-5hJ", "aug": "patch", "prompt_tokens": 653, "answer_tokens": 135}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.options.memSize = 8192 * 8;\n\n\n(\nSynthDef(\\grain, {|out = 0, freq = 100, attack = 0, decay = 1, sustain = 0.1, distort = 0, fTime = 0.1, fFac = 1.2, amp = 1, delay = 0|\n var startFreq, endFreq, src, aEnv, fEnv;\n \n startFreq = fFac * freq;\n endFreq = freq;\n \n aEnv = EnvGen.ar(Env.perc(attack, decay), timeScale: sustain, doneAction: 2, levelScale: amp);\n fEnv = EnvGen.ar(Env([startFreq, endFreq], [fTime]));\n src = SinOsc.ar(fEnv, 1, mul: 1 + distort).wrap2(1);\n \n Out.ar(out, DelayN.ar(src * aEnv!2, 0.1, delay))\n}).add\n);\n\n(\nPdef(\\grainer, Pbind(\n \\radiation, Pseq([\n Pseq([10] ++ (0.1 ) ++ [10] ++ (0.1!6), 1),\n Pseq([ 1] ++ (0.1!6) ++ [ 1], inf)\n ]),\n \\instrument, \\grain,\n \\freq, ([1200, 800, 600, 200]!12).flat.collect{|v| v * rrand(0.99, 1)} * Prand([4, 1, 2, 3, 4, 8], inf),\n \\fTime, 0.0125,\n \\fFac, 5,\n \\sustain, 0.1,\n \\attack, 0.0005,\n \\decay, 2,\n //\\distort, {Pwhite(0.1, 5.0)}!(12 * 4),\n \\amp, 0.1,\n \\delay, {Pwhite(0.01, 0.1)}!(12 * 4),\n \\dur, Pkey(\\radiation)\n)).play\n);\n\n\nPdef(\\grainer).stop\n```"}, {"role": "assistant", "content": "Good Morning!\r\n\r\nInspired by a Nokia alarm clock sound from one of their non-smartphone mobiles, I designed an alarm clock sound for your mobile. The basic idea is to start with a very simple and short grain, giving you a chance to reach for the phone and turn it off before it starts to get annoying."}], "family": "D3", "source_id": "sccode:1-5hF", "aug": "patch", "prompt_tokens": 651, "answer_tokens": 101}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nq = ();\n// either create new programs, or see already generated ones from the programs file\n// q.programs = \"%/DetaNocturn-programs.scd\".format(Document.current.path.dirname).load;\n \n// if new, also adjust score indices. (see below)\nq.programs = {[\\ORG] ++ ({([0, 1, 2] ++ (5..25)).choose}!250) ++ [\\JMP, 1]}!200;\n \ns.boot;\nNdefMixer(s);\n \n(\n// put all programs into buffers. re-running these lines will start with a new set of programs that will -- over a long time period -- relax their amplitudes and complexity.\nq.buffers = q.programs.collect{|prog|\n BBlockerProgram(prog).makeBuffer\n};\n \n// add specs\nSpec.add(\\rate, [1, 40000, \\exp]);\n);\n\n\nNdef(\\deta).clear\n(\n// the score player\n \nTdef(\\player).quant = nil;\nNdef(\\deta).quant = nil;\nNdef(\\deta).fadeTime = 0;\n \nTdef(\\player, {\n var score = 48.collect{\n ([3, 11, 13, 17, 25, 26, 38, 4, 6, 8, 34, 38, 43, 44, 52, 71, 72, 85, 90]\n .scramble[0..7])\n };\n score.do{|a|\n Ndef(\\deta, {|rate = 20000|\n Splay.ar((a.collect{|number|\n LeakDC.ar(Demand.ar(Impulse.ar(rate), 0, DetaBlockerBuf(q.buffers[number].bufnum, 0)))\n })).tanh\n }).play(fadeTime: 0);\n 2.7.wait\n };\n Ndef(\\deta).stop\n})\n);\n \nNdef(\\deta).play\n \n// \n```"}, {"role": "assistant", "content": "A piece experimenting with the settling of 8-bit programs running in BetaBlocker (Dave Griffith & Till Bovermann, 2011)."}], "family": "D3", "source_id": "sccode:1-5hE", "aug": "patch", "prompt_tokens": 651, "answer_tokens": 49}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nPdef(\\zed, \n Pbind(\n \\osc, Pseq([SinOsc, LFSaw],inf),\n \\instrument, Prout({ arg ev;\n SynthDef(\\zed, { arg out=0, gate=1, amp=0.1, pan=0, freq=200;\n var sig;\n sig = ev[\\osc].ar(freq);\n sig = sig * EnvGen.kr(\\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n }).add.yield;\n }).loop,\n \\degree, Pseq([0],inf),\n \\dur, 1,\n \\amp, 0.1,\n )\n).play;\n);\n```"}, {"role": "assistant", "content": "synthdef building should take less time than s.latency for this to work."}], "family": "D3", "source_id": "sccode:1-5hA", "aug": "patch", "prompt_tokens": 309, "answer_tokens": 22}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// requires SignalBox quark\n\n// 1. pick an fft size (must be power of two)\n~size = 2048;\n~size = 4096;\n\n// 2. path to a sound file\n~path = Platform.resourceDir +/+ \"sounds/a11wlk01.wav\";\n\n(\n// 3. analyze audio : this may take a little while for a long sound file\nvar data = Signal.read(~path);\nvar size = ~size;\n\nvar sf = SoundFile.openRead(~path);\nvar sampleRate = sf.sampleRate;\n\nvar hops = 4;\nvar window = Signal.hanningWindow(size);\n\nvar numFrames = (data.size / size * hops);\nvar fftMags = Array(numFrames);\n\nvar imag = Signal.newClear(size);\nvar cosTable = Signal.fftCosTable(size);\n\nsf.close;\n\n(data.size / size * hops).asInteger.do { |j|\n var i = j / hops;\n var r = data[(size * i).asInteger..(size * (i + 1) - 1).asInteger];\n r = r.addAll(Array.fill(size - r.size, {0}));\n r = r * window;\n fftMags.add((fft(r, imag, cosTable).magnitude.log10)[0..(size * 20000/sampleRate).asInteger]);\n};\n\n~fftMags = fftMags;\n);\n\n(\n// 4. generate image : this may also take a little while\nvar width = ~fftMags.size;\nvar height = ~fftMags[0].size;\nvar image = Image.new(width, height);\nvar scaleFunc = { |pixel| pixel.lincurve(0, height, 1, height, curve: 3) }; // curve factor for Y scaleing (0 = linear\n```"}, {"role": "assistant", "content": "Generates an Image containing the spectrogram of a soundfile."}], "family": "D3", "source_id": "sccode:1-5hn", "aug": "patch", "prompt_tokens": 646, "answer_tokens": 20}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n[2, 13, 24, 35, 46].collect({\n |touch, idx|\n var finger = (\\thinkfinger ++ (idx+1).asSymbol);\n var fx = finger ++ \\x;\n var fy = finger ++ \\y;\n var ind_x = ((idx+1) * 10) + idx+1;\n var ind_y = ind_x + 1;\n\n p.at(finger.asSymbol).kr;\n p.at(fx.asSymbol).kr;\n p.at(fy.asSymbol).kr;\n\n HIDdef.element(finger.asSymbol,\n {|val| p[finger.asSymbol].bus.set(val);\n val;\n }, touch.postln;);\n HIDdef.element(fx.asSymbol,\n {|val| p[fx.asSymbol].bus.set(val)}, ind_x.postln;);\n HIDdef.element(fy.asSymbol,\n {|val| p[fy.asSymbol].bus.set(val)}, ind_y.postln);\n});\n\np.use({\n ~resonator = {\n arg input;\n var sig;\n sig = LocalIn.ar(2) + input;\n sig = DelayN.ar(sig, 3.5, \\resonator.asSpec.map(\\delay.kr(0.5, 0.1)) - ControlRate.ir.reciprocal);\n LocalOut.ar(sig * \\dfeedback.kr(0.5, 0.01));\n Limiter.ar(LeakDC.ar(sig)) + input;\n };\n\n\n ~tone = {\n var vibrato = SinOsc.kr(\\vibfreq.kr(5), mul: \\vibdepth.kr(5));\n Limiter.ar(\n LeakDC.ar(\n Mix([\n SawDPW.ar(\n (\\midfreq.asSpec.map(\\freq.kr) + vibrato)),\n \n```"}, {"role": "assistant", "content": "There are some hardcoded values you'll have to mess with to play with this. On my Thinkpad touchscreen, an element with usage type Finger indicates a touch with a float either 1.0 or 0.0. First touch element has ID 2, followed by 13, 24, 35, 46.\r\n\r\nThe X and Y axis data ID's are similarly catchy. The X's have ID's 11, 22, 33, 44, 55 and the Y's have ID's 12, 23, 34, 45, 56.\r\n\r\nI am using a ProxySp."}], "family": "D3", "source_id": "sccode:1-5hi", "aug": "patch", "prompt_tokens": 674, "answer_tokens": 168}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// By Nathaniel Virgo\n// https://listarc.cal.bham.ac.uk/lists/sc-users-2009/msg55766.html\n\n// This comes from the mailing list as an attempt to simulate the vst Shapee\n\n(\ns.boot.doWhenBooted {\nc = Buffer.read(s,\"sounds/a11wlk01.wav\");\n}\n);\n\n(\nx = {\n // parameters to play with - width should be an integer - I think 4 is the theoretical optimum\n var fftsize = 512, width=4;\n\n var in, chain, in2, chain2, out;\n\n // timbre source - vocal sample\n in = PlayBuf.ar(1, c, BufRateScale.kr(c), loop: 1);\n\n // pitch source - random polyphonic line\n in2 = Saw.ar(LFNoise0.ar(1!3).exprange(100,5000)).mean;\n\n chain = FFT(LocalBuf(fftsize), in, wintype:1); \n chain2 = FFT(LocalBuf(fftsize), in2, wintype:1);\n \n chain = chain.pvcalc2(chain2, fftsize, {|e_mags, e_phases, f_mags, f_phases|\n\n var fbins = e_mags.clump(width).collect(_.sum) / f_mags.clump(width).collect(_.sum);\n \n [f_mags*fbins.stutter(width), f_phases];\n //[e_mags, f_phases];\n });\n \n\n out = IFFT(chain);\n Out.ar(0, 0.5 * out.dup);\n}.play(s);\n)\n```"}, {"role": "assistant", "content": "By Nathaniel Virgo. See https://listarc.cal.bham.ac.uk/lists/sc-users-2009/msg55766.html\r\n\r\nThis comes from the mailing list as an attempt to simulate the vst Shapee."}], "family": "D3", "source_id": "sccode:1-5hg", "aug": "patch", "prompt_tokens": 574, "answer_tokens": 83}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Reverse reverb\n\n// by Click Nilson\nhttps://sc-users.bham.ac.narkive.com/hA9sdN11/reverse-reverb\n\n/* preparation; essentially, allocate an impulse response buffer, then\nfollow a special buffer preparation step to set up the data the plugin\nneeds. Different options are provided commented out for loading\nimpulse responses from soundfiles. */\n\n(\nvar lengthinsamples= 40000;\n~fftsize=2048; // also 4096 works on my machine; 1024 too often and amortisation too pushed, 8192 more high load FFT\n\ns.waitForBoot {\n\n{\nvar ir, irbuffer, bufsize;\nvar nextmod=100;\n\nir = [0] ++0.dup(100) ++ (Array.fill(lengthinsamples,{|i| if(i%\n(nextmod)==0,{nextmod= rrand(80,120); 0.3*((i.asFloat/\nlengthinsamples).squared)},{0.0}) }));\n\nirbuffer = Buffer.loadCollection(s, ir);\n\ns.sync;\n\nbufsize= PartConv.calcBufSize(~fftsize, irbuffer);\n\n~irspectrum= Buffer.alloc(s, bufsize, 1);\n\n~irspectrum.preparePartConv(irbuffer, ~fftsize);\n\ns.sync;\n\nirbuffer.free; // don't need time domain data anymore, just needed spectral version\n}.fork;\n\n};\n\n);\n\n\n\n~target= Buffer.read(s, Platform.resourceDir +/+ \"sounds/a11wlk01.wav\");\n\n(\n\n{ var input, kernel, mix = 0.5;\n\n \ninput= PlayBuf.ar(1, ~target, loop:1);\n// snare\n//input= WhiteN\n```"}, {"role": "assistant", "content": "Reverb reverb by Click Nilson based on impulse response convolution. Posted on the mailing list."}], "family": "D3", "source_id": "sccode:1-5he", "aug": "patch", "prompt_tokens": 649, "answer_tokens": 33}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Klang-Bild-Architektur 5/VII\n//Frank M Zeidler y André Werner\n//Realization By Javier Lucas\n(\nt=Task({\n{SinOsc.ar([3136,2997.5])}.play;// C#\n1.wait;\n s.freeAll;\n{SinOsc.ar([3069,2889])}.play;// F#\n 1.wait;\n s.freeAll;\n{SinOsc.ar([3002,2782])}.play;// A\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2395,2807])}.play;// C\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2868,2722])}.play;// D\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2801,2638])}.play;// E\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2734,2556])}.play;// F\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2667,2474])}.play;//G\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2600,2392])}.play;// G#\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2533,2312])}.play;// A\n 1.wait;\n s.freeAll;\n{SinOsc.ar([2466,2232])}.play;// Bb\n 1.wait;\n s.freeAll;\n\n\n})\n)// Evaluate first this task\n\nt.start//Then start it!\n```"}, {"role": "assistant", "content": "Can u hear the differential sounds? They are formed on your ear and are not real. \r\nBased on the electroacustic piece Klang-Bild-Architektur 5/VII by Frank M Zeidler y André Werner."}], "family": "D3", "source_id": "sccode:1-5hd", "aug": "patch", "prompt_tokens": 565, "answer_tokens": 71}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n~divisors = {\n arg n;\n ~divs = List.newClear(0);\n for( 1, floor(sqrt(n)), {arg i; if(n%i==0,{\n //i.postln;\n ~divs.add(i);\n // (i==n.div(i)).postln;\n if(i==n.div(i),{},{~divs.add(n.div(i))});\n },{});\n });\n ~divs.sort;\n ~divs;\n};\n\n\nSynthDef(\\rootsOfUnitySum, { |out=0,freq=1,amp=1,n=1,ks=#[1]|\n var l,sigl,sigr,env;\n\n\n sigl = SinOsc.ar(freq:0,mul:0);\n sigr = SinOsc.ar(freq:0,mul:0);\n ks.do({arg item,i;\n k = item;\n sigr = sigr+SinOsc.ar(freq:freq*2pi*k/n,mul:amp,phase:0.5*pi);\n sigl = sigl+SinOsc.ar(freq:freq*2pi*k/n,mul:amp);\n });\n env = EnvGen.kr(Env.linen(attackTime: 0.001, sustainTime: 1, releaseTime: 0.01, level: 1.0, curve: 'lin'), doneAction: Done.freeSelf);\n sigr = sigr*env;\n sigl = sigl*env;\n\n Out.ar(out, [sigl,sigr])\n}).add;\n\n\n~getPbind = { arg n, amps, durs, freq;\n ~nums = ~divisors.value(n);\n r = Pbind(\\instrument,\\rootsOfUnitySum,\n \\amp,amps,\n \\dur,durs,\n \\freq,freq,\n \\n,Pseq([n],~nums.size),\n \\ks , Pseq(all{:~divisors.value(n),n<-~nums},1)).trace();\n r\n};\n\n~seq = (1..13);\n~tau = all{:~divisors.value(n).size,n<-~seq};\n\n\n~r = Pseq(all{:~getPbind.value(\n n:n,\n amps:Pseq(all{:0.5/t,t<-~tau},1),\n \n```"}, {"role": "assistant", "content": "This is an experiment with roots of unity in supercollider.\r\nI took Eulers formula \r\nexp(2*pi*I*k/n) = cos(2*pi*k/n)+sin(2*pi*k/n)*I\r\nto sonify sums of roots of unity where the sums run through divisors of some numbers."}], "family": "D3", "source_id": "sccode:1-5gJ", "aug": "patch", "prompt_tokens": 771, "answer_tokens": 95}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// The following strings are to avoid listing network bridges which seem to be created by Parallels Desktop:\n// | grep -Fv \"inet 10.\" \n\n(\n~getLocalIPs = {\n var winCMD, macCMD, linCMD, ips;\n \n winCMD = {\n \"ipconfig | findstr /C:IPv4\"\n .unixCmdGetStdOut\n .replace(\" IPv4 Address. . . . . . . . . . . : \", \"\");\n };\n \n macCMD = {\n (\"ifconfig | grep -Fv\" + \"inet 10.\"\n .quote + \"| grep\" + \"inet \"\n .quote + \"| grep -Fv 127.0.0.1 | awk '{print $2}'\"\n ).unixCmdGetStdOut;\n };\n \n linCMD = {\n (\"ip address | grep \\\"inet \\\" | grep -Fv 127.0.0.1 | awk '{print $2}' | cut -d '/' -f1\")\n .unixCmdGetStdOut;\n };\n //linCMD = { (\n // \"ifconfig | grep\" + \"inet \".quote +\n // \"| grep -Fv 127.0.0.1 | awk '{print $2}'\" \n //).unixCmdGetStdOut };\n \n ips = Platform.case(\n \\osx, { macCMD.() },\n \\linux, { linCMD.() },\n \\windows, { winCMD.() }\n );\n \n ips = ips.split(Char.nl);\n ips.removeAt(ips.size-1);\n ips\n}\n);\n\n~getLocalIPs.()\n```"}, {"role": "assistant", "content": "This code outputs an array consisting of local IPs (or an array with one local IP if there is only one) except “127.0.0.1”.\r\n\r\nIt successfully detects multiple IPv4 addresses as well as one IPv4 address under macOS 12.2.1 and Windows 11. However, under Ubuntu 20.04.3, which ran over Parallels Desktop, I strangely could not assign IPv4 to the second network card. Thus, I confirmed only the output o."}], "family": "D3", "source_id": "sccode:1-5gu", "aug": "patch", "prompt_tokens": 569, "answer_tokens": 145}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n{var a=LFNoise0,b=SinOscFB,c=Pulse;b.ar(a.ar([2,3])*(c.ar([5,7],b.kr([7,5]))*(a.ar([3,2]))*[800,1200]),(c.kr([100,80])*[2,3]))}.play\n```"}, {"role": "assistant", "content": "dirty and noisy \"result\" of remembering/learning sc again. still dont understand why it does not work when i move .ar/kr to var definition. hh... will turn it into synthdef..."}], "family": "D3", "source_id": "sccode:1-5gs", "aug": "patch", "prompt_tokens": 144, "answer_tokens": 60}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(//floating point errors\n{ var pink;\n pink = PinkNoise.ar().range(0.08, 0.12)!2;\n 0.5*LeakDC.ar(Median.ar(2, Limiter.ar(99999999*(SawDPW.ar(pink, 0) + SawDPW.ar(pink, pi)), 0.9)))}.play;\n{ var pink;\n pink = PinkNoise.ar().range(0.0999/3, 0.1001/3)!2;\n 0.5*LeakDC.ar(Median.ar(5, Limiter.ar(99999999*(SawDPW.ar(pink, 0) + SawDPW.ar(pink, pi)), 0.9)))}.play;\n{var pink;\n pink = PinkNoise.ar().range(0.00999, 0.01001)!2;\n (0.5*Median.ar(20,\n Limiter.ar(999999*LeakDC.ar(SawDPW.ar(pink, 0+(pi/2)) + SawDPW.ar(pink, pi+(pi/2))), 0.1)))}.play;\n{0.5*Median.ar(30, Limiter.ar(99999999*LeakDC.ar((SinOsc.ar(0.005, 0) + SinOsc.ar(0.005, pi)), 0.05)))!2}.play;\n{0.5*SVF.ar((Median.ar(10, Limiter.ar(999999*LeakDC.ar(LFPulse.ar(0.5, 0) + LFPulse.ar(0.5, pi)), 0.6))), 800)!2}.play;\n)\n```"}, {"role": "assistant", "content": "https://scsynth.org/t/why-the-plot-result-of-summing-2-same-frequency-sinosc-with-phase-reversed-is-not-just-zeros/5805/6\r\n\r\nquick proof of concept\r\n\r\nResults of a subtracting two identical out of phase signals from each-other, which should be silent but isn't because of the imprecision of floating point arithmetic... The quiet signals are then boosted to be audible, kind of like digital lowercase."}], "family": "D3", "source_id": "sccode:1-5g9", "aug": "patch", "prompt_tokens": 536, "answer_tokens": 152}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nPsloth {\n var seed, repeats;\n\n *new { arg seed, repeats=1;\n ^super.newCopyArgs(seed, repeats);\n }\n\n storeArgs{^[seed, repeats]}\n\n embedInStream { arg inval;\n var size=seed.size;\n var pointers=List[];\n repeats.value(inval).do({ arg j;\n j = j+1;\n if(j == j.nextPowerOf(size),{ pointers.add(0); });\n pointers.collect{|i| seed.at(i)}.sum.embedInStream(inval);\n pointers.do{|x, i|\n if((i==0) || (pointers[0..(i-1)].sum==0), {pointers[i] = ((x+1)%size);})\n };\n });\n ^inval\n }\n}\n```"}, {"role": "assistant", "content": "Save this as an extension and recompile class library. You can now use `Psloth([0,1,0], 10)`, for example, instead of declaring a new routine for each pattern.\r\n\r\nI didn't persist the use cases, as this should be saved as a `.sc` file. Please refer to the ancestor code for usage.\r\n\r\nMemory/CPU usage will grow over time, but at a decreasing rate. This can be used for a large amount of repeats. Exte."}], "family": "D3", "source_id": "sccode:1-5g3", "aug": "patch", "prompt_tokens": 301, "answer_tokens": 142}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// https://en.xen.wiki/w/Monzo\n//Monzo notation of JI ratios is often used in combination with Vals for temperament theory. I wrote this not for temperament, but rather to use monzos as a possible alternative to otonality and utonality, espescially when sonifying streams that include negative numbers.\n\n(//function that takes a collection representing a monzo as an argument, and outputs the ratio it encodes\n~zo = {\n arg exponentCollection;\n var ratio = 1;\n exponentCollection.do({arg item, i; ratio = ratio * (i.nthPrime).pow(item);});\n ratio;\n};\n);\n\n//5-limit\n~zo.([-1, 1]); // 3/2\n~zo.([-2, 0, 1]); // 5/4\n~zo.([-3, 2]); // 9/8\n~zo.([-4, 4, -1]); // 81/80\n~zo.([-4, 4, -1]); // 81/80\n\n//7-limit\n~zo.([-2, 0, 0, 1]); // 7/4\n~zo.([-1, -1, 0, 1]); // 7/6\n~zo.([0, 0, -1, 1]); // 7/5\n\n//fractional monzos\n~zo.([-1/2, 3.3, 4, -5]); //sure\n//it might be fun to do monzo glissandos in different places?\n```"}, {"role": "assistant", "content": "function takes in collection as argument, and returns the ratio from the resultant monzo."}], "family": "D3", "source_id": "sccode:1-5fT", "aug": "patch", "prompt_tokens": 491, "answer_tokens": 24}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nt = TempoClock(120/60).permanent_(true);\n\n(\n~change_clock_tempo = {|clock, tempo, beats=1|\n beats.do {|beat|\n var stepTempo = beat.linexp(0, beats-1, clock.tempo, tempo);\n clock.schedAbs(clock.nextBar + beat, {\n \"New Tempo: \".post; (stepTempo*60).post; \" BPM\".postln;\n clock.tempo_(stepTempo);\n });\n };\n nil;\n};\nPbindef(\\n,\n \\octave, 4,\n \\dur, 0.5,\n \\degree, Pseq((0..7), inf)\n).play(t, quant: 4);\n);\n\n~change_clock_tempo.value(t, 200/60, 16);\n~change_clock_tempo.value(t, 50/60, 8);\nt.tempo*60\n```"}, {"role": "assistant", "content": "This gradually changes the tempo of a TempoClock, each beat of a specified number of beats, and starting at the next bar.\r\n\r\n\r\nPersonally, I was not able to heavily distinguish between `.linlin` and `.linexp` for reasonable musical tempos.\r\n\r\n\r\nThere may be a mathematically smoother way of handling this at the control rate.\r\n\r\n\r\nThis function does not gracefully handle multiple simultaneous invoca."}], "family": "D3", "source_id": "sccode:1-5fG", "aug": "patch", "prompt_tokens": 327, "answer_tokens": 138}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.boot;\n\n(\nvar bufferSize = s.sampleRate * 1; // Buffer size is fixed. s.sampleRate * seconds makes sense.\n\nif( ~plotterIn == nil, { ~plotterIn = Bus.audio( s, 2 ) } ); // Declare a global channel for the plotter input, stereo\n\nif( ~plotterBuffer != nil, { ~plotterBuffer.free } ); // Reset the buffer if existant\n~plotterBuffer = Buffer.alloc( s, bufferSize, 2 ); // Create our buffer, stereo\n\nSynthDef( \\toBuffer, { // A simple routing synth\n | bufNum |\n var in = In.ar( ~plotterIn, 2 ); // Takes an input\n RecordBuf.ar( in, bufNum, loop: 0, doneAction: 2 ); // And outputs it in our buffer\n} ).add;\n);\n\n( // Demo Synth\nSynthDef( \\demoSynth, {\n | out = 0, freq = 220 |\n\n var snd = SinOsc.ar( freq!2 );\n snd = snd * EnvGen.kr( Env.perc( 0.1, 0.9 ), doneAction: 2 );\n\n Out.ar( out, snd );\n} ).add\n);\n\n(\nSynth( \\toBuffer, [ \\bufNum, ~plotterBuffer ] ); // Trigger the buffer synth\nSynth( \\demoSynth, [ \\out, ~plotterIn, \\freq, 110 ] ); // Then our favorite synth\n);\n\n// You will need to wait the bufferSize length before plotting it !\n~plotterBuffer.plot // Finally print the result\n\nif( ~plotterBuffer != nil, { ~plotterBuffer.free } ); // Free the buffer if existant\n```"}, {"role": "assistant", "content": "This is a setup that allows you to plot a Synth() output, using a buffer. See https://scsynth.org/t/what-is-the-best-way-to-plot-a-synth/5160 ."}], "family": "D3", "source_id": "sccode:1-5fA", "aug": "patch", "prompt_tokens": 628, "answer_tokens": 67}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nm = SimpleMIDIFile.read( \"~/Téléchargements/Super Mario Bros 2 - Mario Dreams.mid\" ); \n(\n TempoClock.default.tempo = m.tempo/60;\n Pdef(\\bla, \n Pbind(\n \\instrument, \\default,\n [\\midinote, \\dur, \\sustain, \\amp], Prout({ arg ev;\n var timescale = 1/16/60;\n var prevev;\n m.noteSustainEvents.collect({ arg item, idx;\n // [track, absTime, \\noteOn, channel, note, velo, dur, upVelo]\n if(idx == 0) {\n prevev = [item[4], item[1], item[6] * timescale, item[5]/127]\n } {\n prevev[1] = item[1] - prevev[1] * timescale;\n ev = prevev.yield;\n prevev = [item[4], item[1], item[6] * timescale, item[5]/127];\n };\n });\n prevev[1] = prevev[2];\n ev = prevev.yield;\n }),\n )\n ).play\n)\n```"}, {"role": "assistant", "content": "There is the .p method (see http://sccode.org/1-5aT) but here is also a way to retrieve the values directly."}], "family": "D3", "source_id": "sccode:1-5fz", "aug": "patch", "prompt_tokens": 444, "answer_tokens": 43}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// additional UGens needed:\n// AnalogTape, LockhartWavefolder and AnalogVintageDistortion are from\n// \"ported plugins\" https://github.com/madskjeldgaard/portedplugins\n// JPverb is in sc3-plugins\n\nNdef(\\test, {\n var snd,freq=50;\n var noise;\n\n noise = WhiteNoise.ar * LFPulse.kr(freq * [0.5,2],0,0.01).range(0,0.3);\n noise = BPF.ar(noise, LFNoise0.kr([1/5,1/4]).range(1000,8000).lag(1));\n noise = Splay.ar(noise, LFNoise1.ar(1/3).range(-1,1));\n freq = [freq,freq*1.01];\n snd = Pulse.ar(freq);\n snd = snd + Pulse.ar(freq*2.001,LFNoise1.ar(1/3).range(0.01,0.05));\n snd = LeakDC.ar(snd);\n snd = AnalogTape.ar(snd, 0.9, LFNoise1.kr(1/4).range(0,1), 0.5,0,2);\n snd = snd.fold(-0.5,0.9);\n snd = LockhartWavefolder.ar(snd[0] * LFNoise1.kr(1/4).range(1,10), 4) +\n ((LockhartWavefolder.ar(snd[1] * LFNoise1.kr(1/4).range(1,10), 4)) * [-1,1]);\n snd = RLPF.ar(snd, LFNoise1.ar(1/4).exprange(200,9000), LFNoise1.ar(1/3).range(0.1,0.9));\n snd = snd + noise;\n \n snd = AnalogVintageDistortion.ar(snd,0,1, oversample:3);\n snd = LeakDC.ar(snd);\n snd = snd * LFPulse.ar(1/7, width:0.2).lag(0.001);\n snd = JPverb.ar(snd*0.4, 10, 0, 5, low:0.5) + snd;\n snd = Limiter.ar(snd*1, 0.9) * 0.8;\n\n snd;\n}\n```"}, {"role": "assistant", "content": "test to use some distortion UGens from Mads' Ported Plugins and ended up with this tootin fatso."}], "family": "D3", "source_id": "sccode:1-5fv", "aug": "patch", "prompt_tokens": 759, "answer_tokens": 35}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n var gspring;\n gspring = { |freq|\n var delay, sinc, env, line, impul;\n\n delay = freq.reciprocal;\n impul = Impulse.ar(0);\n env = Env.perc(0.001, 0.01).ar;\n line = Line.ar(1000, 50, 0.01 );\n sinc = SinOsc.ar(line);\n\n Pluck.ar( sinc * env, impul, delay, delay, 5, 0.5);\n };\n\n\nSynthDef.new('eguitar',\n { arg amp=1, freq=150, out_bus=0, pan=0;\n\n var snd;\n\n snd = gspring.value(freq-50) +\n gspring.value(freq) +\n gspring.value(freq+50);\n\n snd = (snd * 32.dbamp).tanh;\n snd = RLPF.ar(snd, 2800+freq, 0.5);\n snd = (snd * 32.dbamp).tanh;\n snd = RLPF.ar(snd, 300+freq, 0.5);\n snd = (snd * 32.dbamp).tanh;\n\n snd * -20.dbamp;\n\n Out.ar(out_bus, snd );\n}).add\n);\n\nSynth('eguitar', [freq: 360]);\n```"}, {"role": "assistant", "content": "just a very limited attempt for reference purpose of a hoped for eguitar synth ´\r\nbased on https://sccode.org/1-5aC#c982."}], "family": "D3", "source_id": "sccode:1-5fu", "aug": "patch", "prompt_tokens": 461, "answer_tokens": 58}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~file = \"~/Musique/sc/samplekit/loop/lovin.flac\".standardizePath;\n\ne = SCMIRAudioFile(~file, [[MFCC, 13], [Chromagram, 12]]); // open file for SCMIR\nb = Buffer.read(Server.default, ~file); // buffer for the Pbind\n{e.extractFeatures()}.fork; // extract features before creating similarityMatrix\nm = e.similarityMatrix(unit:10, metric:2); // create similarityMatrix \n\n(\n// simple buffer player\nSynthDef(\\playersec, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, bufnum, speed=1, pos=0, doneAction=2, loop=0, trigger=1, velamp=1;\n // pos in seconds\n var sig;\n var sig1;\n sig = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum) * speed, trigger, startPos: (pos*BufSampleRate.kr(bufnum)), doneAction:doneAction, loop: loop);\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.001,0,1,0.01)),gate,doneAction:doneAction);\n //sig = Pan2.ar(sig, pan, 1).sum;\n Out.ar(out, sig * \\gain.kr(1) * velamp);\n}).add;\n);\n\n(\nPdef(\\sortsample,\n Pbind(\n \\instrument, \\playersec,\n \\bufnum, b,\n // take sample at column 105 and play other columns by order of similarity\n // pos is position in the sample in seconds\n // column 105 start at 105*m.reducedrows+0 and ends at 105*m.reducedrows+m.reducedcolumns\n \n```"}, {"role": "assistant", "content": "analyze a sample with SCMIR and sort sample segments by similarity (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-5fj", "aug": "patch", "prompt_tokens": 628, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// https://recarteblog.wordpress.com/\n//gongFM_SC\n\n// 1. Añadir al servidor\n\n(\nSynthDef(\\gongFM, {\n arg ratio1=0.9, ratio2=0.55, ratio3=1.03, index2=2, index3=4, amp=0.7, dur=7, pan=0;\n var sig, op1, op2, op3, env1, env2, env3;\n env3 = EnvGen.kr(Env.new([0, 1, 1, 0], [0.4, 0.3, dur]), doneAction:2);\n env2 = EnvGen.kr(Env.new([0, 1, 1, 0], [0, 0.3, dur]), doneAction:2);\n env1 = EnvGen.kr(Env.new([0, 1, 1, 0], [0.003, 0.3, dur - 0.5]), doneAction:2);\n op3 = SinOsc.ar(([67, 70, 74].midicps * ratio3), mul:[67, 70, 74].midicps * ratio3 * index3) * env3;\n op2 = SinOsc.ar((([67, 70, 74].midicps * ratio2) + op3), mul:[67, 70, 74].midicps * ratio2 * index2) * env2;\n op1 = SinOsc.ar(([67, 70, 74].midicps * ratio1) + op2);\n sig = op1 * env1 * amp;\n sig = Splay.ar(sig);\n sig = Balance2.ar(sig[0], sig[1], pan);\n Out.ar(0, sig);\n}).add;\n);\n\n\n// 2. Ejecutar los Synths\n\nSynth(\\gongFM);\n\nSynth(\\gongFM, [\\ratio1, 0.503, \\ratio2, 0.50, \\ratio3, 1.35, \\index2, 1.53, \\index3, 4.33]);\n\nSynth(\\gongFM, [\\ratio1, 0.59, \\ratio2, 0.17, \\ratio3, 0.75, \\index2, 1.54, \\index3, 3.29]);\n\nSynth(\\gongFM, [\\ratio1, 0.49, \\ratio2, 0.17, \\ratio3, 0.34, \\index2, 1.33, \\index3, 4.31]);\n\nSynth(\\gongFM, [\\rati\n```"}, {"role": "assistant", "content": "Various gong-like sounds using FM synthesis.\r\nMore detailed info (in Spanish) at https://recarteblog.wordpress.com/2021/05/05/gongfm_sc/."}], "family": "D3", "source_id": "sccode:1-5f7", "aug": "patch", "prompt_tokens": 828, "answer_tokens": 64}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~constructPseudoMethods = { |envir|\n var newEnvir = envir.collect { |value|\n var argNames, argBlock, namesBlock, code, func;\n if(value.isKindOf(Function)) {\n func = value;\n argNames = func.def.argumentString(withDefaultValues: true);\n namesBlock = func.def.argumentString(withDefaultValues: false);\n argBlock = if(argNames.notNil) { \"|self, \" ++ argNames ++ \"|\" };\n code = \"{ |func, envir| { % envir.use { func.value(%) } } }\".format(argBlock ? \"\", namesBlock ? \"\");\n //code.postln;\n code.interpret.value(func, envir)\n } {\n value\n }\n };\n newEnvir.know = true; // we want a prototype object style environment\n};\n```"}, {"role": "assistant", "content": "/*\r\nI often like to write out a library as an environment, like:\r\n\r\n~start_sound = { |freq, amp| <...> };\r\n~start_high_pitch_sound = { |amp| ~start_sound.(14000, amp) };\r\n\r\n… and then use loadRelative to load that library.\r\n\r\nThis, however has the problem that you can't stick the whole library into an environment that you call from the outside. e.g.\r\n\r\nq = ();\r\nq.use { resolveRelative(\"/library.sc."}], "family": "D3", "source_id": "sccode:1-5f6", "aug": "patch", "prompt_tokens": 345, "answer_tokens": 171}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// https://recarteblog.wordpress.com/\n//droneFM01\n\n// 1. Añadir al servidor\n(\nSynthDef(\\droneFM, {\n arg f1Freq=0.1, f2Freq=1.1, f3Freq=2.2, nFreq=440, m1Ratio=1, m2Ratio=2, m3Ratio=3,\n amp=0.1, dur=55, ampM=0.84 , pan=0;\n var sig, car1, mod1, car2, mod2, car3, mod3, env, index;\n index = LFNoise1.kr(0.2).range(2, 12);\n env = EnvGen.kr(Env.new([0, 0.70, 0.70, 0], [dur*0.333, dur*0.333, dur*0.333]), doneAction:2);\n mod1 = SinOsc.ar([nFreq * m1Ratio, nFreq+0.7 * m1Ratio], mul:nFreq * m1Ratio * index) * ampM;\n car1 = SinOsc.ar(f1Freq + mod1);\n mod2 = SinOsc.ar([nFreq * m2Ratio, nFreq+1.4 * m2Ratio], mul:nFreq * m2Ratio * index) * ampM;\n car2 = SinOsc.ar(f2Freq + mod2);\n mod3 = SinOsc.ar([nFreq * m3Ratio, nFreq+0.35 * m3Ratio], mul:nFreq * m3Ratio * index) * ampM;\n car3 = SinOsc.ar(f3Freq + mod3) * 0.4;\n sig = car1 + car2 + car3 * env * amp;\n sig = Pan2.ar(sig, pan);\n Out.ar(0, sig);\n}).add;\n);\n\n// 2. Ejecutar los Synths\n(\nSynth(\\droneFM, [\\nFreq, 50.midicps]);\nSynth(\\droneFM, [\\nFreq, 57.midicps]);\nSynth(\\droneFM, [\\nFreq, 41.midicps]);\n)\n```"}, {"role": "assistant", "content": "Polyrhythmic and dynamic FM drone.\r\n\r\nMore detailed info (in Spanish) at https://recarteblog.wordpress.com/2021/02/23/example-post-2/."}], "family": "D3", "source_id": "sccode:1-5f5", "aug": "patch", "prompt_tokens": 713, "answer_tokens": 67}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// ==========================================\n// How to Record Multichannel Output in SuperCollider\n// ==========================================\n\n// Example - recording 4 output channels *as separate mono files*. \n// Code below also picks a custom path and file name to save them (adjust accordingly to your machine)\n\n// This code sets your SuperCollider Server to 4-channel output\ns.options.numOutputBusChannels = 4;\ns.reboot;\n\n// You can see the 4 channels here:\ns.meter;\n\n// Create 4 recorders (needs to be done just once in a session):\n~recs = Recorder.new(s).dup(4)\n\n// START ALL MONO RECORDERS (chans 0, 1, 2, 3)\n(\nvar basicPath = \"/home/ruviaro/Desktop/\"; // customize this\n\n~recs.do({ arg thisRecorder, index;\n var fileName = \"test\" ++ index ++ \".wav\";\n \n thisRecorder.record(\n path: basicPath ++ fileName,\n bus: index,\n numChannels: 1 // mono\n );\n})\n);\n\n// Start making some sound (below, 4 channels of sound)\n(\n{\n var snd;\n snd = LFTri.ar(\n freq: [100, 204, 310, 405],\n mul: LFPulse.ar([1, 2, 3, 4])\n );\n // snd = Splay.ar(snd);\n Out.ar(0, snd * 0.2);\n}.play;\n);\n\n// Stop all recorders\n~recs.do({ arg thisRecorder; thisRecorder.stopRecording })\n\ns.freeAll;\n\n// ====\n```"}, {"role": "assistant", "content": "This example shows how to record 4 output channels *as separate mono files*. \r\nAlso shows how to pick a custom path and file name for the files. File type chosen is \"wav\" (instead of default \"aiff\")."}], "family": "D3", "source_id": "sccode:1-5eV", "aug": "patch", "prompt_tokens": 646, "answer_tokens": 71}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// poison0ak / melas0nos \n\n(\nSynthDef(\\drunkDwarf,{\n arg out=0, freq=100, k=0.0, loss=0.999, dur=0.5, pan=0.0, rand=1;\n var sig, env, sub,senv;\n env = EnvGen.ar(Env([0,1,1,0], [0.001] ++ ((dur-0.001)*[0.4, 0.6])), doneAction:2);\n senv = EnvGen.ar(Env([1,1,0,0], [( rand * freq + freq/2 )/SampleRate.ir, 0.0, 1.0]));\n sub = Saw.ar([freq/4, freq/2]/4);\n sig = WhiteNoise.ar(0.5) * senv;\n sig = TwoTube.ar(sig, k, loss, rand+ freq, freq/2);\n sig = (sub/4+(sig).fold(10)*sub).tanh;\n sig = RLPF.ar([sig, sig/2], freq*4 * (LFNoise2.ar(0.5).range(1,10)/pi).lagud([0.2, 0.5]).lagud , 1);\n sig = Compander.ar(sig, SinOsc.ar(dur), 0.7,0.2,1,0.001,0.05);\n sig = LPF.ar(sig, 4000).fold2;\n sig = LPF.ar(sig, 4000);\n\n Out.ar(out, Splay.ar(sig*env,pan));\n}).add;\n);\n\n\n\n(\nPbind(\\instrument, \\drunkDwarf,\n \n \\freq, Pseq([100,1000,200,900,100,1050,200,800,100,750,200,500,100,400,200,300], inf),\n \\rand, Pwhite(1,100,inf),\n \\loss, 1,\n \\dur, Pseq([0.25,0.75], inf),\n \\pan, 1,\n \\k, 1.0005\n\n).play;\n)\n```"}, {"role": "assistant", "content": "Just some weird thing made with some physical modelling gone wrong."}], "family": "D3", "source_id": "sccode:1-5eT", "aug": "patch", "prompt_tokens": 694, "answer_tokens": 20}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Kabelscahden \n// by Alberto de Campo and Julian Rohrhuber, 3/2003\n// licenced under creative commons Attribution-ShareAlike 2.5\n\n\n(\n{\n var h, n, m, k, trig;\n trig = Dust.kr( 7 ** LFNoise1.kr(0.3) );\n h = ToggleFF.kr(CoinGate.kr(0.4,trig)) *\n RLPF.ar(LFPulse.ar(50, 0, 0.5, 1, LFNoise1.kr(2, 0.5, -0.5)), 6000, 0.15);\n n = Trig.ar(trig, TRand.kr(0, 0.01, CoinGate.kr(0.4,trig))) * WhiteNoise.ar;\n m = Trig.ar(trig, TRand.kr(0, 0.01, CoinGate.kr(0.4,trig))) * BrownNoise.ar;\n k = Trig.ar(trig, LFNoise1.kr([ 4, 4.2 ], 0.1, 0.11)) *\n LFClipNoise.ar(LFNoise0.kr(7, 30, 40));\n LeakDC.ar(h + n + k + m * 10).distort;\n}.play;\n);\n\nhttps://swiki.hfbk-hamburg.de/MusicTechnology/851\n```"}, {"role": "assistant", "content": "Kabelscahden Guitar Cable Hum Buzz Noise Cable damage - Repost (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-5eM", "aug": "patch", "prompt_tokens": 463, "answer_tokens": 42}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Meandering Sines\n(\n// chord choosing function\n~chords = Dictionary.new;\n~chords.add(\\fifth -> [1, 1.5, 2]);\n~chords.add(\\maj6 -> [1, 1.2, 1.6, 2]);\n~chords.add(\\min6 -> [1, 1.25, 1.666, 2]);\n~chords.add(\\maj7 -> [1, 1.25, 1.875, 2]);\n\n// write pitches into array\n~dronenotes = [\n {~chords[\\fifth].choose}!8 * 44.midicps,\n {~chords[\\maj6].choose}!8 * 41.midicps,\n {~chords[\\fifth].choose}!8 * 44.midicps,\n {~chords[\\min6].choose}!8 * 40.midicps\n];\n\ns.waitForBoot({\n s.sync;\n\n // instrument definition\n SynthDef.new(\\sine, {\n var sig, env;\n env = Env.asr(\\atk.ir(0.05), 0.75, \\rel.ir(2)).kr(2, \\gate.kr(1));\n sig = SinOsc.ar(\n \\freq.kr(220, \\freqlag.kr(1.2)) + SinOsc.kr({Rand(0.02, 0.06)}, 0, {Rand(0.1, 2.0)}), // frequency: slowly meandering a bit\n {Rand(0.0, 2pi)}, // phase\n SinOsc.kr({Rand(1/60, 3/60)}).range(0.2, 0.5)); // meandering amplitude\n sig = sig * env * \\amp.kr(0.2, 0.2);\n sig = Pan2.ar(sig, SinOsc.kr(\\panfreq.ir(1/10), {Rand(0.0, pi)}, {Rand(0.1, 0.99)})); // meandering panning\n Out.ar(\\out.kr(0), sig);\n }).add;\n s.sync;\n\n Pbindef(\\drones,\n \\instrument, \\sine,\n \\freq, Pseq(~dronenotes,inf),\n \\amp, 0.06,\n \\dur, Pwhite(18\n```"}, {"role": "assistant", "content": "8 sine waves, each with a slightly meandering frequency, random phase, slowly varying amplitude, slowly wandering through the stereo field; pitches are chosen from a given chord that is changing at intervals between 18 and 20 seconds."}], "family": "D3", "source_id": "sccode:1-5eE", "aug": "patch", "prompt_tokens": 743, "answer_tokens": 73}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// what can it sound like? see: https://www.youtube.com/watch?v=dRmY3tEwZyE \n// the youtube version has been sent through an additional reverb pedal, but\n// you don't need the pedal to get something that sounds interesting\n\n(\ns.options.memSize_(16384*10);\ns.reboot;\ns.waitForBoot({\n \n Ndef(\\bits, {\n var t = PulseCount.ar(Impulse.ar(8e3));\n var u = PulseCount.ar(Impulse.ar(7009));\n var sig = HPF.ar(\n (\n ((t * 15) & (t >> 5)) |\n ((t * 5) & (t >> [3, 4])) |\n ((t * 2) & (t >> 9)) |\n ((t * 8) & (t >> 11)) |\n (((t*t) & t) | (t >> 3))\n - 3 % 256\n ) / 127-1 * 3\n , 20\n ) * 0.1;\n var sig2 = LPF.ar(HPF.ar(gcd(t*u, u+t), WhiteNoise.ar()*2000 + 1000), 20);\n sig2 = sig2*sig;\n sig = 0.3*Splay.ar(Limiter.ar(Greyhole.ar(sig + sig2, sig, 0.5, sig), 0.5).flatten);\n }).play;\n});\n)\n```"}, {"role": "assistant", "content": "a surprisingly rich soundscape in a few lines of code (lucky accident)."}], "family": "D3", "source_id": "sccode:1-5ei", "aug": "patch", "prompt_tokens": 474, "answer_tokens": 26}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// made for circular speakers. Change number of speakers to match your setup.\n~numSpeakers = 2;\n(\nSynthDef(\\dopplerPithchShift, {\n var sig, env, phasor, buf, hanning, window, phasorfreq, phase, iphase, ratio, numDelays=8, delaywindow=0.1;\n hanning = Signal.hanningWindow(512).asWavetable;\n buf = LocalBuf.newFrom(hanning);\n phasorfreq = ((\\ratio.kr(1) - 1 ) * -1) / delaywindow;\n window = numDelays.collect{|i|\n phase = i.linlin(0, numDelays+1, 0, 2pi);\n Osc.kr(buf, phasorfreq, phase) ;\n };\n env = EnvGen.kr(Env.asr(\\attack.kr(0.01), 1, \\release.kr(0.01)), gate: \\gate.kr(1), doneAction: \\da.kr(2));\n phasor = numDelays.collect {|i|\n iphase = i.linlin(0, numDelays+1, 1, 3).mod(2);\n LFSaw.ar(phasorfreq, iphase).range(0, 1) * delaywindow;\n };\n sig = In.ar(\\in.kr(2));\n sig = numDelays.collect{|i| DelayC.ar(sig, 0.4, delaytime: phasor[i]) * window[i]};\n sig = sig.sum;\n sig = sig * \\amp.kr(1, 0.1) * env;\n sig = PanAz.ar(~numSpeakers, sig, \\pan.kr(0), width: \\width.kr(2));\n Out.ar(\\out.kr(0), sig);\n}).add;\n);\n\n// test\nd = Synth(\\dopplerPithchShift, [\\in, 2, \\amp, 4, \\ratio, -12.midiratio]);\nd.set(\\ratio, 12.midiratio);\nd.f\n```"}, {"role": "assistant", "content": "A first attempt to port a doppler pitch shifter following this tutorial: https://www.youtube.com/watch?v=uyzY_ZP54pA to SuperCollider from Max."}], "family": "D3", "source_id": "sccode:1-5ef", "aug": "patch", "prompt_tokens": 693, "answer_tokens": 68}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// A.Broz: Shepard-Risset glissando demo (2020-10-31)\n\n(\n/*\n ,\n /\n `\\_\\\n \\\n /O\\\n ' '\n*/\nSynthDef(\\shepard, #{ |freq=440, dur=20, direction=1, amp=0.2|\n var partialCount = 4;\n var octRange = 2 ** (partialCount / 2);\n var cycle = 1 / (partialCount * dur);\n var width = if(direction >= 0, 1, 0);\n var sig = partialCount.collect { |n|\n var offset = n / partialCount;\n var phase = (3 * pi / 2) + (2 * pi * offset);\n var vol = SinOsc.kr(cycle, phase).range(0, 1);\n var ratio = VarSaw.kr(cycle, offset, width).exprange(1/octRange, octRange);\n SinOsc.ar(freq * ratio) * vol;\n }.sum;\n sig = sig!2 * (amp / partialCount) * Line.kr(0, 1, 5); // fade in\n sig = JPverb.ar(sig); // reverb\n Out.ar(0, sig);\n}).add;\n\n~playShep = #{ |fund=300, chord=([1, 5/4, 3/2]), dir=(-1), dur=40, amp=0.1|\n chord.collect { |r| (\n instrument: \\shepard,\n freq: fund * r,\n dur: dur,\n direction: dir,\n amp: amp,\n ).play };\n};\n);\n\n// falling chord\n~shep = ~playShep.value;\n\n// rising chord\n~shep = ~playShep.(200, [1, 4/3, 16/9], 1, 70, 0.03);\n\n// free all\n~shep do: _.free;\n```"}, {"role": "assistant", "content": "A short SynthDef that produces a Shepard-Risset glissando and some code to demo it."}], "family": "D3", "source_id": "sccode:1-5ee", "aug": "patch", "prompt_tokens": 631, "answer_tokens": 31}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nMIDIClient.init;\n\n~ob6 = MIDIOut.newByName(\"OB-6\", \"OB-6\");\n// ~ob6.latency = Server.default.latency;\n\n(\np = Pbind(\n \\type, \\midi,\n \\midicmd, \\noteOn,\n \\midiout, ~ob6,\n \\chan, 0,\n \\degree, Pwhite(-7, 12, inf),\n \\dur, Pwrand([0.25, Pn(0.125, 2)], #[0.8, 0.2], inf),\n \\legato, sin(Ptime(inf) * 0.5).linexp(-1, 1, 1/10, 1),\n \\amp, Pexprand(0.5, 1.0, inf)\n).play(quant: 1);\n);\n\n~ob6.allNotesOff(0);\n\n(\nEvent.addEventType(\\OB6_NRPN, {\n var midiout = ~midiout.value;\n var chan = ~chan.value;\n var nrpnNum = ~nrpnNum.value;\n var nrpnValue = ~nrpnValue.value;\n\n if (nrpnValue.class == String) {\n if (nrpnValue.beginsWith(\"c\")) {\n nrpnValue = Bus.new('control', nrpnValue[1..].asInteger, 1, s).getSynchronous();\n };\n };\n\n nrpnValue = nrpnValue.asInteger;\n\n midiout.control(chan, 0x63, nrpnNum >> 7);\n midiout.control(chan, 0x62, nrpnNum & 0x7F);\n midiout.control(chan, 0x06, nrpnValue >> 7);\n midiout.control(chan, 0x26, nrpnValue & 0x7F);\n});\n);\n\n// randomize filter cutoff\n\n(\np = Pbind(\n \\type, \\OB6_NRPN,\n \\midiout, ~ob6,\n \\chan, 0,\n \\nrpnNum, 45,\n \\nrpnValue, Pwhite(0, 164),\n \\dur, 1\n).play(quant: 1);\n);\n\n// randomize filter cutoff with a LFO from a Node bus\n\n(\np = P\n```"}, {"role": "assistant", "content": "I bought a Sequential OB-6 recently and you can control all the parameters with NRPN messages.\r\nI wanted to control these NRPN parameters with patterns, adding LFOs for instance."}], "family": "D3", "source_id": "sccode:1-5ea", "aug": "patch", "prompt_tokens": 752, "answer_tokens": 62}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n arg amp=0.1;\n var a, trig, basefreq, snd, cutoffmod, rqmod;\n \n a = Dseq([0, 2, 3, 5, 7, 8, 10, 12], inf);\n trig = Impulse.kr(4);\n basefreq = Demand.kr(trig, 0, a) + 38;\n basefreq = basefreq.midicps;\n cutoffmod = LFNoise2.ar(0.2).range(100,1500);\n rqmod = LFNoise2.ar(0.2).range(1,0.05);\n\n snd = (Pulse.ar(basefreq + 1 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 2 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 3 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 4 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 5 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 2 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 3 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 4 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 5 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 6 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp);\n \n \n snd = LeakDC.ar(snd);\n snd = RLPF.ar(snd, cutoffmod, rqmod);\n snd = Limiter.ar(in: snd, level: 0.8, dur:0.001);\n snd.dup;\n \n}.play)\n```"}, {"role": "assistant", "content": "I was playing around trying to understand how Demand UGens work and come up with this rave-ish example."}], "family": "D3", "source_id": "sccode:1-5e9", "aug": "patch", "prompt_tokens": 763, "answer_tokens": 28}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\acid, { arg out, freq = 1000, gate = 1, pan = 1, cut = 4000, rez = 0.8, amp = 1, sustain = 1, release = 0.5;\n var sig, env;\n env = EnvGen.kr(Env.linen(0.01, sustain, sustain * release), gate, amp, doneAction: Done.freeSelf);\n sig = Pulse.ar([freq,freq*1.001], 0.5);\n sig = sig + Pulse.ar(freq*0.501, 0.01, [0,0.5]);\n sig = sig + Pulse.ar(freq*1.99, 0.11, [0.5,0]);\n sig = RLPF.ar(sig, cut, rez);\n sig = Pan2.ar(sig);\n sig = sig * env;\n\n Out.ar(out, sig);\n}).add;\n);\n\n\n~bus = Bus.control(s,1);\n~bus2 = Bus.control(s,1);\n\n(\n~lfo1 = SynthDef(\\lfo1, {\n arg fmin=200, fmax=2000;\n Out.kr(~bus, SinOsc.kr(0.1).range(fmin,fmax))\n}).play;\n\n~lfo2 = SynthDef(\\lfo2, {\n arg fmin=1, fmax=3;\n Out.kr(~bus2, SinOsc.ar(0.05).range(fmin,fmax))\n}).play;\n\n\nPbind(\\instrument, \\acid,\n\n \\note, Pfunc{~bus2.getSynchronous * 2}, // !!\n \\cut, Pfunc{ ~bus.getSynchronous }, // !!\n\n \\dur, Pseq([0.08, 0.2, 0.1, 0.03, 0.08, 0.2, 0.12], inf),\n \n // uncomment for an extreme example:\n //\\dur, Pfunc{ ~bus2.getSynchronous.linlin(1,3,5,1) * 0.035 },\n \\legato, 0.3,\n \\release, 2,\n \\root, -30,\n \\pan, Pfunc({0.5.rand2}),\n \\rez, Pfunc({0.7.rand +0.3}),\n \\amp, 0.2).play;\n);\n\n// now you can cha\n```"}, {"role": "assistant", "content": "a learning example where you can control patterns with running ugens via control bus. acid-like."}], "family": "D3", "source_id": "sccode:1-5dD", "aug": "patch", "prompt_tokens": 758, "answer_tokens": 27}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// More fun with arpeggios in F Major\n\n~prog = [\\Fmajor7, \\Dm7, \\Bbmajor7, \\Cdom7]\n\n~chords = ~prog.collect({ arg item, i; ChordSymbol.asDegrees(item, Scale.major)}); // collect the chords into a 2D array\n\np = [0, 2, 1, 3]// new pattern\n\no = [0, 7, 7, 0]\n\n(\n~bass = Pbind(\n \\instrument, \\default,\n \\octave, 4,\n \\scale, Scale.major,\n \\dur, Pbjorklund2(6, 16) * 0.125,\n \\degree, Pseq(\n [\n Pseq([~chords[0][0]],6),\n Pseq([~chords[1][0]],6),\n Pseq([~chords[2][0]]-7,6),\n Pseq([~chords[3][0]],6),\n ],\n inf),\n \\legato, 0.3\n).play;\n\n~chordtest = Pbind(\n \\instrument, \\default,\n \\scale, Scale.major,\n \\dur, 0.5,\n \\degree, Pseq(\n [\n Pseq(~chords[0][p] + o, 1),\n Pseq(~chords[1][p] + o, 1),\n Pseq(~chords[2][p]-7 + o, 1),\n Pseq(~chords[3][p] + o, 1),\n ],\n inf)\n).play;\n);\n(\n~chordtest.stop;\n~bass.stop;\n)\n```"}, {"role": "assistant", "content": "trying to improve upon [my previous attempt at making an arpeggiator](http://sccode.org/1-5dm)."}], "family": "D3", "source_id": "sccode:1-5dv", "aug": "patch", "prompt_tokens": 534, "answer_tokens": 41}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nRetro Stylophone\n\nReverse engineered from: https://www.waitingforfriday.com/?p=334\n\n1. Relaxation oscillator (UJT)\n\n- generated by a combination of two oscillators. The primary oscillator is a\n current controlled PUT (Programmable Uni-Junction Transistor) relaxation oscillator which is\n responsible for generating the overall tone of the instrument.\n A secondary LFO phase-shifted provides the vibrato\n (the relative slow wavering of a sound around the notes centre pitch)\n\n- around 10 VPP\n\n2. LFO phase-shift (vibrato)\n\n- generated by a low-frequency oscillator made with a transistor and several capacitors,\n which produces a triangle/sine wave fed into the frequency control voltage operating the UJT\n\n- frequency of about 8.5Hz, phased shifted of 180 degree, around 4.2 VPP\n*/\n\n(\nSynthDef(\\stylophone, { |freq = 220, vibAmp = 2, toneAmp = 5, atkTime = 0.01, trigger = 0|\n\n var lfo = OnePole.kr(LFPar.kr(8, mul: vibAmp, add: freq), 0.9); // 180 degree inversion\n var relaxOsc = LFPulse.ar(lfo, width: 0.9, mul: toneAmp);\n\n var asr = EnvGen.kr(Env.asr(atkTime * 5, releaseTime: 0.001, curve: \\lin), gate: trigger);\n\n Out.ar(0, relaxOsc * asr)\n}).add\n);\n\nf = Synth(\\stylophone);\n```"}, {"role": "assistant", "content": "Basic tone simulator of a stylophone. Sugestions//improvements are welcome :)."}], "family": "D3", "source_id": "sccode:1-5d2", "aug": "patch", "prompt_tokens": 577, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// random deep fryer. can turn in to rain, waves and other stuff.\n// nice with multichannel iteration. Change number at \"!2\".\n// volume compensation for high quality filter with \"1/q.sqrt\" for mul in BPF.\n// variable \"dist\" for distortion, increasing can go loud, decrease \"amp\" if so.\n// LFNoise1 with noisefreq,noisemul,noiseoffset gives it the wavy feel.\n\n(\nSynthDef(\\friture, {\n arg amp=0.5, dist=2, dens=12, dustamp=1, offset=0, noisefreq=2, noisemul=2,\n noiseoffset=0, frq1=200, frq2=2500, rq1=0.5, rq2=0.1, out=0;\n\n var sig, env;\n\n sig = {BPF.ar((Dust2.ar(dens, dustamp, offset)*LFNoise1.ar(noisefreq,noisemul,noiseoffset)),rrand(frq1,frq2),q=rrand(rq1,rq2),1/q.sqrt)}!2;\n sig = (sig*dist).tanh*amp;\n\n\n Out.ar(out,sig);\n\n }).add;\n);\n\ny = Synth.new(\\friture);\ny.free;\n\ny.set(\\dens,161);\ny.set(\\amp,0.5);\ny.set(\\dist,1);\ny.set(\\rq1,0.2);\ny.set(\\rq2,0.4);\ny.set(\\frq1,133);\ny.set(\\frq2,193);\ny.set(\\noisefreq,1);\ny.set(\\noisemul,2);\ny.set(\\noiseoffset,(-2));\ny.set(\\out,0);\n```"}, {"role": "assistant", "content": "Random deep fryer. Can turn in to rain, waves and other stuff."}], "family": "D3", "source_id": "sccode:1-5cZ", "aug": "patch", "prompt_tokens": 593, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n( // if you like bass wobbles\n\nSynthDef(\\wobble, {\n arg out=0, wflo=1, wfhi=6, decay=0, gate=1, wfmax=8500, freq, iphase;\n var env = Linen.kr(gate, releaseTime: 0.01, doneAction: Done.freeSelf);\n var son = MoogVCF.ar( \n in: (\n Pulse.ar([freq * 0.98, freq], mul:0.5) +\n PinkNoise.ar(LFNoise0.ar(2).range(0, 1.0)) +\n Saw.ar([freq, freq * 1.025], mul:2)\n ).clip2(0.5),\n fco: LFCub.kr(\n freq:LFPulse.kr(0.25, iphase, width: 0.25).range(\n wflo, wfhi) ).exprange(40, wfmax),\n res: 0.4,\n mul:2\n );\n Out.ar(out, son * env);\n}).add;\n\nb = Bus.audio(s,2);\n\nSynthDef(\"delayBus\", { | outBus = 0, inBus, wet = 0.4 |\n var input = In.ar(inBus,2);\n var rev = Greyhole.ar(input * wet,\n delayTime:0.5, feedback:0.5, diff:0.4,\n damp:0.5, modDepth:0.8, modFreq:0.3);\n Out.ar(outBus, input + rev);\n}).play(s, [\\inBus,b]);\n\nPbind(\n \\instrument, \\wobble,\n \\legato, 0.98, \\out, b,\n \\dur, 4,\n \\wflo, Prand([1,2,3],inf),\n \\wfhi, Prand([4,6,8],inf),\n \\wfmax, Pseq([4,6,3,1,9]*500,inf),\n \\iphase, Prand([0,0.25,0.5,0.75], inf),\n \\degree, Pseq([2,0,-2,-2], 8), \\octave, 3,\n).play;\n)\n```"}, {"role": "assistant", "content": "couple of cycles of wobbling bass (as in 'dubstep-wobble'): Saw+Squarewave through a MoogVCF filter. synthDef is 'tempo-agnostic' and there will be problems if you change the tempo (or rather interesting results). needs improvement to be reusable."}], "family": "D3", "source_id": "sccode:1-5cS", "aug": "patch", "prompt_tokens": 703, "answer_tokens": 92}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n( // pure melody experiments\nSynthDef(\"plucking\", {arg out = 0, amp = 0.1, freq = 440, decay = 5, coef = 0.1;\n var env, snd;\n env = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\n snd = Pluck.ar(\n in: BrownNoise.ar(amp),\n trig: Impulse.kr(0),\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n snd = LeakDC.ar(snd).clip2;\n Out.ar(out, snd * env);\n}).add;\n\nb = Bus.audio(s,1);\n\nSynthDef(\"reverbBus\", { arg outBus = 0, inBus, wet = 0.1;\n var input, rev;\n input = In.ar(inBus,1);\n rev = JPverb.ar(input * wet, t60:6, damp:0.5);\n DetectSilence.ar(rev, doneAction: Done.freeSelf); \n Out.ar(outBus, input + (rev));\n}).add;\n\nr = Synth(\"reverbBus\", [\\inBus, b, \\wet, 0.5]);\n\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.major.tuning_(\\just),\n \\octave, 4,\n\n \\degree, Pseq([1, 3, 7, 3,-4,-2, 7, 8, 1,-2, 2, 3], inf),\n \\mtranspose, Pseq([Pseq([0],144),Pseq([0],48),Pseq([3],48),Pseq([4],48)], inf),\n \\gtranspose, Pseq([Pseq([0],36),Pseq([4],36),Pseq([[-3]],36),Pseq([2],36)],inf),\n \\ctranspose, Pser([Pseries(-4,1,4) +.x Pseq([0], 144)],2),\n\n \\coef, Pseq([ Pseq([\n Prand([0.2,0.3,0.4,0.5],1),\n Prand([0.6,0.5],5),\n Prand\n```"}, {"role": "assistant", "content": "some playing around with m/c/g-transpose in Pbind. this stops after it 2 repetitions, but it could start at the beginning and go on forever - just change the last \"2\" in \\ctranspose to inf or however cycles you want. also, it uses a JPverb, so you need sc3_plugins, otherwise change rev line in reverbBus SynthDef to rev = input; or some other selfmade poor-woman's reverb."}], "family": "D3", "source_id": "sccode:1-5cR", "aug": "patch", "prompt_tokens": 729, "answer_tokens": 129}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n( // pure melody experiments\nSynthDef(\"plucking\", {arg out = 0, amp = 0.1, freq = 440, decay = 5, coef = 0.1;\n var env, snd;\n env = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\n snd = Pluck.ar(\n in: BrownNoise.ar(amp),\n trig: Impulse.kr(0),\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n snd = LeakDC.ar(snd).clip2;\n Out.ar(out, snd * env);\n}).add;\n\nb = Bus.audio(s,1);\n\nSynthDef(\"reverbBus\", { arg outBus = 0, inBus, wet = 0.1;\n var input, rev;\n input = In.ar(inBus,1);\n rev = JPverb.ar(input * wet, t60:6, damp:0.5);\n DetectSilence.ar(rev, doneAction: Done.freeSelf); \n Out.ar(outBus, input + (rev));\n}).add;\n\nr = Synth(\"reverbBus\", [\\inBus, b, \\wet, 0.5]);\n\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.major.tuning_(\\just),\n \\octave, 4,\n \\degree, Pseq([1,3,7,8], inf), // four main notes\n \\mtranspose, Pseq([Pseq([0],3),Pseq([-5],3)],inf), // switched mode every 3 notes (*2)\n \n \\gtranspose, Pseq([Pseq([0],36),Pseq([4],36),Pseq([[-3]],36),Pseq([2],36)],inf),\n \\ctranspose, Pser([Pseries(-4,1,6) +.x Pseq([0], 144)],1),\n\n \\coef, Pser([Prand([0.2,0.3,0.4,0.5],1), Prand([0.8,0.7,0.6,0.5],11)], inf),\n \\dur, Prand(\n```"}, {"role": "assistant", "content": "some playing around with m/c/g-transpose in Pbind. this stops after it has transposed 6 times a semitone up, but it could start at the beginning and go on forever - just change the last \"1\" in \\ctranspose to inf or however cycles you want. also, it uses a JPverb, so you need sc3_plugins, otherwise change rev line in reverbBus SynthDef to rev = input; or some other selfmade poor-woman's reverb."}], "family": "D3", "source_id": "sccode:1-5cQ", "aug": "patch", "prompt_tokens": 719, "answer_tokens": 137}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\simpletrackmixer, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;\n var sig;\n sig = InFeedback.ar(\\inbus.kr, 2); \n sig = sig * EnvGen.kr(\\adsr.kr(Env.adsr(0.01,0,1,0.01)),gate,doneAction:2);\n sig = sig * \\pregain.kr(1);\n Out.ar(out, DelayL.ar(sig, 0.1, \\delay.kr(0)) * \\postgain.kr(1));\n Out.ar(\\sendbus0.kr, sig * \\send0.kr(0));\n Out.ar(\\sendbus1.kr, sig * \\send1.kr(0));\n Out.ar(\\sendbus2.kr, sig * \\send2.kr(0));\n Out.ar(\\sendbus3.kr, sig * \\send3.kr(0));\n}).add;\n\nSynthDef(\\fx_echo, { arg out=0, amp=0.1, gate=1;\n var sig;\n var sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8;\n var in = InFeedback.ar(\\inbus.kr, 2); \n sig = in;\n sig = CombC.ar(sig, 1, \\delay.kr(1),\\decay.kr(1));\n sig1 = sig;\n sig1 = LPF.ar(sig1, \\lpf.kr(15000));\n sig1 = HPF.ar(sig1, \\hpf.kr(50));\n sig = SelectX.ar(\\pfmix.kr(0.5), [sig, sig1]);\n sig = SelectX.ar(\\mix.kr(0.5), [in, sig]);\n sig = sig * \\gain.kr(1);\n sig = sig * EnvGen.ar(\\adsr.kr( Env.adsr(0.01,0.1,0.8,0.1) ),gate,doneAction:2);\n Out.ar(out, sig);\n}).add;\n);\n~bus = ~bus ?? { {Bus.audio(s, 2)} ! 10 };\n\n(\nPdef(\\zed, \n Ppar([\n Pbind(\n \\instrument, \\default,\n \\note, Pseq([0,4,Rest(1),-2],inf) + Pseq([Pn(0,8),Pbrown\n```"}, {"role": "assistant", "content": "How to build a mixer with send bus in pattern world (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-5cO", "aug": "patch", "prompt_tokens": 823, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"plucking\", {arg out = 0, amp = 0.1, freq = 440, decay = 5, coef = 0.1;\n var env, snd;\n env = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\n snd = Pluck.ar(\n in: PinkNoise.ar(amp),\n trig: Impulse.kr(0),\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n snd = LeakDC.ar(snd).clip2;\n Out.ar(out, snd * env);\n}).add;\n\nb = Bus.audio(s,1);\n\nSynthDef(\"reverbBus\", { arg outBus = 0, inBus, wet = 0.5;\n var input, rev;\n input = In.ar(inBus,1);\n rev = JPverb.ar(input * wet, t60:3);\n Out.ar(outBus, input + rev);\n}).add;\n);\n\n\n( // start reverb at the end of the group\n~reverb = Synth(\"reverbBus\", [\\inBus, b, \\wet, 0.6]);\n\nPbind(\n \\instrument, \"plucking\",\n \\out, b,\n \\scale, Scale.major.tuning_(\\just),\n \\octave, 4,\n \\degree, Pseq([1,3,7,8,Prand([7,10,11,13,14]),8,7,3], inf),\n \\dur, Pseq([Pwrand([\n Pseq([0.2,0.2]),\n //0.2,\n 0.4,\n Pseq([0.1],4),\n Pseq([0.05],4)],\n [0.5,0.3,0.1,0.1] // weights\n )], 240),\n \\coef, Pwrand([0.8, 0.6, 0.4, 0.2], [0.4,0.3,0.2,0.1], inf),\n \\amp, 1,\n \\addAction, 0, // make sure new synths are added to head of group (optional)\n).play;\n);\n\n// set reverb 'wetness'\n~reverb.set(\n```"}, {"role": "assistant", "content": "using Pluck.ar with PinkNoise as input and Patterns - major scale with sequence: 1,3,7,8 and randomly 10,11,13,14 at some weighted random intervals. at 50bpm it becomes quite soothing. Needs JPverb from sc3_plugins."}], "family": "D3", "source_id": "sccode:1-5cM", "aug": "patch", "prompt_tokens": 702, "answer_tokens": 85}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~resize_enveloppe = { | levels, times |\n var reverted_levels, index;\n index = 0;\n reverted_levels = levels.reverse;\n while( { reverted_levels[index] == 0 && reverted_levels[index+1] == 0 }, { times[ times.size - 1 - index] = 0.01; index = index + 1 } );\n};\n)\n```"}, {"role": "assistant", "content": "Enveloppes sizes are fixed. This means that if enveloppe's levels are equals to [ 1, 0, 0, 0, 0, 0, 0, 0 ] and times are equals to [ 1, 1, 1, 1, 1, 1, 1, 1 ], the synth UGens will take resources 8 seconds but will only be audible 1 second. To avoid this, passing both the levels and the times to this function will detect when the sound stops playing and will reduce the \"silence\" times to 0.01s, thu."}], "family": "D3", "source_id": "sccode:1-5cz", "aug": "patch", "prompt_tokens": 164, "answer_tokens": 141}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\bird,{\n var sig, freqenv, env, trig;\n trig = Dust.ar(2);\n env = EnvGen.ar(Env.perc(0.01,0.4,0.8,-8), trig, doneAction: 2);\n freqenv = EnvGen.ar(Env([Rand(1000,3000), Rand(3000,6000), Rand(1000,2000), Rand(2000,5000)],[0.1,0.01,0.1]);, trig);\n sig = SinOsc.ar(freqenv, 0, env);\n sig = Pan2.ar(sig, Rand(-1.0,1.0));\n Out.ar(0, sig);\n}).add;\n);\n\n(\nRoutine({\n inf.do({\n Synth(\\bird);\n rrand(1.0,2.0).wait;\n })\n}).play;\n)\n```"}, {"role": "assistant", "content": "I haven't found a quite satisfying code about birds, so here's a very simple SynthDef to start with."}], "family": "D3", "source_id": "sccode:1-5cy", "aug": "patch", "prompt_tokens": 318, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\ns.waitForBoot({\n var right, left;\n\n MIDIdef.freeAll;\n if (~midi_initilized.isNil) {\n MIDIClient.init;\n MIDIIn.connectAll;\n ~midi_initialized = 1;\n };\n\n ~n = (\n table: Order(),\n noteOn: {|n,note| n.table[note] = 1},\n noteOff: {|n,note| n.table.removeAt(note)},\n get: {|n,i| \n n.table.indices[i] ?? n.table.indices.first ?? Rest(1)\n },\n seq: {|n,notes|\n notes.asArray.collect{|i| Plazy{n.get(i)}}\n }\n );\n \n MIDIdef.noteOn(\n \\mynoteonhandler, // just a name for this handler\n {\n |val, num, chan, src|\n ~n.noteOn(num)\n }\n );\n\n MIDIdef.noteOff(\n \\mynoteoffhandler, // just a name for this handler\n {\n |val, num, chan, src|\n ~n.noteOff(num) // update note table and update ~n\n /*\n // only enable the following lines if you want the arpeggio to stop as soon as you release the keys\n ~n.table.clear\n */\n }\n );\n\n right = Pbind(\n \\instrument, \\default,\n \\midinote, Pseq(~n.seq(\n [ 0, 2, 1, 2] ++ (([ 0, 2, 1, 2] + 12)!2).flatten\n )),\n \\dur, 2*Pseq([1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ].normalizeSum)\n );\n left = Pbind(\n \\instrument, \\default,\n \\midinote, Ps\n```"}, {"role": "assistant", "content": "Re: Let me know if you have ideas for improvement! (code-wise or feature-wise) ->\r\nI used an object prototype to streamline the process of registering notes and getting sequences of them. Code looks simpler to me and easier to further develop :)."}], "family": "D3", "source_id": "sccode:1-5cx", "aug": "patch", "prompt_tokens": 639, "answer_tokens": 78}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\ns.waitForBoot({\n var right, left;\n var n0, n1, n2;\n var note_getter;\n\n MIDIdef.freeAll;\n if (~midi_initilized.isNil) {\n MIDIClient.init;\n MIDIIn.connectAll;\n ~midi_initialized = 1;\n };\n\n ~note_table = 0!127;\n ~n = nil;\n\n MIDIdef.noteOn(\n \\mynoteonhandler, // just a name for this handler\n {\n |val, num, chan, src|\n ~note_table[num] = 1; // update note table and update ~n\n ~n = ~note_table.selectIndices({|item, i| item != 0});\n }\n );\n\n MIDIdef.noteOff(\n \\mynoteoffhandler, // just a name for this handler\n {\n |val, num, chan, src|\n ~note_table[num] = 0; // update note table and update ~n\n /*\n // only enable the following lines if you want the arpeggio to stop as soon as you release the keys\n ~n = ~note_table.selectIndices({|item, i| item != 0});\n if (~n == []) { ~n = nil; };\n */\n }\n );\n\n note_getter = {\n | index |\n Plazy {\n if (~n.isNil) {\n Pseq([Rest(1)]);\n } {\n ~n[index] ?? (~n[0] ?? Pseq([Rest(1)]));\n };\n };\n };\n\n n0 = note_getter.(0);\n n1 = note_getter.(1);\n n2 = note_getter.(2);\n\n right = Pbind(\n \\instrument, \\default,\n \\midinote, Pseq([ n0, n\n```"}, {"role": "assistant", "content": "Proof of concept code for a midified arpeggiator/auto-accompaniment system, quickly reacting to chord changes\r\nMidi is received as input, and supercollider's default instrument (I know, I know) is generating the output.\r\nThis code is accompaniment to a blog article at https://technogems.blogspot.com/2020/01/making-arpeggiator-in-supercollider.html\r\nLet me know if you have ideas for improvement! (c."}], "family": "D3", "source_id": "sccode:1-5cr", "aug": "patch", "prompt_tokens": 617, "answer_tokens": 155}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\ns.waitForBoot({\n \n // cello like sound\n SynthDef(\\cello, {\n |\n freq=440, amp=1.0, out=0, pan=0.0, rq=0.1,\n atk=0.01, dcy=0.1, sus=0.5, rls=0.4, \n gate=1, dur=2,\n aux=0, auxsend=0.1\n |\n var sig, env,width;\n env = EnvGen.ar(Env.adsr(atk, dcy, sus, rls), gate, doneAction:2);\n width = LFNoise2.kr(1).range(0.001, 0.01);\n sig = VarSaw.ar(freq+ SinOsc.ar(6,mul:Line.kr(0.0, 1, dur,doneAction:2)), width:width);\n sig = RLPF.ar(sig, freq*1, rq);\n sig = Decimator.ar(sig, 22050,2);\n sig = sig *env* amp;\n Out.ar(out, Pan2.ar(sig, pan));\n Out.ar(aux, sig*auxsend);\n }).add;\n\n // I also like to add some verb to make the sound more natural\n // like it is inside a real hall.\n // This reverb by Eli Fieldsteel (see his wavetable youtube tutorial)\n SynthDef(\\reverb, {\n arg in=0, out=0, dec=4, lpf=1500;\n var sig;\n sig = In.ar(in, 2).sum;\n sig = DelayN.ar(sig, 0.03, 0.03);\n sig = CombN.ar(sig, 0.1, {Rand(0.01,0.099)}!32, dec);\n sig = SplayAz.ar(2, sig);\n sig = LPF.ar(sig, lpf);\n 5.do{sig = AllpassN.ar(sig, 0.1, {Rand(0.01,0.099)}!2, 3)};\n sig = LPF.ar(sig, lpf);\n sig = LeakDC.ar(sig);\n Out.ar(out, sig);\n }).add;\n\n s.\n```"}, {"role": "assistant", "content": "making some experiments I came out with this sound which resambles a cello to me.\r\nLet me know in the comments below what do you think about it.\r\nPlease let me know if you have any suggestions and advices to make it sound better.\r\nThank you so much :)."}], "family": "D3", "source_id": "sccode:1-5c3", "aug": "patch", "prompt_tokens": 712, "answer_tokens": 75}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// read a soundfile\n(\ns.waitForBoot({\n\n SynthDef(\\wowflutter_2chan, {\n arg bufnum, out = 0, wobble_rpm=33, wobble_amp=0.05, wobble_exp=39, flutter_amp=0.03, flutter_fixedfreq=6, flutter_variationfreq=2;\n var signed_wobble = wobble_amp*(SinOsc.kr(wobble_rpm/60)**wobble_exp);\n var wow = Select.kr(signed_wobble > 0, signed_wobble, 0);\n var flutter = flutter_amp*SinOsc.kr(flutter_fixedfreq+LFNoise2.kr(flutter_variationfreq));\n var combined_defects = 1 + wow + flutter;\n var sig = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum)*combined_defects, doneAction:Done.freeSelf);\n Out.ar(out, sig);\n }).add;\n\n b = Buffer.read(s, \"pianomusic.wav\"); // link in code description, or use your own...\n s.sync;\n\n Synth(\\wowflutter_2chan ,[\n \\bufnum, b.bufnum,\n \\out, 0,\n \\wobble_rpm, 33,\n \\wobble_amp, 0.04,\n \\wobble_exp, 11, // best an odd power, higher values produce sharper, smaller peak\n \\flutter_amp, 0.02,\n \\flutter_fixedfreq, 6,\n \\flutter_variationfreq, 2\n ]);\n});\n)\n```"}, {"role": "assistant", "content": "add instant nostalgia to your music with a touch of wow and flutter\r\nlink for the sample: https://drive.google.com/file/d/1qysrKqJ0S6Huub4mEKp2Gk8FJqq-gK1C/view?usp=sharing\r\n(probably not a physically accurate emulation)."}], "family": "D3", "source_id": "sccode:1-5bP", "aug": "patch", "prompt_tokens": 574, "answer_tokens": 106}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// in the style of Autechre - Mirrage\n// https://www.youtube.com/watch?v=rXQ9sNRcHYE\n\n(\n{\n var note, snd, delaytime, damp, size, diff, feedback, localout;\n note = Demand.kr(Impulse.kr(0) + Dust.kr(0.1), 0, Diwhite(60, 80, inf));\n delaytime = Demand.kr(Impulse.kr(0) + Dust.kr(0.3), 0, Dwhite(0.1, 0.3, inf));\n damp = Demand.kr(Impulse.kr(0) + Dust.kr(0.4), 0, Dwhite(0.2, 0.6, inf));\n size = Demand.kr(Impulse.kr(0) + Dust.kr(0.3), 0, Dwhite(2, 10, inf));\n diff = Demand.kr(Impulse.kr(0) + Dust.kr(0.2), 0, Dwhite(0.5, 1.0, inf));\n feedback = Demand.kr(Impulse.kr(0) + Dust.kr(0.4), 0, Dwhite(0.8, 1.0, inf));\n snd = SinOsc.ar(freq: [note, note+LFNoise1.kr(freq: 0.1).range(-0.25, 0.25)].midicps);\n localout = Mix.ar(5.collect({ |i|\n Pan2.ar(\n in: Greyhole.ar(in: PitchShift.ar(in: snd, pitchRatio: i), delayTime: delaytime, damp: damp, size: size, diff: diff, feedback: feedback, modDepth: 0.1, modFreq: 5),\n pos: LFNoise1.ar(freq: TRand.ar(10.reciprocal, 1, Impulse.kr(8.reciprocal))).range(-1,1),\n level: (i+1).reciprocal\n ) * -20.dbamp;\n }));\n localout = Compander.ar(in: localout, control: localout, thresh: -6.dbamp, slopeAbove: 3.reciprocal);\n LocalOut.ar(loca\n```"}, {"role": "assistant", "content": "Quick experiment in the style of Autechre Mirrage ambient track."}], "family": "D3", "source_id": "sccode:1-5bM", "aug": "patch", "prompt_tokens": 728, "answer_tokens": 24}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Construct a circulant feedback matrix using the given eigenvalues\n(\n// 1 - The eigenvalues of the feedback coefficient matrix\nd = [\n -1,\n Polar(1, -3pi / 4),\n Polar(1, -pi / 2),\n Polar(1, -pi / 6),\n 1,\n Polar(1, pi / 6),\n Polar(1, pi / 2),\n Polar(1, 3pi / 4)\n];\n\n// 2 - Compute the feedback matrix from the given eigenvalues\nn = d.size;\na = (Matrix.newIDFT(n) * Matrix.withFlatArray(n, 1, d)).real.flat / sqrt(n);\n);\n\n(\ns.waitForBoot({\n var primePowerDelays = { arg delays;\n (delays collect: { |delay, i|\n var prime = i.nthPrime;\n\n prime ** ((log(delay) / log(prime)) + 0.5).floor;\n }).asInteger / s.sampleRate;\n };\n\n var delayLengths = { arg n, dmin, dmax;\n var nm1 = n - 1;\n var d = dmin * ((dmax / dmin) ** ((0..nm1) / nm1));\n \n (d * s.sampleRate).round(1.0).asInteger;\n };\n\n SynthDef(\\sine, { arg out, freq = 440, amp = 0.5, trigFreq = 1;\n Out.ar(out, Decay.ar(Impulse.ar(trigFreq), 0.2, SinOsc.ar(freq, 0, amp)))\n }).add;\n\n SynthDef(\\fdn, { arg in, out, scale = 1.0, coef = 0.5;\n var a, x, w, fb, delT;\n\n fb = Loca\n```"}, {"role": "assistant", "content": "Example of a basic feedback delay network or FDN of order 8. Requires the MathLib quark. Use the scale argument to increase / decrease the delay time and the coef argument to control the decay time. Smaller scale values produce resonating sounds, larger scale values more reverb tail like sounds. Be careful with small scale values in combination with small coef values (hence the tanh).\r\n\r\nFor a the."}], "family": "D3", "source_id": "sccode:1-5bL", "aug": "patch", "prompt_tokens": 602, "answer_tokens": 129}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// last updated on sccode.org fri 7. jun, 14:57 CET\n\n( // load this first - synth def\nSynthDef(\\harpsi, { \n arg outbus = 0, freq = 440, ffreq = 2, amp = 1, gate = 1, release = 1;\n var out;\n freq = freq * Rand(1, 1.005);\n out = EnvGen.ar(Env.adsr(releaseTime:release), gate, doneAction: Done.freeSelf)\n * amp * Pulse.ar([freq,freq*1.005]/1, 0.25, mul:0.75 );\n out = out * [Rand(0.0, 1.0), Rand(0.0, 1.0)];\n out = RLPF.ar(out, freq * (ffreq / 4) + 1 );\n Out.ar(outbus, out); \n}).add; \n);\n\n\n( // then run this - sequence\nTempoClock.default.tempo = 1.4;\n~scale = Scale.new(#[0,2,4,5,7,8,10],tuning: \\pythagorean, name: \"mixolydianb6\");\np = Pbind(\n \\instrument, \\harpsi,\n \\root, -12,\n \\scale, ~scale,\n \\ffreq, Pseq(((1..2) ++ (3..1)),inf),\n \\degree, Pseq([\n Pseries({ rrand(0, 7) }, { ([1,2]).choose }, { rrand(4, 8) }),\n Pseries({ rrand(0, 7) }, {([1,2]).choose}, { rrand(4, 8) }),\n Pseries({ rrand(7, 14) }, 0-{([1,2]).choose}, { rrand(4, 8) })\n ], inf),\n \\release, Prand([5,6,7,8],inf),\n \\dur, Prand((1..8)/4, inf),\n \\amp, Prand(((1..8)/8)+1, inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "mixolydian flat six meditation in pythagorean (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-5bG", "aug": "patch", "prompt_tokens": 656, "answer_tokens": 29}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nb = Bus.audio(s, 2);\na = { |inbus = 0|\n var sig = In.ar(inbus, 2);\n // x axis is side, oriented toward right;\n // y axis is mid\n [sig[1] - sig[0], sig.sum]\n}.play(s.defaultGroup, outbus: b, addAction: \\addAfter);\nc = s.scope;\nc.style = 2;\nc.bus = b;\n)\n```"}, {"role": "assistant", "content": "Very quick-and-dirty hack to show stereo phase. Center = up (12:00). Full left = 10:30, full right = 1:30."}], "family": "D3", "source_id": "sccode:1-5bE", "aug": "patch", "prompt_tokens": 181, "answer_tokens": 44}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\nvar trigger, fund, flashInst;\nflashInst = Array.fill(7,\n{\ntrigger = Dust.kr(2)*PinkNoise.ar(1);\nfund = rrand(100, 137);\nPan2.ar(\nMix.ar(\nArray.fill(7,\n{arg counter;\nvar partial;\npartial = counter + 3;\n//HenonC.ar(fund*partial).atan *\nDPW3Tri.ar(fund*partial).atan *\nEnvGen.kr(Env.adsr(0.01, 0, 0.1, 7.0),\ntrigger, 1/partial) *AY.ar(713)* max(0, LFNoise1.kr(rrand(37.0, 73.0)))\n})\n)*0.2,\n1.0.rand2)\n});\nMix.ar(flashInst)*0.6\n}.play\n)\n```"}, {"role": "assistant", "content": "\"High-energy Radio Bursts, generated by an old coffee machine of Arab origin, manifest themselves as noise and audio signals, and trigger a magnetic alteration with unpredictable effects;\"\r\n\r\n\r\n\r\nhttp://bz-buzz.blogspot.com/2018/10/radio-bursts-from-old-coffee-pot.html\r\n\r\nhttp://bzakirasantjago.blogspot.com/."}], "family": "D3", "source_id": "sccode:1-5bo", "aug": "patch", "prompt_tokens": 319, "answer_tokens": 148}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\madtraffic, {|out, sig, gate=1, freq=440|\n // doneAction: 2 rilascia la synth quando EvnGen ha finito\n sig = (Blip.ar(freq)*0.7+Blip.ar(freq/2+Rand(1,12))*0.7)\n*EnvGen.kr(Env.asr(0.1, 0.3, 0.3), gate, doneAction:2);\n sig = RLPF.ar(sig,SinOsc.kr(0.3, 0, 200, 1500), 0.1);\n sig = FreeVerb.ar(sig, 0.5, 0.5, 0.5);\n Out.ar(out, sig);\n\n}).add;\n);\n\n(\nPbind(\n \\instrument, \\madtraffic,\n \\freq, Pseq([137, 373, Prand([237, 473, 713],1)], inf),\n \\legato, Pseq([1.7, 0.3], inf),\n \\dur, 0.3,\n \\out, Pseq([1, 0], inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "\"It's the lack of eye contact that makes us more idiots, to the point that convertible riders give less to escalation. Closed in the car, explain the psychologists, we regress to childhood and react by shouting, or with that surrogate of the shock that is the horn.\"\r\n\r\n\r\n\r\nhttp://bz-buzz.blogspot.com/2018/09/mad-traffic.html\r\n\r\nhttp://bzakirasantjago.blogspot.it/."}], "family": "D3", "source_id": "sccode:1-5bn", "aug": "patch", "prompt_tokens": 380, "answer_tokens": 155}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// UI sounds\n// this code is an attempt to recreate a sound\n// inspired from some technological/electrical UI interface\n\n// 1. first define the synth\n// Here we are using the FM technique\n(\nSynthDef(\\fmmod, {\n |\n amp=0.2,\n fc=1000,\n fm = 100,\n idx = 100,\n atk=0.01,\n rls=0.1\n |\n var env = EnvGen.ar(Env.perc(atk, rls), doneAction:2);\n var modulator = SinOsc.ar(fm);\n var carrier = SinOsc.ar(fc + (idx*modulator) );\n var sig = carrier * env * amp;\n sig = HPF.ar(sig, 1000);\n Out.ar(0, sig!2);\n}).add;\n);\n\n// 2. then define the Pbind which will play the sequence\n// of UI sounds simulating variuos characters showing up on an\n// imaginary display.\n// Play around FC, FM, ATK and RLS to obtain different sound characters.\n(\np = Pbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 100,\n \\idx, 100,\n \\amp, 0.6,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).asEventStreamPlayer;\n);\n\n// 3. play it\np.play;\n\n// 4. Here are some presets\n\n// \"cricket\" preset\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 100,\n \\idx, 100,\n \\amp, 0.6,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n// preset 2\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, \n```"}, {"role": "assistant", "content": "This code is an attempt to recreate a sound inspired from some technological/science fictional UI interface.\r\n\r\nSounds are created using FM technique.\r\nPlay around FC, FM, ATK and RLS to obtain different sound characters."}], "family": "D3", "source_id": "sccode:1-5bj", "aug": "patch", "prompt_tokens": 638, "answer_tokens": 74}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~root = -13;\n~revSend = Bus.audio(s, 2);\n);\n(\ns.waitForBoot(\n {\n \n SynthDef(\\bell, {\n |\n freq=556, findex=0, frate=2,\n dur=5, pos=0,\n amp=0.25,\n out=0\n |\n var sigA, sigB, sigC, sig, env, fmod;\n env = EnvGen.ar(Env.triangle(5), doneAction:2);\n fmod = findex * SinOsc.kr(frate, mul:0.5, add:0.5) * Line.kr(0, 1, 7);\n sigA = Pulse.ar(freq + fmod, LFNoise2.kr(1).range(0.2, 0.8) );\n sigB = VarSaw.ar(freq + fmod);\n sigC = WhiteNoise.ar() * 0.125;\n sig = SelectX.ar(LFNoise2.kr(2).range(0, 2), [sigA, sigB, sigC]);\n sig = LPF.ar(sig, freq*4 );\n sig = sig * env * amp;\n Out.ar(out, Pan2.ar(sig, pos));\n }).add;\n\n s.sync;\n\n SynthDef(\\rev, {\n arg in=0, out=0, mix=1, room=0.8;\n var sig;\n sig = In.ar(in, 2);\n sig = FreeVerb.ar(sig, mix, room);\n Out.ar(out, sig);\n }).add;\n\n s.sync;\n\n ~rev = Synth(\\rev, [\\in, ~revSend]);\n\n x = Pbind(\n \\instrument, \\bell,\n \\out, ~revSend,\n \\root, Pfunc({~root}),\n \\octave, Pwrand([4, 5, 6, 7], [6,8,3,1].normalizeSum, inf),\n \\degree, Prand(Scale.lydian.degrees, inf),\n \\ctranspose, Pwhite( -0.05, 0.05, inf),\n \n```"}, {"role": "assistant", "content": "Random synths selected from VarSaw, Pulse and WhiteNoise create a texture resambling brasses, woods and flutes.\r\nIt reminds me Micheal Land \"The Dig\" soundtrack (https://en.wikipedia.org/wiki/The_Dig).\r\n\r\nListen to an extract of it here: https://soundcloud.com/nicolaariutti/aurora-borealis."}], "family": "D3", "source_id": "sccode:1-5bi", "aug": "patch", "prompt_tokens": 705, "answer_tokens": 133}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n+ String {\n decodeHex {\n var new = String.new, stream = CollStream(this), ch, int;\n while {\n ch = stream.next;\n ch.notNil\n } {\n if(ch == $%) {\n ch = stream.next;\n if(ch.notNil) {\n int = ch.digit << 4;\n } {\n // If the string ends with %, then 'ch' after that is nil\n // so we can just append the %\n ^new.add($%);\n };\n ch = stream.next;\n if(ch.notNil) {\n ch = (int + ch.digit).asAscii;\n } {\n // If we got this far, we know there was one (only one) char after %\n // so add them both\n ^new.add($%).add(this.last);\n };\n };\n new = new.add(ch);\n };\n ^new\n }\n}\n```"}, {"role": "assistant", "content": "A quick utility function for decoding UTF-8 characters in %hex codes (such as for web URLs). Save the code into a .sc file in your Extensions/ directory, recompile, and then:\r\n\r\n\"%E5%A4%A7%E5%AE%B6%E5%A5%BD\".decodeHex;\r\n-> 大家好\r\n\r\nThis probably works only for UTF-8. SC can save the individual bytes of Unicode characters into String objects, and the IDE will print UTF-8 code points correctly, but th."}], "family": "D3", "source_id": "sccode:1-5aM", "aug": "patch", "prompt_tokens": 316, "answer_tokens": 167}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Handy code for quick class demonstrations.\n// Comparing a few intervals - Just Intonation versus 12-tone Equal Tempered\n\n// Major third (just)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 60.midicps * 5/4], mul: 0.1) }).play\n// Major third (ET12)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 64.midicps], mul: 0.1) }).play;\n\n// Major second (just)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 60.midicps * 9/8], mul: 0.1) }).play\n// Major second (ET)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 62.midicps], mul: 0.1) }).play;\n\n// Perfect fifth (just)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 60.midicps * 3/2], mul: 0.1) }).play\n// Perfect fifth (ET)\nNdef(\\a, { Saw.ar(freq: [60.midicps, 67.midicps], mul: 0.1) });\n```"}, {"role": "assistant", "content": "Simple handy code for quick class demonstrations. Hear and compare a few intervals in Just Intonation versus 12-tone Equal Tempered tuning."}], "family": "D3", "source_id": "sccode:1-5aL", "aug": "patch", "prompt_tokens": 415, "answer_tokens": 47}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Chaos engine hum\n(\n{\n SinOsc.ar(10 + (50 * SinOsc.kr([50, 51], 0, SinOsc.kr(101, Saw.kr(0.12345, 678, 9), 0.2, 0.8), Pulse.kr([25, 25.5], 0.25, 0.125, -0.25))), 0, 0.5, 0);\n}.play();\n)\n```"}, {"role": "assistant", "content": "A deep binaural cycle reminiscent of the engine of a space ship."}], "family": "D3", "source_id": "sccode:1-5aJ", "aug": "patch", "prompt_tokens": 162, "answer_tokens": 21}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nMIDIIn.connectAll;\n// MIDIClient.init;\n\n\n(\n// A SynthDef with ADSR envelope\nSynthDef(\"quick2\", {arg freq = 440, amp = 0.1, gate = 1;\n var snd, env;\n env = Env.adsr(0.01, 0.1, 0.3, 2, amp).kr(2, gate);\n snd = Saw.ar(freq: [freq, freq*1.5], mul: env);\n Out.ar(0, snd)\n}).add;\n);\n\n// Play it with a MIDI keyboard\n(\nvar noteArray = Array.newClear(128); // array has one slot per possible MIDI note\n\nMIDIdef.noteOn(\\myKeyDown, {arg vel, note;\n noteArray[note] = Synth(\"quick2\", [\\freq, note.midicps, \\amp, vel.linlin(0, 127, 0, 1)]);\n [\"NOTE ON\", note].postln;\n});\n\nMIDIdef.noteOff(\\myKeyUp, {arg vel, note;\n noteArray[note].set(\\gate, 0);\n [\"NOTE OFF\", note].postln;\n});\n)\n// PS. Make sure SC MIDI connections are made (MIDIIn.connectAll)\n```"}, {"role": "assistant", "content": "Basic example - how to use a MIDI keyboard with a simple synth."}], "family": "D3", "source_id": "sccode:1-5aI", "aug": "patch", "prompt_tokens": 459, "answer_tokens": 23}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// 1. define the synth\n(\nSynthDef(\\bell, {\n |fs=1, t60=1, pitchy=1, amp=0.25, gate=1|\n var sig, exciter;\n //exciter = Impulse.ar(0);\n exciter = WhiteNoise.ar() * EnvGen.ar(Env.perc(0.001, 0.05), gate) * 0.25;\n sig = Klank.ar(\n `[\n [1, 2, 2.803, 3.871, 5.074, 7.81, 10.948, 14.421], // freqs\n [1, 0.044, 0.891, 0.0891, 0.794, 0.1, 0.281, 0.079], // amplitudes\n [1, 0.205, 1, 0.196, 0.339, 0.047, 0.058, 0.047]*t60 // ring times\n ],\n exciter,\n freqscale:fs*pitchy);\n sig = FreeVerb.ar(sig) * amp;\n DetectSilence.ar(sig, 0.001, 0.5, doneAction:2);\n Out.ar(0, sig!2);\n}).add\n);\n\n\n// 2. Test a single note\nx = Synth(\\bell, [\\fs, 60.midicps, \\t60, 9.177, \\pitchy, 8]);\n\n\n// 3. Test different textures\n\n// glokenspiel\n(\nPbind(\n \\instrument, \\bell,\n \\fs, Pseq( (60..72), 1).midicps,\n \\t60, 6,\n \\pitchy, 4,\n \\dur, 0.25\n).play;\n);\n\n// tubular bells\n(\nPbind(\n \\instrument, \\bell,\n \\fs, Pseq( (60..72), 1).midicps,\n \\t60, 9,\n \\pitchy, 1,\n \\dur, 1\n).play;\n);\n\n// xilophone\n(\nPbind(\n \\instrument, \\bell,\n \\fs, Pseq( (60..72), 1).midicps,\n \\t60, 1,\n \\pitchy, 4,\n \\dur, 0.25\n).play;\n);\n\n// marimba\n(\nPbind(\n \\instrument, \\bell,\n \\fs, Pseq( (60..72), 1).midic\n```"}, {"role": "assistant", "content": "Example of modal synthesis made with a **Klank** UGEN as _resonator_ and white noise impulse as an _exciter_.\r\n\r\nAll resonators of the Klank UGEN are properly tuned to resamble modal frequencies of a real bell I've recoded and analysed.\r\n\r\nThe ```fs```, ```pitchy``` and ```T60``` arguments are used to scale all the system in order to simulate various percussive instruments such as _xilophone_, _m."}], "family": "D3", "source_id": "sccode:1-5ay", "aug": "patch", "prompt_tokens": 751, "answer_tokens": 158}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// define the violin-like sound synth\n(\nSynthDef(\\violin, {\n | midinote=60, gate=1, amp=0.25 |\n var env = EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction:2);\n var sig = VarSaw.ar(\n midinote.midicps,\n width:LFNoise2.kr(1).range(0.2, 0.8)*SinOsc.kr(5, Rand(0.0, 1.0)).range(0.7,0.8))*0.25;\n sig = sig * env * amp;\n Out.ar(0, sig!2);\n}).add;\n);\n\n\n// play a chord (farfisa-like sound)\n(\n[60, 64, 67].do ({\n | note |\n Synth(\\violin, [\\midinote, note]);\n})\n);\n\n// play a single note (it seems also a flute!)\nx = Synth(\\violin, [\\midinote, 84]);\nx.set(\\gate, 0); // stop the note\n\n\n// play some random notes\n(\np = Pbind(\n \\instrument, \\violin,\n \\midinote, Prand( Scale.majorPentatonic.degrees, inf) + 60,\n \\dur, 3,\n \\legato, 1\n).play;\n)\n```"}, {"role": "assistant", "content": "Trying to procedurally synthetise a violin, I eventually came out with a \"Farfisa\" organ like sound.\r\nIt can be used also as a flute!."}], "family": "D3", "source_id": "sccode:1-5as", "aug": "patch", "prompt_tokens": 461, "answer_tokens": 52}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n~a={SinOsc.ar([22.5, 23], mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))* 0.3)};\n~b={SinOsc.ar([22.5, 23], mul: 0.3)};\n~c={SinOsc.ar([22.5, 23]*400, mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))* 0.03)};\n~d={SinOsc.ar([22.5, 23]*400, mul: 0.03)};\nOut.ar(0, ~a+~b+~c+~d);\n}.scope\n)\n```"}, {"role": "assistant", "content": "some basic synth shamanic stuff for rising vibrational frequency (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-58a", "aug": "patch", "prompt_tokens": 247, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~myDust = {[Resonz.ar([[Dust, Dust2].choose.ar(ChaosGen.allSubclasses.choose.ar(0.1).abs * 10), [Dust, Dust2].choose.ar(ChaosGen.allSubclasses.choose.ar(0.1).abs * 10)], rrand(30, 1200), 0.05)*60FreeVerb.ar(Resonz.ar([[Dust, Dust2].choose.ar(ChaosGen.allSubclasses.choose.ar(0.1).abs * 10), [Dust, Dust2].choose.ar(ChaosGen.allSubclasses.choose.ar(0.1).abs * 10)], rrand(30, 1200), 0.05)*60)]};\n\n(\n~mySine={var a, b, c, d;\na={[SinOsc.ar(rrand(30, 75), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))), SinOsc.ar(rrand(30, 75), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30)))] * 0.3};\nb={[SinOsc.ar(rrand(220, 440), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))), SinOsc.ar(rrand(220, 440), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30)))] * 0.1};\nc={[SinOsc.ar(rrand(880, 2200), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))), SinOsc.ar(rrand(880, 2200), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30)))] * 0.064};\nd={[SinOsc.ar(rrand(8800, 22000), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30))), SinOsc.ar(rrand(8800, 22000), mul: ChaosGen.allSubclasses.choose.ar(rrand(1, 30)))] * 0.064};\n Out.ar(0, (a+b+c+d)*0.4);\n};\n);\n\n~dustM1={CmdPeriod.run; ~myDust.play; \n```"}, {"role": "assistant", "content": "sinewaves with pulses. a lot of stochastic stuff, result leading to interesting things."}], "family": "D3", "source_id": "sccode:1-585", "aug": "patch", "prompt_tokens": 735, "answer_tokens": 31}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// This question comes up sometimes.\n// one way to do it is to define an event type:\n\n\n(\nEvent.addEventType(\\dnote, { |server|\n \n var instrument = ~instrument.asDefName;\n var synthLib = ~synthLib ?? { SynthDescLib.global };\n var desc = synthLib.at(instrument);\n \n \n if (desc.notNil) {\n desc.controls.do { |x|\n x.defaultValue !? { x.name.asSymbol.envirPut(x.defaultValue) }\n };\n // for efficiency, get this now\n ~hasGate = desc.hasGate;\n ~msgFunc = desc.msgFunc;\n };\n ~type = \\note;\n \n currentEnvironment.play;\n});\n);\n\n(\nSynthDef(\\test, { |out, freq = 1000| \n Out.ar(out, Line.ar(0.1, 0, 0.1, doneAction:2) * SinOsc.ar(freq)) \n}).add\n);\n\nPbind(\\type, \\dnote, \\instrument, \\test, \\dur, 0.3).play;\n```"}, {"role": "assistant", "content": "One answer to the question \"how to use the SynthDef's default argument in an Event?\"."}], "family": "D3", "source_id": "sccode:1-57P", "aug": "patch", "prompt_tokens": 417, "answer_tokens": 30}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.boot;\n\nMIDIClient.init;\n// check the array of midi destinations for the device you are using, and then create a MIDIOut\n// at the index of the destination you plan on using\n// in the case that the midi destination you are using is the first in the destinations array:\nm = MIDIOut(0); \n\n//playing a simple pattern of midi notes to the hardware synth listening to midi channel 1\n// see also the documentation page \"Pattern Guide Cookbook 04: Sending MIDI\"\n(\nPbind(\n \\type, \\midi,\n \\midicmd, \\noteOn,\n \\midiout, m,\n \\chan, 0,\n \\midinote, Pseq([48, 67, 52], inf), // C, G, E\n \\dur, Pseq([4, 2, 2], inf),\n \\legato, 1.01,\n \\amp, 1,\n).play;\n);\n\n// sending a control message. second argument is control number, third is control value:\nm.control(0, 23, 110);\n\n//NRPN control of filter pole on DSI Tetra:\n// first, set parameter number (24 in this case)\n// set most significant byte for parameter number (0 in this case)\nm.control(0, 99, 0);\n// then least significant byte for parameter number (24 in this case)\nm.control(0, 98, 24);\n// then set value (1 for 4 pole)\n// first set most significant byte for this value (0 in this case)\nm.control(0, 6, 0);\n// then least significant byte for\n```"}, {"role": "assistant", "content": "Controlling DSI tetra with Supercollider--some examples (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-57O", "aug": "patch", "prompt_tokens": 513, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\ns.waitForBoot({\n var squiggleBus;\n squiggleBus = Bus.control(s, 6);\n\n SynthDef(\\generateINeedYouSquiggle, {\n | controlOutBus |\n var time, speed, rotations, commonpart, xy, sc;\n // a nice squiggle in polar coordinates: r = sin(6*phi) + 2\n // convert to parametric equations:\n // commonpart = sin(6*t)+2\n // x(t) = commonpart*sin(t)\n // y(t) = commonpart*cos(t)\n // where t is provided by a low frequency sawtooth wave\n speed = 1;\n rotations = 1;\n time = LFSaw.kr(freq:speed, iphase:1).range(0, speed*rotations);\n commonpart = SinOsc.kr(5*time) + 2; // flower shape\n xy = [commonpart*SinOsc.kr(time), commonpart*SinOsc.kr(time, pi/2), -3, 3, -3, 3]; // x and y vary between -3 and 3\n sc = (xy*0.2).scope; // for visualization only\n Out.kr(controlOutBus, xy);\n }).add;\n\n SynthDef(\\squiggleTestAutomatic, {\n | out = 0, controlInBus |\n var sig, xy;\n\n // read the xy control values in the form [ x, y, minx, maxx, miny, maxy]\n xy = In.kr(controlInBus, 6);\n\n // and use them in the synth\n sig = Pan2.ar(CombN.ar(Resonz.ar(Gendy5.ar(2,3,minfreq:1,maxfreq:xy[0].linlin(xy[2],xy[3],10,700), durscale:0.1, initCps:10),\n xy[1].linlin(xy[\n```"}, {"role": "assistant", "content": "Iannis Xenakis begging us from the grave: \"I need you! I need you! I need you!...\". This code is based on an example from the Help documents that uses MouseX.kr and MouseY.kr, but I've replaced the MouseX and MouseY with a \"2d squiggle\". I wrote a blog post that explains how to generate \"2d squiggles\" like these (as well as completely different ones) - see http://technogems.blogspot.be/2017/08/au."}], "family": "D3", "source_id": "sccode:1-57x", "aug": "patch", "prompt_tokens": 616, "answer_tokens": 155}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\ns.waitForBoot({\n\n SynthDef(\\singer, {\n | out=0, freq=440, amp=0.5, vibrato=6|\n var lfo, lfo2, lfo3, sig;\n lfo = SinOsc.kr(1/5, 0).range(250,1000);\n lfo2 = SinOsc.kr(1/5, 0).range(0.1,0.9);\n lfo3 = SinOsc.kr(vibrato).range(0.3, 1);\n sig = lfo3*RLPF.ar(in:VarSaw.ar(freq:Lag.ar(in:K2A.ar(freq), lagTime:0.3), iphase:0, width:lfo2, mul:amp), freq:lfo, rq:200/lfo);\n Out.ar(out, sig!2);\n }).add;\n\n s.sync;\n\n Pdef.defaultQuant_(0);\n Pdef(\\bass, Pmono(\\default, \\dur, Pwhite(0.01, 0.1, inf), \\freq, (Pgbrown(1,8,5) * 20).round(10), \\amp, Pbrown(0.2,0.6,0.05)));\n Pdef(\\computer, Pmono(\\default, \\dur, Pwhite(0.01, 0.1, inf), \\freq, (Pgbrown(1,8,9) * 100).round(20), \\amp, Pbrown(0.2,0.6,0.05)));\n Pdef(\\soprano, Pmono(\\singer, \\dur, Pwhite(0.01, 0.1, inf), \\freq, Pgbrown(1,8,0.05) * 200, \\amp, Pbrown(0.2,0.6,0.05)/5, \\vibrato, Pbrown(4,7,0.125)));\n Pdef(\\soprano2, Pmono(\\singer, \\dur, Pwhite(0.01, 0.1, inf), \\freq, Pbrown(3,6,0.1) * 100, \\amp, Pbrown(0.2,0.6,0.05)/5, \\vibrato, Pbrown(3,8,0.125)));\n\n fork {\n Pdef(\\bass).play;\n 10.wait;\n Pdef(\\computer).play;\n 10.wait;\n Pdef(\\soprano).play;\n 10.wait;\n Pdef(\\soprano2).play;\n 10.wait;\n Pdef(\\c\n```"}, {"role": "assistant", "content": "When this generative song was released in 2342 it immediately rose to the top spot of the intergalactic U2B channel, easily breaking the all time record of 7 trillion immersive experiences in the first millisecond. Critics praised the composer for the extraordinary independence of melody lines, the bass player for her virtuoso finger picking, the artificially intelligent blender for its awesome sh."}], "family": "D3", "source_id": "sccode:1-57w", "aug": "patch", "prompt_tokens": 796, "answer_tokens": 128}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n//s.options.memSize_(64000);\nTempoClock.tempo_(1.0);\n\ns.waitForBoot({\n SynthDef(\\breathe_in, {\n | out = 0, gate = 1, in1=0.11, in2=0.63, in3=0.18, amdb= -10 |\n var menv = EnvGen.kr(Env.new([0,1,1,0],[in1, in2, in3], curve:'lin'),\n gate,\n doneAction:Done.freeSelf);\n var noise = WhiteNoise.ar(amdb.dbamp);\n var f1 = BPF.ar(in:noise, freq:5790, rq:0.1, mul:-29.dbamp);\n var f2 = BPF.ar(in:noise, freq:3400, rq:0.2, mul:-16.dbamp);\n var f3 = BPF.ar(in:noise, freq:1990, rq:0.1, mul:-23.dbamp);\n var f4 = BPF.ar(in:noise, freq:1250, rq:0.1, mul:-26.dbamp);\n Out.ar(out, menv*(f1+f2+f3+f4)!2);\n }).add;\n\n SynthDef(\\breathe_out, {\n | out = 0, gate=1, out1=0.343, out2=0.387, amdb= -4.33 |\n var menv = EnvGen.kr(Env.new([0, 1, 0], [out1,out2], curve:'lin'),\n gate,\n doneAction:Done.freeSelf);\n var noise = WhiteNoise.ar(amdb.dbamp);\n var f1 = BPF.ar(in:noise, freq:2290, rq:0.1, mul:-17.dbamp);\n var f2 = BPF.ar(in:noise, freq:1290, rq:0.1, mul:-19.dbamp);\n var f3 = BPF.ar(in:noise, freq:490, rq:0.1, mul:-18.dbamp);\n Out.ar(out, menv*(f1+f2+f3)!2);\n }).add;\n\n\n s.\n```"}, {"role": "assistant", "content": "An attempt at emulating a breathing sound. Originally made using sonic-visualizer, based on the spectrogram of the first breath in this recording: http://freesound.org/people/gogo199432/sounds/198025/, and then edited to make it sound longer. Note: needs supercollider 3.9dev."}], "family": "D3", "source_id": "sccode:1-57l", "aug": "patch", "prompt_tokens": 745, "answer_tokens": 108}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// you have to write the sample path in the firts line\n\n~bufferdue = Buffer.read(s,\" WRITE YOUR SAMPLE PATH HERE \", bufnum:2);\n\n(\nSynthDef.new(\\bufbeat, {\n arg amp = 1, out = 0, buf, start, end, freq = 1;\n var sig, ptr;\n ptr = LFNoise1.ar(freq).range(0.0,end);\n sig = BufRd.ar(2, buf, ptr);\n sig = sig * amp;\n Out.ar(out, sig);\n}).add\n);\n\nx = Synth.new(\\bufbeat, [\\buf, ~bufferdue.bufnum, \\start,0, \\end, ~bufferdue.numFrames-1, \\freq, 1, \\amp, 0.5],g);\n\nx.free;\n```"}, {"role": "assistant", "content": "a simple BufRd with the starting point of lecture randomized by LFNoise1."}], "family": "D3", "source_id": "sccode:1-57i", "aug": "patch", "prompt_tokens": 314, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\bird).addSpec(\\dur, [0.01, 1]);\nNdef(\\bird).addSpec(\\trig, [0, 1, \\lin, 1]);\nNdef(\\bird, {|dur = 1|\n\n var freqEnv, env, wEnv, src;\n var startFreq = \\startFreq.kr(1000);\n var endFreq = \\endFreq.kr(4000);\n var trig = \\trig.tr(1);\n\n env = EnvGen.ar(Env(\n [0, 1, 1, 0],\n [0.1, 1, 0.5].normalizeSum\n ), trig, timeScale: dur);\n\n\n wEnv = EnvGen.ar(Env(\n [0, 1, 0],\n [1, 0],\n 2\n ), trig, timeScale: dur);\n\n freqEnv = wEnv * (endFreq - startFreq).abs + startFreq;\n wEnv = 1- (wEnv * 0.5);\n \n src = Pulse.ar(freqEnv * SinOsc.ar(0.1).range(0.99, 1.01), wEnv) * env!2;\n src\n})\n);\n\nNdef(\\bird).play\n\n\nNdef(\\bird).set(\\trig, 1, \\dur, 0.1)\n\n\nNdef(\\bird).set(\\trig, 1, \\dur, rrand(0.1, 0.2), \\endFreq, exprand(500, 1000), \\startFreq, 4000)\n```"}, {"role": "assistant", "content": "Example sound explored in the temporary event Creating soundscapes with live coding techniques \r\nhttps://temporary.fi/experiments/creating-soundscapes-with-live-coding-techniques."}], "family": "D3", "source_id": "sccode:1-578", "aug": "patch", "prompt_tokens": 512, "answer_tokens": 74}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// create a MIDI file\nm = SimpleMIDIFile(\"~/output.mid\");\nm.init1;\nm.timeMode_( \\seconds ); // correct timeMode\n\n// add some random Notes \n((0,(1/8)..5)).do({ |starttime| \n m.addNote( 36 + 50.rand, 32 + 96.rand, starttime, [0.1,0.05].choose, 127, \n track: 1 )\n});\n\n// add some random CCs\n((0,(1/8)..5)).do({ |starttime| \n m.addMIDITypeEvent(type: 'cc', args: [7, 128.rand], absTime: starttime, \n track: 1 )\n});\n\nm.adjustEndOfTrack; // may not be really needed, but nice if you want to do m.plot\n);\n\nMIDIClient.init;\n\n(\n~events = m.midiEvents;\n~midiout = MIDIOut(0);\n~routine = { \n var lastTime = 0; \n \n ~events.do({ |evt| \n (evt[1] - lastTime).wait; \n lastTime = evt[1]; \n switch( evt[2].post,\n \\noteOn, { ~midiout.noteOn( *evt[3..].postln ); },\n \\noteOff, { ~midiout.noteOff( *evt[3..].postln ); },\n \\cc, { ~midiout.control( *evt[3..].postln ); }\n ); }); \n}.fork; \n)\n```"}, {"role": "assistant", "content": "Play a midi file and include CC value changes. Code taken from sc-users mailinglist.\r\n\r\nhttp://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/simpleMIDIfile-play-via-MIDIOut-including-CC-td7632193.html."}], "family": "D3", "source_id": "sccode:1-574", "aug": "patch", "prompt_tokens": 548, "answer_tokens": 117}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Analogizer\n// a quick draft of a model of the EHX Analogizer pedal\n// some info from \"https://www.bassic.de/threads/electro-harmonix-ehx-analogizer.14865686/\"\n\ns.default\ns.boot\n\n// used this for testing: https://www.freesound.org/people/wescwave/sounds/169885/\n~buf = Buffer.read(s, \"169884__wescwave__double-bass-test2.wav\");\n\n(\n~x.free;\n~x = {\n var a, d, s;\n\n a = PlayBuf.ar(2, ~buf, 1, 1, 0, 1);\n a = a.sum!2; // go mono to make the effect more prominent\n\n // the \"distortion modeling\" could use some more love...\n s = (a * MouseY.kr(26/2, 0).dbamp).tanh;\n s = s * MouseY.kr(-16/2, 0).dbamp;\n\n // a simple delay\n d = DelayC.ar(s, 0.1, MouseX.kr(3.5/1000, 65/1000));\n\n // dry/wet...\n a = a + (d * MouseY.kr(0, -96).dbamp);\n\n Out.ar(0, a);\n}.play\n)\n```"}, {"role": "assistant", "content": "The EHX Analogizer (http://www.ehx.com/products/analogizer) is a guitar pedal that apparently consists of a ultra-short delay with some gain stage. It's supposed to \"fatten\" and somehow \"spread\" the sound to make it appear more \"analog\" (thus: dirty). I wanted to quickly test the effect myself.\r\n\r\nI guess with some additional care of the distortion stage and maybe some very little modulation (ster."}], "family": "D3", "source_id": "sccode:1-56I", "aug": "patch", "prompt_tokens": 454, "answer_tokens": 154}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~mdef =\n{\n |key, func, msgNum, permanent = true|\n\n MIDIdef(key, func ?? { MIDIdef(key).func }, msgNum ? MIDIdef(key).msgNum, MIDIdef(key).chan, MIDIdef(key).msgType, MIDIdef(key).srcID).permanent_(permanent)\n}\n```"}, {"role": "assistant", "content": "Change arg values of MIDIdef after instantiation (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-56E", "aug": "patch", "prompt_tokens": 162, "answer_tokens": 24}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.boot;\n(\nSynthDef(\\bup, {\n arg out=0,freq=440,ffreq=440,famp=1,fq=1,\n fatk = 0.01, fdec = 0.1,\n aatk = 0.01, adec = 0.1,\n amp=0.5,gate=1, len=0.2,lag=0.1;\n\n var synth,ampEnv,filtEnv;\n\n filtEnv = EnvGen.kr(\n Env.adsr(fatk,fdec,releaseTime:0.05),\n gate,\n freq*famp,\n ffreq);\n ampEnv = EnvGen.kr(\n Env.adsr(aatk,adec,releaseTime:0.05),\n gate,\n doneAction:2);\n synth = Mix.new([\n LFSaw.ar(Lag.kr([freq*2,freq],lag),[0,pi],amp),\n LFTri.ar(Lag.kr([freq,freq*2],lag),[pi,0],amp)\n ]);\n synth = Pan2.ar(synth) * ampEnv;\n synth = RLPF.ar(synth,filtEnv,fq);\n Out.ar(out,synth);\n}).add;\n);\nTempoClock.default = TempoClock.new(180/120);\n(\np=PmonoArtic(\n \\bup,\n \\dur,Pseq((0.25!3)++(0.125!2),inf),\n \\ffreq, Pseq([1,2,3,4,5]*500,inf),\n \\fq, Pseq([2,2,1,1,1,2,1,1,0.65,0.52],inf),\n \\legato, Pseq([0.3,1,0.83,1],inf),\n \\degree, Pseq([0,2,4,7,9]+.t[0,4,9],inf),\n \\scale, Scale.dorian,\n \\octave, Pseq([1,3]+.t[0,2],inf),\n \\mtranspose, Pseq((0!20)++(2!20)++(4!20)++(5!20),2)\n).play;\n)\n```"}, {"role": "assistant", "content": "This was my creation as I learned how to work with PmonoArtic. Took way too long to realize \"freq\" and \"gate\" were naming conventions and I didnt need to build out additional functionality!."}], "family": "D3", "source_id": "sccode:1-56s", "aug": "patch", "prompt_tokens": 734, "answer_tokens": 61}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\nSynthDef(\\param, { arg freq = 100, sustain, amp;\n var sig;\n sig = LFPar.ar(freq: freq,\n mul: EnvGen.kr(Env.perc(0, sustain, 0.5), doneAction:2) * amp);\n sig = Splay.ar(sig);\n Out.ar(0, sig);\n}).add;\n\ne = Pbind(\n \\midinote, Prout({\n var tone0, tone1, tone2, interval, freq0, delta;\n loop {\n tone0 = rrand(0,11);\n interval = rrand(2,4);\n tone1 = Scale.minor(\\pythagorean).at(tone0) + [0,12,24].choose + 0.07;\n tone2 = Scale.minor(\\pythagorean).at(tone0 + interval) + [0,12,24].choose;\n freq0 = [tone1,tone2]+48;\n postln(freq0);\n freq0.yield;\n }\n }),\n \\dur, Prand([1,2,4,8,12,16,4,6,8], inf),\n \\instrument, \\param,\n \\amp, 0.5,\n \\sustain, 2,\n).play(quant:1); // returns an EventStream\nTempoClock.default.tempo = 1200/60;\n\n)\n```"}, {"role": "assistant", "content": "minor random bliss in two for Prout (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-56b", "aug": "patch", "prompt_tokens": 459, "answer_tokens": 20}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~chaos={\n var signal, myFrequency, frequencyMin=0.1, frequencyMax=30, myAmplitude, amplitudeMin=0.01, amplitudeMax=0.6, myPhase, phaseMin=0, phaseMax=1.5;\n myFrequency = Array.fill(2, {[rrand(frequencyMin, frequencyMax)]});\n myAmplitude = Array.fill(2, {[rrand(amplitudeMin, amplitudeMax)]});\n myPhase = Array.fill(2, {[rrand(phaseMin, phaseMax)]});\n signal = LeakDC.ar(ChaosGen.allSubclasses.choose.ar(myFrequency, myPhase, myAmplitude));\n Out.ar(0, signal);\n};\n);\n\n~chaos.scope\n```"}, {"role": "assistant", "content": "chaos gen modular function for modular pseudo ugen prototyping."}], "family": "D3", "source_id": "sccode:1-55p", "aug": "patch", "prompt_tokens": 308, "answer_tokens": 23}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~lfd={\n var signal, myFrequency, frequencyMin=0.1, frequencyMax=30, myAmplitude, amplitudeMin=0.01, amplitudeMax=0.6, myPhase, phaseMin=0, phaseMax=1.5;\n myFrequency = Array.fill(2, {[rrand(frequencyMin, frequencyMax)]});\n myAmplitude = Array.fill(2, {[rrand(amplitudeMin, amplitudeMax)]});\n myPhase = Array.fill(2, {[rrand(phaseMin, phaseMax)]});\n signal = LeakDC.ar([LFDNoise1, LFDNoise0, LFDNoise3, LFDClipNoise].choose.ar(myFrequency, myPhase, myAmplitude));\n Out.ar(0, signal);\n};\n);\n\n~lfd.scope\n```"}, {"role": "assistant", "content": "a draft of a modular function for LFDNoise sctochastically selection. i shall be turning this into a pseudo ugen, using high level classes abstraction layer."}], "family": "D3", "source_id": "sccode:1-55o", "aug": "patch", "prompt_tokens": 328, "answer_tokens": 54}
@@ -6757,163 +6588,48 @@
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var freqs = [200, 600, 400, 450, 150, 20, 800];\n var amps = Saw.ar(freq: [2,3, 5]).range(1, 0.5, 0.3, 0.8);\n var snd = LFTri.ar(freq: freqs, mul: amps);\n Mix.ar(snd)\n}.play;\n)\n```"}, {"role": "assistant", "content": "LFTri that plays in a single channel with frequent amplitude shifts."}], "family": "D3", "source_id": "sccode:1-53r", "aug": "patch", "prompt_tokens": 157, "answer_tokens": 24}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var saw, bpf;\n saw = Pulse.ar(\n freq: [100,150],\n mul: LFPulse.kr(\n freq: [0, 0.03, 0.04],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(-10, -5, 3).range(200, 400));\n Out.ar(0, bpf);\n}.play;\n)\n```"}, {"role": "assistant", "content": "//Pulse is the UGen. There is multichannel expansion due to the lists in the freqs. The range is a big part of the reason this sounds so deep."}], "family": "D3", "source_id": "sccode:1-53n", "aug": "patch", "prompt_tokens": 180, "answer_tokens": 49}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var saw, bpf;\n saw = Saw.ar(\n freq: [1700,2000],\n mul: LFPulse.kr(\n freq: [2,7],\n width: 0.115));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/3).range(250, 4000)); \n}.play;\n)\n```"}, {"role": "assistant", "content": "Quiz 4a for MUSC 115, pp. 62-84 from Gentle Intro to SuperCollider."}], "family": "D3", "source_id": "sccode:1-53l", "aug": "patch", "prompt_tokens": 160, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\closeN, { |out=0, freq=440, gate=1|\n var son = BPF.ar(in: WhiteNoise.ar(20!2),\n freq: freq,\n rq: 0.005,\n mul: 1,\n );\n var env = EnvGen.ar(\n Env.linen(0.1, 0.5, 0.55, 0.8, \\welch),\n doneAction:2\n );\n son = FreeVerb2.ar(son, son, mix: 0.7, room: 1.0, damp: 0.3);\n Out.ar(out, son * env);\n\n\n}).add;\n);\n\n\n(\na = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [200, 250],\n mul: LFPulse.kr(\n freq: [2, 3],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\ns = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [100, 150],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nd = {\n var saw, bpf;\n saw = Pulse.ar(\n freq: [800, 1000],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15).range(0.0,0.7));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nf = Pbind(\n \\instrument, \\close\n```"}, {"role": "assistant", "content": "Utilizing some Ar's, Kr's, and Pbinds, we can find ourselves in a counter of the fourth mind."}], "family": "D3", "source_id": "sccode:1-53b", "aug": "patch", "prompt_tokens": 756, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nTempoClock.default.tempo = 1.5; \n\n(\nSynthDef(\\plop, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, sustain=1;\n var sig;\n var env = EnvGen.ar(\\env.kr(Env([ 0,1,1,0 ],[1,1,1])),gate,doneAction:2);\n sig = SinOsc.ar(freq * ( env + 1 ));\n sig = sig * env;\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n}).add;\n);\n\n(\nPdef(\\plop, Pbind(\n \\instrument, \\plop,\n \\degree, Pseq([0],inf),\n \\dur, Pseq([8,2],inf),\n \\legato, 0.8,\n \\env, Pfunc({ arg ev; // Pfunc because rrand should be executed for each event\n var times = [ rrand(0.01,1), rrand(0.01,1), rrand(0.01,1) ];\n // sustain is already available in the default event and is computed from dur and legato\n var sustain = ev.use({ ~sustain.value }) / thisThread.clock.tempo; // ~sustain is in beats but env should be in seconds\n var env;\n sustain.debug(\"sustain\");\n env = Env([0,1,1,0], times.normalizeSum * sustain);\n env.asCompileString.debug(\"env\");\n [env]; // array arguments need to be enclosed to avoid multichannel expansion in pbind\n }),\n \\amp, 0.1\n)).play;\n);\n\n\n//////////////\n//another way is to use timeScale of EnvGen\n\n(\nSynthDef(\\plop2, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, tsustain=1;\n var sig;\n```"}, {"role": "assistant", "content": "How to generate random envelope but control it with pattern standard \\dur and \\legato mecanism (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-534", "aug": "patch", "prompt_tokens": 649, "answer_tokens": 38}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nt = TempoClock(140/60/32)\n\n(\nSynthDef(\\bform, { |out = 0, freq = (60.midicps), formfreq = 70, bwfreq = 200, gate = 1, amp = 0.1|\n var env = EnvGen.kr(Env.adsr(releaseTime:0.5, decayTime:0.1), gate, doneAction:2);\n var sig = Formant.ar(freq * ((-1..1)/500 + 1), formfreq * env.range(0.01,2), bwfreq);\n sig = sig * env;\n Out.ar(out, Splay.ar(sig) * amp)\n}).add\n);\n~mbus2 = Bus.audio(s, 2)\n\nNdef(\\l, {LFNoise1.kr(t.tempo)})\nNdef(\\m2).put(0, { InFeedback.ar(~mbus2, 2)}).play\nNdef(\\m2).put(1, \\filter -> { |i| Decimator.ar(i, Ndef(\\l).kr.range(1000,4000), bits:17)})\nNdef(\\m2).put(2, \\filter -> { |i| JPverb.ar(i, t60:5)}).set(\\wet1, 0.3)\n\nPdef(\\f, Pmono(\\bform, \\freq, 110/2, \\formfreq, Pfunc({80.rrand(440)}), \\dur, 1/4, \\bwfreq, 60, \\out, ~mbus2))\n\nPdef(\\f).play(t)\n\nPdef(\\f).stop\n```"}, {"role": "assistant", "content": "An improvisation on Formant, also using JPverb (from DEINDUGens) and Decimator (from DistortionUGens). 'Balungan' is the name given to the central, skeletal melody that underlies a Javanese gamelan piece: actually, this is not very gamelan-like at all, although the stately pace and occasional gong-like notes put me in that frame of mind."}], "family": "D3", "source_id": "sccode:1-51O", "aug": "patch", "prompt_tokens": 536, "answer_tokens": 123}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// setup\nPdef.all.clear;\nNdef.all.clear;\n(\nSynthDef(\\blip, { |out= 0, freq = 261.6255653006, nharm = 10, gate = 1, amp = 0.1|\n var sig = Blip.ar(freq * ((-2..2)/500 + 1), nharm); // five channels, detuned\n var env = EnvGen.kr(Env.adsr(), gate, doneAction:2);\n sig = sig * env;\n Out.ar(out, Splay.ar(sig) * amp)\n}).add\n);\n\n~hitzpath=\"/Users/jsimon/Music/SuperCollider Recordings/hitzamples/\"; // various drum samples\n~bufs = (~hitzpath ++ \"*.aiff\").pathMatch.collect({ |i| Buffer.read(s, i)});\n(\nSynthDef(\\bf, {|out=0 buf=0 amp=0.1 freq=261.6255653006|\n var sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * freq/60.midicps, doneAction:2);\n Out.ar(out, sig * amp)\n}).add\n);\n\nt = TempoClock(140/60).permanent_(true);\n\n~mbus = Bus.audio(s, 2);\nNdef(\\m).put(0, { InFeedback.ar(~mbus, 2) }).fadeTime_(0.2).play; // actually never used!\n\n// go\n\nPbindef(\\b, \\instrument, \\blip)\n~mel = {-12.rand}!16\nPbindef(\\b, \\scale, Scale.hexMajor7)\nPbindef(\\b, \\degree, Pseq(~mel,inf))\nPbindef(\\b, \\dur, 1/4)\nPbindef(\\b, \\out, ~mbus).play(t, quant:4) // <-----------------\n~mel2 = {-12.rand}!32\nPbindef(\\b, \\degree, Pseq(~mel2,inf))\nPbindef(\\b, \\degree, Pseq([~mel, ~mel, ~mel2].flatten,inf))\n// need to do somethin\n```"}, {"role": "assistant", "content": "More rehearsals towards a sort of algorave gig I've been offered, tidied up a bit. One run of this here https://soundcloud.com/tedthetrumpet/lcode-04-gmsnprep-05."}], "family": "D3", "source_id": "sccode:1-51J", "aug": "patch", "prompt_tokens": 759, "answer_tokens": 74}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nNdef(\\pad).fadeTime = 10;\nNdef(\\click).fadeTime = 10;\n\n(\nNdef(\\pad, {\n var src;\n src = Formants.ar(([1, 2, 3, 4] *.t [31, 50].midicps * {LFNoise1.kr(10, 0.003, 1)}!4).flat, Vowel([\\u, \\e], [\\bass, \\tenor, \\soprano]), \n freqMods: LFNoise2.ar(1*[0.1, 0.2, 0.3, 0.4, 0.5].scramble, 0.1), unfold: true).sum * 0.1;\n Splay.ar(src.flat.scramble)\n}).play\n);\n\n(\nNdef(\\click, {\n var src, in;\n var mods = LFNoise2.ar(#[0.1, 0.2, 0.3, 0.4, 0.5].scramble \n * {LFNoise1.ar(0.1).range(0.125, 4)}!5, 0.01);\n \n in = Impulse.ar(75 * [1, 0.66, 0.75, 2.33, 0.2387], mul: 1);\n src = Vowel([\\a, \\o, \\e, \\i, \\u].scramble, [\\bass, \\bass, \\soprano])\n .collect{|vowel, i|\n BPFStack.ar(\n (PinkNoise.ar * 0.0125) + \n in[i], \n vowel,\n freqMods: mods[i] + 1.1,\n unfold: true\n )};\n Splay.ar(src.flat.scramble)\n}).play\n)\n```"}, {"role": "assistant", "content": "very simple but soothing vowel pads. \r\nrequires the Vowel quark."}], "family": "D3", "source_id": "sccode:1-51H", "aug": "patch", "prompt_tokens": 547, "answer_tokens": 28}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nMIDIClient.init;\nMIDIIn.connectAll;\n~lpChan = 0;\n~lpIn = MIDIClient.sources.select({arg item, i; (item.name == \"Launchpad Mini\")})[0]; //Pick the first launcpad mini you find\n~lpOut = MIDIOut.newByName(\"Launchpad Mini\", \"Launchpad Mini\");\n~lpNoteNums = Array.fill([8,8], {|i,j| j+(i*16) });\n);\n\n(\nvar path = [\n ~lpNoteNums[0][0], ~lpNoteNums[0][1], ~lpNoteNums[0][2], ~lpNoteNums[0][3], ~lpNoteNums[0][4], ~lpNoteNums[0][5], ~lpNoteNums[0][6], ~lpNoteNums[0][7],\n ~lpNoteNums[1][7], ~lpNoteNums[2][7], ~lpNoteNums[3][7], ~lpNoteNums[4][7], ~lpNoteNums[5][7], ~lpNoteNums[6][7], ~lpNoteNums[7][7],\n ~lpNoteNums[7][6], ~lpNoteNums[7][5], ~lpNoteNums[7][4], ~lpNoteNums[7][3], ~lpNoteNums[7][2], ~lpNoteNums[7][1], ~lpNoteNums[7][0],\n ~lpNoteNums[6][0], ~lpNoteNums[5][0], ~lpNoteNums[4][0], ~lpNoteNums[3][0], ~lpNoteNums[2][0], ~lpNoteNums[1][0],\n ~lpNoteNums[1][1], ~lpNoteNums[1][2], ~lpNoteNums[1][3], ~lpNoteNums[1][4], ~lpNoteNums[1][5], ~lpNoteNums[1][6],\n ~lpNoteNums[2][6], ~lpNoteNums[3][6], ~lpNoteNums[4][6], ~lpNoteNums[5][6], ~lpNoteNums[6][6],\n ~lpNoteNums[6][5], ~lpNoteNums[6][4], ~lpNoteNums[6][3], ~lpNoteNums[6][2], ~lpNoteNums[6][1],\n ~lpNoteNums[5][1], ~lpNoteNums[4][1]\n```"}, {"role": "assistant", "content": "Just a quick demo of making a spiral pattern on a Novation Launchpad Mini\r\n\r\nVisual of it here: https://www.instagram.com/p/BFjqSxCwF4J/?taken-by=schemawound."}], "family": "D3", "source_id": "sccode:1-51B", "aug": "patch", "prompt_tokens": 872, "answer_tokens": 80}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\simpler, {\n arg buf=0\n ,freq=220\n ,sampleStart=0\n ,loopStart=0\n ,loopLen=1 // between 0 (min) and 1 (max)\n ,fadeTime=0.1\n ,gate=1\n ,attack=0.01\n ,sustain=1\n ,release=1\n ,f0=220;\n\n var rate = freq / f0;\n var sr = rate*BufSampleRate.kr(buf);\n var fadeFrames = fadeTime*sr;\n var loopEnd = loopLen*(BufFrames.kr(buf) - loopStart) + loopStart;\n var loopFrames = loopEnd - loopStart + 1;\n var loopTime = (loopFrames - fadeFrames)/sr;\n var startUpTime = (loopStart - sampleStart)/sr;\n\n var trigLoop = TDuty.ar(Dseq([startUpTime + loopTime, Dseq([loopTime], inf)]), gapFirst:1);\n\n var phaseA = Phasor.ar(trigLoop, rate, sampleStart, inf, loopStart);\n var phaseB = Phasor.ar(trigLoop, rate, loopEnd - fadeFrames, inf, loopEnd - fadeFrames);\n\n var srcA = BufRd.ar(buf.numChannels, buf, phaseA);\n var srcB = BufRd.ar(buf.numChannels, buf, phaseB);\n\n var startLoop = SetResetFF.ar(trigLoop);\n var loopPan = Phasor.ar(trigLoop, 2/fadeFrames * rate, -1, inf, -1).clip(-1,1);\n\n var out = Select.ar(startLoop, [srcA, LinXFade2.ar(srcB, srcA, pan:loopPan)]);\n var env = EnvGen.ar(Env.asr(attack, sustain, release, 1), gate, doneAction:2);\n\n Out.ar(0, Splay.ar(out) * env);\n}).add\n```"}, {"role": "assistant", "content": "Looping sampler with crossfading. Looping point and loop length can be adjusted.\r\n\r\nhttps://soundcloud.com/inlet/sc-160515-234815."}], "family": "D3", "source_id": "sccode:1-51A", "aug": "patch", "prompt_tokens": 702, "answer_tokens": 58}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nb = Buffer.read(s, Platform.resourceDir +/+ \"sounds/a11wlk01.wav\");\n\n(\n{\n var snd, envTime, knee, out;\n snd = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);\n envTime = MouseX.kr(1.0e-3, 0.1e-3);\n knee = MouseY.kr(0, -90).dbamp;\n out = DelayC.ar(snd, 0.01, envTime * 0.5) * EnvFollow.ar(snd, 1 - (envTime * SampleRate.ir).reciprocal).max(knee).reciprocal;\n out * 0.1!2\n}.play;\n)\n```"}, {"role": "assistant", "content": "a replication of the legendary LADSPA plugin of the same name, originally written by steve harris. a compressor with a super fast attack which results in harsh distortion fx. requires sc3-plugins."}], "family": "D3", "source_id": "sccode:1-51w", "aug": "patch", "prompt_tokens": 270, "answer_tokens": 69}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// add custom event\nEvent.addEventType(\\nbind, {arg server;\n\n var id = (currentEnvironment[\\ndef] ? currentEnvironment[\\instrument]).asSymbol;\n var type = \\note;\n\n if (Ndef(id).isPlaying.not) {\n Ndef(id).play;\n };\n\n ~type = type;\n ~group = Ndef(id).group;\n ~out = Ndef(id).bus;\n\n currentEnvironment.play;\n});\n\n// synth\nSynthDef(\\synth1, {arg freq = 440, out = 0;\n \n var env = Env.perc.kr(doneAction:2);\n var sig = SinOscFB.ar(freq * [1, 1.01], 0.7);\n sig = sig * env;\n OffsetOut.ar(out, Splay.ar(sig));\n \n}).add;\n\n// set up first set of fx\nNdef(\\fx1).play;\nNdef(\\fx1)[0] = \\filter -> {arg in;\n in.abs;\n};\n\n// set up additional fx\nNdef(\\fx2).play;\nNdef(\\fx2)[0] = \\filter -> {arg in;\n in + AllpassC.ar(in, 0.2, 0.2, [3, 5]);\n};\n\n);\n\n// play a pattern\nPbind(\\instrument, \\synth1, \n // specify custom event type\n \\type, \\nbind, \n // switch between fx\n \\ndef, Pseq([\\fx1, \\fx2], inf),\n \\degree, Pwhite(0, 5, inf)\n).play;\n```"}, {"role": "assistant", "content": "Custom event type for wiring up effects (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-51t", "aug": "patch", "prompt_tokens": 541, "answer_tokens": 21}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\kalimba, {\n |out = 0, freq = 440, amp = 0.1, mix = 0.1|\n var snd, click;\n // Basic tone is a SinOsc\n snd = SinOsc.ar(freq) * EnvGen.ar(Env.perc(0.03, Rand(3.0, 4.0), 1, -7), doneAction: 2);\n snd = HPF.ar( LPF.ar(snd, 380), 120);\n // The \"clicking\" sounds are modeled with a bank of resonators excited by enveloped white noise\n click = DynKlank.ar(`[\n // the resonant frequencies are randomized a little to add variation\n // there are two high resonant freqs and one quiet \"bass\" freq to give it some depth\n [240*ExpRand(0.97, 1.02), 2020*ExpRand(0.97, 1.02), 3151*ExpRand(0.97, 1.02)],\n [-9, 0, -5].dbamp,\n [0.8, 0.07, 0.08]\n ], BPF.ar(PinkNoise.ar, 6500, 0.1) * EnvGen.ar(Env.perc(0.001, 0.01))) * 0.1;\n snd = (snd*mix) + (click*(1-mix));\n snd = Mix( snd );\n Out.ar(out, Pan2.ar(snd, 0, amp));\n}).add;\n);\n\n(\nPbind(\n \\instrument, \\kalimba,\n \\dur, Pseq([0.3, 0.15], inf),\n \\stretch, 1.3,\n \\amp, 0.5*(2**Pgauss(0, 0.1)),\n \\degree, Pseq([0, -3, [1, 4], 2, Rest, 1, -3, -2, -4, -2, [0, 5], 1, Rest, 0, -2, Rest], inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "Here is a slightly thinner sounding version of snappizz's kalimba SynthDef. I added filtering on the SinOsc and on the PinkNoise. IMO it sounds better if the mix stays low."}], "family": "D3", "source_id": "sccode:1-51n", "aug": "patch", "prompt_tokens": 637, "answer_tokens": 65}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\reed, {\n |out = 0, freq = 440, amp = 0.1, gate = 1, attack = 0.3, release = 0.3|\n var snd, blow;\n // pulse with modulating width\n snd = Pulse.ar((Rand(-0.03, 0.05) + freq.cpsmidi).midicps, 0.48 + LFNoise1.kr(0.06, 0.1), 0.2);\n // add a little \"grit\" to the reed\n snd = Disintegrator.ar(snd, 0.5, 0.7);\n // a little ebb and flow in volume\n snd = snd * LFNoise2.kr(5, 0.05, 1);\n // use the same signal to control both the resonant freq and the amplitude\n blow = EnvGen.ar(Env.asr(attack, 1.0, release), gate, doneAction: 2);\n snd = snd + BPF.ar(snd, blow.linexp(0, 1, 2000, 2442), 0.3, 3);\n // boost the high end a bit to get a buzzier sound\n snd = BHiShelf.ar(snd, 1200, 1, 3);\n snd = snd * blow;\n Out.ar(out, Pan2.ar(snd, 0, amp));\n}).add;\n\nPbind(\n \\instrument, \\reed,\n \\amp, 0.1*(2**Pgauss(0, 0.1)),\n \\dur, 5.0,\n \\legato, 1,\n \\root, 1,\n \\attack, 0.2,\n \\release, 0.2,\n \\degree, Pseq([[-7, -3, 0, 2], [-7, -2, 0, 3], [-7, -1, 1, 4]].mirror1, inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "possible basis for harmonica, accordion, etc. adapted from an example from the SelectXFocus help file."}], "family": "D3", "source_id": "sccode:1-51m", "aug": "patch", "prompt_tokens": 583, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\kalimba, {\n |out = 0, freq = 440, amp = 0.1, mix = 0.1|\n var snd;\n // Basic tone is a SinOsc\n snd = SinOsc.ar(freq) * EnvGen.ar(Env.perc(0.005, Rand(2.5, 3.5), 1, -8), doneAction: 2);\n // The \"clicking\" sounds are modeled with a bank of resonators excited by enveloped pink noise\n snd = (snd * (1 - mix)) + (DynKlank.ar(`[\n // the resonant frequencies are randomized a little to add variation\n // there are two high resonant freqs and one quiet \"bass\" freq to give it some depth\n [240*ExpRand(0.9, 1.1), 2020*ExpRand(0.9, 1.1), 3151*ExpRand(0.9, 1.1)],\n [-7, 0, 3].dbamp,\n [0.8, 0.05, 0.07]\n ], PinkNoise.ar * EnvGen.ar(Env.perc(0.001, 0.01))) * mix);\n Out.ar(out, Pan2.ar(snd, 0, amp));\n}).add;\n\nPbind(\n \\instrument, \\kalimba,\n \\dur, Pseq([0.3, 0.15], inf),\n \\amp, 0.1*(2**Pgauss(0, 0.1)),\n \\mix, Pwhite(0.05, 0.15),\n \\degree, Pseq([0, -3, [1, 4], 2, Rest, 1, -3, -2, -4, -2, [0, 5], 1, Rest, 0, -2, Rest], inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "i needed a kalimba sound so i built one with SinOsc + DynKlank. feedback and improvements are welcome :)."}], "family": "D3", "source_id": "sccode:1-51l", "aug": "patch", "prompt_tokens": 565, "answer_tokens": 43}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\ping, {\n arg freq = 440, pan = 0;\n var sig;\n sig = SinOsc.ar(freq, 0, 0.3);\n sig = sig * EnvGen.ar(Env.perc(0.01, 1), doneAction:2);\n sig = Pan2.ar(sig, pan);\n Out.ar(0, sig)\n}).add;\n);\n\n(\n~scramb = {|pan|\nvar notes = [0,4,7,14,9,12,4,7,9,7];\nvar dur = [1,1,2,3,6,3,4,5,2,1,13];\nvar transp = [0, 5, 7, 3, 2];\nvar scrambRand = {|array|\n var rand = rrand(0, array.size-3);\n var end = rand + rrand(1,2);\n var range = (rand..end);\n var reverseRange = range.reverse;\n var temp = array.copy;\n range.postln;\n range.do({|item, index|\n array[item] = temp[reverseRange[index]];\n });\n array;\n};\nvar octRand = {|array|\n var rand = rrand(0, array.size-1);\n array[rand] = array[rand] + [-12,0,12].choose;\n };\nvar task = Task {\n var step = 0;\n var transpStep = 0;\n loop {\n var freq = (notes.wrapAt(step) + 60 + transp.wrapAt(transpStep)).midicps;\n Synth(\\ping, [\\freq, freq, \\pan, pan]);\n (dur.wrapAt(step) * 0.15).wait;\n step = step + 1 % (notes.size * 12;);\n if (step%32 == 0, {scrambRand.value(notes)});\n if (step%20 == 0, {scrambRand.value(dur)});\n if (step%66 == 0, {transpStep = transpStep + 1 % (transp.size)});\n if (step%24 == 0, {notes = note\n```"}, {"role": "assistant", "content": "This composition uses a task to read an array of durations and pitches. Every certain number of cycles, the functions scrambRand and octRand are called. scrambRand reverses a random sub-segment of the array. octRand randomly transposes a note up or down an octave. Every so often, all pitches are transposed according to the transp array. \r\n\r\nTwo instances of this process are run simultaneously, one."}], "family": "D3", "source_id": "sccode:1-51k", "aug": "patch", "prompt_tokens": 685, "answer_tokens": 128}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Wine Glass Sound\n(\nSynthDef(\"AM\", { arg freq = 523.25, modfreq = 1, amp = 0.5, attack = 2, dur = 5, pos = 0;\n var carrier, modulator, env;\n modulator = SinOsc.kr(modfreq).range(0, 1);\n carrier = SinOsc.ar(freq: freq, mul: modulator);\n env = Env.perc(attackTime: attack, releaseTime: dur - attack, level: amp).kr(2);\n carrier = carrier * env;\n Out.ar(0, Pan2.ar(carrier, pos))\n}).add;\n);\n\n(\nPbind(\n\\instrument, \"AM\",\n \\note, 15,\n \\dur, 10,\n \\amp, Pwhite(0.5, 0.1),\n \\att, 1,\n \\rel, 10\n).play;\n);\n\n\n\n\n// changes to the modfreq in SynthDef \"AM1\" -- rougher rubbing against the glass\n(\nPbind(\n\\instrument, \"AM\",\n \\note, 15,\n \\dur, 10,\n \\amp, Pwhite(0.5, 0.1),\n \\att, 1,\n \\rel, 10,\n \\modfreq, 10\n).play;\n);\n\n\n\n\n// even higher modfreq -- greater number of voices\n(\nPbind(\n\\instrument, \"AM\",\n \\note, 15,\n \\dur, 10,\n \\amp, Pwhite(0.5, 0.1),\n \\att, 1,\n \\rel, 10,\n \\modfreq, 1000\n).play;\n)\n```"}, {"role": "assistant", "content": "This is an addition to my first code of wine glass sound: \"The friction between a finger dipped in water and the edge of a wine glass creating a sound.\" I have added a couple more synthdefs/codes to demonstrate the differences when modfreq is changed. A higher modfreq changes the purity of the tone."}], "family": "D3", "source_id": "sccode:1-51e", "aug": "patch", "prompt_tokens": 519, "answer_tokens": 101}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"Triangular AM\", { arg freq = 440, modfreq = 5, amp = 0.5, attack = 0.01, release = 0.1, pos = 0, gate = 1;\n var carrier, modulator, env;\n modulator = SinOsc.kr(modfreq).range(0, 1); // provides amplitude modulation for wobble\n carrier = LFTri.ar(freq: freq, mul: modulator); // provides triangle wave for an interesting harmonic\n env = Env.asr(\n attackTime: attack,\n sustainLevel: amp,\n releaseTime: release).kr(doneAction: 2, gate: gate);\n carrier = carrier * env;\n Out.ar(0, Pan2.ar(carrier, pos))\n}).add;\n);\n\n(\n// Using these settings you can produce a pulsating wobble sound\n~wobble = Pbind(\n \\instrument, \"Triangular AM\",\n \\scale, Scale.aeolian,\n \\ctranspose, -12,\n \\degree, Pseq([\n [-7,-3, 0, 2, 4, 7],\n [-8, -4, -1, 1, 3, 6],\n [-9, -5, -2, 0, 2, 5],\n [-5, -1, 2, 4, 6, 9],\n [-4, 0, 3, 5, 7, 10],\n ], inf),\n \\dur, Pseq([Pn(4, 3), 2, 2], inf),\n \\amp, 0.4,\n \\modfreq, Pseq([Pn(6.5, 3), 2, 6.5], inf),\n \\attack, 2,\n \\release, 1.2,\n \\pos, [-1, -0.7, -0.2, 0.2, 0.7, 1],\n \\gate, 0,\n);\n);\n\n~wobble.play;\n```"}, {"role": "assistant", "content": "Wobble, tremolo, whatever you want to call it. This code uses amplitude modulation with a triangle wave to produce a lower register pulsating synth."}], "family": "D3", "source_id": "sccode:1-51d", "aug": "patch", "prompt_tokens": 583, "answer_tokens": 50}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\bass, { arg freq = 440, amp = 0.5, gate = 1;\n var snd, env, oscfreq, output;\n var lfo;\n oscfreq = {freq * LFNoise2.kr(Rand(0.0001,0.5)).range(0.98, 1.02)}!13;\n lfo = { SinOsc.kr({ 1/Rand(2,52) }!13) };\n env = Env.adsr(0.07, 1, 0.9, 0.1).kr(doneAction:2, gate: gate);\n output = LFSaw.ar(oscfreq, mul: lfo.value.range(0,1));\n output = RLPF.ar(output, (env*freq) + 1*freq * lfo.value.range(1/4,2), lfo.value.range(0.1,1));\n output = Splay.ar(output, lfo.value.range(0,1));\n output = output * env * amp;\n Out.ar(0, output);\n }).add;\n);\n\nPdef(\\bass, Pbind(\n \\instrument, \\bass,\n \\tempo, 113/60,\n \\ctranspose, -26,\n \\degree, Pseq([Pseq([3, 5, 1, 3, 5, 8, 1], 2), Pseq([3, 2, 5, -1], 1), Pseq([3, 2, 5, 0], 1), Pseq([1, 5, 0,1,2,5,4], 2), Pseq([1, 0,2],2), 3],inf),\n \\dur, Pseq([Pseq([8, 4, 4, 8, 4, 2, 2], 2), Pseq([8,4,2, 2], 2),Pseq([8, 4, 4, 8, 4, 2, 2], 2), Pseq([8, 4, 4], 2), 16], inf),\n \\legato, 1.0,\n \\amp, 0.6,\n)).play;\n\nPdef(\\bass, Pmono(\\bass,\n \\tempo, 113/60,\n \\ctranspose, -26,\n \\degree, Pseq([Pseq([3, 5, 1, 3, 5, 8, 1], 2), Pseq([3, 2, 5, -1], 1), Pseq([3, 2, 5, 0], 1), Pseq([1, 5, 0,1,2,5,4], 2), Pseq([1, 0,2],2), 3],inf),\n \\dur, Pseq([Pseq([8, 4, 4, 8, \n```"}, {"role": "assistant", "content": "my hobbit: adding random arrays of LFO everywhere (bonus: a glitch i don't know where it come from)."}], "family": "D3", "source_id": "sccode:1-516", "aug": "patch", "prompt_tokens": 786, "answer_tokens": 37}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"AM\", { arg freq = 440, modfreq = 5, amp = 0.5, attack = 0.01, decay = 0.3, release = 0.1, pos = 0, gate = 1, phaserfreq = 0, phaserdepth = 0.3;\n var phaser, carrier, modulator, env;\n phaser = SinOsc.ar(freq: phaserfreq, mul: phaserdepth*modfreq, add: modfreq);\n modulator = SinOsc.ar(phaser).range(0, 1);\n carrier = SinOsc.ar(freq: freq, mul: modulator);\n env = Env.adsr(\n attackTime: attack,\n decayTime: decay,\n sustainLevel: 0.8,\n releaseTime: release).kr(doneAction: 2, gate: gate);\n carrier = carrier * env * amp;\n Out.ar(0, Pan2.ar(carrier, pos))\n}).add;\n);\n\n(\n Pbind(\n \\instrument, \"AM\",\n \\dur, 1/4,\n \\degree, Pseq([0,3,5,7,5,3], inf),\n \\ctranspose,Pseq([Pseq([0],24),Pseq([3],24),Pseq([5],24)],inf),\n \\modfreq, 2000, // try higher numbers here\n \\pmindex, Pwhite(2, 3),\n \\amp, 0.3,\n \\attack, 1,\n \\release, Pwhite(0.1, 0.3),\n \\pos,Pseq([Pseq([1],8),Pseq([1],8),Pseq([1],8),Pseq([1],8)],inf),\n).play;\n)\n```"}, {"role": "assistant", "content": "Cool modulation synth and Pbind that gets a sound similar to that of a carousel at a carnival. Toy with the \\dur and set to 1/2 and it gives a spookier run down sound or speed up 1/16 to get the sound of some one repeating \"yayayaya\". Reminiscent of Roller Coaster Tycoon."}], "family": "D3", "source_id": "sccode:1-515", "aug": "patch", "prompt_tokens": 567, "answer_tokens": 103}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"bass\", { arg freq = 440, amp = 0.5, gate = 1;\n var snd, env, oscfreq, output;\n oscfreq = {freq * LFNoise2.kr(0.5).range(0.98, 1.02)}!3;\n snd = Splay.ar(LFSaw.ar(oscfreq, mul: amp));\n env = Env.adsr(0.7, 4, 0, 0.1).kr(doneAction:2, gate: gate);\n snd = snd;\n output = LPF.ar(snd, (env*freq) + 2*freq);\n Out.ar(0, output);\n }).add;\n);\n\nPbind(\n \\instrument, \"bass\",\n \\tempo, 113/60,\n \\ctranspose, -26,\n \\degree, Pseq([Pseq([3, 5, 1, 3, 5, 8, 1], 2), Pseq([3, 2, 5, -1], 1), Pseq([3, 2, 5, 0], 1), Pseq([1, 5, 0,1,2,5,4], 2), Pseq([1, 0,2],2), 3],inf),\n \\dur, Pseq([Pseq([8, 4, 4, 8, 4, 2, 2], 2), Pseq([8,4,2, 2], 2),Pseq([8, 4, 4, 8, 4, 2, 2], 2), Pseq([8, 4, 4], 2), 16], inf),\n \\legato, 1,\n \\amp, 0.6,\n).play;\n```"}, {"role": "assistant", "content": "This is a nice morphing saw bass, that uses multi-voice detuning and stereo expansion for a nice, wide feel, as well as a decaying low pass filter over the course of the sound. Be careful when using higher notes or else the filter may clip."}], "family": "D3", "source_id": "sccode:1-514", "aug": "patch", "prompt_tokens": 496, "answer_tokens": 78}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(//compander -> amplitude\nn=Ndef(\\ct,{\n //var sig=SinOsc.ar*(1-LFSaw.ar(1,0,0.5,0.5));\n var sig=SinOsc.ar*(1-LFPulse.ar(1));\n var inputspecs=[\n Spec.add(\\clampTime, [0.00001, 10,\\exp,0,0.05]);\n Spec.add(\\clampTime2, [0, 1,\\lin,0,0.05]);\n Spec.add(\\relaxTime, [0.00001, 60,\\exp,0,1]);\n Spec.add(\\compression, [0.01, 1,\\lin,0,0.1]);\n Spec.add(\\slopeBelow, [0.01, 10,\\lin,0,0.1]);\n Spec.add(\\slopeAbove, [0.0001, 1,\\lin,0,0.25]);\n ];\n var t=\\thresh.kr(0.75);\n var ct=\\clampTime.kr(0.05);\n var rt=\\relaxTime.kr(1);\n var slopeBelow= \\slopeBelow.kr(1);\n var slopeAbove= \\slopeAbove.kr(0.9);\n\n var a=Amplitude.ar(sig,ct,rt);\n var prevmaxval=a.abs;\n var lg1=pow(prevmaxval / t, slopeBelow - 1);\n var absx = lg1.abs;\n var lg=if((absx < 1e-15),0,if((absx > 1e15),1,lg1));\n var ag=pow(prevmaxval / t, slopeAbove - 1);\n var next_gain=if (prevmaxval < t,lg,ag);\n \n var cp=Compander.ar(sig,sig,t,slopeBelow,slopeAbove,ct,rt);\n Out.ar(0,[sig * next_gain,cp]);\n});\nn.gui;\n\n);\n\ns.scope(bufsize:2**14)\n```"}, {"role": "assistant", "content": "I am not sure if anybody else is interested in such a thing but i think it is cool be able to look inside the working of compander inside of SuperCollider.\r\n\r\nleftchannel=different UGens\r\nrightchannel=Compander.ar."}], "family": "D3", "source_id": "sccode:1-50J", "aug": "patch", "prompt_tokens": 687, "answer_tokens": 77}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Rumush\n// Facebook: https://www.facebook.com/rumushproduction\n// SoundCloud: https://soundcloud.com/rumushproduction\n// YouTube: https://www.youtube.com/channel/UCs_Cn1R4iFrYOyc8liFucSQ\n// Blog: https://mycelialcordsblog.wordpress.com/\n// GitHub: https://github.com/RumushMycelialCords\n\n(\nNdef(\\fdb1, {\n var src, loc, freq, rt;\n rt = 0.25;\n freq = Duty.ar(16/rt,0,Dseq([60,68,67,59,61,64,65].midicps,inf));\n\n src = Saw.ar(freq)*Decay.ar(Impulse.ar(rt),1/rt,0.25);\n //src = SoundIn.ar(0);\n loc = LocalIn.ar(2)+src;\n loc = FreqShift.ar(loc,-1);\n loc = loc+DelayC.ar(loc,0.2,freq.reciprocal);\n loc = DelayC.ar(loc,4,LFNoise1.ar(rt!2).range(0.25,2));\n loc = DelayC.ar(loc,4,2);\n //loc = (loc*250).tanh;\n //loc = LPF.ar(loc,2500);\n loc = loc+AllpassC.ar(loc,0.1,LFNoise0.ar(rt!2).range(0.05,0.1),4);\n loc = HPF.ar(loc,100);\n\n LocalOut.ar(loc*1.75);\n\n Out.ar(0,Limiter.ar(loc)*0.5);\n}).play\n)\n```"}, {"role": "assistant", "content": "Simple feedback Ndef that can produce variety of sounds by just changing two variables, freq and rt. Feel free to modify the code and let me know what you come up with."}], "family": "D3", "source_id": "sccode:1-50D", "aug": "patch", "prompt_tokens": 596, "answer_tokens": 52}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var time = 0.23;\n var freq = (55).midicps;\n var a = VarSaw.ar(freq/2, width: XLine.ar(0.5,1,time)).range(0,XLine.ar(0.666,1/666,time));\n var tone = SinOsc.ar(freq).fold(-0.23*a,a) * EnvGen.ar(Env([1,0],[time]));\n Out.ar(0, tone.dup);\n}.play;\n)\n```"}, {"role": "assistant", "content": "Seekers are something you should avoid.\r\nI put this code through Rakarrack to get some samples for heXon.\r\nheXon is a FOSS dual stick arcade shooter available at www.LucKeyProductions.nl."}], "family": "D3", "source_id": "sccode:1-50B", "aug": "patch", "prompt_tokens": 203, "answer_tokens": 72}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Rumush\n// YouTube: https://www.youtube.com/channel/UCs_Cn1R4iFrYOyc8liFucSQ\n// Facebook: https://www.facebook.com/rumushproduction\n// SoundCloud: https://soundcloud.com/rumushproduction\n// Blog: https://mycelialcordsblog.wordpress.com/\n\n(\nSynthDef(\\chaosGlitch2, {\n arg len = 10, fundFreq = 40, henA = 2, henB = 0.4, t = 1, gate = 1;\n var mainEnv = EnvGen.kr(Env.triangle(len,1), gate, doneAction:2);\n var speed = Array.geom(4, t, [1.75, 1.25].choose);\n var freq = Array.geom(8, fundFreq*2, 1.5);\n var pulse = {|rat1,rat2|LFPulse.ar(rat1, [0,0.5,1].choose)*LFPulse.ar(rat2)};\n var a = Lag.ar(HenonN.ar(\n speed.choose*(mainEnv*10000.rand),\n henA, henB,\n ), 0.01);\n var bass = SinOsc.ar(fundFreq!2*(a*1.0.rand), 0, Lag.ar(pulse.(t, speed.choose), 0.001));\n var tone1 = SinOsc.ar([(fundFreq+Rand(0,5))*a,(fundFreq+Rand(0,5))*a], 0, 0.01*pulse.(speed.choose, speed.choose));\n var tone2 = Pan2.ar(SinOsc.ar(freq.choose*a, 0, 0.1*pulse.(speed.choose, t)), a);\n var tone3 = SinOsc.ar([freq.choose,freq.choose*a], 0, 0.05*pulse.(speed.choose, t))*mainEnv.round(0.25);\n var noise = Pan2.ar(PinkNoise.ar(a*0.1*pulse.(t,t)), a);\n var impulse = RLPF.ar(Impulse.ar(pulse.(t, speed.choose), a\n```"}, {"role": "assistant", "content": "Another glitch SynthDef with a simple pattern to play it. You can achieve variety of textures with it. From simple tones to noise and wicked basses. Have fun :)."}], "family": "D3", "source_id": "sccode:1-50l", "aug": "patch", "prompt_tokens": 752, "answer_tokens": 53}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nf = {\n var rep = [4, 8, 16, 32];\n var n = rep.choose;\n var x = [\n\n 54, 60, 66, 72, 81, 90, 96, 102,\n 108, 128, 132, 144, 162, 180, 192, 204,\n 216, 240, 264, 288, 324, 360, 384, 408,\n 432, 480, 528, 576, 648, 720, 768, 816,\n 864, 960, 1056, 1152, 1296, 1440, 1536, 1632,\n 1728, 1920, 2112, 2304, 2592, 2880, 3072, 3264,\n 3456, 3840, 4224, 4608, 5184, 5760, 6144, 6528,\n 6912, 7680, 8448, 9216, 10368, 11520, 12288, 528\n\n ];\n var fac1 = [1,10,100,1000].choose;\n var fac2 = [1,10,100,1000].choose;\n var fac3 = [1,10,100,1000].choose;\n Mix.fill(n,\n {\n var detune = 5.rand;\n var saw;\n var sin;\n detune = XLine.kr(0.1,1+250.0.rand ,2+9.0.rand) * 2.0.rand* [1,-1].choose;\n sin = SinOsc.ar(x.choose * ( 1 + ( SinOsc.ar(x.choose/fac1) * x.choose/fac2 )) + detune, 4.rand, 0.25);\n saw = RLPF.ar(Saw.ar(x.choose*0.01+detune, 0.75), x.choose, 2.rand);\n saw = [\n saw,\n saw.fold2( SinOsc.ar(x.choose/fac3).range(0.1,1) ),\n saw.wrap2( SinOsc.ar(x.choose/fac3).range(0.1,1) ),\n saw * SinOsc.ar(x.choose/2),\n ( saw * SinOsc.ar(x.choose/fac3).range(1,20) ).tanh/2,\n ]\n```"}, {"role": "assistant", "content": "That's why I love SC, I just randomly added code, and everytime something cool come from it! =)."}], "family": "D3", "source_id": "sccode:1-50k", "aug": "patch", "prompt_tokens": 707, "answer_tokens": 31}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Rumush\n// https://mycelialcordsblog.wordpress.com/\n// https://fungorumush.bandcamp.com/releases\n// https://soundcloud.com/fungorum\n\n(\nf = {\n var rep = [4, 8, 16, 32];\n var n = rep.choose;\n var x = [\n\n 54, 60, 66, 72, 81, 90, 96, 102,\n 108, 128, 132, 144, 162, 180, 192, 204,\n 216, 240, 264, 288, 324, 360, 384, 408,\n 432, 480, 528, 576, 648, 720, 768, 816,\n 864, 960, 1056, 1152, 1296, 1440, 1536, 1632,\n 1728, 1920, 2112, 2304, 2592, 2880, 3072, 3264,\n 3456, 3840, 4224, 4608, 5184, 5760, 6144, 6528,\n 6912, 7680, 8448, 9216, 10368, 11520, 12288, 528\n\n ];\n Mix.fill(n,\n {\n var detune = 5.rand;\n var sin = SinOsc.ar(x.choose, 4.rand, 0.25);\n var saw = RLPF.ar(Saw.ar(x.choose*0.01+detune, 0.75), x.choose, 2.rand).tanh;\n Pan2.ar((sin+saw) * EnvGen.kr(Env.sine(12, 1/n), 1, doneAction:2),\n 1.rand2) }\n );\n};\n);\n\n(\n// DEFINE A ROUTINE\nr = Routine({\n\n inf.do({\n f.play;\n 10.wait;\n })\n});\n);\n\nr.reset.play;\n```"}, {"role": "assistant", "content": "Random texture generator based on 'the perfect frequencies' code with a simple routine to play it."}], "family": "D3", "source_id": "sccode:1-50j", "aug": "patch", "prompt_tokens": 604, "answer_tokens": 28}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// For more SynthDefs and examples please head to: https://mycelialcordsblog.wordpress.com/ \n\n(\nSynthDef(\\hasherTest,\n{\narg rate = 1, freq = 60, index = 1000, tRate = 100,\nout = 0, fRate = 0.1;\n\nvar t_trig = LFPulse.kr(0.5/fRate, 0.5);\nvar random = LFNoise0.ar(rate, add:1);\nvar noise = Hasher.ar(random);\nvar sound = Saw.ar((freq+(noise*index)), Decay.kr(Impulse.kr(tRate), noise*0.001)).tanh;\nsound = Pan2.ar(sound, noise-0.3*2);\nFreeSelf.kr(t_trig);\nOut.ar(out, sound);\n}).store;\n);\n\n(\nPbind(\n\\instrument, \\hasherTest,\n\\dur, 5,\n\\rate, Pfuncn({100.rand}, inf),\n\\freq, Pfuncn({10000.rand}, inf),\n\\index, Pfuncn({20000.rand}, inf),\n\\tRate, Pfuncn({1000.rand}, inf),\n\\fRate, 5,\n).play;\n)\n```"}, {"role": "assistant", "content": "It is a simple SynthDef I made after having a look at Hasher UGen with a pattern to play it. It creates nice and varied glitch sounds."}], "family": "D3", "source_id": "sccode:1-50i", "aug": "patch", "prompt_tokens": 438, "answer_tokens": 45}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~syncSaw = {\n arg syncFreq=440, sawFreq=440, maxRatio=20, minFreq = 10;\n var maxDelay = 1/minFreq;\n var n = floor(maxRatio);\n var b = LocalBuf(Server.default.sampleRate*maxDelay ,1).clear;\n var baseWaveform = Saw.ar(syncFreq);\n var sig = 0;\n n.do {\n arg i;\n var delay = i/sawFreq;\n var amplitude = (sawFreq/syncFreq-i) min: 1 max: 0;\n sig = sig + (BufDelayL.ar(b,baseWaveform,delay)*amplitude);\n };\n sig;\n};\n);\n\n(\n// test it\nplay {~syncSaw.(100,MouseX.kr.range(100,2000).lag)!2}\n);\n\n(\n// compare with aliased version\nplay {SyncSaw.ar(100,MouseX.kr.range(100,2000).lag)!2}\n);\n\n\n(\n// audio rate modulation of sawFreq results in a waveform that's not strictly\n// correct, but sounds good.\nplay {~syncSaw.(MouseY.kr(50,200),MouseX.kr.range(100,2000).lag+SinOsc.ar(20,mul:150))!2}\n// (audio rate modulation of syncFreq doesn't really work.)\n);\n\n(\n// aliased version of the above\nplay {SyncSaw.ar(MouseY.kr(50,200),MouseX.kr.range(100,2000).lag+SinOsc.ar(20,mul:150))!2}\n)\n```"}, {"role": "assistant", "content": "I've always wanted a band limited version of the SyncSaw UGen. After taking a look at [1], I realised it's actually quite easy to implement this in SuperCollider. The paper uses a series of band-limited impulses and then integrates them, but since the integral of an impulse is a sawtooth wave, we can just use Saw.ar. All we need to do is sum up a variable number of them with the appropriate phases."}], "family": "D3", "source_id": "sccode:1-50h", "aug": "patch", "prompt_tokens": 569, "answer_tokens": 133}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\rlpf, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2, ffreq=4000, rq=0.3;\n var sig, sig1, sig2, sig3;\n sig = LFSaw.ar(freq * [1.01,1,0.99]);\n sig = RLPF.ar(sig, ffreq, rq);\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);\n sig = Splay.ar(sig, spread, amp, pan);\n Out.ar(out, sig);\n}).add;\n);\n\n///////// lfo communicating with main pattern\n\n(\nNdef(\\lfo1, { EnvGen.kr(Env([1,4,1],[0.1,0.2]), \\trig.tr(0)) * \\lforange.kr(1000); });\n\nPdef(\\main, Pbind(\n \\instrument, \\rlpf,\n \\midinote, Pseq([60, 62, 64], inf),\n \\legato, 0.5,\n \\move, Pseq([0,1,0, 1,0,0],inf),\n \\lforange, Pseq([1000,2000,3000],inf).stutter(8),\n \\ffreq, Pfunc({ arg ev;\n Ndef(\\lfo1).set(\\trig, ev[\\move], \\lforange, ev[\\lforange]);\n Ndef(\\lfo1);\n }),\n \\dur, 0.5\n)).play \n);\n\n////// sub pattern way\n\n(\n Pdef(\\micro, { arg midinote, move;\n Pbind(\n \\instrument, \\rlpf,\n \\midinote, midinote + \n switch(move,\n \\up, Pseq((0..7)),\n \\down, Pseq((7..0)),\n Pseq(0!8),\n ),\n \\dur, 1/16,\n )\n });\n\n Pdef(\\main,\n Pbind(\n \\instrument, \\micro,\n \\move, Pseq([\\n, \\n, \\up, \\n, \\n,\n```"}, {"role": "assistant", "content": "Two simple ways to set a different modulation per step in a pattern."}], "family": "D3", "source_id": "sccode:1-509", "aug": "patch", "prompt_tokens": 735, "answer_tokens": 19}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// a function to get the n loudest partials for a formant filter using Klank and Vowel\n\n// needs the Vowel quark:\n\n\"Vowel\".include;\n\n// tenor, for instance\na = \"aeiou\".as(Array).collect { |x| Vowel(x.asSymbol, \\tenor) };\n\n// function for threshold\n(\nf = { |vowel, thresh = 0.3|\n var freqs = (40..10000).collect { |x| x + 0.5.rand2 };\n var result = [];\n freqs.do { |freq|\n var amp = vowel.ampAt(freq);\n if(amp > thresh) {\n result = result.add([freq, amp])\n }\n };\n result.size.postln;\n result.flop\n};\n);\n// or alternatively, for number of partials\n(\ng = { |vowel, numPartials = 30|\n var freqs = (40..10000).collect { |x| x + 0.5.rand2 };\n var result = [];\n freqs.do { |freq|\n var amp = vowel.ampAt(freq);\n result = result.add([freq, amp])\n };\n\n result = result.sort { |a, b| a[1] > b[1] }.keep(numPartials);\n\n result.flop\n};\n);\n\n// some examples\n\nNdef(\\vow, { Klank.ar(`(f.(a[0], 0.7) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play;\nNdef(\\vow, { Klank.ar(`(f.(a[0], 0.3) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play;\nNdef(\\vow, { Klank.ar(`(f.(a[2], 0.7) ++ 0.2), Impulse.ar(MouseX.kr(1, 1000, 1))) * 0.001 }).play;\nNdef(\\vow, { Klank.ar(`(f.\n```"}, {"role": "assistant", "content": "A function to get the n loudest partials, or all partials louder than a threshold, for a formant filter using Klank and Vowel."}], "family": "D3", "source_id": "sccode:1-504", "aug": "patch", "prompt_tokens": 678, "answer_tokens": 43}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Some people have asked me to explain my sctweet \"basso gettato\" published in the web-album \"SC140\" by The Wire by an initiative of Dan Stowell. (http://supercollider.github.io/community/sc140.html)\n\n//Here is my attempt to explain the code:\n\n//original sctweet\nplay{x=165;b=SinOsc;p=Trig.ar(Saw.ar(x),1);y=b.ar(p*x);z=b.ar(p);(GVerb.ar(GrainIn.ar(2,y,y/2,z,p*z,-1),9))/9}//basso gettato #SuperCollider\n\n\n//p\n//creates a \"nice series\" of numbers above 0 and below 1 with the duration of 1 second\n{Saw.ar(165)}.plot(0.1) //simple sawtooth wave\n{Trig.ar(Saw.ar(165),1).poll}.play //get values just after the \"above 0\" jump\n{Trig.ar(Saw.ar(165),1)}.plot(30) //wait 30 seconds, go get a cofee, and come back to see the skyscraper profile of the \"nice numbers\" generated\n\n//z\n//is a variable LFO as it is a SinOsc with frequency argument equal to the current \"nice number\" generated by p\n{SinOsc.ar((Trig.ar(Saw.ar(165),1)).poll)}.play\n\n//y\n//is a faster version of z, as the sinusoids have the frequency values generated by the multiplication of p \"nice values\" and 165\n{SinOsc.ar((Trig.ar(Saw.ar(165),1)*165).poll)}.play \n\n//grainin\n// creates grains of z at y rate, duration is y/2 and pan of each gra\n```"}, {"role": "assistant", "content": "An attempt to explain my sctweet \"basso gettato\", published in the web-album \"SC140\" by The Wire by an initiative of Dan Stowell. (http://supercollider.github.io/community/sc140.html)."}], "family": "D3", "source_id": "sccode:1-4Zx", "aug": "patch", "prompt_tokens": 593, "answer_tokens": 78}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"plucking\", {arg amp = 0.1, freq = 220, decay = 5, coef = 0.1;\nvar env, snd;\nenv = EnvGen.kr(Env.linen(0, decay, 0.5), doneAction: 2);\nsnd = Pluck.ar(\n in: SinOsc.ar(0.5*freq, 0, amp),\n trig: Impulse.kr(0),\n\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n Out.ar(0, [snd, snd]);\n}).add;\n);\n(\nSynthDef(\\FreeVerb2x2, {|outbus, mix = 0.23, room = 0.42, damp = 0.666, amp = 1.0|\n var signal;\n\n signal = In.ar(outbus, 2);\n\n ReplaceOut.ar(outbus,\n FreeVerb2.ar( // FreeVerb2 - true stereo UGen\n signal[0], // Left channel\n signal[1], // Right Channel\n mix, room, damp, amp)); // same params as FreeVerb 1 chn version\n\n}).add;\nz = Synth(\\FreeVerb2x2, [\\outbus, 0], addAction:\\addToTail)\n);\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.locrian,\n \\degree, Prand([[-2.5, -4.001], [-7.002, -5], [-1, -3.003], [-1.005, -0.51], [-5, -3], [-4, -4], [0, 1]], inf),\n \\amp, Pseq([0.23, 0.042, 0.2, 0.32], inf),\n \\decay, Pseq([0.25,2.5, 0.025, 0.25], inf),\n \\coef, Pseq([0.3, 0.2, 0.9], inf),\n \\dur, Pseq([0.2, 0.01, 0.21, 0.001, 0.0001, 0.00911, 0.191, 0.23],inf)\n)\n```"}, {"role": "assistant", "content": "The final version had a preverb added to it in Audacity. It can be found here:\r\nhttps://modanung.bandcamp.com/track/return-of-the-king."}], "family": "D3", "source_id": "sccode:1-4Zk", "aug": "patch", "prompt_tokens": 696, "answer_tokens": 56}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//a SynthDef\n(\nSynthDef(\"plucking\", {arg amp = 0.1, freq = 220, decay = 5, coef = 0.1;\n\nvar env, snd;\nenv = EnvGen.kr(Env.linen(0, decay, 0.5), doneAction: 2);\nsnd = Pluck.ar(\n in: Saw.ar(freq, 0.5*amp),\n trig: Impulse.kr(0),\n\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n Out.ar(0, [snd, snd]);\n}).add;\n);\n\n//Bugger soundtrack\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.lydian,\n \\degree, Prand([[-2.5, -4.001], [-7.002, -5], [-1, -3.003], [1.005, 0.51]], inf),\n \\amp, Pseq([0.1, 0.2, 0.3, 0.4, 0.5, 0.5, 0.5, 0.5], inf),\n \\decay, Pseq([0.25,1, 0.5, 0.125], inf),\n \\coef, Pseq([0.7, 0.8, 0.9], inf),\n \\dur, Pseq([0.01, 0.0025, 0.2475, 0.24, 0.5], inf)\n).play;\n)\n```"}, {"role": "assistant", "content": "This will be the sound track for Bugger, a Frogger clone that started as a school assignment.\r\nSimple SynthDef using Pluck, and a few Pbinds. \r\n\r\nBugger can be found on [GitLab](https://gitlab.com/Modanung/Bugger)."}], "family": "D3", "source_id": "sccode:1-4Zj", "aug": "patch", "prompt_tokens": 480, "answer_tokens": 93}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// running this line will show all your MIDI ins and outs on the console\n// find the number of the output interface you want to use\nMIDIClient.init;\n\n// select the midi out you would like to use\nm = MIDIOut( 8 ).latency_(0.0);\n\n// send a sysex functions\n// some example messages MKS-50 here:\n// \"http://www.vintagesynth.com/roland/sysex.php\"\n// this one using MIDI CHANNEL 2 ( 0x01 )\n\n// set filter\n~set_param = { | param, value |\n m.sysex(Int8Array[ 0xF0, 0x41, 0x36, 0x01, 0x23, 0x20, 0x01, param, value, 0xf7]);\n};\n\n\n// connect will connect to all midi in devices\n// if you need to specify one,\n// check the sources at: MIDIClient.sources\n// and connect using MIDIIn.connect( source_index )\nMIDIIn.connectAll;\n\n// show incoming control data\n~control = { arg src, channel, control, value;\n \n // ( control + \" : \" + value ).postln;\n \n switch( control,\n 32, {\n // value.postln;\n // still have to convert value to hex number\n ~set_param.value( 0x10, value );\n });\n};\n\nMIDIIn.addFuncTo(\\control, ~control);\n```"}, {"role": "assistant", "content": "This snippet is a proof of concept showing how to map MIDI CC to MIDI Sysex messages.\r\n\r\nIt can be improved by filtering MIDI source, and routing channel and control number in a neater way.\r\n\r\nunfortunately i couldn't test this code on my synths, the CC part was tested."}], "family": "D3", "source_id": "sccode:1-4Zi", "aug": "patch", "prompt_tokens": 477, "answer_tokens": 96}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// connect will connect to all midi in devices\n// if you need to specify one,\n// check the sources at: MIDIClient.sources\n// and connect using MIDIIn.connect( source_index )\nMIDIIn.connect;\n\n// show incoming control data\n~control = { arg src, chan, num, val; \n [chan,num,val].postln; \n};\n\nMIDIIn.addFuncTo(\\control, ~control);\n```"}, {"role": "assistant", "content": "Simple example showing how to listen for MIDI control messages."}], "family": "D3", "source_id": "sccode:1-4Zh", "aug": "patch", "prompt_tokens": 182, "answer_tokens": 19}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\bass, { |outbus, midinote = 42|\n var freq = midinote.midicps;\n var subfreq = freq / 2;\n \n // Envelopes\n var subenv = EnvGen.kr(Env.perc(0, 1), doneAction:2);\n var env = EnvGen.kr(Env.perc(0, 0.5));\n \n // Component synthesis\n var pluck = Pluck.ar(PinkNoise.ar, 1, 0.2, subfreq.reciprocal) * subenv * 2;\n var tri = VarSaw.ar(freq) * env;\n var sin = SinOsc.ar(freq) * env;\n var sub = (SinOsc.ar([subfreq, subfreq - 2, subfreq + 2]).sum * subenv).tanh;\n var click = RLPF.ar(Impulse.ar(0), [2000, 8000], 1).sum * 1000;\n \n // Initial signal\n var sig = pluck + tri + sub + click;\n \n // Resonant LPFs\n sig = RLPF.ar(sig, XLine.ar(freq * 100, freq * 10, 0.15));\n sig = sig + (MoogFF.ar(sig, freq * 20, 2.5) * 0.1);\n \n // EQ resulting signal\n sig = BPeakEQ.ar(sig, 400, 0.5, -9);\n sig = BPeakEQ.ar(sig, 2000, 0.5, 6);\n sig = BHiShelf.ar(sig, 8000, 1, 3);\n sig = BPeakEQ.ar(sig, 200, 1, 3);\n \n // Apply another envelope to dampen a bit more\n sig = sig * XLine.kr(1, 0.6, 0.1);\n \n // Tanh distortion / limiting\n sig = (sig * 1).tanh;\n \n // Another round of signal coloring, using another RLPF\n // and sine components\n sig = sig + RLPF.ar(sig, XLine.ar(freq * 100, \n```"}, {"role": "assistant", "content": "In response to http://sound.stackexchange.com/questions/35138/help-me-make-a-patch-for-this-bass-stab-pluck\r\n\r\nListen at http://ericsluyter.com/sounds/noquarterbass.mp3."}], "family": "D3", "source_id": "sccode:1-4YY", "aug": "patch", "prompt_tokens": 677, "answer_tokens": 90}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\temposync, {\n | gate=1 tempo=1 tbeat=0 amp=0.5 pan=0 out=0 |\n var env, mult, sel, tmult, output;\n env = Env.asr(0.05, 1, 0.05).kr(2, gate);\n mult = 1;\n sel = MouseY.kr(6, 0).round;\n tmult = tempo*mult;\n output = Select.ar(sel, [\n Impulse.ar(tmult, (tbeat*mult)%1),\n SinOsc.ar(tmult, (tbeat*mult*2pi)%2pi),\n LFTri.ar(tmult, (tbeat*mult*4)%4), // 2\n LFSaw.ar(tmult, (tbeat*mult*2)%2),\n Saw.ar(tmult), // 4.\n LFPulse.ar(tmult, (tbeat*mult)%1)*2-1,\n Pulse.ar(tmult), // 6.\n ]); // NOTE: Saw and Pulse are not syncable because they have no phase inputs...\n output = LPF.ar(BrownNoise.ar, output.exprange(20,20000));\n Out.ar(out, Pan2.ar(output, pan, env * amp));\n}).add;\n\nPdef(\\lfo_demo, Pbind(\\instrument, \\temposync,\n \\dur, Pwhite(0.1, 1.0, inf),\n \\legato, 1,\n \\tbeat, Pfunc({thisThread.clock.beats}),\n \\tempo, Pfunc({thisThread.clock.tempo}),\n));\n```"}, {"role": "assistant", "content": "This code shows you how to tempo-sync the various oscillator types in SuperCollider. When you play the pattern, you should be able to hear that the output will sound fairly consistent, even though the pattern's \\dur is totally random. That is because the \\tbeat and \\tempo parameters are provided to the Synth via the pattern. It is possible to calculate what the starting phase of the oscillator sho."}], "family": "D3", "source_id": "sccode:1-4Xg", "aug": "patch", "prompt_tokens": 539, "answer_tokens": 119}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\na = Synth(\\MoaningDialogue)\n\n//COOL TWEAKS\n//AngryTweak\na.set(\\feedback, 29,\\freq, 6)\n//CalmTweak\na.set(\\feedback, 60, \\freq, 0.8)\n//WeirdTweak\na.set(\\feedback, 2.8, \\freq, 2)\n\n(\nSynthDef(\\MoaningDialogue, {\n |rateL = 0.2, rateR = 0.3, freq = 2, feedback = 50, mul = 1 , lpfreq = 2500|\n Out.ar(0,\n FreeVerb.ar(\n BLowPass.ar(\n SinOscFB.ar(\n LFDNoise1.kr([rateL, rateR], freq), feedback;\n , mul),\n lpfreq,\n 0.2\n ),\n 0.3,\n 0.0\n )\n )}\n).add\n)\n```"}, {"role": "assistant", "content": "One of the first synths I made.\r\nA frog-like sounding synth, with a dialogue between the left and the right channel.\r\nI've also notated some simple tweaks."}], "family": "D3", "source_id": "sccode:1-4Xe", "aug": "patch", "prompt_tokens": 338, "answer_tokens": 57}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n{ Pan2.ar(Klank.ar(`[[1, 2.2, 3.5, 4.9], nil, Array.series(4, 1, -0.2)], PinkNoise.ar(EnvGen.ar(Env.perc(0.001,0.01), Impulse.ar(4))), 0), 0); }.play;\n```"}, {"role": "assistant", "content": "I accidentally set the freqscale of a Klank to 0. What resulted was a surprisingly varied and dynamic bit of glitch. The joy of typos in SC :)."}], "family": "D3", "source_id": "sccode:1-4Xd", "aug": "patch", "prompt_tokens": 139, "answer_tokens": 55}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n( // first run synthdef\nSynthDef(\\piano, {|midinote, outBus=0|\n Out.ar(outBus, MdaPiano.ar(midinote.midicps, decay:0.5)); // from sc3-plugins\n}).add;\n);\n\n( // now the rest\n~dur = {|len1=4, len2=3|\n Plazy({\n var dur = len1;\n\n inf.do{|n|\n var overlap = (n % len1 == 0) || (n % len2 == 0);\n if(n>=len1 && dur==len1 && overlap,\n {\n dur=len2;\n },\n {\n if(n>0 && dur==len2 && overlap,\n {\n dur=len1;\n });\n }\n );\n dur.yield;\n };\n }).asStream;\n};\n\n~note = { |root=48|\n Plazy({\n var scale = Scale.major.degrees.flat;\n inf.do{|n|\n var oct = (n / scale.size).floor;\n var degree = 12*oct + scale.wrapAt(n) + root;\n degree.yield;\n }\n }).asStream;\n};\n\nr = Routine({\n var durStream = ~dur.value(9, 14.5);\n var noteStream = ~note.value(48);\n inf.do {\n var dur = durStream.next();\n var note = noteStream.next();\n fork{\n inf.do{\n Synth(\\piano, [\\midinote, note]);\n 4.yield; // loop duration\n };\n };\n dur.yield;\n };\n});\n\nr.play(TempoClock(2));\n)\n```"}, {"role": "assistant", "content": "An attempt at coding this algorithm:\r\nhttp://www.synthtopia.com/content/2014/12/22/the-molecular-music-box-how-simple-rules-can-lead-to-rich-patterns/\r\n\r\nI haven't really checked for errors, but is sounds ok.\r\n\r\nThere are a few other SC versions as well. See for example:\r\n\r\nhttp://www.kimri.org/blog/?p=487\r\n\r\nand\r\n\r\nhttp://sccode.org/1-4Ww."}], "family": "D3", "source_id": "sccode:1-4X3", "aug": "patch", "prompt_tokens": 595, "answer_tokens": 174}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nNdef(\\oneLine).play\n(\nNdef(\\oneLine,{\n var t, x, y, z, exp = 11, length;\n length = 2.pow( exp );\n\n t = PulseCount.ar( Impulse.ar( 8000 ) );\n\n y = InFeedback.ar( 16, 2 );\n\n x = ( t >> 6 | ( y * 2 << 3 ) );\n // x = ( t * 5 >> 12 ).bitXor( y * 3 << 6 & ( [ 16, 18 ] * t ) );\n\n Out.ar( 16, x);\n\n x % length / ( length - 1 ) * 2 -1 * 0.5;\n}\n)\n);\n\n(\nvar voices = 5;\nNdef(\\oneLine).clear;\nNdef(\\oneLine, {\n var t, x, y, z, exp = 11, length;\n length = 2.pow( exp );\n t = PulseCount.ar( Impulse.ar( 8000 ) );\n\n y = InFeedback.ar( 16, voices );\n\n x = ( t * 5 >> 12 )\n .bitXor( \n y * 3 << Demand.kr(\n Impulse.kr( 0.1 ! voices ) , \n 0, \n Drand( (3..11), inf ) \n ) & ( \n (13..17).choose.postln * t \n ) \n );\n\n Out.ar( 16, x);\n\n x % length / ( length - 1 ) * 2 - 1 * voices.reciprocal;\n}\n);\n\nNdef(\\y, { Splay.ar( LeakDC.ar( Ndef.ar(\\oneLine, voices) ) ) } ).play\n)\n```"}, {"role": "assistant", "content": "Based on the examples and references from \r\nhttp://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/one-liner-C-code-in-SC-td6854421.html#a6903794."}], "family": "D3", "source_id": "sccode:1-4X0", "aug": "patch", "prompt_tokens": 538, "answer_tokens": 94}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//NIMate \"Full Skeleton\" Kinect Theremin\n\n//Start server\n\ns.boot;\n\n\n//Start buses and OSC receivers\n\nb=Bus.control(s,3);\nc=Bus.control(s,3);\n\n\nOSCdef.new(\n \\rh_xyz,\n {\n |msg, time, addr, recvPort|\n postln(msg);\n b.setnSynchronous([msg[1],(msg[2]+1)/2,msg[3]+0.3]);\n },\n \"/Right_Hand\", nil, 7000\n);\n\n\nOSCdef.new(\n \\lh_xyz,\n {\n |msg, time, addr, recvPort|\n postln(msg);\n c.setnSynchronous([msg[1]+0.9,(msg[2]+1)/2,msg[3]+0.3]);\n },\n \"/Left_Hand\", nil, 7000\n);\n\n\nOSCdef(\\lh_xyz).enable;\nOSCdef(\\rh_xyz).enable;\n\n\n//Synth definition and bus mapping\n\nSynthDef(\\theremin,\n {\n |ctrl=#[0,0,0], ctrr=#[0,0,0]|\n var f, a, vibrate, tremrate;\n\n f = LinExp.kr(ctrr[0],0,1,100,1000);\n vibrate = LinExp.kr(ctrl[0],0,1,1,500);\n tremrate = 100*ctrl[1];\n\n a = SinOsc.ar(f + (f *\n SinOsc.ar(vibrate,0,0.1)),0,\n mul: ctrr[1])*\n SinOsc.kr(tremrate);\n\n Out.ar([0,1], a)\n }).add;\n\nx=Synth.new(\\theremin);\n\nx.map(\\ctrr,b);\nx.map(\\ctrl,c);\n\n\n//Clean up\n\nx.free;\nb.free;\nc.free;\ns.stop;\ns.quit;\n```"}, {"role": "assistant", "content": "Simple Theremin receiving OSC messages generated by NIMate via a MS Kinect.\r\nThe code is raw and contains arbitrary mapping. Works with \"Full Skeleton\" mode. Can be adapted to \"OSC control\" mode by changing \"/Right_hand\" and \"Left_Hand\" in the OSCDefs with the correct joint names. In that case You'd also need sigle channel buses.\r\nOSCDef and Bus definition and mapping could be of interest to whoev."}], "family": "D3", "source_id": "sccode:1-4Wg", "aug": "patch", "prompt_tokens": 679, "answer_tokens": 147}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\birdy, {arg freq=1500, amp=0.5, rate=10;\n var osc, son, convIn, rand;\n osc=LFCub;\n rand = LFNoise1.ar(rate);\n convIn=LinCongN.ar(rate);\n son = osc.ar(Convolution.ar(convIn,convIn));\n freq = Latch.kr(rand.range(0,1).round(0.1), rand) * freq;\n freq = osc.ar(osc.ar(rand)*rand.range(0,10)).range(freq, freq*3);\n son = Formlet.ar(son, freq, convIn.abs*0.1, rand.abs);\n son = Normalizer.ar(son, 0.9, 0.1) * convIn.abs * LFPulse.kr(LFPulse.kr(rand.abs), 0, rand.abs);\n son = son + GVerb.ar(son, 99, 2, mul: rand.range(0,0.3));\n son * amp\n}).play\n)\n```"}, {"role": "assistant", "content": "I just rewrote one of autocsi's tweets and came out with this which sounds like a digital bird of some kind:."}], "family": "D3", "source_id": "sccode:1-4Wd", "aug": "patch", "prompt_tokens": 371, "answer_tokens": 36}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n//fundamental pitch triad\n~notes = [45,55,60].midicps;\n\ns.waitForBoot({\n Routine{\n\n SynthDef.new(\\tone, {\n arg freq=440, pan=0, rel=0.05;\n var sig;\n sig = SinOsc.ar(freq);\n sig = sig * EnvGen.kr(Env.perc(0.005,rel), doneAction:2);\n sig = Pan2.ar(sig, pan, 0.05);\n Out.ar(0, sig);\n }).add;\n\n s.sync;\n\n 50.do{\n Pbind(\n \\instrument, \\tone,\n\n //trace some event times just for fun\n \\dur, Pseq(Array.geom(50, rrand(1.5,1.51), rrand(0.923,0.929)).mirror,inf).trace,\n\n \\freq, exprand(~notes[0],8000).round(~notes[0]),\n \\pan, rrand(-1.0,1.0),\n \\rel, exprand(0.005,0.35),\n ).play;\n\n Pbind(\n \\instrument, \\tone,\n \\dur, Pseq(Array.geom(50, rrand(1.5,1.51), rrand(0.923,0.929)).mirror,inf),\n \\freq, exprand(~notes[1],11000).round(~notes[1]),\n \\pan, rrand(-1.0,1.0),\n \\rel, exprand(0.005,0.35),\n ).play;\n\n Pbind(\n \\instrument, \\tone,\n \\dur, Pseq(\n Array.geom(50, rrand(1.5,1.51), rrand(0.923,0.929)).mirror,inf\n ),\n \\freq, exprand(~notes[2],15000).round(~notes[2]),\n \\pan, rrand(-1.0,1.0),\n \\rel, exprand(0.005,0.35\n```"}, {"role": "assistant", "content": "150 unique streams of harmonic sine waves ebb and flow, gradually drifting more and more out of phase."}], "family": "D3", "source_id": "sccode:1-4Wc", "aug": "patch", "prompt_tokens": 656, "answer_tokens": 35}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\bitshift, {\n var t = PulseCount.ar(Impulse.ar(8e3));\n var sig = HPF.ar(\n ( \n ((t * 15) & (t >> 5)) |\n ((t * 5) & (t >> [3, 4])) |\n ((t * 2) & (t >> 9)) |\n ((t * 8) & (t >> 11))\n - 3 % 256\n ) / 127-1 * 3\n , 20\n ).distort * 0.2; \n sig = Greyhole.ar(sig, sig, 0.5, sig).flop.mean/4;\n}).play;\n)\n```"}, {"role": "assistant", "content": "Not very original since I copied the bit code from http://schemawound.com/post/58980873930/bitwise and added a greyhole. But it sound so amazing I want to share it =)."}], "family": "D3", "source_id": "sccode:1-4Wa", "aug": "patch", "prompt_tokens": 229, "answer_tokens": 70}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nz = { exprand(100.0, 5000.0) } ! 20;\nNdef(\\x, {\n var in = Decay.ar(Dust.ar(MouseX.kr(0.0001, 0.1, 1) * z, 10), 0.3) * PinkNoise.ar(0.4 ! (z.size div: 3), 1);\n z = z * LFNoise1.ar(0.2 ! z.size).range(1, 2) * LFNoise0.ar(20 ! z.size).exprange(1, 1.8);\n Splay.ar(ComplexRes.ar(in, z, 10 / z)) * 2\n}).play\n);\n\n\n// this started out as a comparison between BPF and ComplexRes\n\n\n(\nz = [253.12, 2881.123, 2883.4, 1002.2, 882.01];\nNdef(\\x, {\n var in = Decay.ar(Dust.ar(5, 100), 0.3) * PinkNoise.ar(0.4, 1);\n ComplexRes.ar(in, z, 10 / z).sum\n}).play\n);\n\n\n(\nz = [253.12, 2881.123, 2883.4, 1002.2, 882.01];\nNdef(\\x, {\n var in = Decay.ar(Dust.ar(5, 100), 0.3) * PinkNoise.ar(0.4, 1);\n BPF.ar(in, z, (10 / z) * 2).sum\n}).play\n);\n\n(\nz = [253.12, 2881.123, 2883.4, 1002.2, 882.01];\nNdef(\\x, {\n var in = Decay.ar(Dust.ar(5, 100), 0.3) * PinkNoise.ar(0.4, 1);\n z = z * LFNoise0.ar(13).range(1, 2);\n ComplexRes.ar(in, z, 10 / z).sum\n}).play\n);\n\n\n(\nz = [253.12, 2881.123, 2883.4, 1002.2, 882.01];\nNdef(\\x, {\n var in = Decay.ar(Dust.ar(5, 100), 0.3) * PinkNoise.ar(0.4, 1);\n z = z * LFNoise0.ar(13).range(1, 2);\n BPF.ar(in, z, (10 / z) * 2).sum\n}).play\n)\n```"}, {"role": "assistant", "content": "playing around with ComplexRes UGen (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-4VX", "aug": "patch", "prompt_tokens": 732, "answer_tokens": 22}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n({var\n rf = 7\n , rt = Impulse.kr(rf)\n , bs = 8.collect({|i| PulseDivider.kr(rt, 16, i*2)})\n , bt = bs[0] + bs[2] + Dust.kr(SinOsc.kr(0.01, 0, 0.25, 0.25))\n , be = Decay.kr(bt, 0.2)\n , se = Decay.kr(bs[5]+bs[6], 0.01)\n , bass = be*SinOsc.ar(SinOsc.ar([5,6], 0, 20, \n Demand.kr(bt, 0, Drand((30..48), inf)).midicps\n ))\n , snar = se*SinOsc.ar(2000+[0, 5])\n , off = (LPF.kr(BrownNoise.kr([1,1]), 10)**(1/3))>0\n , hat = DelayL.kr(Decay.kr(Mix.kr(bs), 0.01), 20, rf.reciprocal*off)*PinkNoise.ar\n , line = Saw.ar(50)*0.1*(LFNoise0.kr(50)>0)*SinOsc.kr(0.1, 0, 0.4, 0.45)\n ;\n Out.ar(0, FreeVerb.ar(bass+snar + hat + line, \n SinOsc.kr(0.01, 0, 0.4, 0.5), \n 0.8, 0.5))\n}.play\n)\n```"}, {"role": "assistant", "content": "50 Hz line noise chasing your syncopated steps through the small and big rooms of an abandoned factory."}], "family": "D3", "source_id": "sccode:1-4VU", "aug": "patch", "prompt_tokens": 496, "answer_tokens": 33}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{ var nse, env, kic;\n kic = tanh(Ringz.ar(LPF.ar(Trig.ar(Impulse.ar(1.0),SampleDur.ir),1000),30,0.25,7).sin*2);\n env = Env.perc(0.05, 1, 1, -4);\n nse = BrownNoise.ar(2) + PinkNoise.ar(0.5) * EnvGen.kr(env,Impulse.kr(1), doneAction: 2);\n\n nse = Mix.ar(BPF.ar(nse,[100,1200,80,40,20],MouseX.kr(0,1),[1,0.2,1,1,1]));\n nse = LPF.ar(nse + kic, MouseY.kr(100,1000))! 2\n\n}.play\n)\n```"}, {"role": "assistant", "content": "A muffled thump. An attempt at a Jurassic Park © glass of water sort of thing - or breaking into a silo."}], "family": "D3", "source_id": "sccode:1-4VR", "aug": "patch", "prompt_tokens": 287, "answer_tokens": 41}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n ~needed_interval = 20;\n\n ~funk = {\n\n // if last time isn't defined, create it with 1000 seconds ago time\n if( ~last_time.isNil ) {\n ~last_time = Date.getDate.bootSeconds;\n ~last_time = ~last_time - 1000;\n };\n\n // if needed interval has passed, execute the funkie\n if( ( Date.getDate.bootSeconds - ~last_time ) > ~needed_interval ) {\n\n // safe last execution time, so next calls will have to wait the needed interval\n ~last_time = Date.getDate.bootSeconds;\n\n ( \"SOMETHING HAPPENS HERE AT MAXIMUN RATE OF 1 TIME EACH\" + ~needed_interval + \" SECONDS \" );\n\n } {\n ( \"YOU STILL HAVE TO WAIT\" );\n }\n };\n);\n\n~funk.value()\n```"}, {"role": "assistant", "content": "A friend of mine asked me how to limit a function to happen at maximun rate of 1 time every N seconds.."}], "family": "D3", "source_id": "sccode:1-4Vu", "aug": "patch", "prompt_tokens": 351, "answer_tokens": 28}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var input, sig = DC.ar(0);\n // Per-key trigger & envelopes\n var trig, env, qenv;\n // Each key's BPF Q attack time (global)\n var qtime = LFNoise2.kr(1).linexp(-1, 1, 0.1, 1);\n // Master trigger sum\n var master_trig = DC.kr(0);\n \n // Live input plus noise, pitch shifted, with a little dust\n input = ({ (SoundIn.ar(0) * 5) + (PinkNoise.ar * 0.5) } ! 2);\n input = input + PitchShift.ar(input, 0.2, 2, 0.5, 0.1);\n input = input + Dust2.ar(20, 2);\n \n // For each useful key on the keyboard... (123..126 are arrows)\n ((0..100) ++ (123..126)).do { |i|\n trig = KeyState.kr(i, 0, 1, 0);\n master_trig = master_trig + trig;\n env = Decay2.kr(trig, 0.01, 0.1) * 0.1;\n // Start wide, get narrow\n qenv = EnvGen.kr(Env([1, 0.01, 1], [qtime, 0.1], \\exp, 1), trig);\n // Randomly shifting frequency, pan strangely\n sig = sig + (BPF.ar(input * env, LFNoise1.kr(0.1).range(10, 100).midicps, qenv) * ({ LFNoise0.kr(1).range(0, 1) } ! 2));\n };\n \n // Mouse funkiness\n master_trig = master_trig + MouseButton.kr(0, 1, 0);\n sig = sig + BMoog.ar(MoogFF.ar(input * Decay2.kr(MouseButton.kr(0, 0.02, 0), 0.001, 0.5), MouseY.kr(500, 10000, \\exponential)), MouseX.kr(100, 1000, \\exponen\n```"}, {"role": "assistant", "content": "Type and click while breathing into microphone and still pretend not to be insane."}], "family": "D3", "source_id": "sccode:1-4Vr", "aug": "patch", "prompt_tokens": 671, "answer_tokens": 26}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"plucking\", {arg amp = 0.1, freq = 440, decay = 5, coef = 0.1;\n\nvar env, snd;\nenv = EnvGen.kr(Env.linen(0, decay, 0), doneAction: 2);\nsnd = Pluck.ar(\n in: WhiteNoise.ar(amp),\n trig: Impulse.kr(0),\n\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: coef);\n Out.ar(0, [snd, snd]);\n}).add;\n);\n\n// Example 1\n(\nPbind(\n \\instrument, \"plucking\",\n \\freq, Pwhite(440, 880),\n \\amp, 0.1,\n \\decay, 4,\n \\coef, 0.1,\n \\dur, Prand([0.51, 0.1, 0.1], inf)\n).play;\n);\n\n// Example 2\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.locrian,\n \\degree, Pwhite(7, 15),\n \\amp, Pwhite(0.1, 0.5),\n \\decay, Pwhite(7, 12),\n \\coef, Pwhite(0.01, 0.1),\n \\dur, Prand([0.1, 0.2, 0.4, 0.27, 0.13, 0.38], inf)\n).play;\n);\n\n// Example 3\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.lydian,\n \\degree, Pseq([8, 17, 8, 9, 8, 17, 7], inf),\n \\amp, Pwhite(0.1, 0.5),\n \\decay, Pwhite(1, 2),\n \\coef, Pseq([0.7, 0.8, 0.4], inf),\n \\dur, Prand([0.1, 0.2, 0.4], inf)\n).play;\n);\n\n// Example 4\n(\nPbind(\n \\instrument, \"plucking\",\n \\degree, Pseq([-5, -2, 1, 4, 6, 9], inf),\n \\mtranspose, -7,\n \\\n```"}, {"role": "assistant", "content": "Simple SynthDef using Pluck, and a few Pbinds demonstrating making use of it."}], "family": "D3", "source_id": "sccode:1-4Vj", "aug": "patch", "prompt_tokens": 681, "answer_tokens": 29}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~loadChunks = { |server, path, startFrame = 0, numFrames = -1, action, chunkSize = 1048576|\n var sf, numCh, bufs, incr = 0;\n sf = SoundFile.openRead(path);\n if(sf.isOpen) {\n numCh = sf.numChannels;\n if(numFrames < 0) {\n numFrames = sf.numFrames - startFrame;\n } {\n numFrames = min(numFrames, sf.numFrames - startFrame);\n };\n sf.close;\n bufs = Buffer.allocConsecutive((numFrames / (chunkSize - 1)).roundUp, server, chunkSize, numCh);\n {\n server.sync;\n bufs.do { |buf, i|\n buf.read(path, startFrame + incr, chunkSize, 0);\n server.sync;\n incr = incr + chunkSize - 1; // overlap 1 sample for interpolation\n };\n action.value(bufs);\n }.fork(AppClock);\n bufs\n } {\n \"% could not be opened.\".format(path).warn;\n };\n};\n);\n\nb = ~loadChunks.value(s, \"your-file.aiff\", action: { \"done\".postln });\n\n(\nSynthDef(\\playchunks, { |out = 0, bufnum, numbufs = 1, rate = 1, amp = 0.1|\n var phaseTrigFb = LocalIn.ar(1),\n frames = BufFrames.kr(bufnum),\n phase = Phasor.ar(phaseTrigFb, rate, 1, frames + 1000, 1),\n phaseTrig = phase >= (frames - 1),\n bufOffset = PulseCount.ar(phaseTrig),\n sig = BufRd.ar(2, bufnum + bufOffset, ph\n```"}, {"role": "assistant", "content": "One of the common questions on the list is about handling very large sound files with BufRd. BufRd indexes into the buffer using a single-precision float, which supports buffers only up to 2**24 frames (a bit more than six minutes at 44.1 kHz).\r\n\r\nThis approach loads sequential chunks of a sound file into buffers that are within reach of BufRd. Then, the SynthDef can advance from one buffer to the."}], "family": "D3", "source_id": "sccode:1-4Vi", "aug": "patch", "prompt_tokens": 639, "answer_tokens": 139}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"partial2\",{|gate=1,att,dec,rel,freq,cut,req,fenv,amp|\n var a = Mix.new(LFSaw.ar([freq,freq*3],[0,pi],mul:[0.5,0.5])*EnvGen.kr(Env.adsr(att,dec,releaseTime:rel),gate,levelScale:0.3,doneAction:2));\n var b = RLPF.ar(a,SinOsc.kr(fenv,mul:cut/2,add:cut/2)*EnvGen.kr(Env.perc,gate,doneAction:2),req);\n Out.ar(0,b*amp!2);\n}).add();\n);\n\n~f={|deg,freq,root=50| Scale.minorPentatonic.degreeToFreq(deg,root.midicps,1)*freq}\n\nPbind(\\instrument,\\partial2,\\amp,0.3,\\scale,Scale.minorPentatonic,\\dur,Pseq([1.5,1,0.5,1],inf),\\mtranspose,-10,\\degree,Pseq([Pseq([[1,7],[4,6],[2,5],[3,1]],3),Pseq([[6,5],[2,7],[1,3],[8,2]],1)],inf),\\cut,Prand(Array.fill(8,{|i| ~f.value(rrand(1,7),i+1)}),inf),\\req,Prand([0.7,0.5],inf),\\att,Pseq([0.02,0.04],inf),\\dec,Prand([0.1],inf),\\rel,Pseq([1],inf),\\fenv,Pseq([0.01,2,0.05,4],inf)).play;\n```"}, {"role": "assistant", "content": "In the process of learing abstract algorithm\r\nhttps://soundcloud.com/pierrealainbourdil/substractive-synthesis."}], "family": "D3", "source_id": "sccode:1-4Vg", "aug": "patch", "prompt_tokens": 613, "answer_tokens": 44}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\np = ProxySpace.push(s.boot);\n~a.play.quant_(4); ~b.play.quant_(4);\n~c = { LFNoise1.kr(8).range(0,15).round };\n~a = Pbind(\\degree, Pstutter(4, Pseq([0,2,3,4], inf)), \\octave, [3,4], \\dur, 0.25, \\amp, 0.3);\n~b = Pbind(\\octave, 4, \\scale, Scale.majorPentatonic, \\degree, ~c, \\dur, 1/4, \\legato, 0.5);\n```"}, {"role": "assistant", "content": "a short piece which plays random major music. It sounded very happy."}], "family": "D3", "source_id": "sccode:1-4Vf", "aug": "patch", "prompt_tokens": 226, "answer_tokens": 18}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// where did I leave my keys?\n(\nvar n = 30, m = 5;\nNdef.clear(3);\nNdef.ar(\\x, n);\nNdef(\\y, { Splay.ar(Ndef.ar(\\x, m, LFNoise1.kr(1/m).range(0, n - m - 1))).clip2 * 0.5 }).play; \nNdef(\\x, { \n { \n var a = Ndef.ar(\\x, 1, LFNoise0.kr(Rand()) * Rand() + Rand() * n);\n a + 0.1 * SinOsc.ar(ExpRand(0.2, 1000)) \n } ! n\n}); \n);\n\n// where did I put my keys?\n(\nvar n = 30, m = 5;\nNdef.clear(3);\nNdef.ar(\\x, n);\nNdef(\\y, { Splay.ar(Ndef.ar(\\x, m, LFNoise1.kr(1/m).range(0, n - m - 1))).clip2 * 0.5 }).play; \nNdef(\\x, { \n {\n var a = Ndef.ar(\\x, 1, LFNoise0.kr(Rand()) * Rand() + Rand() * n);\n SinOsc.ar(ExpRand(0.2, 1000), a) \n } ! n\n}); \n)\n```"}, {"role": "assistant", "content": "Cross-tuning between multiple signal dimensions. The code is finished without listening."}], "family": "D3", "source_id": "sccode:1-4Ve", "aug": "patch", "prompt_tokens": 422, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\nodeTest, {\n // the input\n// var input = Impulse.ar([1, 3, 5].reciprocal * 1, phase: [0, 0.25, 0.5]).sum;\n\n //var input = Impulse.ar([2, 3], phase: [0, 0.25]).sum;\n// var input = Select.ar(Line.kr(0, 1, 10) * SinOsc.ar(0.01).range(0, 1), [Impulse.ar([0.2, 0.3], phase: [0, 0.25]).sum, LocalIn.ar(1)]);\n\n var input = Select.ar(Line.kr(0, 1, 10), [Impulse.ar(0.134), LocalIn.ar(1)]);\n // the nodes, each takes its predecessor as input and estimates the duration between two events.\n var nodes = (1..20).inject([input], {|last, item|\n var dur = Gate.ar(\n Timer.ar(TDelay.ar(last.first, Rand(1, 4))),\n last.first\n );\n\n [TDuty.ar(\n dur.lag(20),\n TDelay.ar(last.first, dur.lag(20)),\n 1\n )] ++ last\n });\n\n\n LocalOut.ar(nodes.first);\n\n // add a pitch to each\n nodes = nodes.collect{|node, i| SinOsc.ar((500 + (i*250)), 0.9pi)\n// * Decay2.ar(node, 0.01, 0.2)\n * EnvGen.ar(Env.perc(0.0001, 0.1), gate: node)\n * 2 * (25-i) * 0.01};\n\n // splay in stereo field\n //nodes.sum!2;\n Splay.ar(nodes)// + (SinOsc.ar(2000) * Decay2.ar(input, 0.01, 0.2) * 0.1);\n\n}).play\n)\n```"}, {"role": "assistant", "content": "Idea: network of loosely connected nodes. Each node has a dedicated pulse rate / phase. Inducing an irregular trigger signal influences the nodes to (gradually) adapt their pulsation freq (and phase?) to the one of the input.\r\nsound example: https://soundcloud.com/lfsaw/sync-weakconnection-tduty-time."}], "family": "D3", "source_id": "sccode:1-4Vb", "aug": "patch", "prompt_tokens": 641, "answer_tokens": 124}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// Simple amplitude tracker sending values to sclang\nSynthDef(\\ampTracker, { |in|\n var freq = 30; // num of values per second\n SendReply.kr(Impulse.kr(freq), '/amp', Amplitude.kr(SoundIn.ar(in)));\n}).add;\n);\n\n// start the tracker on scsynth\nSynth(\\ampTracker);\n\n(\n// receive the values in sclang\nOSCdef(\\ampTracker, { |m|\n m.postln;\n // now use m[3] for your purpose (detecting changes, etc...)\n}, '/amp');\n)\n```"}, {"role": "assistant", "content": "It's jsut an amplitude tracker, to exaplin how to send values from scsynth to sclang."}], "family": "D3", "source_id": "sccode:1-4V8", "aug": "patch", "prompt_tokens": 240, "answer_tokens": 34}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// Set things up, and start the Synth\ns.waitForBoot {\n SynthDef(\\oscplayer,{ arg out = 0, bufnum;\n var signal;\n signal = Osc.ar(bufnum, MouseX.kr(60, 300));\n Out.ar(out, signal ! 2)\n }).add;\n\n z = { Env([0] ++ rrand(-0.5, 0.5!5) ++ 0, [0.1, 0.2, 0.05, 0.3, 0.4, 0.1].scramble, \\sin).asSignal(512) };\n a = z ! 2;\n // a[0] is the start waveform, a[1] is the target to morph to...\n a.plot;\n\n c = a[0].asWavetable;\n b.free; b = Buffer.alloc(s, c.size); // 1024: twice the size of the 512-element signal!\n s.sync;\n b.setn(0, c);\n\n x = Synth(\\oscplayer, [\\bufnum, b]);\n};\n);\n\n(\n// Do interpolation from one wave to another\nfork {\n var fadeTime = 5; // seconds\n var stepSize = 0.025; // seconds\n var numSteps = fadeTime / stepSize;\n \"Fading...\".postln;\n numSteps.do { arg i;\n var interp = i / (numSteps - 1);\n var interpSignal = a[0] * (1 - interp) + (a[1] * interp);\n b.setn(0, interpSignal.asWavetable);\n (fadeTime/numSteps).wait;\n };\n \"...done!\".postln;\n};\n);\n\n(\n// Generate a new target buffer, then run the fork above again to morph to new wave!\na[0] = a[1];\na[1] = z.value;\na.plot;\n);\n\nx.free; b.free;\n```"}, {"role": "assistant", "content": "This is in response to a question on sc-users, with subject: [Envelope as signal](http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Envelope-as-signal-td7603680.html), about how to morph between two different Envelopes-as-wavetables...\r\n\r\nI tried to do one with double-buffering and cross-fading between the two buffers using XFade2.ar, but it gave me a sort of \"pulsing\"."}], "family": "D3", "source_id": "sccode:1-4V1", "aug": "patch", "prompt_tokens": 624, "answer_tokens": 169}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~name = \"saw\";\n\nSynthDef(~name, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2, ffreq=300, rq=0.3;\n var sig;\n sig = LFSaw.ar(freq);\n sig = RLPF.ar(sig, ffreq, rq);\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);\n sig = Splay.ar(sig, spread, amp, pan);\n Out.ar(out, sig);\n}).add;\n\n\n~morph = { arg mainkey, lagtime, pat;\n var base = pat.asStream.next(());\n var bind = List.new;\n var proxy;\n base.keysValuesDo { arg key, val;\n var ndefkey = \"%.%\".format(mainkey, key).asSymbol;\n Ndef(ndefkey, { \n Line.kr(Ndef(ndefkey).kr, val, lagtime)\n });\n proxy = Ndef(ndefkey);\n bind.add(key);\n bind.add(proxy.bus.asMap);\n };\n Pbind(*bind)\n};\n);\n\n\nPdef(~name).play;\n\n\n(\n// preset 1\n\n~a = Pdef(~name, ~morph.(\\bla, 2.1, Pbind(\n \\freq, 100,\n \\ffreq, 1300,\n)) <> Pbind(\n \\instrument, ~name,\n \\dur, 1,\n));\n\n);\n\n(\n// preset 2\n\n~a = Pdef(~name, ~morph.(\\bla, 1, Pbind(\n \\freq, 1500,\n \\ffreq, 200,\n)) <> Pbind(\n \\instrument, ~name,\n \\dur, 1,\n));\n\n);\n```"}, {"role": "assistant", "content": "When you understand that Ndef can be used to modulate pattern keys, it opens a whole new world."}], "family": "D3", "source_id": "sccode:1-4UY", "aug": "patch", "prompt_tokens": 631, "answer_tokens": 27}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\pitchTrack, {\n var soundin = SoundIn.ar(0);\n var zc = ZeroCrossing.ar(soundin);\n // var pt = Pitch.kr(soundin);\n // var tt = Tartini.kr(soundin);\n SendReply.kr(Impulse.kr(1), '/pitchTrackUtil', [zc, zc.cpsmidi]);\n}).add;\n\n~pitchTrack = {\n if(~pitchTrackSynth.isNil or: { ~pitchTrackSynth.isRunning.not }, {\n ~pitchTrackSynth = Synth(\\pitchTrack);\n ~pitchTrackNW = NodeWatcher.register(~pitchTrackSynth);\n }, {\n ~pitchTrackSynth.free;\n ~pitchTrackSynth = nil;\n \"Pitch tracker stopped.\".postln;\n });\n};\n\n~pitchTrackOSCFunc = {\n OSCFunc({\n | msg |\n (\"Pitch:\"+msg[3].round.asString.padLeft(5)+msg[4].round.asString.padLeft(3)).postln;\n }, '/pitchTrackUtil');\n};\n\n~pitchTrackOSCFunc.();\n\nCmdPeriod.add({~pitchTrackOSCFunc.();});\n```"}, {"role": "assistant", "content": "This is a small utility i wrote to make it easy to detect the pitch of incoming audio (i.e. your voice into your mic). I recommend binding the execution of \"~pitchTrack.();\" to a keyboard shortcut in your editor/IDE. It's incredibly convenient to just input a hotkey and instantly see information about the current frequency and MIDI note number for the incoming audio. Because of how i've written ~p."}], "family": "D3", "source_id": "sccode:1-4UW", "aug": "patch", "prompt_tokens": 498, "answer_tokens": 138}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// For a long time I was thinking of what would be the best way to do this: function composition (functors) in live coding with patterns - it seems all in place anyway.\n\n// some synthdef\n(\nSynthDef(\\Pdefhelp, { arg out, freq, sustain=1, amp=1, pan;\n var env, u=1;\n env = EnvGen.kr(Env.perc(0.03, sustain), 1, doneAction:2);\n 3.do { var d; d = exprand(0.01, 1); u = SinOsc.ar(d * 300, u, rrand(0.1,1.2) * d, 1) };\n Out.ar(out, Pan2.ar(SinOsc.ar(u + 1 * freq, 0, amp * env), pan));\n}).add;\n);\n\nPdef(\\stut, { Pstutter(~stutter ? 1, ~pattern) }); // this defines a function that maps one pattern to another.\nPdef(\\x, Pbind(\\instrument, \\Pdefhelp, \\note, Pseq([0, 4, 7, 3, 0, 1, 0], inf)));\nPdef(\\y, Pdef(\\stut) <> (pattern: Pdef(\\x), stutter: Pseq([2, 2, 4, 3], inf)) <> (dur: 0.1, legato: 0.2)).play;\nPdef(\\y, Pdef(\\stut) <> (pattern: Pdef(\\x), stutter: Pseq([2, 2, 4, 3], inf)) <> (dur: 0.1, legato: 0.2)).play;\n\n\n// Up to a certain point, this also works for non-event-patterns:\n\n// pattern as an argument\nPdefn(\\x, Pseq([1, 2, 5, 6, 7], inf));\nPdefn(\\x); // omitting the second argument, we can access the proxy\nPdefn(\\x).asStream.nextN(20); // ... play one event stream\nPdefn(\\x).source.\n```"}, {"role": "assistant", "content": "A simple example that shows of how to build higher-level patterns using Pdef."}], "family": "D3", "source_id": "sccode:1-4UV", "aug": "patch", "prompt_tokens": 631, "answer_tokens": 21}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\Synth3,\n {arg ress = 0;\n var klank, env;\n klank = Klank.ar(`[{Rand(70,21000)}!7, {Rand(0.128,0.700)}!7],BrownNoise.ar(0.7));\n klank = klank;\n env = EnvGen.kr(Env.perc(0.07, ress), doneAction:2);\n Out.ar(0, klank*env.dup*0.0128);\n}).add;\n)\n\n\n{inf.do{x = rrand(0.01,0.7); Synth(\\Synth3, [\\ress, x+(7*x)]); x.wait;}}.fork\n```"}, {"role": "assistant", "content": "Play around with {Rand(70, 21000)}!7\r\n\r\nA simple example for the begginers... hope I can contribute to something =)."}], "family": "D3", "source_id": "sccode:1-4UT", "aug": "patch", "prompt_tokens": 262, "answer_tokens": 41}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Script for generating fractal noise by cascading N first order filters. From: \"The Sounding Object\", chapter 8\ns.boot; s.scope\n\n(\nvar fp1,n,fp,fo,a,b,beta,t,norm;\n\nfp1 = 50; // frequency of first pole\nn = 6; // nr. of poles\nh = 2; // density of poles per frequency decade\nbeta = 1; // spectral parameter\nt = s.sampleRate.reciprocal ? 44100.reciprocal; // sampling period\nnorm = exp(beta).reciprocal**1.72;\n\nfp = Array.newClear(n).put(0,fp1); // pole frequencies\nfo = Array.newClear(n); // zero frequencies\na = Array.newClear(n); // pole coefficients\nb = Array.newClear(n); // zero coefficients\n\nn do: { |i|\n (i > 0).if { fp[i] = 10**h.reciprocal*fp[i-1] };\n fo[i] = 10**(0.5*beta*h.reciprocal)*fp[i];\n a[i] = exp(-2pi*fp[i]*t);\n b[i] = exp(-2pi*fo[i]*t)\n};\n\nSynthDef(\\fractalNoise,{ arg out=0;\n var signal = WhiteNoise.ar(1!2);\n n do: { |i| signal = FOS.ar(signal,1,b[i].neg,a[i]) };\n Out.ar(out,norm*signal)\n}).add;\n);\n\n// test it\ns.sendMsg('/s_new',\\fractalNoise,s.nextN\n```"}, {"role": "assistant", "content": "This code generates fractal noise by cascading N first order filter sections. beta = 0 -> white noise, beta = 1 -> pink noise, beta = 2 -> brown noise. Not too sure about the normalization constant, since it is purely based on empirical reasoning, but it seems to work pretty well."}], "family": "D3", "source_id": "sccode:1-4UN", "aug": "patch", "prompt_tokens": 610, "answer_tokens": 96}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Tracking audio data\n///////////////////////////////////\n\nSynthDef(\\pulse,{\n var sig, chain, onsets;\n sig = SinOsc.ar(Rand(220.0,440.0))\n *EnvGen.ar(Env.perc(releaseTime:0.5),Dust.ar(0.5))*0.7;\n Out.ar(0,sig !2);\n //\n chain = FFT({LocalBuf(512, 1)}, sig);\n onsets = Onsets.kr(chain,0.1,\\power);\n SendTrig.kr(onsets);\n SendPeakRMS.kr(sig, 20, 3, \"/replyAddress\");\n}).add;\nSynth(\\pulse)\n\n~host = NetAddr(\"localhost\", 4859); // address de PROCESSING\n\n\no = OSCFunc({ arg msg, time;\n [time, msg].postln;\n ~host.sendMsg(\"/trigger\",42,12.34,\"hello processing\");\n},'/tr', s.addr);\n\np = OSCFunc({ |msg|\n \"peak: %, rms: %\".format(msg[3], msg[4]).postln\n}, '/replyAddress');\n\n//////////////////////////////////////////////////////////////////////\n///////////////////////////////////////////////////////////////////////\n\n// Processing code\n\n// OSC RECEIVE\nimport oscP5.*;\nimport netP5.*;\n\nOscP5 oscP5; // objet for OSC send and receive\nNetAddress myRemoteLocation; // objet for service address\n\nvoid setup() {\n size(400,400);\n oscP5 = new OscP5(this,4859); // start OSC and listen port ...\n // set remote location to localhost SuperColider port\n myRemoteLocation = new NetAddre\n```"}, {"role": "assistant", "content": "first in SC i analyse audio data with some useful UGens: Onsets, SendTrig and SendPeakRMS;\r\nthis data is then polled back to de client and dispatched to Processing via NetAddr and OSCFunc classes\r\nin Processing i receive the incoming messages and simple trig a draw function with the callback oscEvent (use oscP5 and netP5 libs."}], "family": "D3", "source_id": "sccode:1-4UL", "aug": "patch", "prompt_tokens": 693, "answer_tokens": 130}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n~name = 'xfiles';\nSynthDef(~name, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2, \n ifreq=5, maxdelaytime=0.05, delaytime= 0.05, decaytime=0.2, ffreq=1000, rq=0.3;\n var sig, sig1, sig2, sig3;\n sig = BPF.ar(\n Pluck.ar(\n Crackle.ar(\\crackle.kr([1.9,1.8])),\n Impulse.ar(ifreq),\n maxdelaytime,\n delaytime,\n decaytime\n ),\n ffreq,\n rq\n );\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);\n sig = Splay.ar(sig, spread, amp, pan);\n Out.ar(out, sig);\n}).add;\n);\n\n\n(\n\nPdef(~name, Pbind(\n \\instrument, ~name,\n \\maxdelaytime, 0.15,\n \\delaytime, Pwhite(0.0001,0.010),\n \\ifreq, Pseq([3,5.2,2,4.33],inf),\n \\ifreq, Pwhite(4.1,18.1),\n \\legato, 1.5,\n \\dur, 1/8 * Pwhite(0.9,1.9),\n \\amp, 4.0\n)).play;\n\n);\n```"}, {"role": "assistant", "content": "I always liked this sound when watching X-Files, then I re-created it by chance =) (fork of the tweet 0007 by redFrik)."}], "family": "D3", "source_id": "sccode:1-4Ur", "aug": "patch", "prompt_tokens": 517, "answer_tokens": 47}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{ var lk = [0,3,7,9], jx = [3,4,2,4,2], n, ox = 10, qw, cx, oi,z,w, faz, mp,\n cs = [Select,Stepper,RLPF,LFTri,Pulse,PulseDivider,Lag2,Lag,EnvGen,\n Saw, LPF, PitchShift, AllpassN, Env, LocalIn, LocalOut, Impulse ];\n var fa,ffa, ra, eca, era, fsa, xc, fxc, rq, ec, er,xcs, o,e;\n mp = {… |n,alk| alk = alk ? lk; \n {midicps(jx .choose * 12 + lk.choose) } !n }; \n faz = [ mp.(3)* 2.midiratio, mp.( 3 )\n *1. midiratio, mp.( 2,[ 0,3,9 ])*5.midiratio,mp.(1 )*1.midiratio ]; \n fa = faz[[3,0,3,1,2,2,2,2, 1,1,1,1,0,3]].flat; \n n = fa.size; \n qw = Impulse.kr(10); \n cx = PulseDivider.kr(qw, n); \n oi = Stepper.kr(qw,0,0,n-1); \n fsa = { [0,0,0, 0.02,0.08,0.1 ].choose }!div(n,4); \n xcs = Select.kr( Stepper.kr( qw,0,0,fsa.size-1 ), fsa); \n xc = Lag2.kr( Select.kr(oi, fa), xcs ); \n ffa = { rrand( 20, 90 ) } ! n;\n ffa.size.do({ |i| var pn = [2,4,8].choose;\n if ( 0.2.coin, { ffa[i] = Select.kr(Stepper.kr(cx, 0,0,pn-1), { rrand( 4, 70 ) } ! n) }) });\n fxc = Lag2.kr( Select.kr(oi, ffa), 0.04);\n ra = { rrand(0.05,0.5) } ! n;\n rq = Lag.kr( cs[0].kr(oi, ra), 0.04);\n eca = { [-4,0,-1].choose } ! n;\n ec = Select.kr(oi,eca);\n o = Saw.ar(xc) + Pulse\n```"}, {"role": "assistant", "content": "i found this somewhere as an example of obtrusive coding. i don't know who the original author is, sorry. I cleaned it a bit up as a study tool for myself. (learned a lot from this patch)."}], "family": "D3", "source_id": "sccode:1-4Uf", "aug": "patch", "prompt_tokens": 838, "answer_tokens": 61}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{ var arr, x, c, y, p, n, ff, fx, fy, pp, ppv, ppb, ppbv, d, dd, ddarr, ddarrs, ddd, dddd, clar, cl, cn, cy, cs, fl, z1, z2, mx, v, out;\n\n arr = [60,74,65,64,62,67,69,65,64,62].scramble.midicps;\n n = arr.size;\n x = Impulse.kr(8);\n c = Stepper.kr(CoinGate.kr(0.8,x),0,0,n-1);\n y = Select.kr(c, arr);\n p = Lag2.kr(y,0.01);\n ff = { rrand(100, 2000) } ! n;\n fx = Select.kr(c, ff);\n fl = Lag2.kr(fx, SinOsc.kr(0.2, 0, 1, 1));\n z1 = SinOsc.ar(p,0,1).tanh;\n fy = MoogVCF.ar(z1, fl, 0.6).tanh.clip2;\n v = FreeVerb2.ar(fy, fy, SinOsc.kr( 0.2, 0.9, 0.08, 0.3), 1);\n\n\n\n ddarr = [38, 38, 38, 42, 42, 36, 36].midicps;\n ddarrs = ddarr.size;\n d = Stepper.kr(PulseDivider.kr(x, 4), 1, 0, ddarrs-1);\n dd = Select.kr(d, ddarr);\n ddd = SinOsc.ar(dd, 0, 0.2).tanh;\n\n pp = HPF.ar(BPF.ar(Saw.ar([440,330], 0.1), fx, 1 ), 400);\n ppb = DelayC.ar(pp, 0.2, SinOsc.kr(0.1, 0, 1, 0), 1, 0.5);\n ppv = FreeVerb.ar(pp, pp, 0.5, 0.5, 1);\n\n clar = [0.1, 0.3, 0.1];\n cn = clar.size;\n cl = Stepper.kr(CoinGate.kr(0.7,x),0,0,cn-1);\n cy = Select.kr(cl, clar);\n cs = RLPF.ar(WhiteNoise.ar(cy)*0.7, SinOsc.kr(0.1, 0, 500, 1500), 0.3, 0.5);\n\n\n mx = Limiter.ar(Mix.ar([v, ppv*0.7, ddd*0.7, cs*0.5]));\n\n\n\n}.play\n)\n```"}, {"role": "assistant", "content": "my first SC patch. nothing special but i wanted to create something musical that is slightly different each time the code gets evaluated. Needs JoshUgens and maybe others."}], "family": "D3", "source_id": "sccode:1-4Ue", "aug": "patch", "prompt_tokens": 827, "answer_tokens": 53}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nq = q ? ();\n\n(\nq.s1 = {|q, left, item, right, rContextSize|\n //[left, item, right].postln;\n ((maxItem(item - left) ? 0) + (maxItem(item - right) ? 0)) * 0.5\n};\n\nq.peak1 = {|q, signal, windowSize = 4|\n var mean, sDev, aAbs, peaksSize;\n var rWindowSize = windowSize.reciprocal;\n var h = 3; // 1<= h <= 3\n var idxs = List[];\n var a = signal.collect{|val, i|\n // compute peak function value for each of the N points in T\n q.s1(\n signal.copyRange(i-windowSize, i-1), \n val, \n signal.copyRange(i+1, i + windowSize), \n val\n );\n };\n // Compute the mean m and standard deviation s of all positive values in array a;\n aAbs = a.abs;\n mean = aAbs.mean;\n sDev = aAbs.stdDev;\n\n// mean.postln;\n// sDev.postln;\n \n\n a.do{|val, i| // collect all indices that are concidered big \n if ((a[i]>0) && ((a[i]-mean) > (h*sDev))) {\n idxs.add(i);\n }\n };\n peaksSize = idxs.size.postln;\n\n // retain only one peak of any set of peaks within windowSize of each other\n idxs.inject([0], {|last, now, i|\n ((now - last.last) <= windowSize).if({\n (signal[now] > signal[last.last]).if({\n last.pop;\n last ++ now;\n }, {\n last;\n })\n }, {\n\n```"}, {"role": "assistant", "content": "after http://www.tcs-trddc.com/trddc_website/pdf/SRL/Palshikar_SAPDTS_2009.pdf."}], "family": "D3", "source_id": "sccode:1-4Ud", "aug": "patch", "prompt_tokens": 615, "answer_tokens": 56}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(//*********PREPARE**********\np.pop;\n//Any code that needs to access your own environment goes here\np = ProxySpace.push(s);\n~fxLoop.play.fadeTime_(5);\n);\n\n(//*********FXLoop**********\n~fxLoop = {\n var in = SoundIn.ar([0,1]);\n // in = in + (in * SinOsc.ar(LFTri.ar([0.1, 0.09]).range(215, 321)));\n in = in + CombC.ar(in, 2, SinOsc.ar(0.015).range(0.5, 1) * [0.13, 0.17], 7);\n in = in + CombC.ar(in, 2, SinOsc.ar(0.01).range(0.5, 1) * [0.1, 0.15], 7);\n in = in + CombC.ar(in, 2, [1.5, 1.0], 7);\n in = in + GVerb.ar(in, 10);\n in = in / 3;\n in;\n}\n)\n```"}, {"role": "assistant", "content": "Audio Sample: https://soundcloud.com/schemawound/supercollider-guitar-fx-test."}], "family": "D3", "source_id": "sccode:1-4U5", "aug": "patch", "prompt_tokens": 353, "answer_tokens": 42}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n x = SinOsc.ar(SinOsc.ar(0.0045).range([40,42], [1000, 950])) * GrainSin.ar(2, Impulse.ar(1), SinOsc.kr(0.003).range(0.001, 0.01), SinOsc.kr(0.002).range(1000, 4000), SinOsc.kr(0.3), -1, 512, 0.5);\n x = CombC.ar(x, 4, SinOsc.kr(0.1).range(0.1, 2), 10, 1, x);\n x = RLPF.ar(x, SinOsc.kr(0.022).abs * SinOsc.kr(0.01).range(400, 4000), 1);\n x = CombC.ar(x, 6, 6, 10, 1, x);\n x = SinOsc.ar(SinOsc.ar(0.0001).range(400, 4000)) * x;\n x = GVerb.ar(x);\n x = Compander.ar(x, x, 0.2, 1, 1/10) * 0.5;\n x = x + LPF.ar(DelayC.ar(x, 2, SinOsc.ar(0.01).range(0.9, 1.1), SinOsc.ar(0.0001).range(0, 1), 0), 200);\n y = GVerb.ar(HPF.ar(SinOsc.ar(SinOsc.kr(0.1).range(200, 210)) * GrainSin.ar(2, Impulse.ar(1), 1, SinOsc.ar(1/8).range(80, 100), 0, -1, 512, 0.1) * SinOsc.ar(0.001), 400));\n z = WhiteNoise.ar(SinOsc.kr([0.1, 0.145]) * SinOsc.kr(0.34) * SinOsc.kr(1.13) * SinOsc.kr(0.712));\n z = RHPF.ar(z, SinOsc.kr(0.001).range(1000, 4000) * SinOsc.kr(0.0212).abs, 0.5);\n z = z + CombC.ar(z, 1, 0.1, 1);\n z = z + CombC.ar(z, 1, 1, 10);\n z = z * SinOsc.ar(0.0001) * 0.004;\n x+y+z;\n}.play\n)\n```"}, {"role": "assistant", "content": "Appears on the free compilation \"I PREFER THE TERM ARTIFICIAL PERSON MYSELF: A Compilation of Machine-Made Audio\"\r\n\r\nAvailable as a free download from Kill Collector Culture\r\n\r\nhttp://killcollectorculture.bandcamp.com/album/i-prefer-the-term-artificial-person-myself-a-compilation-of-machine-made-audio."}], "family": "D3", "source_id": "sccode:1-4TZ", "aug": "patch", "prompt_tokens": 740, "answer_tokens": 152}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(//*********PREPARE**********\np.pop;\n//Any code that needs to access your own environment goes here\np = ProxySpace.push(s);\n~fxLoop.play.fadeTime_(5);\n);\n\n(//*********FXLoop**********\n~fxLoop = {\n var in = SoundIn.ar([0,1]);\n in;\n}\n)\n```"}, {"role": "assistant", "content": "Code for using Supercollider as a realtime livecode FX processor for audio input. Blog post explaing this code: http://schemawound.com/post/53528545022/fxloop."}], "family": "D3", "source_id": "sccode:1-4TX", "aug": "patch", "prompt_tokens": 165, "answer_tokens": 69}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nfork{\n //---------Source Files---------\n ~numOfPatterns = 16;\n ~synthDefToUse = \\bufPlay; //Change to \\bufPlay2 to use stereo samples\n ~rate = 2; //Rate of playback\n ~source = [ // Create an array of your samples. ~media.samples points at my base sample directory and is defined in my startup file.\n ~media.samples ++ \"808/kicks/808 kick 6.wav\",\n ~media.samples ++ \"808/snares/808 snare 6.wav\",\n ~media.samples ++ \"808/hats/808 hat 2.wav\",\n ~media.samples ++ \"808/other/808 cowbell.wav\",\n ~media.samples ++ \"808/other/808 clap.wav\",\n ~media.samples ++ \"808/other/808 rim.wav\",\n ~media.samples ++ \"808/other/808 maraca.wav\"\n ];\n Buffer.freeAll;\n ~buffers = ~source.collect{|source| Buffer.read(s, source)};\n ~patterns = ~numOfPatterns.collect{|val| Pbind(*[dur: Pn(1/val, val)])};\n ~randPattern = Prand(~patterns, 1);\n ~patterns = ~buffers.collect{|buf| Pbind(*[bufnum: buf]) <> ~randPattern};\n SynthDef(\\bufPlay, {|out = 0, bufnum, rateScale = 1, amp = 1| Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum) * rateScale, doneAction: 2) * amp!2);}).add;\n SynthDef(\\bufPlay2, {|out = 0, bufnum, rateScale = 1, amp = 1| Out.ar(out, PlayBuf.ar(2, bufnum, BufRate\n```"}, {"role": "assistant", "content": "The Unfunky Drummer - Insert samples, extract joy.\r\nCode by Jonathan Siemasko http://www.schemawound.com/\r\n\r\nNOTE: Set values for ~synthDefToUse, ~rate and ~source before running."}], "family": "D3", "source_id": "sccode:1-4TQ", "aug": "patch", "prompt_tokens": 676, "answer_tokens": 91}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var a, b, c, d, n, e, f, out;\n\n a = Impulse.ar(8)*1.5;\n\n b = WhiteNoise.ar * Env([1.0,1.0,0.0],[0.01,0.01],\\step).ar(0, Impulse.ar(1 )) ;\n b = FreeVerb.ar(b, 0.5, 0.4)*2.5;\n\n c = SinOsc.ar(40) * Env.perc(0.01,0.2).ar(0, TDuty.ar(Dseq([1/4,1/2,1/8,1/8],inf)));\n 5.do{ c = (c.distort + c)*0.75};\n c = c * 1.5;\n\n d = LPF.ar(Saw.ar([20,47]).sum , XLine.ar(4000,200,0.5)) * Env.perc.ar(0, Impulse.ar(1/16)) * 0.5;\n d = (GVerb.ar( d , roomsize:10, revtime:6) * 200).clip(-1.0,1.0) * 0.3;\n\n n = 12;\n e = ( Saw.ar( 40*(1..n) * ({ LFNoise1.ar(0.1).range(1,1.01) } ! n) ) *\n ({ LFNoise1.ar(0.1).range(0.0,1.0) }!n)).sum * 10;\n e = CombC.ar(e, 0.1, 0.1, 4) + e;\n e = e.tanh * 0.3 * SinOsc.ar(0.05).range(0.5,1.0);\n e = e.dup;\n e = e * SinOsc.ar(0.03).range(0.2,1.0) * 0.5;\n\n f = Blip.ar(100) * Blip.ar(100) * Env([0.0,0.0,1.0],[8,8],[\\step,\\linear,\\step])\n .ar(0, Impulse.ar(1/16)) * 2 ;\n\n out = ((a + b + c + f) ! 2) + d + e;\n out = out * 0.2\n\n}.play\n)\n```"}, {"role": "assistant", "content": "Trying to get something similar to lahetys from the album Katodivaihe of Pan Sonic. Would love to see people tweak it to get it even closer !."}], "family": "D3", "source_id": "sccode:1-4TP", "aug": "patch", "prompt_tokens": 681, "answer_tokens": 52}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//playing soundfiles in sequence - one after the other\ns.boot;\n\n(\ns.latency= 0.05;\nb.do{|x| x.free}; //free all previous buffers\nb= [ //edit paths - any number of files - make sure mono\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-01.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-02.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-03.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-04.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-05.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-06.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-07.wav\"),\n Buffer.read(s, \"/Applications/SuperCollider344/sounds/samples/Screech-08.wav\")\n];\nSynthDef(\\sample, {|out= 0, buf, rate= 1|\n Out.ar(out, PlayBuf.ar(1, buf, rate, doneAction:2)!2);\n}).add;\n);\n\n\n//test1 - single\nSynth(\\sample, [\\buf, b[0]]).register.onFree{\"hello\".postln};//should post when first soundfile done playing\n\n\n//test2 - looping through samples one after the other\n(\nRoutine({\n var index= 0;\n var c= Condition.new;\n inf.do\n```"}, {"role": "assistant", "content": "simple example showing how to play one soundfile after the other in a sequence. use as a template."}], "family": "D3", "source_id": "sccode:1-4TI", "aug": "patch", "prompt_tokens": 669, "answer_tokens": 28}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nc=13;a=Array.fib(64,0,1);b=Array.fill(size:c,function:{arg i;a[i]%12});\np=1/(21-c);Pdef(\\x,Pbind(\\dur,p,\\degree,Pseq(b,1,0)));\nr=Array.fill(c,{arg i;Pbindf(Pdef(\\x),\\mtranspose,1-b[i]);});\nPseq(r,(1/p)).play;\n)\n```"}, {"role": "assistant", "content": "Wow ! the conciseness of SuperCollider is wonderful !\r\nWe can make many attractive melodies !."}], "family": "D3", "source_id": "sccode:1-4TF", "aug": "patch", "prompt_tokens": 190, "answer_tokens": 38}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\nodeTest, {\n // the input\n var input = Impulse.ar([1, 3, 5].reciprocal, phase: [0, 0.133, 0.5]).sum;\n\n // the nodes, each takes its predecessor as input and estimates the duration between two events. \n // Unfortunately, the starting point of Timer is '0' which we have to put into reasonable limits. System settles after about 15 seconds\n var nodes = (1..10).inject([input], {|last, item| \n [TDuty.ar(max(0.25, Timer.ar(last.first)), 0, 1)] ++ last\n });\n\n // add a pitch to each\n nodes = nodes.collect{|node, i| SinOsc.ar((4000 + (i*500))) * Decay2.ar(node, 0.01, 0.2)};\n\n // splay in stereo field\n Splay.ar(nodes);\n\n}).play\n)\n```"}, {"role": "assistant", "content": "Idea: network of loosely connected nodes. Each node has a dedicated pulse rate / phase. Inducing an irregular trigger signal influences the nodes to (gradually) adapt their pulsation freq (and phase?) to the one of the input.\r\nsound example: https://soundcloud.com/lfsaw/sync-weakconnection-tduty-time."}], "family": "D3", "source_id": "sccode:1-4Tw", "aug": "patch", "prompt_tokens": 337, "answer_tokens": 124}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nb = Buffer.read(s, Platform.resourceDir +/+ \"sounds/a11wlk01.wav\");\n\n// This is very cool!\n\n(\n{\n Spring.ar(PlayBuf.ar(1, b, loop: 1)*Saw.ar(4));\n}.play;\n)\n```"}, {"role": "assistant", "content": "Feeding sound file multiplied by a slow saw wave into the spring physical model. Fascinating results ensue."}], "family": "D3", "source_id": "sccode:1-4Tt", "aug": "patch", "prompt_tokens": 130, "answer_tokens": 34}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var mod = SinOsc.ar([0.1,0.15,0.2]).range(0,1);\n var saw = LFSaw.ar([10,12,15]);\n var out = (saw - ((saw>0)*mod)+(mod*0.5));\n Splay.ar(out)*0.4;\n}.play;\n\n{\n var mod = SinOsc.ar([0.1,0.15,0.2]).range(0,1);\n var saw = SinOsc.ar(LFSaw.ar([10,12,15]).range(200,300));\n var out = (saw - ((saw>0)*mod)+(mod*0.5));\n Splay.ar(out)*0.4;\n}.play\n)\n```"}, {"role": "assistant", "content": "Made with code from Jonatan Liljedahl and Glen Fraser. Based on the Korg Z1 sawtooth oscilator."}], "family": "D3", "source_id": "sccode:1-4Tl", "aug": "patch", "prompt_tokens": 264, "answer_tokens": 42}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.boot;\n\n(\nSynthDef(\"lazerdrone\", {\n var in, freq, hasFreq;\n\n \n in = SinOsc.ar(440 * LFSaw.kr(100, 1000));\n\n # freq, hasFreq = Pitch.kr(\n in,\n ampThreshold: 0.09,\n median: 1);\n freq = freq * hasFreq;\n //freq.poll;\n \n SinOsc.kr(freq).poll;\n \n Out.ar(0, in + \n SinOsc.ar(440, \n 0, \n Clip.kr(\n SinOsc.kr(freq), \n 0)\n )\n );\n}).play;\n)\n```"}, {"role": "assistant", "content": "A lazer sound then a drone with morse-code like bleeps. A byproduct of testing the triggering algorithm in the mono2eN SynthDef."}], "family": "D3", "source_id": "sccode:1-4Te", "aug": "patch", "prompt_tokens": 262, "answer_tokens": 50}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// a Panthera Pardus meditates about his melanism\n\n(\n~chrs = {|in, speed| DelayC.ar(in, 0.5, Array.fill(12, {|i| LFNoise2.ar(speed).range(0.022, 0.024);}).sum)};\n~phas = {|in, speed=1| var chain; chain = in+FreqShift.ar(in, 0, SinOsc.kr(speed).range(0, pi)).tanh; chain = chain + FreqShift.ar(chain, 0, SinOsc.kr(speed*0.97).range(0, pi)).tanh; chain=(chain*0.5).tanh; };\n~smear = {|in, bins=50| var chain; chain=FFT(LocalBuf(2048), in); chain=PV_MagSmear(chain, bins); chain=IFFT(chain)*0.5; };\n\nNdef.clear;\nNdef(\\pantheraPardus___).play;\nNdef(\\___hisInner).play;\nNdef(\\pantheraPardus___).fadeTime = 5;\nNdef(\\___hisInner).fadeTime = 50;\n\nNdef(\\pantheraPardus___, {arg amp=1;\n var sig, env, sig0, ctrl;\n ctrl = LFGauss.kr(5, 0.15);\n sig = (Saw.ar([LFNoise1.kr(1).range(15, 30), 0.025], 0.14)) * LFNoise2.kr(1).range(0.5, 1);\n sig = (sig + PinkNoise.ar(0.1) * LFNoise2.kr(1).range(0.1, 0.4)) * ctrl;\n sig = sig*0.25 + ~chrs.(~phas.(sig, [0.2, 0.174]), [0.1, 0.12]);\n sig = DynKlank.ar(`[[100, 200, 300, 1000, 4000, 9000], (ctrl.range(0.2/6, 1/6)*LFNoise2.kr(1).range(0.2, 1))!6, 0.025], sig*0.2);\n sig = ~smear.(sig, 5);\n sig = HPF.ar(LPF.ar(sig, (LFNoise2.kr(1.25).range(100, 2000))), 250); \n\n```"}, {"role": "assistant", "content": "a Panthera Pardus meditates about his melanism (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-4Tb", "aug": "patch", "prompt_tokens": 776, "answer_tokens": 27}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// By Bjørn Houdorf March 2013, Play your (short) soundfiles with some delay.\n\nb = SoundFile.collectIntoBuffers(\"yourSoundFileFolder/*\"); // 1. rund this\n\n( // 2. and then run this\nt = Task({\n({\n var num= b.size.rand;\n var buf= b[num];\n 0.1*Splay.ar(PlayBuf.ar(buf.numChannels, buf, 1, 1, 0, 0));\n}.play;\n) \n});\n);\n\n\n( // 3. Then run this\nz = Task({\nloop({\n t.start;\n 0.1.wait;\n});\n});\n);\n\n\nz.start; // 4. and run this\nz.stop; // 5. and finally run this\n```"}, {"role": "assistant", "content": "Play your (short) soundfiles with some delay. Your soundfiles should be in the folder \"yourSoundFileFolder\"."}], "family": "D3", "source_id": "sccode:1-4T9", "aug": "patch", "prompt_tokens": 286, "answer_tokens": 42}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns = Server.internal;\ns.boot;\n\n(\nSynthDef(\"4for8\", {\n arg width=2, level=0.5;\n\n // change to match number of output audio channels\n var numChans = 6;\n\n var in, amp, pos=0, sig, sig2, sig2pan, out, chain, chainSpec, centroid, freq, hasFreq, freq2, hasFreq2;\n\n in = SoundIn.ar(0); // input\n\n # freq, hasFreq = Pitch.kr(\n in,\n ampThreshold: 0.09,\n median: 7);\n freq = freq * hasFreq* 0.01;\n freq.poll;\n\n chainSpec = FFT(LocalBuf(2048, 1), in);\n\n centroid = SpecCentroid.kr(chainSpec);\n\n centroid = ((centroid * 0.0005)-0.3)*10;\n\n // new possition determined by centroid\n pos = VarLag.kr(\n centroid,\n 0.9,\n ); // smooths the position\n\n\n // PanAz position of the sound\n sig = PanAz.ar(\n numChans,\n in,\n pos,\n level,\n width,\n ).scramble;\n\n chain = FFT({LocalBuf(2048, 1)}.dup(numChans), sig);\n\n chain = PV_MagFreeze(chain, SinOsc.kr(freq*100));\n\n sig2 = IFFT(chain);\n\n sig2pan = SplayAz.ar(\n numChans,\n sig2\n );\n\n // Mixing wet and dry signal.\n out = sig + sig2pan;\n out = out*0.7;\n Out.ar(0, out);\n}).add;\n\n);\n\n(\nx = Synth(\"4for8\")\n\nx.set(\\width, 5, \\level, 0.2)\n)\n```"}, {"role": "assistant", "content": "The synthdef version of the mono2eN system - a multichannel autospatilisation musical performance tool."}], "family": "D3", "source_id": "sccode:1-4T6", "aug": "patch", "prompt_tokens": 626, "answer_tokens": 32}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n var time = 30;\n var line = Line.kr(3000, 290, time);\n var line2 = Line.kr(280, 290, time);\n var line3 = Line.kr(0.01, 10, time);\n var sin = Mix.ar(SinOsc.ar([line, line2]) * SinOsc.ar(line3));\n var comb = CombC.ar(sin, time, SinOsc.kr(0.1).range(0.1, 0.2), time);\n var env = EnvGen.ar(Env.linen(0.01, time, 10), 1, doneAction:2);\n comb * env * 0.05!2;\n}.play\n)\n```"}, {"role": "assistant", "content": "Here is some quick code that sounds like an old sci-fi UFO landing."}], "family": "D3", "source_id": "sccode:1-4T0", "aug": "patch", "prompt_tokens": 244, "answer_tokens": 22}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n{h={|f|1-LFTri.ar(f)};l={|s,e|Line.ar(s,e,1200,1,0,2)};FreeVerb.ar(h.(l.(147,5147))*h.(l.(1117,17))*h.(100)*h.([55,55.1])*0.05,0.7,1)}.play\n\n//Explanation of this piece - http://schemawound.com/post/40100438722/11-13-2012-tweet-explained\n```"}, {"role": "assistant", "content": "Explanation of this piece - http://schemawound.com/post/40100438722/11-13-2012-tweet-explained."}], "family": "D3", "source_id": "sccode:1-4SS", "aug": "patch", "prompt_tokens": 208, "answer_tokens": 48}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// declare an event type which sends OSC commands to Renoise\n\n(\nEvent.addEventType(\\renoise, { |server|\n var renoiseOscServer = NetAddr(\"127.0.0.1\", 8000);\n var notes = [~midinote.value, ~ctranspose.value, ~velocity.value, ~sustain.value, ~lag.value, ~timingOffset.value, ~instr.value, ~track.value].flop;\n var timeNoteOn, timeNoteOff, instrument, track, velocity;\n var serverLatency;\n\n serverLatency = server.latency ? 0;\n\n notes.do {|note|\n instrument = note[6] ? -1;\n track = note[7] ? -1;\n velocity = note[2].asInt.clip(0,127);\n\n // sustain and timingOffset are in beats, lag is in seconds\n timeNoteOn = (thisThread.clock.tempo.reciprocal*note[5])+note[4]+server.latency;\n timeNoteOff = (thisThread.clock.tempo.reciprocal*(note[3]+note[5]))+note[4]+server.latency;\n SystemClock.sched(timeNoteOn, {renoiseOscServer.sendMsg(\"/renoise/trigger/note_on\", instrument.asInt, track.asInt, (note[0]+note[1]).asInt, velocity )});\n SystemClock.sched(timeNoteOff, {renoiseOscServer.sendMsg(\"/renoise/trigger/note_off\", instrument.asInt, track.asInt, (note[0]+note[1]).asInt)});\n }\n});\n);\n\n// Now start Renoise OSC server, load a sample, and try some patterns\n\n// straight timin\n```"}, {"role": "assistant", "content": "Renoise tracker (see renoise.com) can be controlled with OSC commands.\r\nWith this Renoise Event Type, you can easily generate some patterns which will be played by Renoise.\r\nUseful if you want to make patterns with VSTi :-)\r\n\r\nUsage :\r\n- start Renoise\r\n- in preferences, start OSC server\r\n- load a sample or VSTi in a sample slot in Renoise\r\n- start Supercollider\r\n- try this code\r\n- make more patter."}], "family": "D3", "source_id": "sccode:1-4SN", "aug": "patch", "prompt_tokens": 643, "answer_tokens": 162}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// restricting fm to harmonic sidebands after\n// [Chowning, 1973] Chowning, J. (1973). The synthesis of complex spectra by means of frequency modulation. Journal of the Audio Engineering Society, 21(7):526–534.\n// restriction actually happens because of the specs, not server-side.\n\nSpec.add(\\index, [0, 40]);\nSpec.add(\\harm1, [0, 20, \\lin, 1]);\nSpec.add(\\harm2, [0, 20, \\lin, 1]);\nSpec.add(\\fundFreq, \\freq);\n\nNdef(\\fmk, {\n \n PMOsc.ar(\n \\carFreq.kr(100, 0.1), \n (\\harm1.kr(1, 1)/(\\harm2.kr(1, 1)) * LFNoise1.ar(50).range(0.995, 1.001))*\\carFreq.kr(100), \n \\index.kr(1, 0.1) * SinOsc.ar(2.5).range(0.995, 1.005)\n ) \n})\n);\nNdef(\\fmk).gui\n```"}, {"role": "assistant", "content": "Restricting fm to harmonic sidebands after[Chowning, 1973]. Restriction actually happens because of the specs, not server-side.\r\n----- \r\nChowning, J. (1973). The synthesis of complex spectra by means of frequency modulation. Journal of the Audio Engineering Society, 21(7):526–534."}], "family": "D3", "source_id": "sccode:1-4SL", "aug": "patch", "prompt_tokens": 405, "answer_tokens": 116}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// derived from an answer by Sergio Luque to a mail to the sc-users SuperCollider mailing list on 2013/03/22\n\n(\nvar registerSize = 16;\nvar min =\"C2\".namemidi.asInteger;\nvar max = \"C6\".namemidi.asInteger;\nvar waitTime = 0.05; // in seconds\n//var chance = 0.1;\nvar chance = Pseq([Pseries(0, 0.1, 10), Pseries(1, -0.1, 10)], inf);\nvar change = 10; // step size\n\n\nPbind(\n \\midinote, Pswitch1(\n { \n Pbrown(min, max, Pif(Prout({ chance.trace.coin.embedInStream }), change, 0))\n } ! registerSize, \n Pseq(Array.iota(registerSize), inf)\n ),\n \\dur, waitTime\n).play\n)\n```"}, {"role": "assistant", "content": "wiard noise ring variation using a ringbuffer instead of bitshifting.\r\nRe-implemented according to Julian Parker's m4l patch.\r\nDerived from an answer by Sergio Luque to a mail to the sc-users SuperCollider mailing list on 2013/03/22."}], "family": "D3", "source_id": "sccode:1-4SJ", "aug": "patch", "prompt_tokens": 326, "answer_tokens": 97}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n b = {|x,y|\n var arr = List[];\n case\n {y % x.size == 0} // condition 1\n {\n var per = y / x.size;\n x.size.do{|oo|\n var pp = 1,i = 1;\n arr.add( x[oo] );\n while({i < per},{\n arr.add(0);\n i = i+1;\n });\n }\n }\n {x.size % y == 0} // condition 2\n {\n var pp = x.size / y, i = 0, sz = x.size;\n while({i < sz},{\n if(i % pp == 0)\n { arr.add(x[i]) };\n i=i+1;\n });\n };\n arr\n };\n a = [1,1,1,1];\n c = b.value(a,16) \n // [ 1, 1, 1, 1 ]\n // becomes\n // [ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ]\n\n b.value(c,4); \n // [ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ]\n // becomes\n // [ 1, 1, 1, 1 ]\n)\n```"}, {"role": "assistant", "content": "useful for expanding or reducing arrays by 2^x.\r\nI would like to know if there is a more concise way to write this!\r\nAny suggestions?\r\n\r\n(duplicate post, sorry! forgot to log in!)."}], "family": "D3", "source_id": "sccode:1-4SH", "aug": "patch", "prompt_tokens": 413, "answer_tokens": 64}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nq = ();\n\nq.registerSize = 16;\nq.rbuf = RingBuffer(q.registerSize);\n\n// parameters, can be changed while playing\nq.min = \"C2\".namemidi.asInteger;\nq.max = \"C6\".namemidi.asInteger;\nq.waitTime = 0.05; // in seconds\n\nq.chance = 0.1;\nq.change = 10; // step size\n\n\n(\n// initialise\nq.registerSize.do{\n q.rbuf.overwrite(rrand(q.min, q.max));\n};\n\n// do one step\nq.step = {|q, rbuf, chance, step, min, max|\n var item;\n item = rbuf.pop;\n (chance.coin).if{\n // apply brown noise, bounce back from constraints.\n //\"+++++++ change! % >> \".postf(item);\n item = (item + step.xrand2).fold(min, max); \n item; //.postln;\n };\n rbuf.add(item);\n item; // return (altered) item\n};\n\n(\nTdef(\\steppr, {\n var midinote;\n loop{\n midinote = q.step(q.rbuf, q.chance, q.change, q.min, q.max); \n \n // debug output\n // q.rbuf.asArray.postln;\n \n // play the current note, can be basically everything\n (\n midinote: midinote, \n sustain: 0.05, \n dur: 0.2, \n amp: 0.2\n ).play;\n \n q.waitTime.wait;\n }\n})\n);\n);\n\n\n// start\nTdef(\\steppr).play\n\n// stop\nTdef(\\steppr).stop\n```"}, {"role": "assistant", "content": "wiard noise ring variation using a ringbuffer instead of bitshifting.\r\nReimplemented according to Julian Parker's m4l patch."}], "family": "D3", "source_id": "sccode:1-4SE", "aug": "patch", "prompt_tokens": 597, "answer_tokens": 49}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nq = ();\n\nq.registerSize = 7; // max 64\nq.rbuf = ((2**q.registerSize).asInteger).rand;\n\n// parameters, can be changed while playing\n\n// The higher change, the greater the chance for a new value\nq.change = 0.1;\n\n// The higher chance, the greater the chance the new value is HIGH\nq.chance = 0.5;\n\nq.waitTime = 0.01; // in seconds\n\n(\nq.ror = {|q, x, shift, numBits| \n // shift right by m bits, input x is a number with numBits bits:\n var lsbs = x & ((1 << shift) - 1);\n (x >> shift) | (lsbs << (numBits-shift));\n};\n\n// do one step\nq.step = {|q, rbuf, change, chance|\n\n // rotate\n rbuf = q.ror(rbuf, 1, q.registerSize);\n// rbuf.asBinaryDigits(7).postln;\n\n (change.coin).if{\n // swap bit\n //rbuf = rbuf.bitXor(1);\n \n rbuf = rbuf.setBit(0, chance.coin.postln);\n \"+++++++ change!>>\".postln;\n };\n\n rbuf; // return (altered) item\n};\n\n(\nTdef(\\steppr, {\n loop{\n q.rbuf = q.step(q.rbuf, q.change, q.chance); \n \n // debug output\n // q.rbuf.asArray.postln;\n \n // play the current note, can be basically everything\n (\n midinote: q.rbuf, \n sustain: 0.01, \n dur: 0.2, \n amp: 0.2\n ).play;\n \n q.waitTime.wait;\n }\n})\n);\n);\n\n// start\nT\n```"}, {"role": "assistant", "content": "\"In latter model synthesizers, digital noise sources began to appear in place of analog ones. Traditionally, a psuedo-random shift register set up for optimal length. By optimal length, it is meant that every state of all available bits will appear at some time, but the order is unknown. Essentially a counter that counts in an unknown order. This represents the maximum state of information \"entrop."}], "family": "D3", "source_id": "sccode:1-4SD", "aug": "patch", "prompt_tokens": 625, "answer_tokens": 116}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Prime numbers\n \nServer.default.boot;\n(\n//maximum number\n~max=100;\n\n//synthdefs: 2 filtered sawteeth for number and divisor\nSynthDef ( \\gsaw, {arg g;\n Out.ar(1, \n RLPF.ar ( Saw.ar(20*g), 10000*(1-(g/~max)), 0.2, 0.2)\n )\n}).add;\n\nSynthDef ( \\dsaw, {arg d, g;\n Out.ar(0,\n RLPF.ar( Saw.ar(20*d), 10000*d/sqrt(g), 0.2, 0.2)\n // the square root is important: if you search for the divisors of a number,\n // don't search beyond the square root of the number. There won't be any.\n )\n}).add;\n\n//a fm-sound with carrier 20*number and modulator 20*divisor, modulation index = 10\nSynthDef (\\fm, {arg m, c;\n Out.ar(0,\n Pan2.ar(SinOsc.ar(20*c+(SinOsc.ar(20*m, 0, 200*m, 0))), 0)\n )\n}).add;\n\n);\n(\nr=Routine({\n var number, divisor;\n //the list of prime numbers\n l=Array.newClear(indexedSize: 0);\n\n for (2, ~max,{arg number;\n x=Synth(\\gsaw, [\\g, number]); //play the number\n divisor=2;\n p=true; //prime number?\n while ({((divisor <= (number.sqrt)).and(p == true))},\n { \n y=Synth(\\dsaw, [\\d, divisor, \\g, number]); //play the divisor\n z=Synth(\\fm, [\\m, divisor, \\c, number]); //play the fm sound of number and divisor\n 1.wait; //1 second should\n```"}, {"role": "assistant", "content": "The search for prime numbers from 1 to 100 is represented by sound. Channel 1: the numbers, channel 0: the divisors. In the center: a fm-sound with a carrier that is related to the number and a modulator that is related to the divisor. A harmonic sound means the carrier is a multiple of the modulator, so the number is a multiple of the divisor. Therefor a harmonic sound means: not a prime number."}], "family": "D3", "source_id": "sccode:1-4Sq", "aug": "patch", "prompt_tokens": 589, "answer_tokens": 117}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\ns.boot;\n\n(\nq = ();\nq.length = 16; // 16 seconds == 8 bars @ 120bpm\nq.numFrames = q.length * s.sampleRate; \nq.looperInBus = Bus.audio(s);\n\nSpec.add(\\switch, [0, 1, \\lin, 1, 0]);\nSpec.add(\\recLevel, \\db);\nSpec.add(\\preLevel, \\db);\nSpec.add(\\playbackRate, \\rate);\nSpec.add(\\recEnable, \\switch);\nSpec.add(\\recCuePoint, [0, q.length]);\nSpec.add(\\playCuePoint, \\recCuePoint);\nSpec.add(\\resetRec, \\switch);\nSpec.add(\\resetPlay,\\switch);\n);\n\nNdefMixer(s)\n\n(\nNdef(\\clicktrack, {\n Mix([\n SinOsc.ar(440) * Decay.ar(Impulse.ar(2), 0.1, 0.2), \n SinOsc.ar(880) * Decay.ar(Impulse.ar(0.5), 0.1, 0.2)\n ]);\n})\n);\n\n(\nNdef(\\oneTrackLooper, { // A looper for one track, mono.\n var in = Ndef(\\input).ar; // your input\n\n var buffer = LocalBuf.newFrom(0!q.numFrames); // stores loop\n var recEnable = \\recEnable.kr(0).lag2(0.01);\n var recLevel = \\recLevel .kr(0).dbamp;\n var preLevel = \\preLevel .kr(0).dbamp;\n // converts from samples to seconds\n var playCuePoint = \\playCuePoint.kr(0) * s.sampleRate; \n var resetRec = \\resetRec.tr(1);\n var resetPlay = \\resetPlay.tr(1);\n var playRate = \\playbackRate.kr(1);\n \n // recording\n RecordBuf.ar(\n in, \n buffer, \n loop: 1, \n recLeve\n```"}, {"role": "assistant", "content": "very basic, more explanation and a sound example here:\r\nhttp://tai-studio.org/index.php/2013/02/looper/."}], "family": "D3", "source_id": "sccode:1-4Sm", "aug": "patch", "prompt_tokens": 712, "answer_tokens": 48}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef.new(\\vinylCrackling, { arg out=0;\n var pop,imp,modImp,midNoise,hiNoise,loNoise,loopTime=8,numChan=2,w,x,y;\n\n //Harder pops\n pop = TDuty.ar(Dseq({ 1.0.bilinrand.abs } ! loopTime,inf));\n pop = Resonz.ar(Decay.ar(pop,TRand.ar(0.001,0.1,pop)),Demand.ar(pop,0,Dseq({ 7000.bilinrand.abs+40 } ! loopTime,inf)),\n mul:Demand.ar(pop,0,Dseq({ exprand(0.1,0.87) } ! loopTime,inf)));\n pop = LeakDC.ar(pop,TRand.ar(0.9,0.9995,pop));\n #w,x,y = PanB2.ar(pop,Demand.ar(pop,0,Dseq({ 1.0.rand2 } ! loopTime,inf)));\n\n //Softer, highpass filtered impulses\n imp = { arg i; HPF.ar(LPF.ar(Dust2.ar(8),8000.0),6000.0,WhiteNoise.ar(0.7)) } ! numChan;\n\n //Faster, modulated lowpass filtered impulses\n modImp = LPF.ar(Dust.ar(LFDNoise3.ar(1).exprange(100,500),LFDNoise3.ar(10).exprange(0.01,0.07)),9000.0) ! numChan;\n\n //Mid frequency modulated noise background\n midNoise = LPF.ar(GrayNoise.ar(LFDNoise3.ar(60))*WhiteNoise.ar(0.009),12000.0) ! numChan;\n\n //High frequency modulated noise background\n hiNoise = HPF.ar(LPF.ar(GrayNoise.ar(LFDNoise3.ar(60))*WhiteNoise.ar(0.01),14000.0),8000.0) ! numChan;\n\n //Low frequency modulated noise background\n loNoise = LPF.ar(BrownNoise.ar(PinkNoise.ar.range\n```"}, {"role": "assistant", "content": "Came across this when browsing through my SC files. An attempt at emulating an old, dusty record including pops and crackles."}], "family": "D3", "source_id": "sccode:1-4Sj", "aug": "patch", "prompt_tokens": 720, "answer_tokens": 40}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\"Musical Toys For Little Robots\"\n\n or\n\n \"How I learned to stop worrying and love the proxy\"\n\nhttp://soundcloud.com/unknown-artist-6/musical-toys-for-little-robots\n\n */\n\n~fx=Bus.audio(s,2);\n\n(\nSynthDef(\\mallet,{arg in=0,out=0,m=48,a=1,r=1,p=0;\n\n var sig=Array.fill(3,{|n| SinOsc.ar(m.midicps+(n*0.01),mul:a*0.3)}).sum;\n var env=EnvGen.kr(Env.perc(0.001,r),gate:1,doneAction:2);\n\n Out.ar(out,Pan2.ar(sig*env,pos:p));\n};\n).add;\n\nSynthDef(\\rev,{arg in=0,out=0;\n var sig=In.ar(in,2);\n sig=sig*0.8+CombC.ar(sig,0.5,0.3,0.5,0.2);\n Out.ar(out,sig)\n };\n).add;\n);\n\nSynth(\\rev,[\\in:~fx]);\n\n\n(\nfork{\n var degrees=Prand([0,4,5,7,9,12],inf).asStream;\n var root=[36,48,60,72];\n var x;\n x=Array.new;\n a=PatternProxy(Pseq([0+root.wchoose([0.3,0.4,0.2,0.1])],inf));\n d=1/8;\n\n ~streams=[];\n ~names={|pbind| ~streams=~streams++pbind.play(quant:1)};\n\n ~names.value(Pbind(*[\\instrument:\\mallet,\n \\m:a,\n \\dur:d,\n \\a:{rrand(0.4,1)*0.05},\n \\p:{rrand(-0.2,0.2)},\n \\r:{rrand(0.5,0.8)},\n \\out:~fx\n ]));\n\n\n 20.do({|n|\n x=x.add(degrees.next+root.wchoose([0.3,0.4,0.2,0.1]));\n x.postl\n```"}, {"role": "assistant", "content": "An algorithmic/aleatoric composition for mallets and proxy patterns."}], "family": "D3", "source_id": "sccode:1-4S9", "aug": "patch", "prompt_tokens": 765, "answer_tokens": 22}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//redFrik - redo_minimalish sketch\n(\ns.waitForBoot{\n \n SynthDef(\\p, {|out= 0, freq= 400, amp= 0.1, gate= 1, detune= 0|\n var env= EnvGen.ar(Env.perc(Rand(0.001, 0.01), LinRand(0.2, 0.4), amp, Rand(-9, -1)), doneAction:2);\n var snd= Mix(SinOsc.ar(freq+[0, detune*0.1], env*2pi));\n Out.ar(out, Pan2.ar(snd*env, Rand(-1, 1)));\n }).add;\n Ndef(\\p, Pspawn(Pbind(\\method,\\par,\\delta,1/8,\\pattern,{Pbind(\\instrument, \\p, \\dur,a=Pseq((1..9).sputter),\\sustain,1/8/a,\\degree,a,\\detune,a)})));\n Ndef(\\p).play(vol:0.5);\n \n Ndef(\\t, {\n var mod= Saw.ar([3, 4], Saw.ar(1, 32, 128), Duty.ar(1, 0, flop(Dseq([0, 8, 1, 5])*[1, 4, 8])));\n var snd= SinOsc.ar(Saw.ar(2, 64, 99), mod)/9;\n CombN.ar(snd, 1/4, 1/4.125, SinOsc.kr(0.005, 1.5pi).range(0, 6));\n });\n Ndef(\\t).play(vol:0.5);\n \n Routine.run({\n var cnt= 1;\n loop{\n var syn;\n cnt= cnt%8+1;\n syn= {\n var del= DelayN.ar(InFeedback.ar(0, 2)+(InFeedback.ar(100, 2)), 1, 1);\n SinOsc.ar(cnt*99+[0, 2], del[1..0])/4;\n }.play(outbus: 64);\n {syn.release(16)}.defer(9-cnt);\n wait(9-cnt);\n };\n });\n Ndef(\\c, {InFeedback.ar(64, 2)}).play(vol:0.5);\n \n Ndef(\\r, {\n var lfos= LFNoise1.ar(0.5!2\n```"}, {"role": "assistant", "content": "took five of my own tweets and played them at the same time."}], "family": "D3", "source_id": "sccode:1-4S6", "aug": "patch", "prompt_tokens": 761, "answer_tokens": 19}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nb = SoundFile.collectIntoBuffers(\"yourSoundFileFolder/*\"); // By Bjørn Houdorf, December 21, 2012\n\n(\n{\nvar number = b.numChannels, randomNumber, trigger, delayed, panned, sound, mixedSound, rotatedSound;\ntrigger = Dust.kr(Array.fill(number,1), 1, -0.5); // Generates random impulses from -0.5 to 0.5. as a excitation function\nrandomNumber = TRand.kr(1, number, trigger);\nsound = PlayBuf.ar(Array.fill(number,1) ,randomNumber,1,trigger,0,0); // play sound files\ndelayed = DelayL.ar(sound, trigger, trigger); // delaying the sound files\npanned = Pan2.ar(delayed, Array.fill(number,{1.0.rand2})); // pan them out in the stereo field\nmixedSound = 0.05*Mix.new(panned);// and mix them to one stereo signal\nrotatedSound = Rotate2.ar(mixedSound[0], mixedSound[1], LFSaw.kr(0.05)); // rotate stereo signal\n}.play; // play it all\n)\n```"}, {"role": "assistant", "content": "Put your sound files in the sound file folder. The code plays random sound files panned out in the stereo field. A swarm of sound files."}], "family": "D3", "source_id": "sccode:1-4RX", "aug": "patch", "prompt_tokens": 435, "answer_tokens": 45}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\bass, { | atk = 0.01, dur = 0.15, freq = 50, amp=0.8 |\n var env, osc;\n env = EnvGen.kr( Env.perc( atk, dur-atk, amp, 6 ), doneAction: 2 );\n osc = BPF.ar(LFSaw.ar(freq), freq, 2, mul: env) ! 2;\n Out.ar([0,1],osc);\n}).add;\n);\n\n(\nSynthDef('wiro', { | amp = 0.1 |\n var osc, env, noise, out;\n noise = LPF.ar(WhiteNoise.ar(1),6000);\n osc = HPF.ar(noise,2000);\n //env = Line.ar(1, 0, 0.1);\n env = EnvGen.kr(Env.perc(0.01,0.05), doneAction: 2);\n out = (osc * env);\n Out.ar([0,1],out*amp)\n}).add;\n);\n\n(\nPpar([\n Pbind(\n \\instrument, \\bass,\n \\degree, Pseq([ Pseq([Pn(Pshuf([0,2,4],1),2),Pn(Pshuf([3,5,7],1),2)],2),Pn(Pshuf([-3,-1,1],1),2) ],inf),\n \\dur, Pseq([0.25,0.5,0.25],inf),\n \\legato, Pseq([ Pgeom(0.05, 0.05, 40), Pgeom(2.05, -0.05, 40) ], inf),\n \\octave, 3,\n \\amp, 0.03\n ),\n\n Pbind(\n \\instrument, \\wiro,\n \\dur, Pseq([0.5,0.25,0.25], inf),\n \\legato, Pseq([ Pgeom(0.05, 0.05, 40), Pgeom(2.05, -0.05, 40) ], inf),\n \\amp, 0.05,\n )\n]).play\n)\n```"}, {"role": "assistant", "content": "Ppar two intrument cumbia base. I'm just beginning to learn supercollider so I'm interested in feedback. The synths are modified from what sources on the Internet."}], "family": "D3", "source_id": "sccode:1-4RW", "aug": "patch", "prompt_tokens": 660, "answer_tokens": 49}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n0050\n\"pushing air\" => \".--. ..- ... .... .. -. --. / .- .. .-.\"\n*/\n\n~morsestr = \".--. ..- ... .... .. -. --. / .- .. .-. / \";\n\n~ctlbus1 = Bus.control(s);\nMIDIIn.connectAll;\n\n(\nSynthDef(\\perc, {|freq=280|\n var ampEnv, snd, attack, release, sat, mod;\n release = 3;\n attack = ~ctlbus1.kr;\n sat = -2;\n mod = SinOsc.ar(4, 0, 2);\n ampEnv = EnvGen.ar(Env.perc(attack, release, 1), doneAction:2);\n snd = ampEnv * SinOsc.ar([freq, (1.005*freq)+mod], [Rand(0,3.14),Rand(0,3.14)]);\n snd = 2/(1 + (sat*snd).exp) - 1;\n Out.ar(0,snd);\n}).add;\n);\n\n~t = TempoClock.new;\n~t.tempo = 3;\nTdef(\\morse).play(~t);\n\n\n(\nMIDIdef.cc(\\attackTime, \n {|val, num, chan, src| \n var attackTime;\n\n attackTime = val.linlin(0,127,0,2);\n ~ctlbus1.set(attackTime);\n (\"attackTime: \" ++ attackTime).postln;\n },2);\n\nMIDIdef.cc(\\tempo, \n {|val, num, chan, src| \n var index;\n var tempoArray = [3,6,12];\n \n index = val.linlin(0,127,0,2);\n ~t.tempo = val.linlin(0,127,1,12);//tempoArray[index];\n val.linlin(0,127,1,12).postln;//tempoArray[index].postln;\n },14);\n);\n\n(\nTdef(\\morse,\n{ \n inf.do{ |i| \n \n var f0 = 180 * (2**(0/12));\n var freq = 2**(([-7,-3,0,2,5,9,12].choose)/12) * f0;\n var char = ~morses\n```"}, {"role": "assistant", "content": "code for disquiet 0050 project: http://disquiet.com/2012/12/13/disquiet0050-morsebeat/\r\nlisten here: http://soundcloud.com/inlet/pushing-air-disquiet0050."}], "family": "D3", "source_id": "sccode:1-4RU", "aug": "patch", "prompt_tokens": 770, "answer_tokens": 77}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// A beautiful sc140 tweet by Batuhan Bozkurt, parametrized for real-time changes\n(\n// Start sound here\na = { | rateL = 5, rateR = 6, blipMul = 100, blipAdd = 50, fMul = 50, kMul = 1 |\n f = LocalIn.ar(2).tanh;\n k = Latch.kr(f[0].abs,Impulse.kr(1/4)) * kMul;\n LocalOut.ar(\n f +\n CombC.ar(Blip.ar([rateL, rateR], blipMul * k + blipAdd, 0.9), 1, k*0.3, fMul * f));f\n}.play\n);\n\n// Set parameters for changing sound here: \n\na.set(\\rateL, 10);\n\na.set(\\rateR, 8);\n\na.set(\\blipMul, 25);\n\na.set(\\blipAdd, 70);\n\na.set(\\fMul, 30);\n\n\na.set(\\kMul, 0.01);\n```"}, {"role": "assistant", "content": "A beautiful sc140 tweet by Batuhan Bozkurt, parametrized for real-time changes. To do: Add gui widgets for easier interactive control."}], "family": "D3", "source_id": "sccode:1-4RP", "aug": "patch", "prompt_tokens": 349, "answer_tokens": 55}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Fig 58.7: Red alert\n//Complete patch, saw + second harmonic, resonators, distortion and post filters to create \n//fixed resonance. Contains the subpatch shown in fig 58.6.\n\n(\n SynthDef(\\red, {\n \n var env, redAlert, dfbe, aIn, bIn, cIn, aOut, bOut, cOut;\n \n # aIn, bIn, cIn = LocalIn.ar(7).clumps([5,1,1]);\n \n env = [\n EnvGen.ar(Env.new([0,1,1,0], [0.9, 0.3, 0.0])), \n EnvGen.ar(Env.new([0,1,1,0], [0.01, 0.88, 0.01]))\n ];\n env[0] = LFSaw.ar(env[0].sqrt * 487 + 360, 1, 0.5, 0.5);\n env[0] = (env[0] - 0.5) + ((env[0] * 2 * 2pi).cos * 0.3);\n redAlert = (env[0] - OnePole.ar(env[0], exp(-2pi * (1 * SampleDur.ir)))) * env[1];\n redAlert = redAlert + (cIn * 0.006) * 0.2;\n \n \n // fig 58.6: Delay feedback element\n dfbe = 0!6;\n redAlert = redAlert + (aIn * 0.7);\n 5.do{|i| dfbe[i] = DelayN.ar(redAlert[i], 0.1, [0.015, 0.022, 0.035, 0.024, 0.011][i])};\n aOut = dfbe[0..4]; \n \n redAlert = redAlert[0..4].sum;\n redAlert = (redAlert - OnePole.ar(redAlert, exp(-2pi * (12 * SampleDur.ir))));\n \n dfbe[5] = redAlert + (bIn * 0.7);\n dfbe[5] = DelayN.ar(dfbe[5], 0.1, 0.061);\n # bOut, cOut = dfbe[5]!2;\n LocalOut.ar(aOut ++ bOut ++ cOut);\n \n redAlert = Clip.ar(redAlert * 4, -1, 1);\n \n```"}, {"role": "assistant", "content": "Based on pure data code from the book \"Designing Sound\" by Andy Farnell. (Chapter 58)."}], "family": "D3", "source_id": "sccode:1-4RI", "aug": "patch", "prompt_tokens": 728, "answer_tokens": 33}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//Fig 44.5: Motor\n//Contains the subpatches shown in fig 44.2, 44.3, 44.4 and 44.6.\n\n(\n{ \n \n | // arguments range: 0.0 - 1.0\n runtime = 0.2, \n statorLevel = 0.7, \n brushLevel = 0.9, \n rotorLevel = 0.6, \n maxSpeed = 0.3, \n volume = 0.5,\n tubeRes = 0.2\n |\n \n var motorEnv, motorEnv1, motorEnv2, motor, rotor, drive, stator, resonance;\n \n // fig 44.2: Speed Control Envelope\n motorEnv = (Line.ar(0,1,runtime * 20, doneAction:2)) * 2;\n motorEnv1 = (1 - motorEnv.min(1)).pow(6); // fast growing curve\n motorEnv2 = motorEnv.max(1) - 1; // linear decay\n motorEnv = (motorEnv1 + motorEnv2) * (-1) + 1;\n \n drive = motorEnv * (maxSpeed * (-2000));\n drive = LFSaw.ar(drive, 1, 0.5, 0.5);\n \n // fig 44.3: Rotor\n rotor = WhiteNoise.ar;\n rotor = BPF.ar(rotor, 4000, 1.reciprocal) * brushLevel;\n rotor = (rotor + (rotorLevel * 0.2)) * drive.pow(4);\n \n // fig 44.4: Stator\n stator = (Wrap.ar(drive * 2) * 2pi).cos;\n // notice the difference in SC between (stator * stator) and stator.pow(2)\n // to a\n```"}, {"role": "assistant", "content": "based on pure data code from the book \"Designing Sound\" by Andy Farnell. (Chapter 44, Practical 21, Motors)."}], "family": "D3", "source_id": "sccode:1-4RG", "aug": "patch", "prompt_tokens": 594, "answer_tokens": 42}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n{Mix({|i|var j=Impulse,t=TChoose.kr(j.kr(1/8),[1,6,3]/8),r=Ringz.ar(j.ar(i*t+0.25),600*t*i+[0,9]);CombC.ar(r,1,0.5,4,0.1,r)}!4).tanh/4}.play\n```"}, {"role": "assistant", "content": "Hi colliders, this is my first post here, and also my very first sc tweet! \r\nIt's nothing special, just a little rhythmic Ringz thingy...\r\nAs a beginner, I found this really useful getting the hang of some syntax shortcuts:\r\nhttp://schemawound.com/post/25710867587/supercollider-tweets-background-tips."}], "family": "D3", "source_id": "sccode:1-4RD", "aug": "patch", "prompt_tokens": 153, "answer_tokens": 126}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\sawFilt, { |out = 0, freq = 440, amp = 0.1, gate = 1, cf = 100, wobble = 3, t_bd, t_sd, pw = 0.4|\n var base = Splay.ar(RLPF.ar(Pulse.ar(freq * [0.99,0.5,1.01],pw),cf.lag(0.05),0.3).madd(SinOsc.ar(wobble).range(0.5,4)).sin) * 0.5;\n var env = Linen.kr(gate, attackTime: 0.01, releaseTime: 0.5, doneAction: 2);\n var sig = base;\n var bd = tanh(Ringz.ar(LPF.ar(Trig.ar(t_bd,SampleDur.ir),1000),30,0.5,5).sin*2);\n var sd = tanh(Ringz.ar(LPF.ar(Trig.ar(t_sd,SampleDur.ir),1000),120,0.75,PinkNoise.ar(2!2)).sin*2);\n sd = HPF.ar(sd,60);\n sig = tanh(GVerb.ar(HPF.ar(base * env,30), 70, 11, 0.15)*0.5 + sig + bd + sd);\n Out.ar(out, sig*amp*env);\n}).add;\n);\n\n(\np = Pproto(\n {\n ~id = (\n type: \\on,\n dur: 0,\n instrument: \\sawFilt,\n amp: 1,\n ).yield[\\id];\n ~type = \\set;\n },\n Ppar([\n Pbind(\n \\args, #[freq],\n \\freq, Pseq([49,47,50,48]-12,inf).midicps,\n \\dur, 4,\n ),\n Pbind(\n \\args, #[cf],\n \\cf, Pseq([100,Prand([700,400,1100],3)],inf),\n \\stutter, Prand([1,2,4,8],inf),\n \\dur, PdurStutter(Pkey(\\stutter)*2, 2\n```"}, {"role": "assistant", "content": "This is a demonstration of how several parallell patterns can be controlling a single synth."}], "family": "D3", "source_id": "sccode:1-4Rn", "aug": "patch", "prompt_tokens": 680, "answer_tokens": 28}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\scansynth1, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;\n var in, ou;\n var spring = (0.12).dup(40);\n var damp = (0.0564812).dup(40);\n var springs;\n var sel;\n in = LPF.ar(LocalIn.ar(1), XLine.ar(1,10,0.3)) * 0.97 + (LPF.ar(Trig.ar(gate, 0.01),200) * WhiteNoise.ar.range(0.98,1));\n ou = in;\n springs = spring.collect { arg spr, i;\n ou = Spring.ar(ou, spr, damp[i]);\n };\n LocalOut.ar(ou);\n sel = VarSaw.ar(freq * [0.999,1,0.499,2,1.01] * 0.5, width: LFNoise2.ar(1/2).range(0.2,0.5)).range(0, spring.size-1);\n ou = Splay.ar(SelectX.ar(sel, springs), 1);\n ou = ou * EnvGen.ar(\\adsr.kr(Env.adsr(0.3,0.1,0.8,0.1)),gate,doneAction:2);\n ou = Pan2.ar(ou, pan, amp);\n Out.ar(out, ou);\n}).add;\n);\n\n(\nPdef(\\plop, Pbind(\n \\instrument, \\scansynth1,\n \\scale, Scale.minor,\n \\degree, Pseq([0,2,4],inf) + [0,2,4,-12],\n \\strum, 3/8,\n \\dur, 3,\n \\amp, 2,\n \\legato, 1.4\n)).play;\n)\n```"}, {"role": "assistant", "content": "Impetus provided by this fine thread: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Scanned-Synthesis-in-SC-td7585748.html."}], "family": "D3", "source_id": "sccode:1-4Rm", "aug": "patch", "prompt_tokens": 586, "answer_tokens": 84}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"Please Hold (Extended)\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n var seconds;\n\n { \n SynthDef(\\PleaseHold, {|seconds = 7|\n var sines = \n SinOsc.ar(Line.kr([40, 47], 47, seconds - 1)) \n * \n SinOsc.ar(Line.kr([65, 60], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([80, 89], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([300, 270], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([435, 472], 47, seconds - 1))\n *\n Line.ar(1, 0, seconds)\n ;\n var verb = FreeVerb.ar(sines, 1, 1, 0) * 0.9;\n var riseLine = (SinOsc.ar([330, 335]) * Line.ar(0, 0.5, seconds)).clip2(0.4);\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var output = (verb + riseLine) * env;\n Out.ar(0, output * 0.6);\n }).add;\n\n s.sync;\n\n seconds = 420; Synth(\\PleaseHold, [\\seconds, seconds]);\n }.fork\n)\n```"}, {"role": "assistant", "content": "\"Please Hold (Extended)\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4Rf", "aug": "patch", "prompt_tokens": 603, "answer_tokens": 144}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"Sound Check (Extended)\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n var seconds;\n\n { \n SynthDef(\\SoundCheck, {|seconds = 7|\n var sin1 = SinOsc.kr([110, 90], 0, [440, 330]);\n var sin2 = SinOsc.kr(1, 0, 5, 105);\n var sinModDepth = SinOsc.kr(0.01, 0, 10) * SinOsc.ar(0.00033, 0, 1000); //Magic number for 7 seconds\n var sinMod = (sin1 + sin2) * sinModDepth;\n var ampMod = SinOsc.kr(0.1, 0, 0.5, 1) * SinOsc.kr(1, 0, 0.5, 1);\n var sinLine = SinOsc.ar(Line.kr(40, 10, seconds););\n var sum = SinOsc.ar(sinMod, 0, ampMod).distort;\n var comb1 = (CombL.ar(sum, 0.01, 0.005, 1) + sum) * sinLine;\n var comb2 = (comb1 + (CombL.ar(comb1, 0.008, 0.007, 0.5) * 0.4));\n var clip1 = comb2.clip2(1) * 0.8;\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var output = (clip1 * SinOsc.ar(40) * SinOsc.ar(456)) * env;\n Out.ar(0, output * 0.5);\n }).add;\n\n s.sync;\n\n seconds = \n```"}, {"role": "assistant", "content": "\"Sound Check (Extended)\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4Rb", "aug": "patch", "prompt_tokens": 679, "answer_tokens": 146}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"Dawn\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n {\n //-----Variables-----\n var mainout = 0;\n\n //-----SynthDefs-----\n SynthDef(\\additivePad, { \n |\n outbus = 0, freq = 40, amp = 1, attack = 0.1, decay = 0.1, \n lfo0L = 0.5, lfo0R = 0.5, lfo1L= 0.1, lfo1R = 0.1, lfo2L= 0.5, lfo2R = 0.5\n |\n var syn, env, ampMod, output;\n var lfo2input = Array.new(2);\n var lfo = Array.new(3);\n lfo = lfo.add(SinOsc.kr([lfo0L, lfo0R]).range(0, 1));\n lfo = lfo.add(SinOsc.kr([lfo1L, lfo1R]).range(0, 1));\n lfo2input = lfo2input.add(lfo2L * lfo[0] * lfo[1]); //Left\n lfo2input = lfo2input.add((lfo2R * (1 - lfo[0])) * (1 - lfo[1])); //Right\n lfo = lfo.add(SinOsc.kr(lfo2input, 1.5pi).range(0, 1));\n env = EnvGen.kr(Env.perc(attack, decay), doneAction: 2);\n s\n```"}, {"role": "assistant", "content": "\"Dawn\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4Ra", "aug": "patch", "prompt_tokens": 628, "answer_tokens": 138}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"Hymncycle (Second Phase)\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n{\n var seconds = 400;\n var source, effect, verbBus, verb, pulse1, pulse2;\n\n SynthDef(\\verb, {|outbus = 0, inbus, room = 0.15, damp = 0.5, seconds = 400|\n var mix = SinOsc.kr(0.06).range(0.50, 1);\n var input = In.ar(inbus);\n var verb = FreeVerb.ar(input, mix, room, damp);\n var verb2 = FreeVerb.ar(verb, mix, [room, room * 0.95], damp);\n var filt = DFM1.ar(verb2, SinOsc.ar(0.08).range(800, 4500), 0.3, 1, 0.0);\n var line = Line.kr(0.0, 1.0, seconds);\n var temp = (filt * (1 - line)) + (filt * SinOsc.ar(5000) * SinOsc.ar(400) * line);\n var delay = temp + DelayC.ar(temp, 2, 2);\n Out.ar(outbus, delay * 0.4);\n }).add;\n\n SynthDef(\\pulse, {|outbus = 0, freq = 60, second = 400|\n var pulse = Impulse.ar(freq) * LFTri.ar(10001); \n var output = pulse + (SinOsc.ar(Line.ar(60, 80, seconds, doneAction: 2)) * 0.02);\n Out.ar(outbus, output)\n }).add;\n\n Serv\n```"}, {"role": "assistant", "content": "\"Hymncycle (Second Phase)\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4R9", "aug": "patch", "prompt_tokens": 662, "answer_tokens": 150}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"The Crawl (Extended)\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n var seconds;\n\n {\n SynthDef(\\TheCrawl, {|seconds = 7|\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var output = \n Mix(\n Pulse.ar(\n (400..550) * Line.ar(1, 2.5, seconds), \n * SinOsc.ar(0.2222) * SinOsc.ar(0.31) * SinOsc.ar(0.123).range(0.1, 0.9)\n )\n ) * 0.1 * SinOsc.ar([300,150]) * env;\n output = ((output + CombL.ar(output, 0.1, 0.1, 0.1) * 0.5) * 0.4).clip2(0.2);\n output = BMoog.ar(output, 5000);\n output = FreeVerb.ar(output, Line.ar(0, 1, seconds) , 1, 0);\n Out.ar(0, output);\n }).add;\n\n s.sync;\n\n seconds = 120; Synth(\\TheCrawl, [\\seconds, seconds]);\n }.fork\n)\n```"}, {"role": "assistant", "content": "\"The Crawl (Extended)\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4R8", "aug": "patch", "prompt_tokens": 552, "answer_tokens": 146}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\n\"The Same Color As Your Skin (Extended)\" by Schemawound\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\nFull album is available for download from http://www.schemawound.com\n\nCode by Jonathan Siemasko\nContact: schemawound@yahoo.com\nHomepage: http://www.schemawound.com/\n*/\n\n(\n var seconds;\n\n { \n SynthDef(\\TheSameColorAsYourSkin, {|seconds = 320|\n //Sines\n var sineLine1 = Line.kr(600, 210, seconds);\n var sineLine2 = Line.kr(100, 210, seconds);\n var sines = SinOsc.ar(sineLine1) * SinOsc.ar(sineLine2);\n //Filter\n var filterLineLFO = SinOsc.ar(0.2);\n var filterLine = Line.kr(200, 6000, seconds, doneAction: 2) * filterLineLFO;\n var filtLFO = SinOsc.kr(0.4).range(60, filterLine);\n var filter = BMoog.ar(sines, filtLFO, 0.9, 1).tanh * 0.5;\n //Comb\n var comb = CombL.ar(filter, 1, 0.3, 1);\n var mix1 = (comb + GVerb.ar(filter)) * 0.1;\n mix1 = (CombL.ar(mix1, 1, 1, 6) * 0.3) + mix1;\n mix1 = HPF.ar(mix1, 20) * 0.5;\n Out.ar(0, mix1);\n }).add;\n\n s.sync;\n\n seconds = 320; Synth(\\TheSameColorAsYourSkin, [\\seconds, seconds]);\n }.fork\n)\n```"}, {"role": "assistant", "content": "\"The Same Color As Your Skin (Extended)\" by Schemawound\r\nAppears on the album \"They Want To Make Your Body Move. I Want To Hold You Perfectly Still.\"\r\nFull album is available for download from http://www.schemawound.com\r\n\r\nCode by Jonathan Siemasko\r\nContact: schemawound@yahoo.com\r\nHomepage: http://www.schemawound.com/."}], "family": "D3", "source_id": "sccode:1-4R7", "aug": "patch", "prompt_tokens": 636, "answer_tokens": 153}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// let's say there is a directory \"pat\" with *.scd files where each file contains, for example:\n// test.scd \n{ |dict,loc| // recieve global dict\n loc = ( //and define local(this file) dict, but if don't need it - just return anonymously\n selector: { |self, ev| self.at([\\p1,\\p2].choose).fn(ev) }, // sample selector\n p1: ( // some object \n fn: { |self, ev| // recieve self and some args\n Pbind(*[ // return something\n instrument: \\default,\n delta: ev.delta/8,\n amp: Pseq((0.3..0.8).scramble, inf),\n octave: self.state.next\n ])\n }, \n state: Pseq((3..6), inf).asStream // i.e. object attribute\n ),\n p2: ( // altered version of p1\n fn: { |self, ev| // able to access both local and global dict\n Pbindf(loc.p1.fn(ev), \\mtranspose, self.state.next) // * dict.some_name.some_key.fn(ev),\n },\n state: Pseq((1..3),inf).asStream\n )\n // etc..\n )\n};\n\n// and while working in file which resides above directory where test.scd located\n(\nvar dict = \"pat/*.scd\".resolveRelative.pathMatch.inject((), { |d, i| // create dictionary\n d[i.basename.splitext[0].asSymbol] = i.load.(d) \n});\ndict.test.p2.fn((delta:\n```"}, {"role": "assistant", "content": "i don't like scrolling large files and stick to \"don't-repeat-youself\" principle - therefore i come to this technique for code structuring which involves [using Environments as object prototypes](http://bit.ly/LAFfEg) and closures. sclang is cool )."}], "family": "D3", "source_id": "sccode:1-4R5", "aug": "patch", "prompt_tokens": 549, "answer_tokens": 95}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//larger sparse arrays; some may lead to silence\n//feedback warning!\n\n(\na=[10]++(Array.fill(10,{var bsize, asize; bsize= rrand(1,2); asize=rrand(0,1); \n\n[0.7.rand2,bsize]++(Array.fill(bsize,{[rrand(0,999), exprand(0.1,6)]}).flatten) ++ [asize] ++ (Array.fill(asize,{[rrand(0,999), exprand(0.1,6)]}).flatten);\n\n}).flatten);\n //feedback coefficients\nc=Buffer.sendCollection(s, a, 1);\n)\n\n{(NL2.ar(SoundIn.ar([0,1]),c,1000,1000).clip2(1.0))}.play //with\n\n(\nvar e; \nvar num; \n\nnum=rrand(2,10);\n\ne=[num]++(Array.fill(num,{var bsize, asize; bsize= rrand(1,2); asize=rrand(0,1); \n\n[0.7.rand2,bsize]++(Array.fill(bsize,{[rrand(0,999), exprand(0.1,6)]}).flatten) ++ [asize] ++ (Array.fill(asize,{[rrand(0,999), exprand(0.1,6)]}).flatten);\n\n}).flatten);\n\nif(e.size<=a.size,{\n\nc.sendCollection(e);\n});\n)\n```"}, {"role": "assistant", "content": "run first code block, then second, then third. re-run third block to randomly generate a new array of filter parameters. processes standard audio in and plays through standard audio out."}], "family": "D3", "source_id": "sccode:1-4R4", "aug": "patch", "prompt_tokens": 518, "answer_tokens": 53}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\nThis compilation is meant to be downloaded in full and played on random.\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\nBlog post about this track: http://schemawound.tumblr.com/post/29553130142/se7en-seconds-in-hea7en-the-crawl\n*/\n\n(\n var seconds = 7;\n\n { \n SynthDef(\\TheCrawl, {|seconds = 7|\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var output = \n Mix(\n Pulse.ar(\n (400..550) * Line.ar(1, 2.5, seconds), \n * SinOsc.ar(0.2222) * SinOsc.ar(0.31) * SinOsc.ar(0.123).range(0.1, 0.9)\n )\n ) * 0.1 * SinOsc.ar([300,150]) * env;\n output = ((output + CombL.ar(output, 0.1, 0.1, 0.1) * 0.5) * 0.4).clip2(0.2);\n output = BMoog.ar(output, 5000);\n output = FreeVerb.ar(output, Line.ar(0, 1, seconds) , 1, 0);\n Out.ar(0, output);\n }).add;\n\n s.sync;\n\n Synth(\\TheCrawl, [\\seconds, seconds]);\n }.fork\n\n```"}, {"role": "assistant", "content": "Schemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\r\nThis compilation is meant to be downloaded in full and played on random.\r\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\r\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\r\nBlog post."}], "family": "D3", "source_id": "sccode:1-4QZ", "aug": "patch", "prompt_tokens": 622, "answer_tokens": 162}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\nThis compilation is meant to be downloaded in full and played on random.\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\nBlog post about this track: http://schemawound.tumblr.com/post/29553173950/se7en-seconds-in-hea7en-please-hold\n*/\n\n(\n var seconds = 7;\n\n { \n SynthDef(\\PleaseHold, {|seconds = 7|\n var sines = \n SinOsc.ar(Line.kr([40, 47], 47, seconds - 1)) \n * \n SinOsc.ar(Line.kr([65, 60], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([80, 89], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([300, 270], 47, seconds - 1))\n * \n SinOsc.ar(Line.kr([435, 472], 47, seconds - 1))\n *\n Line.ar(1, 0, seconds)\n ;\n var verb = FreeVerb.ar(sines, 1, 1, 0) * 0.9;\n var riseLine = (SinOsc.ar([330, 335]) * Line.ar(0, 0.5, seconds)).clip2(0.4);\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var output = (verb + \n```"}, {"role": "assistant", "content": "Schemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\r\nThis compilation is meant to be downloaded in full and played on random.\r\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\r\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\r\nBlog post."}], "family": "D3", "source_id": "sccode:1-4QY", "aug": "patch", "prompt_tokens": 612, "answer_tokens": 162}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\nThis compilation is meant to be downloaded in full and played on random.\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\nBlog post about this track: http://schemawound.tumblr.com/post/29553156736/se7en-seconds-in-hea7en-sound-check\n*/\n\n(\n var seconds = 7;\n\n { \n SynthDef(\\SoundCheck, {|seconds = 7|\n var sin1 = SinOsc.kr([110, 90], 0, [440, 330]);\n var sin2 = SinOsc.kr(1, 0, 5, 105);\n var sinModDepth = SinOsc.kr(0.01, 0, 10) * SinOsc.ar(0.00033, 0, 1000); //Magic number for 7 seconds\n var sinMod = (sin1 + sin2) * sinModDepth;\n var ampMod = SinOsc.kr(0.1, 0, 0.5, 1) * SinOsc.kr(1, 0, 0.5, 1);\n var sinLine = SinOsc.ar(Line.kr(40, 10, seconds););\n var sum = SinOsc.ar(sinMod, 0, ampMod).distort;\n var comb1 = (CombL.ar(sum, 0.01, 0.005, 1) + sum) * sinLine;\n var comb2 = (comb1 + (CombL.ar(comb1, 0.008, 0.007, 0.5) * 0.4));\n var clip1 = comb2.clip2(1) * 0.8;\n var env\n```"}, {"role": "assistant", "content": "Schemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\r\nThis compilation is meant to be downloaded in full and played on random.\r\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\r\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\r\nBlog post."}], "family": "D3", "source_id": "sccode:1-4QX", "aug": "patch", "prompt_tokens": 649, "answer_tokens": 162}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\nThis compilation is meant to be downloaded in full and played on random.\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\nBlog post about this track: http://schemawound.tumblr.com/post/29553190911/se7en-seconds-in-hea7en-by-the-throat\n*/\n\n(\n var seconds = 7;\n\n { \n SynthDef(\\ByTheThroat, {|seconds = 7|\n var pulse = (Pulse.ar(10, 0.5, 0.5) + Pulse.ar(35, 0.3, 0.5));\n var sin1 = SinOsc.ar(LFNoise0.kr([1.2, 1.0], 1000, 1000));\n var line1 = Line.kr(10, 3000, seconds);\n var sin2 = SinOsc.ar(line1);\n var out = pulse * sin1 * sin2 * 0.3;\n var line2 = Line.kr(100, 5000, seconds);\n var filt1 = BMoog.ar(out, line2, 0.1, 0, 0.95) * 0.8;\n var env = EnvGen.ar(Env.linen(0.1, seconds - 0.2, 0.1), doneAction:2);\n var comb = (CombL.ar(filt1, 0.1, 0.1, 1) + filt1) * env;\n Out.ar(0, HPF.ar(comb, 15) * 0.4);\n }).add;\n\n s.sync;\n\n Synth(\\ByTheThroat, [\\seconds, seconds]);\n }.fo\n```"}, {"role": "assistant", "content": "Schemawound track from \"Waxen Wings Presents: Se7en Seconds in Hea7en\". A Collection of 71 works all 7 seconds in length.\r\nThis compilation is meant to be downloaded in full and played on random.\r\nThe compilation is available for free download from http://waxenwings.bandcamp.com/album/se7en-seconds-in-hea7en/\r\nFull HD version of the accompanying video can be seen at vimeo.com/47629281/\r\nBlog post."}], "family": "D3", "source_id": "sccode:1-4QW", "aug": "patch", "prompt_tokens": 648, "answer_tokens": 162}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from the SIGNALVOID compilation.\nSIGNALVOID is a noise compilation. Participants were asked to create up to three tracks, each of exactly one minute in length, with no gaps of silence at the beginning or end. Download the free compilation here: http://archive.org/details/SignalvoidMp3 or http://archive.org/details/SignalvoidFlac\nPhysical copies are available here http://signalvoid.bandcamp.com/merch/signalvoid-2\n\nBlog post about the creation of this track http://schemawound.tumblr.com/post/29065985817/signalvoid-1-burn-it-to-disc-then-burn-the-disc\n*/\n\n(\n {\n var saw1 = Saw.ar((10..100));\n var saw2 = Mix(Saw.ar(saw1).range(100, 600));\n var sin0 = SinOsc.ar(0.002).range(5,75);\n var sin1 = SinOsc.ar(0.1).range(1,sin0);\n var sin2 = SinOsc.ar(0.15).range(2,10);\n var sinMod = (sin1 * sin2)!2;\n var sin66 = SinOsc.ar(0.0164).range(600,1000);\n var saw3 = Saw.ar(sinMod).range(200, sin66);\n var saw4 = Saw.ar(saw3);\n var sin3 = Mix(SinOsc.ar((1..100)));\n var sum1 = (saw2 * saw4) * sin3;\n var comb1 = CombL.ar(sum1, 1, 0.2, 1) + sum1;\n var sin4 = SinOsc.ar(0.12).range(3, 1000);\n var comb2 = comb1.tanh;\n var sin5 = SinOsc.ar(sin4)\n```"}, {"role": "assistant", "content": "Schemawound track from the SIGNALVOID compilation.\r\nSIGNALVOID is a noise compilation. Participants were asked to create up to three tracks, each of exactly one minute in length, with no gaps of silence at the beginning or end. Download the free compilation here: http://archive.org/details/SignalvoidMp3 or http://archive.org/details/SignalvoidFlac\r\nPhysical copies are available here http://signalv."}], "family": "D3", "source_id": "sccode:1-4QU", "aug": "patch", "prompt_tokens": 644, "answer_tokens": 161}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nSchemawound track from the SIGNALVOID compilation.\nSIGNALVOID is a noise compilation. Participants were asked to create up to three tracks, each of exactly one minute in length, with no gaps of silence at the beginning or end. Download the free compilation here: http://archive.org/details/SignalvoidMp3 or http://archive.org/details/SignalvoidFlac\nPhysical copies are available here http://signalvoid.bandcamp.com/merch/signalvoid-2\n\nBlog post about the creation of this track http://schemawound.tumblr.com/post/29066507849/signalvoid-2-the-same-color-as-your-skin\n*/\n\n(\nvar songLength = 60;\n{\n //Sines\n var sineLine1 = Line.kr(600, 210, songLength);\n var sineLine2 = Line.kr(100, 210, songLength);\n var sines = SinOsc.ar(sineLine1) * SinOsc.ar(sineLine2);\n //Filter\n var filterLineLFO = SinOsc.ar(0.2);\n var filterLine = Line.kr(200, 6000, songLength, doneAction: 2) * filterLineLFO;\n var filtLFO = SinOsc.kr(0.4).range(60, filterLine);\n var filter = BMoog.ar(sines, filtLFO, 0.9, 1).tanh * 0.5;\n //Comb\n var comb = CombL.ar(filter, 1, 0.3, 1);\n var mix1 = (comb + GVerb.ar(filter)) * 0.1;\n mix1 = (CombL.ar(mix1, 1, 1, 6) * 0.3) + mix1;\n HPF.ar(mix1, 100) * 0.5;\n}.play\n)\n```"}, {"role": "assistant", "content": "Schemawound track from the SIGNALVOID compilation.\r\nSIGNALVOID is a noise compilation. Participants were asked to create up to three tracks, each of exactly one minute in length, with no gaps of silence at the beginning or end. Download the free compilation here: http://archive.org/details/SignalvoidMp3 or http://archive.org/details/SignalvoidFlac\r\nPhysical copies are available here http://signalv."}], "family": "D3", "source_id": "sccode:1-4QT", "aug": "patch", "prompt_tokens": 633, "answer_tokens": 161}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\clusterboom, {| out = 0, freq=55, dur=1, amp=1|\n Out.ar(\n out,\n Splay.ar({SinOsc.ar(exprand(freq-(freq/128),freq+(freq/128)),0,0.1)}!33)\n * EnvGen.kr(Env.perc,1,1,0,dur,2)\n * amp\n ) \n}).add;\n);\n\n\n(\n~notes = [ 21, 21, 9, 19, 19, 9 ];\n~durs = [ 1/4, 1/4, 1/2, 1/8, 1/8, 14/8 ];\n~amps = [ 4, 4, 0, 3, 3, 0 ];\n\n~notespatternproxy = PatternProxy(Pxrand(~notes,inf)); \n~durspatternproxy = PatternProxy(Pxrand(~durs, inf));\n~ampspatternproxy = PatternProxy(Pxrand(~amps, inf)); \n\np = Pbind(\n \\instrument, \\clusterboom,\n \\midinote, ~notespatternproxy,\n \\dur, ~durspatternproxy,\n 'amp', ~ampspatternproxy, \n);\n);\np.play;\n\n// eval while running:\n\n~notespatternproxy.source = Pxrand(~notes + 7,inf); \n~notespatternproxy.source = Pxrand(union(~notes, ~notes + 7),inf); \n~notespatternproxy.source = Pxrand(~notes,inf);\n```"}, {"role": "assistant", "content": "change stuff in running Pbind with patternproxies (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-4QQ", "aug": "patch", "prompt_tokens": 564, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nServer.local.waitForBoot({\n(\nz.free;\nz = Buffer.alloc(s, 512, 1);\nz.sine1(1.0 / [1, 2, 3, 4], true, true, true);\n\n fork( { loop {\n SynthDef(\"g1\",{ arg out=0,bufnum=0,dur=1,rate=1,pos=0,sdens=1,edens=1;\n var dens = Line.kr(sdens,edens,dur);\n var trig = [LFNoise0,SinOsc,Impulse,LFPulse,LFSaw].choose.ar(Line.kr(sdens,edens,dur));\n //var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*0.5.rrand(2)),doneAction:2);\n var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*(0.5.rrand(4))),doneAction:2);\n Out.ar(out,\n GrainBuf.ar(2,trig,1/dens,bufnum,rate,pos)*env;\n )\n }).add();\n [1,2,4,8,16,32].choose.postln.wait;\n }\n }\n );\n\n\na = Pbind(\\instrument,\\g1,\\dur,Pseq([Pseq([0.25],32),Pseq([0.25,0.125,0.125],32),Pseq([0.125],32)],inf),\\sdens,Pseq([9000,1000,500]/10,inf),\\edens,Prand([Pseq([9000,1000,500]/10,4),Pseq([1],1)],inf),\\rate,Pfunc({-10.0.rrand(10)}),\\pos,Pfunc({1.0.rand}),\\bufnum,z.bufnum);\nb = Pbind(\\instrument,\\g1,\\dur,Pseq([4],inf),\\sdens,Pseq([9000,1000,500]/100,inf),\\edens,Prand([Pseq([9000,1000,500]/10,1),Pseq([1],3)],inf),\\rate,Pfunc({-10.0.rrand(10)}),\\pos,Pfunc({-10.0.rrand(10)}),\\bufnum,z.bufnum);\nc = Pbind(\\instrument,\\g1,\\dur,Pseq([4/3],in\n```"}, {"role": "assistant", "content": "Hi to all SCaddicts,\r\nThis is my first post here, hope you'll enjoy it.\r\nRhythmic automaton with some nice *hope so* effects."}], "family": "D3", "source_id": "sccode:1-4QN", "aug": "patch", "prompt_tokens": 821, "answer_tokens": 53}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n////////#superCollider///////////\n///// audio @ http://archive.org/details/ChiptuneBreakz\n///\n(\nTdef(\\cheaptune,{\n var sig2,sig1,sig3,a,rel; \n sig1=[8,12,16,20];\n sig2=2/sig1.scramble;\n sig3=2*sig1.scramble;\n rel=Pxrand([0,0,0,0,0,0,0,1],inf).asStream;\n inf.do{\n a=[0.125,0.25,0.5,0.5,0.25,0.125,1].choose;\n x=[60,67,75,79,94].scramble;\n play{EnvGen.ar(Env.perc(0.01,a+rel.next),doneAction:2)*\n AY.ar(x.midicps*a*sig1.choose,x*sig2.choose.midicps,a*sig3.choose.midicps,0.25,3,15,10,7)};\n play{EnvGen.ar(Env.perc(0.01,a/2),Duty.kr(Dseq([0.5,0.25],inf),0,Dxrand([0,1],inf)),doneAction:2)*\n BrownNoise.ar(0.6)!2};\n play{EnvGen.ar(Env.perc(0.01,a/4),Duty.kr(Dseq([0.25,0.5],inf),0,Dseq([0,1],inf)),doneAction:2)*\n LFNoise0.kr(16)*WhiteNoise.ar(0.2)!2};\n a.wait\n }\n});\nTdef(\\cheaptune).play;\n);\ns.record;\ns.stopRecording;\n//\n```"}, {"role": "assistant", "content": "playing around with few functions, came up with this nice aleatory chiptune breakz!."}], "family": "D3", "source_id": "sccode:1-4QM", "aug": "patch", "prompt_tokens": 607, "answer_tokens": 27}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\ChicagoPad2, { |out = 0, freq = 440, freq2=660, freq3=528, cutoff = 500, amp = 0.2, gate=1|\n\n var snd;\n var delay = 0.045+0.05;\n\n freq = freq + SinOsc.kr(freq*1/2, 0, freq/2, 0);\n\n snd = Saw.ar([freq, freq+1, freq-1, freq2, freq3] * [0.99,1])*0.1;\n\n snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1, freq2, freq3, freq2+1, freq3+1],0, LFTri.kr(7.13).range(0.00,0.1))*0.1;\n\n\n snd = Mix(snd);\n snd = FreeVerb.ar(snd, 0.51,10,0.1)*2;\n snd = snd *8;\n snd = RLPF.ar(snd, SinOsc.kr([0.1,4.2], 0, [1700,480], [4000,700,5000])/[20.51,20], SinOsc.ar(0.1,1.5*pi)+1.05)/3;\n snd = Mix(snd);\n\n snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);\n\n snd = snd * EnvGen.ar(Env.dadsr(delay,0.4, 0.01,0.8,0.4), gate, doneAction:2);\n //snd = snd * EnvGen.ar(Env.adsr(0.4, 0.01,0.8,0.4), gate, doneAction:2);\n\n snd = [snd , AllpassC.ar(snd, delay, 0.05+SinOsc.ar(0.11).range(0,0.045), 0.3)];\n snd = snd * amp;\n Out.ar(out, snd);\n\n}).add;\n);\n\n(\nPdef(\\plop2, Pbind(\n \\instrument, \\ChicagoPad2,\n \\degree, Pseq([0,4,0,3,1],inf),\n \\root, -4,\n \\freq2, Pkey(\\freq)*(3/2) / 2,\n \\freq3, Pkey(\\freq)*(5/6) / 2,\n \\legato, 1,\n \\cutoff, 4500,\n \\dur\n```"}, {"role": "assistant", "content": "a little fork of the Chicago chord pad. Edit: eliminate the click by replacing adsr by dadsr."}], "family": "D3", "source_id": "sccode:1-4QL", "aug": "patch", "prompt_tokens": 813, "answer_tokens": 42}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\fun, {\n var src, freq = 25;\n var lagTime = \\lagTime.kr(0);\n var vibrato = \\vibrato.kr([ 1.3515662384033, 1.3061940193176, 0.604791264534, 1.2328997278214, 0.33569867610931, 0.40528120040894, 1.0865307760239, 1.22394572258, 1.7781081724167, 0.15319232463837 ], lagTime);\n \n var vibRatio = \\vibRatio.kr([ 2.9047239411079, 0.39578121743921, 0.10932490532285, 0.051738858660565, 0.17840235868831, 0.024495380749894, 3.9689920754869, 4.1139229659643, 0.23327501819885, 0.97643604193256 ], lagTime);\n \n var freqVary = \\freqVary.kr([ 143.76541377614, 14.25479545154, 6.6728691888342, 58.434807398325, 154.89385962072, 34.112274650688, 3.1140823758236, 10.42040949808, 158.59959972037, 1.2163188440936 ], lagTime);\n \n \n var numSrcs = vibrato.size;\n\n src = numSrcs.collect{|i|\n var freq2 = (freq * freqVary[i]) * LFNoise2.kr(0.01).range(1, 1.5);\n \n SyncSaw.ar(freq2, freq2 * SinOsc.ar(Line.kr(1, vibrato[i], 20) * vibRatio[i], Rand(0, 0.8)).range(pi, pi * 0.1)) * rrand(0.05, 0.1)\n };\n \n src = Splay.ar(src);\n \n}).play\n);\n\nNdef(\\fun).fadeTime = 20;\n\nNdef(\\fun).rebuild\n\n(\nNdef(\\fun).setn(\n \\lagTime, [5],\n \\vibRatio, {exprand(0.1, 3)}!10,\n \\freqVary, {exprand(1, 150)}!10,\n \n```"}, {"role": "assistant", "content": "Based on the answer to my question if there is a synced oscillator on SuperCollider, I played with SyncSaw as suggested by JmC."}], "family": "D3", "source_id": "sccode:1-4QF", "aug": "patch", "prompt_tokens": 845, "answer_tokens": 44}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nfork { loop {\n Ndef(\\ae, {\n var gen = { |...par| [LFNoise2,LFNoise0,LFBrownNoise2,LFBrownNoise0,SinOsc,LFPar].choose.kr(*par) };\n var sig = Median.ar(6, [LFCub,LFSaw,LFPulse].choose.ar(\n LFSaw.kr([8,10]).exprange(40,gen.([1/11,1/9]).exprange(300,600)) \n * gen.([1/10,1/11]).range(1,3)\n ).perform(\n [\\ring2,\\ring1,\\sqrdif].choose,\n VarSaw.ar(\n LFTri.kr([9,11]).exprange(80,gen.([1/10,1/11]).exprange(1200,6200)) \n * gen.([1/10,1/11]).range(0.3,2),\n 0, gen.([1/9,1/8]).range(0.1,0.9)\n )\n ))\n * Decay.kr(\n Impulse.kr(\n [2,3] * gen.([1/5,1/6]).exprange(1/2,4), \n mul: gen.(1).range(0.7,1)\n )\n + Dust.kr([4,5] / 2 * gen.([1/5,1/6]).exprange(1,4), gen.(1).range(0.2,0.5)), \n { gen.(1/5.rrand(10)).range(0.1.rrand(0.2),0.3.rrand(0.5)) } ! 2\n );\n Limiter.ar(\n GVerb.ar(\n Rotate2.ar(sig[0],sig[1], gen.(1)) \n * LFGauss.kr([1/10,1/11], { gen.(1/9).range(0.15,0.3) } ! 2)\n + BPF.ar(\n WhiteNoise.ar(EnvGen.kr(Env.perc.circle, 1, gen.([1/3,1/4]).range(0.2, 0.45), 0, gen.([1/4,1/5]).exprange(0.1, 0.5))),\n gen.([1/5,1/6]).range(200.rrand(600), 4200),\n gen.\n```"}, {"role": "assistant", "content": "some sound exploring - [soundcloud](http://soundcloud.com/vividsnow/bin-aural-revolve)."}], "family": "D3", "source_id": "sccode:1-4Qi", "aug": "patch", "prompt_tokens": 752, "answer_tokens": 40}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// proceed with caution. start at min volume, and not with your expensive speakers.\n\nfork{b=Buffer.alloc(s,512,1);inf.do{b.cheby({[1,0].choose}!2);{(Shaper.ar(b,SinOsc.ar(55,0,Line.kr(1,0,2,1,0,2))))!2}.play;0.1.wait;}};\n```"}, {"role": "assistant", "content": "can anyone tell me what the loud click is, and how to control it?\r\n\r\ni kind of really like it, but it sounds scary, \r\n\r\nand the resulting waveform is bizarre, too.\r\n\r\n[http://soundcloud.com/tengototen/m-chtegern-ikeda](http://soundcloud.com/tengototen/m-chtegern-ikeda)\r\n\r\n\r\nupdate: some discussion, and lots of interesting things to try out, [on the list](http://new-supercollider-mailing-lists-foru."}], "family": "D3", "source_id": "sccode:1-4Qc", "aug": "patch", "prompt_tokens": 173, "answer_tokens": 176}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/*\nsonic focal depth\nTen layers of sound, all constantly running,\nyet only one is in \"sharp focus\" at any time.\nMove the mouse up and down to control the focal depth.\nby Dan Stowell 2012-05-14, after a chat w Simon Katan.\n\nYou'll need the PV_MagSmooth ugen which is in sc3-plugins.\n*/\n\ns.boot\n\n~nlayers = 10;\n~basefreqs = ~nlayers.collect{|x| (x * 7 + 60).midicps};\n~fftbufs = ~nlayers.collect{ Buffer.alloc(s, 2048) };\n\n(\nx = {\n var layers, position, trig, ampenv, freqenv, layerpos, smoothfactor, ampfactor;\n position = MouseY.kr(0, 1);\n /* Create sounds - each layer must have spectral variation in it */\n layers = ~basefreqs.collect{ |basefreq|\n trig = Dust.ar(10);\n ampenv = Decay2.ar(trig, 0.0001, 0.2);\n freqenv = Decay.ar(trig, 0.1).linexp(0,1,1,1.5);\n SinOsc.ar(freqenv * basefreq, 0, ampenv);\n };\n /* Now apply focal effect - least smoothing (0) when the \n mouse is at the same \"position\" as a layer */\n layers = layers.collect{|son, i|\n layerpos = i / (~nlayers - 1); // 0 to 1\n smoothfactor = 1 - (layerpos - position).abs.linexp(0,1, 1, 0.0005);\n ampfactor = (layerpos - position).abs.linlin(0,1, 1, 0.9);\n IFFT(PV_MagSmooth(FFT(~fftbufs[i], son\n```"}, {"role": "assistant", "content": "Ten layers of sound, all constantly running,\r\nyet only one is in \"sharp focus\" at any time.\r\nMove the mouse up and down to control the focal depth.\r\nby Dan Stowell 2012-05-14, after a chat w Simon Katan.\r\n\r\nYou'll need the PV_MagSmooth ugen which is in sc3-plugins."}], "family": "D3", "source_id": "sccode:1-4Q5", "aug": "patch", "prompt_tokens": 641, "answer_tokens": 109}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nfork{\n // notes sequence\n var seq = Pxrand([0,3,5,7,8],inf).asStream;\n loop{\n var dur = 8;\n var num = 8;\n var root = 36;\n var freq = (seq.next+root).midicps;\n var spread = rrand(0.4,0.8);\n var attack = rrand(0.05, 0.3);\n \n // play the cluster\n play{\n var harm = Array.geom(num, 1, 1.5);\n var harma = Array.geom(num, 0.5, 0.8);\n var detune = Array.fill(num, { LFNoise2.kr(1,0.01,1) });\n var source = PinkNoise.ar;\n var bandwidth = Rand(0.001,0.01);\n var generator = [\n SinOsc.ar(freq*harm*detune, mul:harma*0.3).scramble,\n Resonz.ar(source, freq*harm*detune, bandwidth, mul:harma).scramble * 50\n ].wchoose([0.2,0.8]);\n var snd = Splay.ar(generator,spread);\n snd * LFGauss.ar(dur, attack, loop:0, doneAction:2);\n };\n dur.wait;\n };\n \n};\n\n// global triple super gverb\n{\n var in = In.ar(0,2);\n in = (in*0.2) + GVerb.ar(in, 220, 12, mul:0.6);\n in = (in*0.2) + GVerb.ar(in, 220, 12, mul:0.6);\n in = (in*0.2) + GVerb.ar(in, 220, 12, mul:0.6);\n ReplaceOut.ar(0, Limiter.ar(LeakDC.ar(in)))\n}.play(addAction:\\addToTail)\n```"}, {"role": "assistant", "content": "Going to sleep, need some relaxing after 10 hours epic sax guy."}], "family": "D3", "source_id": "sccode:1-4EG", "aug": "patch", "prompt_tokens": 619, "answer_tokens": 24}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// 2012.05.04\n// Work for NX014 Class\n// Inspiration: A Rukano Tweet. Thanks rukano!\n// Comment: Cosmic Organ.\n\np = ProxySpace.push(s.boot);\n\n~a.play;\n\n~a = { var alpha,gamma;\n alpha= LFNoise2;\n gamma= {[rrand(30,50),rrand(50,70),rrand(50,70),rrand(70,100)].choose.midicps*alpha.kr(1,0.01,1)}!24;\n Pan2.ar(LeakDC.ar(Normalizer.ar(\n BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(FreeVerb.ar(\n Splay.ar(RLPF.ar(LFSaw.ar(gamma)/4,gamma*LFCub.kr(rrand(0.01,0.1),0,2,3),alpha.kr(1/8,0.6,0.7))) \n ,0.1,0.1,0.1)\n ,100,6.0,6),1000,6.0,0),5000,6.0,0),10000,6.0,6)\n ,(0.8/0.999)*1,0.1)),0)\n};\n\n~a = nil;\n```"}, {"role": "assistant", "content": "A cosmic organ with a inspiration of rukano tweet. Thanks rukano!."}], "family": "D3", "source_id": "sccode:1-4mZ", "aug": "patch", "prompt_tokens": 451, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// fixed (unchanging) impulse response\n// cmd-. to stop\n\n(\ns.waitForBoot {\n var c = Condition.new, cleanfunc = { CmdPeriod.remove(cleanfunc); b.free };\n fork {\n b = Buffer.alloc(s, 2048, 1);\n CmdPeriod.add(cleanfunc);\n s.sync;\n a = {\n RecordBuf.ar(BrownNoise.ar * EnvGen.ar(Env(#[0, 1, 0], #[0.5, 0.5], \\sin), timeScale: b.duration, doneAction: 2), b, loop: 0);\n 0\n }.play;\n OSCpathResponder(s.addr, ['/n_end', a.nodeID], { |time, resp, msg|\n resp.remove;\n c.unhang;\n }).add;\n c.hang;\n a = {\n var freq = MouseX.kr(150, 450, warp: 1, lag: 0.1);\n LeakDC.ar(Convolution2.ar(Impulse.ar(freq), b, framesize: b.numFrames) * -35.dbamp) ! 2;\n }.play;\n };\n};\n);\n\n\n\n// multiple impulse responses for timbre control\n(\ns.waitForBoot {\n var c = Condition.new, cleanfunc = { CmdPeriod.remove(cleanfunc); b.free };\n fork {\n b = Buffer.allocConsecutive(3, s, 2048, 1);\n CmdPeriod.add(cleanfunc);\n s.sync;\n a = {\n var sig = [BrownNoise.ar, PinkNoise.ar, WhiteNoise.ar];\n sig.do { |chan, i|\n RecordBuf.ar(chan * EnvGen.ar(Env(#[0, 1, 0], #[0.5, 0.5], \\sin), timeScale: b[i].duration, doneAction: 2), b[i], loop: 0);\n \n```"}, {"role": "assistant", "content": "Inspired by Formlet, which does something like formant synthesis by outputting short sinusoidal grains in response to impulses, I thought, what if we replace the sine grains with an arbitrary impulse response?\r\n\r\nYou could do that with TGrains, but as the pitch goes up, so does the number of overlapping grains and CPU use along with it. But, convolution of a chain of impulses should be the same as."}], "family": "D3", "source_id": "sccode:1-2XJ", "aug": "patch", "prompt_tokens": 674, "answer_tokens": 129}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(// * //watch the postWindow\na=[\"m\",\"x\",\"f\",\"k\",\"d\",\"p\"];\nx=Array;\ny=x.newClear(6);\n~mxfkdp=Task({\n inf.do({y.put(x.series(6,0,1).choose,a.scramble).postln;\n 0.03.wait;})}).play;\nm=fork({inf.do({\n \"array num:\".postcln;\n if(y[x.series(6,0,1).choose.postcln]==a,\n {\"lo encontraste!/found it!\".postcln;\n 1.do({GVerb.ar(\n EnvGen.ar(Env.perc(0.01,8),1,doneAction:2)*\n Blip.ar(XLine.kr(440,1600,8)),50,10,0.02)}.play);\n ~mxfkdp.stop;\n m.stop;}, \n {\"buscando.../seeking...\".postcln;});\n 0.03.wait})});\n);\n//.SCtweetLong\n```"}, {"role": "assistant", "content": "this code throws a scrambled array of arrays seeking among them for the original array,\r\nIt only sounds when it founds it. (may take a while)\r\nthe idea started trying a SCtweet, but became with this funny code!."}], "family": "D3", "source_id": "sccode:1-2v2", "aug": "patch", "prompt_tokens": 393, "answer_tokens": 69}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n Ndef(\\x, {\n var output;\n var delayTime;\n var delayMax = 0.2;\n var delayAdd = 0.1;\n var pulseFreq = 0.5;\n var proxyMul = 2;\n var pulseMin = 40;\n var pulseMax = 130;\n var numOfEchos = 2;\n\n var mainPulse = LFPulse.ar(pulseFreq, 0, 0.5).range(pulseMin, pulseMax);\n var proxy = Ndef(\\x).ar * proxyMul;\n var ampModFreq = SinOsc.ar(0.01, 0).range(0.3, 30);\n var ampMod = LFNoise1.ar(ampModFreq, 6);\n output = SinOsc.ar(mainPulse + proxy, 0, ampMod).tanh;\n numOfEchos.do{\n delayTime = {delayMax.rand + delayAdd}!2;\n output = AllpassL.ar(output, 0.1, delayTime, 5);\n };\n output.tanh;\n }).play\n)\n```"}, {"role": "assistant", "content": "Something I put together a while back by forking Dark Sea Horns."}], "family": "D3", "source_id": "sccode:1-29p", "aug": "patch", "prompt_tokens": 376, "answer_tokens": 21}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(SynthDef(\\x, {|midi = 60, amp = 0.8| Out.ar(0, Pan2.ar(SinOsc.ar(midi.midicps, mul: EnvGen.kr(Env.perc(0, 0.5), timeScale: 0.5, levelScale: 0.3)), Rand(-1, 1)) * EnvGen.kr(Env.perc(0, 0.5), timeScale: 1.3*0.5, levelScale: Rand(0.3, 0.5), doneAction:2));}).add;)\n\n(~phase = Pbind(*[ instrument: \\x, dur: 0.5, midi: Pseq([0, 4, 7] + 60, inf)]);\n5.do({|val| ~phase.play(TempoClock.new((110 + (0.5 * val)) / 60))}); )\n```"}, {"role": "assistant", "content": "Experimenting with some Reich style phasings\r\n\r\nAudio: http://soundcloud.com/schemawound/goodnightworld."}], "family": "D3", "source_id": "sccode:1-29d", "aug": "patch", "prompt_tokens": 301, "answer_tokens": 46}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\dubecho,{|in, out, length = 1, fb = 0.8, sep = 0.012|\n var input = In.ar(in, 2);\n var feedback = LocalIn.ar(2);\n var output = LeakDC.ar(feedback*fb + input);\n output = HPF.ar(output, 400);\n output = LPF.ar(output, 5000);\n output = output.tanh;\n LocalOut.ar(DelayC.ar(output, 1, LFNoise2.ar(12).range([length,length+sep],[length+sep,length])).reverse);\n ReplaceOut.ar(out, output);\n}).add;\n\n// Example as effecet bus\n~bus = Bus.audio(s, 2);\n~echo = Synth(\\dubecho, [\\in, ~bus, \\length, TempoClock.default.tempo*(3/8), \\fb, 0.7, \\sep, 0.0012], addAction: \\addToTail);\n\n// send something\nplay{ Out.ar(~bus, LFGauss.ar(1, 0.1, loop:0, doneAction:2) * Blip.ar(80!2, 8)) }\n\n// turn it off\n~echo.free;\n```"}, {"role": "assistant", "content": "Fork of Bjorn's Dub echo, rewritten w/o the Feedback Quark (using LocalIn + LocalOut) and adding a ping pong (can be removed by deleting the .reverse method in the LocalOut line)."}], "family": "D3", "source_id": "sccode:1-1P8", "aug": "patch", "prompt_tokens": 417, "answer_tokens": 75}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\dubecho,{|in, out, length = 1, fb = 0.8, sep = 0.012|\n var input = In.ar(in, 2);\n var output = input + Fb({ |feedback|\n \n var left, right;\n var magic = LeakDC.ar(feedback*fb + input);\n magic = HPF.ar(magic, 400); // filter's on the feedback path\n magic = LPF.ar(magic, 5000);\n magic = magic.tanh; // and some more non-linearity in the form of distortion\n #left, right = magic; // let's have named variables for the left and right channels\n magic = [DelayC.ar(left, 1, LFNoise2.ar(12).range(0,sep)), DelayC.ar(right, 1, LFNoise2.ar(12).range(sep,0))].reverse;\n\n },length);\n\n ReplaceOut.ar(out, output);\n}).add;\n\n// Example as effecet bus\n~bus = Bus.audio(s, 2);\n~echo = Synth(\\dubecho, [\\in, ~bus, \\length, TempoClock.default.tempo*(3/8), \\fb, 0.7, \\sep, 0.0012], addAction: \\addToTail);\n\n// send something\nplay{ Out.ar(~bus, LFGauss.ar(1, 0.1, loop:0, doneAction:2) * Blip.ar(80, 8)) }\n\n// turn it off\n~echo.free;\n```"}, {"role": "assistant", "content": "Taking the Dub echo by Bjorn and putting some ping poing to it :)."}], "family": "D3", "source_id": "sccode:1-1P4", "aug": "patch", "prompt_tokens": 508, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\ping, { |out, freq=440, amp=0.1, impdecay=0.01, attack=0.0001,sustain=0.1, famt=3, ffreq=1000, hdur=0.1|\n var snd, trig, decay;\n trig = Impulse.ar(0);\n decay = Decay2.ar(trig, attack, impdecay) * 1;\n snd = Mix(Ringz.ar(decay, freq*[1,2], sustain));\n snd = snd + Mix(SinOsc.ar(freq*[Rand(1,1.1),Rand(1.4, 1.6), Rand(1.9,2.1), Rand(3.9, 4.1)], mul:Decay2.ar(trig, 0.01,hdur)));\n snd = BLowPass.ar(snd, ffreq * decay.linexp(0,1,1,famt), 0.1);\n snd = snd * EnvGen.ar(Env.linen(0, sustain/Rand(1.0,4.0), 0.1), doneAction:2);\n OffsetOut.ar(out, (snd * amp)!2);\n}).add;\n\nNdef(\\ping, Pbind(\n \\instrument, \\ping,\n \\scale, Scale.mixolydian,\n \\n, Pwhite(1,4,inf),\n \\octave, Pclump(Pkey(\\n), Prand([6,7], inf)),\n// \\degree, Pclump(Pkey(\\n), Pwrand([0,2,3,4,5,6], [10,7,3,5,2,1].normalizeSum, inf)),\n \\degree, Pclump(Pkey(\\n), Place([[0,1,2,3,4], [2,3,4,5,6], [4,3,4,3,6,7], [0,2,1,2,1,4,3,3,5]], inf)),\n \\attack, Pclump(Pkey(\\n), Pwhite(0.0005, 0.001)),\n \\sustain, Pfunc{ |e| e.octave / 4 } + Pwhite(0.01, 0.5, inf),\n \\strum, Prand([0, 1/3, 1/4, 1/16, 1/32, 1, 2], inf),\n \\detune, Pclump(Pkey(\\n), Pwhite(-2.0, 2.0, inf)),\n \\ffreq, Pclump(Pkey(\\n), Pwhite(200.0, 2000.0, inf\n```"}, {"role": "assistant", "content": "I was trying to to a music box sound that sounds kind of broken.\r\nNot very disappointed with the result :)."}], "family": "D3", "source_id": "sccode:1-1Kl", "aug": "patch", "prompt_tokens": 787, "answer_tokens": 37}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nvar base = 2.6; // or TempoClock.tempo; // set tempo\nthisThread.randSeed = 1000000.rand.postln; // to recall interesting variants\nf = { |out = 0|\n var sig = Pan2.ar(\n Klank.ar(\n `[ Array.rand(30, 50, 10000), Array.rand(30, 0, 1.0), Array.rand(30, 0, 1.0) ],\n [\n LFBrownNoise2.ar( LFDNoise3.kr(base / 4).range(20, 10000), 0.005),\n GbmanL.ar( MouseX.kr(0, Array.geom(5,2,2).choose), 3.0.rand2, 3.0.rand2 ) / 3,\n Impulse.ar( A2K.kr(GbmanL.ar(MouseY.kr(0, Array.geom(5,2,2).choose), 3.0.rand2, 3.0.rand2)) * base / 4 ) / 4,\n Dust.ar( Array.geom(4,base/2,2).choose ) / 4,\n Impulse.ar( Array.geom(4,base/2,2).choose ) / 4,\n LFPulse.ar( LFDNoise3.kr(base).range(62.rrand(100), 110.rrand(350)), mul: 0.003 )\n ].choose\n )\n * \n SinOsc.kr(\n Demand.kr(Impulse.kr(base / 16), 0, Dxrand(Array.geom(5, base / 4, 2), 8)),\n mul:0.1 * A2K.kr(GbmanL.ar(Array.geom(5,1/8,2).choose, 3.0.rand2, 3.0.rand2)), add:0.1\n ),\n LFTri.kr(base / (4,6..24).choose, mul: 0.7.rrand(0.2), add: 0.3.rand)\n );\n Out.ar(out, sig );\n};\n{ ReplaceOut.ar(0, Limiter.ar(FreeVerb.ar(In.ar(0,2), 1.0.rrand(0.33)))) }.play( addAction:\\addToTail );\n{ f.play(\n```"}, {"role": "assistant", "content": "lunatic asylum band during moon eclipse\r\n\r\np.s. slightly different sounding on each run )."}], "family": "D3", "source_id": "sccode:1-Td", "aug": "patch", "prompt_tokens": 700, "answer_tokens": 35}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n~x.play;\n\n~x = { var alpha,beta; alpha = rrand(99,399); beta = alpha = rrand(99,399);Pan2.ar(LeakDC.ar(Normalizer.ar(BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(BPeakEQ.ar(\nFreeVerb.ar(Formant.ar(TRand.kr(alpha,alpha+(rrand(5,20)),Impulse.kr(rrand(10,100))), TRand.kr(beta,beta+(rrand(5,20)),Impulse.kr(rrand(10,100))), EnvGen.kr(Env.adsr,Impulse.kr(rrand(100,666)))*rrand(666,3333),0.125),\nrrand(0.5,1.0),rrand(0.5,1.0),rrand(0.5,1.0))\n,100,6.0,12),1000,6.0,0),5000,6.0,0),10000,6.0,12),0.6,0.1)),0)\n};\n```"}, {"role": "assistant", "content": "A drone insect-string from:\r\n\r\nhttp://musicnumbers.wordpress.com/2011/11/25/nx010/."}], "family": "D3", "source_id": "sccode:1-Qw", "aug": "patch", "prompt_tokens": 377, "answer_tokens": 41}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\\klee8, {|freq= 400, rate= 0.5,\n list= #[0, 0, 0, 0, 0, 0, 0, 0],\n mul= #[0, 0, 0, 0, 0, 0, 0, 0]|\n var i= LFSaw.kr(rate, 1, 0.5, 0.5)*list.size;\n var sum= (mul*Select.kr(i+(0..list.size-1)%list.size, list)).sum;\n var src= SinOsc.ar(freq+sum, 0, Decay2.kr(Impulse.kr(list.size*rate), 0.01, 0.1, 0.5));\n Out.ar(0, Pan2.ar(Mix(src)));\n}).add;\n);\na= Synth(\\klee8)\na.set(\\list, #[4, 0, 0, 2, 0, 0, 0, 0]*100) //set the values\na.set(\\mul, #[1, 0, 0, 0, 0, 0, 0, 0]) //activate 1 read head\na.set(\\mul, #[1, 1, 0, 0, 0, 0, 0, 0]) //activate 2 read heads\na.set(\\mul, #[1, 1, 1, 0, 0, 0, 0, 0])\na.set(\\mul, #[1, 1, 1, 1, 0, 0, 0, 0])\n\na.set(\\mul, #[1, 0.5, 0.25, 0, 0, 0, 0, 0])\na.set(\\list, #[4, 0, -4, 2, 0, 0, 0, 0]*100)\na.set(\\freq, 500)\na.set(\\rate, 1.5)\na.free\n\n\n(\nSynthDef(\\klee16, {|freq= 400, rate= 0.5,\n list= #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n mul= #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]|\n var i= LFSaw.kr(rate, 1, 0.5, 0.5)*list.size;\n var sum= (mul*Select.kr(i+(0..list.size-1)%list.size, list)).sum;\n var src= SinOsc.ar(freq+sum, 0, Decay2.kr(Impulse.kr(list.size*rate), 0.01, 0.1, 0.5));\n Out.ar(0, Pan2.ar(Mix(src)));\n}).add;\n)\n```"}, {"role": "assistant", "content": "i've also written a pattern class Pklee http://fredrikolofsson.com/f0blog/?q=node/467."}], "family": "D3", "source_id": "sccode:1-Cw", "aug": "patch", "prompt_tokens": 807, "answer_tokens": 41}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\np = Pbind(\n \\instrument, \\bufGrainPan,\n \\bufnum, b,\n \\time, Pwhite(0.1, 0.3, inf),\n \\start, Pwhite(0.0, b.duration - Pkey(\\time), inf) * b.sampleRate,\n \\pan, Pwhite(-1.0, 1.0, inf),\n \\delta, Pkey(\\time) * Pexprand(0.8, 1.25, inf)\n);\n\nq = Pseq([\n (play: {\n // initialization event\n SynthDef(\\bufGrainPan, { |start, time, bufnum, pan, rate = 1, amp = 1,\n attack = 0.001, decay = 0.02, outbus|\n var sig;\n sig = PlayBuf.ar(1, bufnum, rate * BufRateScale.kr(bufnum), 1, start, 0)\n * EnvGen.kr(Env.linen(attack, time, decay), doneAction:2);\n Out.ar(outbus, Pan2.ar(sig, pan, amp));\n }).add;\n\n// NOTE: Mac OSX/Windows users need to change this for the actual location\n\n b = Buffer.read(s, Platform.systemAppSupportDir +/+ \"sounds/a11wlk01.wav\");\n\n s.sync\n }, delta: 0),\n p\n]);\n\nf = { // cleanup func\n b.debug(\"freeing\").free\n};\n);\n\n\ns.reboot;\n\n// RT\n(\nr = q.play;\nc = SimpleController(r).put(\\stopped, { c.remove; f.value });\n);\n\nr.stop; // should free the buffer\n\n\n\n// NRT\n(\nScoreClock.beginScore;\nPfindur(10, q).play(ScoreClock); // cleanup not needed since NRT server dies anyway\n\nScoreClock.makeScore.recordNRT(PathName.tmp +/+ \"osc.osc\", thisProce\n```"}, {"role": "assistant", "content": "A quick demo of one way to allocate server-side resources (SynthDefs, Buffers) that works in RT/NRT with minimal modification.\r\n\r\nYou'll need Jonatan Liljedahl's ScoreClock quark:\r\n\r\n\r\n// Mac OSX / Linux\r\n\r\nQuarks.install(\"ScoreClock\");\r\n\r\n\r\n// Windows, see http://swiki.hfbk-hamburg.de/MusicTechnology/883."}], "family": "D3", "source_id": "sccode:1-Al", "aug": "patch", "prompt_tokens": 675, "answer_tokens": 154}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"pulse\",{ arg freq,delayTime,amp = 1.0,attack = 0.01;\n var out,out2,env;\n env = EnvGen.kr(Env.perc(attack, 1, 5, 10),doneAction: 2);\n z = SinOsc.ar(freq,0,0.7);\n a = Pan2.ar(ToggleFF.ar(TDelay.ar(z,delayTime)) * SinOsc.ar(freq),\n SinOsc.kr(3,0), 0.6);\n out = Pan2.ar(z, SinOsc.kr(5,1.0pi),0.7 ) + a;\n out = out * env;\n out = out.clip2(1);\n \n Out.ar(0,FreeVerb.ar(out,0.7,1.0,0.4, amp)); \n}).send(s);\n\nSynthDef(\"droneee\", { arg freq = 440, amp = 1.0, outbus = 0, phase = 0;\n var out, env;\n env = EnvGen.kr(Env.sine(10),doneAction: 2);\n out = LFPulse.ar(freq , 0.15);\n out = RLPF.ar(out,SinOsc.kr(0.3, 0, 200, 1500), 0.1);\n out = FreeVerb.ar(out, 0.5, 0.5, 0.5) * env;\n out = Pan2.ar(out, SinOsc.kr(1/10, phase),amp);\n \n Out.ar(outbus, out);\n}).send(s);\n\n\nSynthDef(\"bass\",{\n arg freq,amp,outbus=0;\n var env,out;\n out = SinOsc.ar(freq,0,amp);\n env = EnvGen.kr(Env.perc(0.5,1,1,0),doneAction: 2); \n out = out*env;\n out = Pan2.ar(out,0);\n Out.ar(outbus,out);\n \n \n}).send(s);\n);\n\n\n(\n\np = Prand( [31,40, 45,64,68,69], inf).asStream;\nq = Prand( [3,0.7,1,0.5], inf ).asStream;\ne = Prand([59,72,76,79,81,88,90],inf).asStream;\n\nt = Task({\n inf.do({\n \n```"}, {"role": "assistant", "content": "This is our first work and posting.\r\nPlease give us advice.\r\n\r\nFrom Japan."}], "family": "D3", "source_id": "sccode:1-1y", "aug": "patch", "prompt_tokens": 762, "answer_tokens": 26}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n Limiter.ar(HPF.ar(\n GVerb.ar(\n Pan2.ar(\n PMOsc.ar(\n Demand.kr(\n Impulse.kr(\n SinOsc.kr(SinOsc.kr(1/30).range(1/10, 1/15)).range(0, 25)\n * LFPulse.kr(0.2).range(0.5, 1)\n + \n LFDNoise3.kr(1/10, 10, 10)\n ), \n 0, \n Dxrand(Array.geom(100, 50, 1.06), inf) + Dgeom(1, 1.005)\n ),\n [[3,5],[7,11]] + SinOsc.ar([1/60, 1/45]).range(0, 1300),\n Demand.kr(\n Impulse.kr(SinOsc.kr(0.1).range(0.1, 20)),\n 0,\n Dxrand(Array.series(13, 0, 0.5), inf)\n )\n ).sum,\n SinOsc.ar(1, mul:0.5),\n LFPar.ar([1/5,1/3]).range(0.3, 1)\n ), \n 250, \n 0.5, \n damping:SinOsc.kr(1/20).range(0.2,0.7), \n drylevel: SinOsc.kr(1/15).range(0.2,0.7), \n earlyreflevel:0.3\n ) * 0.1\n +\n LFDNoise3.ar(SinOsc.kr(1/15, [0, pi/4]).range(100,350), 0.3),\n [SinOsc.ar(1/45, [0,pi/2]).range(20, 120)]\n ))\n}.play\n)\n```"}, {"role": "assistant", "content": "strange device found in space )\r\n\r\np.s. different \"station\" each run."}], "family": "D3", "source_id": "sccode:1-1p", "aug": "patch", "prompt_tokens": 586, "answer_tokens": 25}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n//--set alarms\n(\n~num= 25; //number of alarms\n~fadeTime= 10; //fade in time in seconds\n~num.do{|i|\n Ndef((\"alarm\"++i).asSymbol, {|amp= 0, lag= 5|\n var src= Pulse.ar(\n ExpRand(300, 3000)+LFPulse.kr(ExpRand(3, 30), 0, Rand(0.4, 0.6), Rand(-100, 100)),\n Rand(0.4, 0.6),\n LFPulse.kr(LinRand(0.05, 2), 0, LinRand(0.1, 0.5), 0.5)\n );\n Pan2.ar(src, Rand(-0.95, 0.95), amp.lag(lag));\n });\n};\nNdef.all; //list them\n);\n\n\n//--start alarms (takes a while)\n(\n~task.stop;\n~task= Task({\n ~num.do{|i|\n Ndef((\"alarm\"++i).asSymbol).play(fadeTime: ~fadeTime).set(\\amp, 7/~num).postln;\n i.linlin(0, ~num-1, ~fadeTime*2, ~fadeTime/2).wait;\n };\n}).play;\n);\n\n\n//--stop alarms\n(\n~task.stop;\n~task= Task({\n ~num.do{|i|\n Ndef((\"alarm\"++i).asSymbol).stop(fadeTime: 1/~fadeTime);\n i.linlin(0, ~num-1, 1/~fadeTime, 10/~fadeTime).wait;\n };\n}).play;\n)\n```"}, {"role": "assistant", "content": "i wrote this for a sleeping bag concert in stockholm nov 2010. never set it off in the end as planned."}], "family": "D3", "source_id": "sccode:1-1k", "aug": "patch", "prompt_tokens": 565, "answer_tokens": 40}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// poor man's panning\n{\n var f, hornbostelwertheimerkonstante;\n f = MouseY.kr(1, 100, 1);\n hornbostelwertheimerkonstante = 0.00063;\n Impulse.ar(f, hornbostelwertheimerkonstante * f * [1, MouseX.kr(0, 2)], 0.1) \n}.play\n```"}, {"role": "assistant", "content": "If you are too poor to afford changing the amplitudes of a stereo signal, just let the channels wait. But the signal frequency is an impasse that is to be valued in itself."}], "family": "D3", "source_id": "sccode:1-1h", "aug": "patch", "prompt_tokens": 163, "answer_tokens": 62}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\n\nz = ( ( SinOsc.ar( ((LFSaw.kr(-0.05,1) +1) *100 + 20 ), LFTri.kr(40,0,1), LFSaw.kr(1.5) ) \n * LFTri.kr(rrand(0.005,0.03),3.99.rand,0.2) ) + \n( LFPulse.ar(60,0,0.5,Pulse.ar(0.5,0.5,0.1)) * LFTri.kr(rrand(0.005,0.03),3.99.rand,0.5) ) +\n( SinOsc.ar(65,0,LFPulse.kr(0.66666,0.5,0.3)*0.3) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) )+\n( LFPar.ar(120,0,LFPulse.kr(0.5,0.5,0.2)*0.3) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( LFCub.ar(185,0,LFPulse.kr(0.5,0.74,0.2)*0.3) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( SinOsc.ar(365,0,LFPulse.kr(1.33333333,0,0.1)*0.3) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( FreeVerb.ar(LFTri.ar(260,0,LFPulse.kr(0.5,0.25,0.01)*0.3),0.5,0.8,0.1) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( SinOsc.ar(800,0,LFPulse.kr(2,0,0.1)*0.1) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( LFPar.ar(820,0,LFPulse.kr(1.666666,0,0.1)*0.1) * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( WhiteNoise.ar( LFPulse.kr(2,0.5,0.001,1) )/2 * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( WhiteNoise.ar( LFPulse.kr(1,0.5,0.001,1) )/2 * LFTri.kr(rrand(0.005,0.03),3.99.rand,1) ) +\n( WhiteNoise.ar( LFPulse.kr(1.666666,0.5,0.001,1) )/4 * LFTri.kr(rrand(0.005,0.03),3.99.ran\n```"}, {"role": "assistant", "content": "something i did as one of my first playing around with SC. it's almost a nice chilled dance track made just with pulses and oscilators..."}], "family": "D3", "source_id": "sccode:1-1g", "aug": "patch", "prompt_tokens": 965, "answer_tokens": 45}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{ \n Limiter.ar(\n GVerb.ar(\n ( \n BPF.ar(\n WhiteNoise.ar([0.07,0.07]) + Blip.ar([13,19], 200.rand, mul:0.5),\n SinOsc.kr(\n SinOsc.kr([1/108,1/109]).range(1/108, 1/13)\n ).exprange(10, 23000),\n PMOsc.kr(1/54,1/216, 3).range(0.1, 2)\n ) \n * \n SinOsc.ar(Array.rand(20, 1/216, 1), mul: Array.rand(20, 0.2, 1)).reshape(10,2)\n ).sum,\n roomsize:10,\n damping: PMOsc.kr(1/27, 1/108, 3).range(0.5, 1), \n drylevel: SinOsc.kr(1/9).range(0.1, 1)\n )\n +\n GVerb.ar(\n Pan2.ar(\n LPF.ar(\n DynKlank.ar(\n `[\n Array.rand(6, 600, 4000).collect({|freq|\n SinOsc.kr(1/108).range(freq/2,freq)\n }), \n nil, \n Array.rand(6, 1/108, 1/27).collect({|freq|\n SinOsc.kr(freq).range(1/108,1/3)\n })\n ],\n Limiter.ar(\n Dust.ar( SinOsc.kr(1/256).exprange(1/27, 3), TRand.kr(0.15, 0.25, Dust.kr(1/9))) \n + \n Impulse.ar( SinOsc.kr(1/108).exprange(1/54, 3), 0, TRand.kr(0.6, 0.8, Dust.kr(1/3)))\n )\n ),\n 1700,\n \n```"}, {"role": "assistant", "content": "Just experimental sketch of somewhere audio background. \r\n\r\np.s. some random variations on each run."}], "family": "D3", "source_id": "sccode:1-1f", "aug": "patch", "prompt_tokens": 667, "answer_tokens": 36}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nNdef(\\z, {\n\n // get fed back signal and add a little noise to get things going\n var sig = Ndef(\\z).ar + WhiteNoise.ar(0.001!2);\n var a, k, delfreq, minfreqs, freqs, dry;\n \n // delay due to distance from amp - I chose 0.05s, or 20Hz\n delfreq = 20;\n sig = DelayN.ar(sig,1/10-ControlDur.ir,1/delfreq-ControlDur.ir);\n\n // guitar string frequencies - for some reason I had to pitch them down\n // a few octaves to get a good sound.\n // open strings\n //// freqs = (64+[0,5,10,15,19,24]).midicps/8;\n // e minor\n freqs = (64+[0,7,12,15,19,24]).midicps/4;\n \n // whammy bar modulates freqs:\n minfreqs = freqs*0.5;\n freqs = freqs*MouseButton.kr(1,0.75,4);\n \n // 6 comb filters emulate the strings' resonances\n sig = CombN.ar(sig!6,1/minfreqs,1/freqs,8).mean;\n\n // a little filtering... mouse Y controls amp\n sig = LPF.ar(sig,8000);\n sig = HPF.ar(sig*MouseY.kr(0,5),80);\n\n // and some not too harsh distortion - mouse X controls damping\n sig = RLPFD.ar(sig,MouseX.kr(200,10000,1)*[1,1.1],0.1,0.5);\n sig = sig + sig.mean;\n\n // and finally a spot of reverb\n dry = sig;\n 10.do {\n d = 0.2.rand;\n sig = AllpassN.ar(sig,d,d,5);\n };\n (dry + sig)*0.125;\n\n}).play;\n)\n```"}, {"role": "assistant", "content": "A simulation of holding an electric guitar up to the amplifier, creating feedback. Press the mouse button to activate the whammy bar :)."}], "family": "D3", "source_id": "sccode:1-U", "aug": "patch", "prompt_tokens": 645, "answer_tokens": 50}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n// Pulse doesn't respond well to being frequency modulated - loads of weird low freq noise\n{ Pulse.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(1,2000))*0.2 !2}.play\n);\n\n(\n// LFPulse doesn't sound like an analogue synth due to loads of aliasing\n{ LFPulse.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(1,2000))-0.5*0.4 !2}.play\n);\n\n(\n// But you can also produce a good approximation of a pulse wave by clipping a \n// high-amplitude sine wave. Clipper8 (from sc3-plugins) allows you to do this \n// in a band-limited way. This sounds much more like a frequency modulated analogue\n// oscillator.\n{ Clipper8.ar(SinOsc.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(0,2000), 0, 10), -0.2, 0.2) !2}.play\n// note: there are two SinOscs - the inner one is the modulator and the outer one is\n// clipped to make the pulse wave\n);\n\n(\n// with PWM too\n{ Clipper8.ar(SinOsc.ar(SinOsc.ar(XLine.kr(1,8000,20)).range(50,1000), 0, 10)+LFTri.ar(8,mul:9.9), -0.2, 0.2) !2}.play\n)\n```"}, {"role": "assistant", "content": "The standard Pulse UGen doesn't sound very good when its pitch is modulated at audio frequencies. This example shows how to produce a band-limited pulse wave that can be modulated at audio rate, producing a better approximation to the kind of FM effects that an analogue modular synth can produce.\r\n\r\nRequires sc3-plugins."}], "family": "D3", "source_id": "sccode:1-T", "aug": "patch", "prompt_tokens": 521, "answer_tokens": 111}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0, true, false, true);\n\nNdef(\\feedbacker, {|resetRate = 100, freq = 100, lowFreq = 100, rq = 0.1|\nvar src = OscN.ar(b, freq);\nBufWr.ar(src, b, Phasor.ar(Impulse.ar(resetRate), BufRateScale.kr(b) * 1, 0, BufFrames.kr(b)));\nsrc\n})\n\nNdef(\\feedbacker, {|resetRate = 100, freq = 100, lowFreq = 100, rq = 0.1|\nvar src = OscN.ar(b, freq);\nBufWr.ar(src, b, Phasor.ar(Impulse.ar(resetRate), BufRateScale.kr(b) * 1, 0, BufFrames.kr(b)));\nsrc = RLPF.ar(src, lowFreq, rq);\nsrc\n})\n\n\nNdef(\\feedbacker).pause\nNdef(\\feedbacker).resume\n\nNdef(\\feedbacker, {|resetRate = 100, freq = 100|\nvar src = OscN.ar(b, freq);\nBufWr.ar(src, b, min(BufFrames.kr(b), Phasor.ar(Impulse.ar(resetRate), BufRateScale.kr(b) * 0.25, 0, 4* BufFrames.kr(b))));\nsrc\n}).play\n\n\n\n\n\n\nNdefMixer(s)\n```"}, {"role": "assistant", "content": "Feedback Oscillator after a pd patch by claudius maximus (a SuperCollider snippet)."}], "family": "D3", "source_id": "sccode:1-P", "aug": "patch", "prompt_tokens": 556, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/* Markov Chain Experiment II\n Jacob Joaquin\n\n Get a visual representation of the Markov Chain here:\n http://codehop.com/supercollider-markov-chain/\n*/\n\n(\n// Synthesizer\nSynthDef(\\my_synth, {|dur = 1.0, amp = 1.0, freq = 440|\n var env = EnvGen.ar(Env.new([1, 0.1, 0], [0.06, dur - 0.06]), doneAction: 2);\n Out.ar([0, 1], SinOsc.ar([freq * 0.995, freq * 1.005], 0, env * amp))\n}).add; \n\n// Create task\nt = Task({\n // Set attributes of each node\n // [freq, dur, [[next_state, weighted_random],…]]\n var node_list = [\n [60, 1, [[1, 2]]],\n [62, 0.5, [[0, 1], [2, 1]]],\n [63, 1, [[0, 1], [3, 1]]],\n [65, 0.5, [[0, 1], [3, 4], [4, 1]]],\n [67, 1, [[5, 1]]],\n [70, 1.5, [[4, 1], [6, 2]]],\n [69, 1, [[4, 1], [7, 2]]],\n [72, 0.5, [[4, 1], [7, 4], [0, 2]]]\n ];\n\n var node_index = 0;\n var bps = 133.0 / 60.0; // Beats per second\n \n inf.do({\n var weight = 0;\n var random;\n var accumulator;\n var node = node_list[node_index]; \n var freq = node[0].midicps;\n var dur = node[1] / bps;\n var paths = node[2];\n \n // Get total statistical weight of connected nodes\n (0 .. paths.size - 1).do {|i| weight = weight + paths[i][1]};\n \n // Gener\n```"}, {"role": "assistant", "content": "A simple melody algorithmically generated with a Markov Chain."}], "family": "D3", "source_id": "sccode:1-O", "aug": "patch", "prompt_tokens": 678, "answer_tokens": 17}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/* An approach to try to reproduce the 'famous' bassline of \"Der Mussolini\" by D.A.F. */\n\n// very bad simulated analogue distorted bass synth\n// too distorted compared to the original...\n\nSynthDef(\\daf_bass,{ |out, freq=440, sustain=1, gate=1, amp=0.1|\n var snd, env, fenv, harm;\n harm = [1,1.01,2,2.02,3.5,4.01,5.501];\n harm = harm ++ (harm*2);\n snd = SinOsc.ar(freq*harm).sum.distort * 2;\n snd = snd + SinOsc.ar(freq / [1, 2]).sum!2;\n env = EnvGen.kr(Env.adsr(0.001,0.2,0.9,0.25), gate, amp, doneAction:2);\n snd = snd * env;\n OffsetOut.ar(out, (snd!2));\n}).add;\n\n// approx 63 bpm\nTempoClock.default.tempo = 63/60;\n\n// approx bass pattern + modulation of Mussolini bassline\nPdef(\\daf_bass,\n Pbind(\n \\instrument, \\daf_bass,\n \\scale, Scale.minor,\n \\octave, [3], // try out [2,3] or [3,4] for octave bass leetness\n \\ctranspose,Pseq([\n Pn(-1,16*4),\n Pn(1,16*2)\n ], inf),\n // -1 for thinking in musical degrees...\n \\degree, Pseq([1, 4, 1, 10, 1, 8, 1, 1, 8, 1, 8, 1, 8, 7, 1, 8]-1,inf),\n \\legato, Pwhite(0.75, 0.8),\n \\dur, 0.2\n )\n).play;\n\n// link: http://www.youtube.com/watch?v=15ScQivK5DY\n```"}, {"role": "assistant", "content": "An approach to try to reproduce the 'famous' bassline of \"Der Mussolini\" by D.A.F."}], "family": "D3", "source_id": "sccode:1-J", "aug": "patch", "prompt_tokens": 653, "answer_tokens": 36}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n/* An approach to try to reproduce the 'famous' bassline of \"Verschwende deine Jugend\" by D.A.F. */\n\nSynthDef(\\daf_bass,{ |out, freq=440, sustain=1, gate=1, amp=0.1|\n var snd, env, fenv, harm;\n \n harm = [1,1.01,2,2.02,3.5,4.01,5.501];\n harm = harm ++ (harm*2);\n \n snd = SinOsc.ar(freq*harm).sum.distort.squared * 6;\n snd = snd + SinOsc.ar(freq / [1, 2]).sum!2;\n\n fenv = EnvGen.kr(Env.adsr(0.075,0.05,0.1,0.25));\n\n snd = RLPF.ar(snd, fenv.range(freq*2, freq*8), 0.75, 2) + (snd * 0.25);\n env = EnvGen.kr(Env.adsr(0.001,0.2,0.9,0.25), gate, amp, doneAction:2);\n \n snd = LeakDC.ar(Limiter.ar(snd * env));\n OffsetOut.ar(out, (snd!2));\n}).add;\n\n// approx 65 bpm\nTempoClock.default.tempo = 65/60;\n\n// approx bass pattern + modulation of Verschwende Deine Jugend bassline\nPdef(\\daf_bass,\n PmonoArtic(\\daf_bass,\n \\scale, Scale.minor,\n \\octave, [3],\n \\root, 2,\n \\ctranspose,Pseq([\n Pn(0, 8*4),\n Pn(-5, 8*4)\n ], inf),\n \\degree, Pseq([7,7s,1,8,1,1,7,1]-1,inf),\n \\dur, 0.18\n )\n).play;\n\n// link: http://www.youtube.com/watch?v=KjqrnUBdLqY\n```"}, {"role": "assistant", "content": "An approach to try to reproduce the 'famous' bassline of \"Verschwende deine Jugend\" by D.A.F."}], "family": "D3", "source_id": "sccode:1-I", "aug": "patch", "prompt_tokens": 676, "answer_tokens": 39}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"wibbly\", \n {\n arg out = 0, freq = #[60, 65, 57], amp = 0.5, lagTime = 0.1, trigRate = 3, detune = 0.2, noOfSynths = 20;\n var output;\n var maxNoOfTones = 50;\n \n output = Mix.fill(\n maxNoOfTones,\n {\n arg index;\n \n var trig, pitches, dseq_index;\n trig = Impulse.kr(0) + Dust2.kr(trigRate);\n dseq_index = Drand([0, 1, 2], inf);\n \n pitches = \n Lag.kr(\n Select.kr(Demand.kr(trig, 0, dseq_index), freq) + TRand.kr(detune.neg, detune, trig),\n lagTime * Rand(0.8, 1.2)\n ).midicps;\n \n \n SinOscFB.ar(\n pitches,\n Rand(0, 0.8), \n amp * Lag.kr(TRand.kr(0.8, 1.0, trig), lagTime * Rand(0.8, 1.2))\n )\n *\n (if(index < noOfSynths, 1, 0));\n \n }\n );\n \n output = Mix(output) * (1 / noOfSynths) * Line.kr(0.0, 1.0, 0.3);\n \n Out.ar(out,\n \n output ! 2\n );\n \n }\n).send(Server.default);\n);\n\n// try different values for the 3 tones\na = Synth(\\wibbly, [\\freq, [60, 65, 69]]);\na.set( \\freq, [60, 60.2, 60.4]);\na.set( \\freq, [34, 39, 43]);\n```"}, {"role": "assistant", "content": "Concept: instead of having 3 sustained tones making up a triad, how about having several tones that jump to the notes at random? If a number of these are heard together, the effect of hearing the triad will be the same, except the texture will be much more involving. Try setting noOfSynths to 1 or 2 to understand the concept.\r\nRoom for improvement: pan the tones, perhaps using Splay to make a nice."}], "family": "D3", "source_id": "sccode:1-A", "aug": "patch", "prompt_tokens": 589, "answer_tokens": 124}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n// Resonator, must subtract blockSize for correct tuning\n(\nSynthDef(\"testRes\", {\n \nvar freq = 300, localIn, input, limitLevel = 0.2, output;\nvar feedbackAmt = 0.999;\n\nfreq = MouseY.kr(20, 678, \\exponential).poll;\nfeedbackAmt = MouseX.kr(0.2, 0.99999).poll;\nlocalIn = LocalIn.ar(1); \ninput = LFNoise1.ar(freq * 16, 0.2);\ninput = input + Dust2.ar(freq);\n\n\nLocalOut.ar(\n HPF.ar(LPF.ar(DelayC.ar(input + (localIn * feedbackAmt), 2, freq.reciprocal - ControlRate.ir.reciprocal), freq * 8), freq * 0.125)\n);\n\noutput = Limiter.ar(localIn, limitLevel, 0.01) * limitLevel.reciprocal;\nOffsetOut.ar(0, output ! 2);\n\n}).play(s);\n\n)\n```"}, {"role": "assistant", "content": "Using filtered feedback with a noise input to produce a tone. Some bass notes turn a little noisy if the freq is left at one value for a few seconds. It's worth scoping this too.\r\nRoom for improvement: some of the vars could / should be arguments."}], "family": "D3", "source_id": "sccode:1-z", "aug": "patch", "prompt_tokens": 379, "answer_tokens": 86}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\nvar noise, out;\nnoise = LFNoise0.kr(8);\n\nout = if( noise > 0.0,\n if(noise > 0.5, \n if(noise > 0.9, WhiteNoise.ar(0.2), Pulse.ar(60, 0.5, 0.4)),\n SinOsc.ar(500, 0, 0.25)\n ),\n Saw.ar(160, 0.5)\n);\n\nout ! 2\n\n}.play;\n)\n```"}, {"role": "assistant", "content": "A short, silly example of using if in a SynthDef. Using Select is generally a better thing to do."}], "family": "D3", "source_id": "sccode:1-v", "aug": "patch", "prompt_tokens": 181, "answer_tokens": 32}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n{\nvar vuvuMix, crowdNoise, crowdHi, crowdLo, crowdDust, crowdMix, noOfVuvus = 30;\n\n\n\nvuvuMix = Mix.fill(noOfVuvus,\n {\n |i|\n var freq, amp, thresh = 0.39, pan, vuvu; \n freq = LFNoise0.kr(17.2).lag(1.1).range(57.8.midicps, 58.2.midicps) * Rand(0.96, 1.04) * WhiteNoise.kr.range(0.99, 1.01);\n \n amp = LFNoise0.kr(6.94).lag(0.52).range(0.02, 0.4) * if(LFNoise0.kr(2.95) > thresh, 1, 0).lag(0.32);\n \n \n vuvu = LPF.ar(Saw.ar(freq) + LPF.ar(WhiteNoise.ar(0.12), Rand(700, 1500)), 2000, amp * 0.2);\n Pan2.ar(vuvu, -0.3.blend(0.3, (i / (noOfVuvus - 1))));\n }\n);\n\ncrowdNoise = WhiteNoise.ar(LFNoise0.kr(0.8).lag(1.8).range(0.1, 0.2) * 0.125);\ncrowdHi = RHPF.ar(crowdNoise, LFNoise0.kr(2.3).lag(1.17).range(1400, 1480), 0.1);\ncrowdHi = crowdHi + RHPF.ar(crowdNoise, LFNoise0.kr(0.9).lag(0.17).range(900, 1000), 0.1);\ncrowdHi = LPF.ar(crowdHi, 5000, 0.3);\ncrowdLo = BrownNoise.ar(0.01);\n\ncrowdDust = Splay.arFill(70, { BPF.ar(Dust2.ar(Rand(90, 170)), ExpRand(1600, 1700), Rand(0.3, 0.4)); }, 0.6) * 3;\ncrowdMix = (crowdHi + crowdLo + crowdDust) * 0.45;\nOut.ar(0, vuvuMix + crowdMix);\n}.play;\n\n\n)\n```"}, {"role": "assistant", "content": "Let's travel back in time to summer 2010: a new, evil sound comes to the stadiums of South Africa and the streets of football-loving cities."}], "family": "D3", "source_id": "sccode:1-t", "aug": "patch", "prompt_tokens": 754, "answer_tokens": 50}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n{\n\nvar output, basePitch = 387, macroPitch, macroPitchAmt = 400;\nvar modOsc, modAmt = 1.3, amp = 0.8;\nvar creakRate, creakTrig, creakEnvGen, noise, combs, oscFreq;\n\nnoise = LFNoise1.ar(LFNoise0.kr(4.8).lag(0.4).range(3646, 7777), 0.6);\n\ncreakRate = EnvGen.kr(\n Env(\n [40, 25, 15, 2],\n [0.9, 0.6, 1.0],\n -4\n ),\n doneAction: 2\n\n);\ncreakTrig = Impulse.kr(creakRate);\n\ncreakEnvGen = EnvGen.kr(\n Env(\n [0.0, 1.0, 0.0],\n [0.02, 0.1],\n [5, -8]\n ),\n creakTrig,\n timeScale: SinOsc.kr(1.5).range(0.12, 0.26) * Line.kr(0.5, 2.3, 2)\n\n);\n\nmacroPitch = EnvGen.kr(\n Env(\n [0.0, 4, 0.1, 0.3, 0.4, 0.7, 0.9],\n [0.2, 0.2, 0.4, 0.3, 0.48, 0.59],\n [2, 2, -4, -3, -2, -4]\n )\n\n);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.17);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.232, modOsc * 0.3);\n\noscFreq = basePitch + (macroPitch * macroPitchAmt);\noscFreq = oscFreq * (1 + (creakEnvGen * 2));\noutput = SinOsc.ar(oscFreq, modOsc * modAmt, 1);\noutput = output * SinOsc.ar(SinOsc.kr(1.6).range(1220, 1355));\noutput = output + noise;\noutput = output.clip(-0.5, 0.5) * creakEnvGen * amp * TRand.kr(0.8, 1.0, creakTrig);\n\ncombs = Mix([CombC.ar(output, 0.2, 0.0084, 0.12), \n```"}, {"role": "assistant", "content": "I aimed for the sound of a creaky door but fell a little short - you be the judge."}], "family": "D3", "source_id": "sccode:1-s", "aug": "patch", "prompt_tokens": 794, "answer_tokens": 30}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n{\n\nvar flutter, flutterAmt = 0.02, humPitch = 88, hum, humLevel = 0.3, amp = 1.0, output;\nvar swing, swingNoise, swingLevel = 1.0, swingSwitch, swingThresh = 0.87;\nvar clash, clashTrig, clashDecay, clashEnvGen, clashSpring, clashLevel = 0.6;\n\nflutter = 4.collect(\n { \n |i|\n LFNoise0.kr(rrand(3, 16), flutterAmt, 1).lag(0.48);\n }\n);\n\nhumPitch = humPitch * StandardL.ar(2, 3.7).range(0.97, 1.03);\n\nhum = Mix(SyncSaw.ar([humPitch, humPitch * 1.001] * flutter.copyRange(0, 1), [humPitch * 1.003, humPitch * 1.0025] * flutter.copyRange(2, 3)));\nhum = hum * LFNoise0.kr(8.77224).range(0.2, 1.0).lag(0.4);\nhum = RLPF.ar(hum, LFNoise0.kr(21).range(200, 1800).lag(1.2), 0.5) * 0.1 * humLevel;\n\nhumPitch = humPitch * StandardL.ar(3.8, 2.9).range(0.93, 1.07);\n\nswingNoise = LFNoise1.kr(16.2).range(0, 1);\nswingSwitch = if(swingNoise > swingThresh, 1, 0).lag2(0.9, 1.3);\nswingLevel = swingLevel * swingSwitch;\n\nhumPitch = humPitch * StandardL.ar(3.8, 2.9).range(0.97, 1.03) * (1 + (swingSwitch * 0.2));\n\nswing = SyncSaw.ar(humPitch * 0.501, humPitch * 1.09);\nswing = LPF.ar(swing, 4300);\nswing = swing * swingLevel;\n\nclashTrig = Trig.kr(\n Schmidt.kr(1 - swingSwitch, swingThresh, swingThresh + 0.01),\n 0.01\n);\n```"}, {"role": "assistant", "content": "Another Star Wars inspired sound effect.\r\nRoom for improvement: this does not really give the sense of two lightsabers engaging in combat, there should be another humming sound and each one should be panned slightly (as well as tuned a little differently.)."}], "family": "D3", "source_id": "sccode:1-q", "aug": "patch", "prompt_tokens": 755, "answer_tokens": 76}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nNdef(\\a, {\n var src, loc, delay=0.01;\n src = Decay2.ar(Impulse.ar(1/8), LFNoise2.kr(4).range(0.001, 0.0001),\n LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(4).exprange(40, 4000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise0.kr(1/4).range(100, 1200).lag, 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.501).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, delay * 2, delay * 1);\n LocalOut.ar(loc.reverse * 0.49);\n Out.ar(0, loc * 0.9)\n}).play;\n\nNdef(\\b, {\n var src, loc, del;\n del = 1/100;\n src = Decay2.ar(TDuty.ar(1/4,0,Dseq([1, 0.5, 0.3, 0.1],inf)), \n LFNoise2.kr(4).range(0.001, 0.0001), LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(200).exprange(40, 14000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise2.kr(0.1).range(40, 400), 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.51).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, del * 2, del * 1);\n LocalOut.ar(loc.reverse * 0.45);\n Out.ar(0, Compander.ar(loc,loc,0.1, 1, 0.05) * 1.2)\n}).play;\n\nN\n```"}, {"role": "assistant", "content": "Trying out some stuff to get some melodies/pads out of feedback and some beats in the background."}], "family": "D3", "source_id": "sccode:1-i", "aug": "patch", "prompt_tokens": 769, "answer_tokens": 35}
-{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\dubecho,{|length = 1, fb = 0.8, sep = 0.012|\nvar input = In.ar(0, 2);\nvar output = input + Fb({\n\narg feedback; // this will contain the delayed output from the Fb unit\n\nvar left,right;\nvar magic = LeakDC.ar(feedback*fb + input);\nmagic = HPF.ar(magic, 400); // filter's on the feedback path\nmagic = LPF.ar(magic, 5000);\nmagic = magic.tanh; // and some more non-linearity in the form of distortion\n#left, right = magic; // let's have named variables for the left and right channels\nmagic = [DelayC.ar(left, 1, LFNoise2.ar(12).range(0,sep)), DelayC.ar(right, 1, LFNoise2.ar(12).range(sep,0))]; // In addition to the main delay handled by the feedback quark, this adds separately modulated delays to the left and right channels, which with a small \"sep\" value creates a bit of spatialization\n\n},length);\nReplaceOut.ar(0, output);\n}).store;\n\n// Example Usage\n~echo = Synth(\\dubecho, [\\length, TempoClock.default.tempo*(3/8), \\fb, 0.7, \\sep, 0.0012], addAction: \\addToTail);\n~echo.free;\n~echo.set(\\gate, 0);\n```"}, {"role": "assistant", "content": "A pretty simple Dub echo, approximating something like the [Space Echo](https://secure.wikimedia.org/wikipedia/en/wiki/Space_Echo) made popular by King Tubby, Scientist, Lee Perry, et al. Built around the Feedback Quark, though I'm not really leaning on the functionality it provides over a simple LocalOut-based feedback path."}], "family": "D3", "source_id": "sccode:1-h", "aug": "patch", "prompt_tokens": 502, "answer_tokens": 126}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\nSynthDef(\\pluck, {|freq = 440, dur = 1|\nvar klang,note;\ndur = dur * 2;\nnote = freq.cpsmidi;\nnote = note + (LFNoise2.ar(20).range(-1,1) * (1/8));\nklang = SinOsc.ar((note * [1,1.002]).midicps, phase: VarSaw.ar(note.midicps, width: Line.ar(1,0.2,dur))) * 0.3;\nklang = klang * XLine.ar(1,1/10000,dur,doneAction:2);\nOut.ar(0, klang);\n}).store;\n\nPbind(\n\\instrument, \\pluck,\n\\degree, Pn(Pseries(0, Pwrand([Pwhite(-3,3,inf).round(1),1],[32,1],inf), 4),inf)-1 + [0,2,-1,-14],\n\\dur, Pseq([4, [5,2,1]].convertRhythm / 2, inf),\n\\strum, Pwhite(0,1/8,inf),\n\\octave, [5,6]\n).play;\n```"}, {"role": "assistant", "content": "A synthdef and simple pbind to play some (pretty repetitive) bebop-ish arpeggios. The conjunction reminds me a bit of James Blake."}], "family": "D3", "source_id": "sccode:1-g", "aug": "patch", "prompt_tokens": 397, "answer_tokens": 50}
{"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nSynthDef(\"additivePad\", \n { arg numOfCycles = 100;\n var lfo;\n var lfo2;\n var lfo3;\n lfo = SinOsc.kr([Rand(0.5,1000),Rand(0.5,1000)], 1.5pi, 0.5, 0.5);\n lfo3 = SinOsc.kr([Rand(0.1,0.5),Rand(0.1,0.5)], 1.5pi, 0.5, 0.5);\n lfo2 = SinOsc.kr([(Rand(0.5,1000) * lfo) * lfo3, (Rand(0.5,1000) * (1 - lfo)) * (1 - lfo3)], 1.5pi, 0.5, 0.5);\n Out.ar(\n 0, \n Mix.arFill(\n numOfCycles,\n { \n SinOsc.ar(\n Rand(40,1000),\n 0, \n (numOfCycles.reciprocal * 0.75) * lfo2)\n }\n ) * EnvGen.kr(Env.perc(Rand(0.1,30), Rand(0.1,30)), doneAction: 2)\n )\n }\n).send(s); \n);\n\n(\nr = Routine({\n 200.do({\n x = Synth.new(\"additivePad\"); \n 10.wait;\n });\n});\n);\n\nr.play;\n```"}, {"role": "assistant", "content": "Just going crazy with modulation. Sample is available here: http://soundcloud.com/schemawound/schemawound-dawn-demo-version."}], "family": "D3", "source_id": "sccode:1-c", "aug": "patch", "prompt_tokens": 480, "answer_tokens": 54}
{"conversations": [{"role": "user", "content": "What is `A2K` in SuperCollider?"}, {"role": "assistant", "content": "A2K — Audio to control rate converter. Audio to control rate converter. Only needed in specific cases. Category: UGens > Conversion."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/A2K.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 49}
@@ -13642,35 +13358,32 @@
{"conversations": [{"role": "user", "content": "Explain `ZeroCrossing` in SuperCollider briefly."}, {"role": "assistant", "content": "ZeroCrossing — Zero crossing frequency follower Outputs a frequency based upon the distance between interceptions of the X axis. The X intercepts are determined via linear interpolation so this gives better than just integer wavelength resolution. This is a very crude pitch follower, but can be useful in some situations. Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/ZeroCrossing.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 111}
{"conversations": [{"role": "user", "content": "What does `ZeroCrossing.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Zero crossing frequency follower Arguments: in — Input signal.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/ZeroCrossing.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 23}
{"conversations": [{"role": "user", "content": "How is `ZeroCrossing` typically used in SuperCollider?"}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\n{\n var a;\n a = SinOsc.ar(SinOsc.kr(1, 0, 600, 700), 0, 0.1);\n [a, ZeroCrossing.ar(a) * 0.0005]\n}.scope;\n)\n```"}], "family": "C2", "source_id": "supercollider:HelpSource/Classes/ZeroCrossing.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 87}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//Sam Pluta - 2006\n//this Synth uses the SoundIn as a trigger to step through and granulate the loaded buffer\n\ns.boot;\nb = Buffer.read(s, ExampleFiles.child); //use your own buffer here - mine is probably not on your computer\n\n(\nSynthDef(\"TriggerBufferGranular\", {arg out=0, bufnum=0, in=0, thresh = 0.004, ampScaler = 1, duration =\n0.2, pan=0,centerPosition=0.1, interp=1, incrementBy = 200;\n\n var trig, amp, gatedAmp, triggerBool, outamp, bufferFrames, bufRateScale;\n var bufPointer, trigs, env, envGens, outArray, grNum;\n\n grNum = 4; // the number of granulators in the synthdef\n bufferFrames = BufFrames.kr(bufnum);\n bufRateScale = BufRateScale.kr(bufnum);\n amp = Amplitude.kr (SoundIn.ar(in));\n triggerBool = (SoundIn.ar(in) >= thresh);\n gatedAmp = Latch.kr(amp, triggerBool);\n outamp = (gatedAmp * ampScaler);\n\n trig = Trig.kr(triggerBool, duration/4); //makes a trigger if triggerBool goes over the threshold\n env = Env([0,1,0],[duration/2,duration/2],'sine');\n\n bufPointer = PulseCount.kr(trig); //a counter that counts the number of triggers triggered\n\n //each trigger below triggers once for every four times trig (above) triggers (if a trig trig could trig trig)\n\n trigs =\n```"}, {"role": "assistant", "content": "Sam Pluta - 2006 this Synth uses the SoundIn as a trigger to step through and granulate the loaded buffer."}], "family": "D3", "source_id": "supercollider:examples/demonstrations/TriggerBufferGranulator.scd", "aug": "patch", "prompt_tokens": 626, "answer_tokens": 40}
{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// (thor magnusson) (2006)\n\n// An instrumentalist inside a synthdef.\n\n(\nSynthDef(\\drummer, { arg out=0, tempo=4;\n var snare, base, hihat;\n tempo = Impulse.ar(tempo); // for a drunk drummer replace Impulse with Dust !!!\n\n snare = WhiteNoise.ar(Decay2.ar(PulseDivider.ar(tempo, 4, 2), 0.005, 0.5));\n base = SinOsc.ar(Line.ar(120,60, 1), 0, Decay2.ar(PulseDivider.ar(tempo, 4, 0), 0.005, 0.5));\n hihat = HPF.ar(WhiteNoise.ar(1), 10000) * Decay2.ar(tempo, 0.005, 0.5);\n\n Out.ar(out,(snare + base + hihat) * 0.4 ! 2)\n}).add;\n);\n\na = Synth(\\drummer);\na.set(\\tempo, 6);\na.set(\\tempo, 18);\na.set(\\tempo, 180); // check the CPU! no increase.\na.free;\n```"}, {"role": "assistant", "content": "(thor magnusson) (2006) An instrumentalist inside a synthdef."}], "family": "D3", "source_id": "supercollider:examples/pieces/DrummerSynthDef.scd", "aug": "patch", "prompt_tokens": 404, "answer_tokens": 27}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// LMFAP: Little Man From Another Place (the dwarf in the Red Room)\n// (thor magnusson) (2006)\n\n// better use headphones !!!\n(\ns = Server.local;\nb = Buffer.alloc(s, 44100 * 6.0, 2);\n);\n(\nSynthDef(\\LMFAP, {|combdecay=1, allpassdecay=0.5, wet=0.1, bufnum, rate=1, end=264600|\n var in, signal;\n in = SoundIn.ar([0,1]);\n z = DelayN.ar(in, 0.1, 0.51);\n y = Mix.ar(Array.fill(3,{ CombL.ar(z, 0.05, rrand(0.03, 0.05), combdecay) }));\n 6.do({ y = AllpassN.ar(y, 0.030, rrand(0.01, 0.03), allpassdecay) });\n BufWr.ar(in+(y*wet), bufnum, Phasor.ar(0, 1, 0, end));\n signal = BufRd.ar(2, bufnum, Phasor.ar(0, BufRateScale.kr(0)*rate, 0, end));\n y = Mix.ar(Array.fill(7,{ CombL.ar(signal, 0.05, rrand(0.03, 0.05), combdecay) }));\n 6.do({ y = AllpassN.ar(y, 0.050, rrand(0.03, 0.05), allpassdecay) });\n Out.ar(0, signal+(y*wet));\n}).add;\n);\n\n// wait a bit\nc = Synth(\\LMFAP, [\\bufnum, b.bufnum, \\rate, -1]);\n\n\nc.set(\\combdecay, 3)\nc.set(\\allpassdecay, 0.4)\n\nc.set(\\rate, -0.8)\n\nc.set(\\wet, 0.4) // more reverb\n\nc.set(\\end, 44100*3) // 3 sec loop\n\nc.free;\nb.free;\n```"}, {"role": "assistant", "content": "LMFAP: Little Man From Another Place (the dwarf in the Red Room) (thor magnusson) (2006) better use headphones !!!."}], "family": "D3", "source_id": "supercollider:examples/pieces/Little_Man_From_Another_Place.scd", "aug": "patch", "prompt_tokens": 688, "answer_tokens": 54}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// (thor magnusson) (c 2007)\n\n// A reinterpretation of the Poème symphonique was composed by György Ligeti (in 1962)\n// http://www.youtube.com/watch?v=QCp7bL-AWvw\n\n(\nSynthDef(\\ligetignome, {arg tempo=1, filterfreq=1000, rq=1.0;\nvar env, signal;\n var rho, theta, b1, b2;\n b1 = 2 * 0.996839 * cos(0.0931624);\n b2 = 0.996839.squared.neg;\n signal = SOS.ar(Impulse.ar(tempo), 1.0, 0.0, 0.0, b1, b2);\n signal = RHPF.ar(signal, filterfreq, rq);\n Out.ar(0, Pan2.ar(signal, 0));\n}).add;\n);\n\n// and we create 10 different metronomes running in different tempi\n// (try with 3 metros or 30 metros)\n(\n13.do({\n Synth(\\ligetignome).set(\n \\tempo, (rrand(0.5,1.5)).reciprocal,\n \\filterfreq, rrand(2000,4000),\n \\rq, rrand(0.3,0.9) )\n});\n);\n\n// -----------\n\n// and something totally else... ligeti's brother:\n\n(\nvar trig;\nvar wait = 4;\nTask({\n 20.do({\n trig = [1, 1.5].wchoose([0.7, 0.3]);\n {Resonz.ar(Impulse.ar(trig, 0, 50*rrand(5,10)), Rand(200,2000), 0.003) ! 2}.play;\n (wait + rrand(0.1,1)).wait;\n wait = wait - rrand(0.01, 0.2);\n });\n \"thank you! you can now stop this program at any point!\".postln;\n}).play\n)\n```"}, {"role": "assistant", "content": "(thor magnusson) (c 2007) A reinterpretation of the Poème symphonique was composed by György Ligeti (in 1962) http://www.youtube.com/watch?v=QCp7bL-AWvw."}], "family": "D3", "source_id": "supercollider:examples/pieces/Poeme Symphonique.scd", "aug": "patch", "prompt_tokens": 661, "answer_tokens": 84}
-{"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// (thor magnusson) (2007)\n\n// a 19th century steam train leaving the station\n\n(\n{\n var steam, pan, time, e2, filter, we, whistle;\n time = 24;\n\n e2 = Env.new([-0.8, 0.8 ], [ time+2],'sine');\n we = Env.new([0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0], [2, 0, 0.2, 0, 0.2, 0, 0.8, 0, 4, 0, 3]);\n\n steam = WhiteNoise.ar(LFSaw.ar(XLine.ar(1, 7, time)))+PinkNoise.ar(LFSaw.ar(XLine.ar(1, 7, time)));\n filter = BPF.ar(steam, 600, 1+EnvGen.ar(Env.sine(time,9)));\n whistle = Mix.ar(GVerb.ar(Klank.ar(`[[800, 600, 1200, 990], nil, [1, 1, 1, 1]], WhiteNoise.ar(0.005)) * EnvGen.ar(we, timeScale:time/10.2 ), 100, 0.3, 0.1));\n\n pan = Pan2.ar(filter+whistle, EnvGen.ar(e2, doneAction:2));\n pan\n\n}.play\n);\n\n// (julian rohrhuber) (2007)\n\n// julian took the train into the 21st century:\n\n(\n{\n var hiss, time, e2, ee2, filter, we, whistle, train;\n time = 24;\n\n e2 = Env.new([0, 1, 0], [ time / 2, time / 2]);\n we = Env.new([0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0], [0.2, 0, 0.2, 0, 0.2, 0, 0.8, 0, 2, 0, 3]);\n ee2 = EnvGen.ar(e2, doneAction:2);\n hiss = HPF.ar(WhiteNoise.ar(10 ! 2), ee2.linexp(0, 1, 10000, 1000), 0.03);\n\n whistle = Mix.ar(GVerb.ar(Klank.ar(`[[1, 1.25, 1.2, 1.5].midiratio * 50, nil, [1, 1, 1, 1\n```"}, {"role": "assistant", "content": "(thor magnusson) (2007) a 19th century steam train leaving the station."}], "family": "D3", "source_id": "supercollider:examples/pieces/Trains.scd", "aug": "patch", "prompt_tokens": 745, "answer_tokens": 30}
{"conversations": [{"role": "user", "content": "[ 1, 2, 1, 1, 2, 1, 1 ] how to find adjacent elements in an array?"}, {"role": "assistant", "content": "SuperCollider forum — [ 1, 2, 1, 1, 2, 1, 1 ] how to find adjacent elements in an array\n\nRandColors:\n\nI need to find the index, the how many times (the adjacent values are equal) and what is the adjacent value.\n\nThis is perhaps a bit verbose and clunky, but it meets the above specification:\n\n```supercollider\n(\n~repeats = {|array|\n // return [index, number of repeats, the value] for each repeated value\n var results = [];\n var thisIndex = 0;\n var thisCount = 1;\n var thisValue = array[0];\n array[1..].do{|val, i|\n if(val == thisValue,\n {thisCount = thisCount + 1},\n {\n if(\n thisCount > 1,\n {results = results.add([thisIndex, thisCount, thisValue])},\n );\n thisValue = val;\n thisIndex = i + 1;\n thisCount = 1;\n }\n )\n };\n if(thisCount > 1, {results = results.add([thisIndex, thisCount, thisValue])});\n results;\n}\n);\n\na = [1, 2, 1, 1, 1, 2, 1, 1];\nb = ~repeats.value(a);\n\na = [2, 3, 5, 5];\nb = ~repeats.value(a);\n```"}], "family": "Q", "source_id": "scsynth:5233-5", "aug": "forum", "prompt_tokens": 45, "answer_tokens": 426}
{"conversations": [{"role": "user", "content": "How to know the hardware buffer size?"}, {"role": "assistant", "content": "SuperCollider forum — How to know the hardware buffer size\n\nSay you want to use a UGen to control an external hardware device, independently of the soundcard. At first, one would think that this calculation is time-locked to the control rate, so e.g. at 1.5 kHz for a 48 kHz sample rate and a block size of 32.\n\nBut no, of course this calculation is time-locked to the hardware buffer size (I/O buffer size) of the soundcard you happen to use. EDIT: For a typical (low) setting, this is something like 256, so that would be about 190 Hz (5 ms). This may be too much delay for some applications, so we may want a smaller buffer size.\n\nIn scsynth, we can set a value for this size via ServerOptions:\n\n```supercollider\n // reduce to block size\ns.options.hardwareBufferSize = s.options.blockSize;\ns.reboot;\n```\n\nUnfortunately, not all soundcards support low block sizes. Also high quality sound cards may have very large ones, actually – this is a cultural thing, when you use them for recording, it is not a problem. But for live I/O it introduces delay (a quarter second is like an eternity then).\n\nSo now my question: how do I know if the above setting has been actually successful? How do I know what buffer size is current?\n\nI am sure that on different OSes there are ways to derive this in different ways. Maybe there is a way in supercollider as well?"}], "family": "Q", "source_id": "scsynth:7355-1", "aug": "forum", "prompt_tokens": 29, "answer_tokens": 466}
-{"conversations": [{"role": "user", "content": "Saving \"Presets\"?"}, {"role": "assistant", "content": "SuperCollider forum — Saving \"Presets\"?\n\nIf you don’t care too much about it being human readable, just use writeArchive and readArchive:\n\n```supercollider\na = Array.fill(400, {rrand(0,2200)});\n\na.writeArchive(\"/Users/spluta1/Documents/SC/test\");\n\nb = Object.readArchive(\"/Users/spluta1/Documents/SC/test\");\n\nb.postln;\n```\n\nSam"}], "family": "Q", "source_id": "scsynth:4006-3", "aug": "forum", "prompt_tokens": 25, "answer_tokens": 163}
+{"conversations": [{"role": "user", "content": "Saving \"Presets\"?"}, {"role": "assistant", "content": "SuperCollider forum — Saving \"Presets\"?\n\nIf you don’t care too much about it being human readable, just use writeArchive and readArchive:\n\n```supercollider\na = Array.fill(400, {rrand(0,2200)});\n\na.writeArchive(\"/Users/spluta1/Documents/SC/test\");\n\nb = Object.readArchive(\"/Users/spluta1/Documents/SC/test\");\n\nb.postln;\n```\n"}], "family": "Q", "source_id": "scsynth:4006-3", "aug": "forum", "prompt_tokens": 25, "answer_tokens": 160}
{"conversations": [{"role": "user", "content": "Approaches to recording generated midi in DAW?"}, {"role": "assistant", "content": "SuperCollider forum — Approaches to recording generated midi in DAW?\n\nToday I spent another 6 hours or so trying to record in ardour (linux) both the midi information generated by supercollider and the audio generated by sending this midi to external synths. I finally hit the right combination of magic to make it work and I want to add my recipe in this thread so that I can find it back the future (and perhaps it also works for someone else).\n\nIngredient 1: a2jmidid. You can run it manually on the command line using “a2jmidid -e” or (like me) you can just use the “start midi bridge” button in the jack front-end application “Cadence” (enable the “export hardware ports checkbox”)\n\nIngredient 2: In supercollider itself, it is extremely important to only connect to a port and not to specify a destination uid. It seems that by specifying a destination uid, supercollider gets some kind of direct connection to the midi destination and ardour can no long introspect/record what is happening (I know it doesn’t sound scientific - this is purely the result of empiric observation/frustration.\n\nSo in supercollider, simply use\n\n```supercollider\n~synth1 = MIDIOut(0);\n~synth2 = MIDIOut(1);\n```\n\nand then in ardour’s Window->Midi Connections dialog, you can connect the out ports from supercollider to both your external synth and the track in which you want to record the midi information.\n\nFor midi driver in jack you can configure None.\n\nIf you want to record the generated midi in ardour, do NOT use connection syntax like\n\n```supercollider\n~synth1 = MIDIOut(0, MIDIClient.destinations[2].uid);\n```\n\nand do NOT use\n\n```supercollider\n~synth1 = MIDIOut.newByName(\"INTEGRA-7\", \"INTEGRA-7 MIDI 1\");\n```\n\nIf you just want to send midi to the external synth without recording the information, both previous ways of connecting work as well but these ways of connecting appear to work only if the jack MIDI driver is configured to use “ALSA sequencer” mode. It doesn’t seem to work with “None” or “ALSA Raw” (this may need some further investigation to clear out)."}], "family": "Q", "source_id": "scsynth:2326-20", "aug": "forum", "prompt_tokens": 34, "answer_tokens": 759}
-{"conversations": [{"role": "user", "content": "Why LeakDC and not a standard HPF for DC removal?"}, {"role": "assistant", "content": "SuperCollider forum — Why LeakDC and not a standard HPF for DC removal?\n\nHello everyone,\n\nI’m a bit sceptical of the DC removal implementation in LeakDC. As I understand it, DC removal is nothing but a HPF, preferably placed below the audible range. For this purpose, LeakDC seems to be reaching far too high, attenuating the audible low frequencies. You can run the following code and look at the server meter to see the difference in level between the two audio channels (note: there is of course no DC offset in this example that would need fixing):\n\n```supercollider\n( play { [\n SinOsc.ar(50),\n LeakDC.ar(SinOsc.ar(50))\n] * 0.2 } )\n```\n\nAlso, LeakDC’s behaviour is not consistent between sample rates (as is mentioned in the help file).\n\nI ran the it through Plugin Doctor to back up my suspicions and got these results:\n\nstandard coefficient of 0.995:\n\nSR 48 kHz: Filter starts rolling off at 200 Hz, -2dB at 50 Hz.\n\nSR 96 kHz: Filter starts rolling off at 500 hz! It reaches already -2dB at 100 Hz, -5 dB at 50 Hz.\n\ncoefficient of 0.999:\n\nSR 48 kHz: Filter starts rolling off at 50 Hz, -2 dB at 10 Hz.\n\nSR 96 kHz: Filter starts rolling off at 100 Hz, -2 dB at 20 Hz.\n\nI wonder why one wouldn’t just use a standard HPF at 10 Hz (or so) instead? It is consistent between sample rates, it only starts to roll of below 30 Hz and it reaches only -0.5 dB at 20 Hz. So this actually looks much better in the server meter:\n\n```supercollider\n( play { [\n SinOsc.ar(50),\n HPF.ar(SinOsc.ar(50), 10)\n] * 0.2 } )\n```\n\nSo my question is: Is there any reason why the LeakDC implementation would be peferable to such a standard butterworth HPF?\n\nOne difference I can see is that the HPF still has an initial offset spike before settling around zero phase, LeakDC does not show that behaviour:\n\n```supercollider\n{ LeakDC.ar(DC.ar(0.5)) }.plot(0.5);\n{ HPF.ar(DC.ar(0.5), 10) }.plot(0.5);\n\n{ LeakDC.ar(SinOsc.ar + DC.ar(0.5)) }.plot(0.02);\n{ HPF.ar(SinOsc.ar + DC.ar(0.5), 10) }.plot(0.02);\n```\n\nSo this could be a reason – I don’t know enough about filters to understand why this happens though. Any enlightenment would be appreciated."}], "family": "Q", "source_id": "scsynth:4780-1", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 890}
+{"conversations": [{"role": "user", "content": "Why LeakDC and not a standard HPF for DC removal?"}, {"role": "assistant", "content": "SuperCollider forum — Why LeakDC and not a standard HPF for DC removal?\n\nHello everyone,\n\nI’m a bit sceptical of the DC removal implementation in LeakDC. As I understand it, DC removal is nothing but a HPF, preferably placed below the audible range. For this purpose, LeakDC seems to be reaching far too high, attenuating the audible low frequencies. You can run the following code and look at the server meter to see the difference in level between the two audio channels (note: there is of course no DC offset in this example that would need fixing):\n\n```supercollider\n( play { [\n SinOsc.ar(50),\n LeakDC.ar(SinOsc.ar(50))\n] * 0.2 } )\n```\n\nAlso, LeakDC’s behaviour is not consistent between sample rates (as is mentioned in the help file).\n\nI ran the it through Plugin Doctor to back up my suspicions and got these results:\n\nstandard coefficient of 0.995:\n\nSR 48 kHz: Filter starts rolling off at 200 Hz, -2dB at 50 Hz.\n\nSR 96 kHz: Filter starts rolling off at 500 hz! It reaches already -2dB at 100 Hz, -5 dB at 50 Hz.\n\ncoefficient of 0.999:\n\nSR 48 kHz: Filter starts rolling off at 50 Hz, -2 dB at 10 Hz.\n\nSR 96 kHz: Filter starts rolling off at 100 Hz, -2 dB at 20 Hz.\n\nI wonder why one wouldn’t just use a standard HPF at 10 Hz (or so) instead? It is consistent between sample rates, it only starts to roll of below 30 Hz and it reaches only -0.5 dB at 20 Hz. So this actually looks much better in the server meter:\n\n```supercollider\n( play { [\n SinOsc.ar(50),\n HPF.ar(SinOsc.ar(50), 10)\n] * 0.2 } )\n```\n\nSo my question is: Is there any reason why the LeakDC implementation would be peferable to such a standard butterworth HPF?\n\nOne difference I can see is that the HPF still has an initial offset spike before settling around zero phase, LeakDC does not show that behaviour:\n\n```supercollider\n{ LeakDC.ar(DC.ar(0.5)) }.plot(0.5);\n{ HPF.ar(DC.ar(0.5), 10) }.plot(0.5);\n\n{ LeakDC.ar(SinOsc.ar + DC.ar(0.5)) }.plot(0.02);\n{ HPF.ar(SinOsc.ar + DC.ar(0.5), 10) }.plot(0.02);\n```\n"}], "family": "Q", "source_id": "scsynth:4780-1", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 847}
{"conversations": [{"role": "user", "content": "Strange offset behaviour when plotting some .kr uGens?"}, {"role": "assistant", "content": "SuperCollider forum — Strange offset behaviour when plotting some .kr uGens\n\nI’ve got a workaround for this now.\n\n```supercollider\ns.quit;\nServer.local.options.blockSize = 4;\ns.boot;\n\n{[\n LFTri.ar(s.sampleRate/2, 1, 2), // just to show where the samples are\n Impulse.ar(0), // audio rate impulse in correct place\n Impulse.kr(0), // control rate impulse with offset issue\n Trig1.kr(1, 0) // control rate impulse in correct place\n]}.plot(70/s.sampleRate);\n\n{[\n LFTri.ar(s.sampleRate/2, 1, 2), // just to show where the samples are\n Phasor.ar(Impulse.ar(0), 1/8, -2, 2, -0.625), // Phasor as it behaves in audio rate\n Phasor.kr(Impulse.kr(0), 1/2, -2, 2, -0.625), // Phasor as it behaves in control rate\n Phasor.kr(Impulse.kr(0), 1/2, -2, 2, -0.5) + (1.5 * Trig1.kr(1, 0)) // Phasor in control rate patched to match audio rate\n]}.plot(70/s.sampleRate)\n```\n\nI assume the problem is that the first control rate sample is meant to be more of a ‘sample -1’ than ‘sample 0’, hence why plot omits it when the output is at control rate. This would be fine if audio rate uGens started after one control period. Since they don’t, I’m happy to just adjust the code to make the subsequent samples correct, and then use + (x * Trig1.kr(1, 0)) to patch the first sample. The only problem now is that it’s more complicated to do that with some other uGens."}], "family": "Q", "source_id": "scsynth:450-13", "aug": "forum", "prompt_tokens": 38, "answer_tokens": 604}
-{"conversations": [{"role": "user", "content": "Do is not ¨returning¨ array (campanology)?"}, {"role": "assistant", "content": "SuperCollider forum — Do is not ̈returning ̈ array (campanology)\n\nYou can remove the need for all mutable variables by computing the indexes to swap first - these are stored in indexesEven and indexesOdd.\n\nThen an array of functions is made (swappers)...i.e.[indexesEven, indexesOdd, indexesEven....]\n\nFinally, .inject is used to chain these together, taking the previous result as the input to the next and building an array.\n\n```supercollider\n(\n~swap_sort_steps = {\n |parts|\n var swapConsequtiveIndexes = {|from, to|\n (from..to).clump(2).collect{|p| p.reverse }.flat\n };\n var indexesEven = swapConsequtiveIndexes.(0, parts - 1);\n var indexesOdd = [0] ++ swapConsequtiveIndexes.(1, parts - 1);\n var swappers = parts.collect{ |n|\n {|toSwap| if(n.even)\n { indexesEven.collect{|i| toSwap[i]} }\n { indexesOdd.collect{|i| toSwap[i]} }\n }\n };\n postf(\"indexesEven : %\\nindexesOdd : %\\n\", indexesEven, indexesOdd);\n swappers.inject( [(0..parts-1)], {\n |col, f|\n col ++ [f.(col.last)]\n });\n};\n)\n```\n\nAlso, as I’m sure you know, if anyone else is reading who doesn’t know what this is... its a swap sort algorithm."}], "family": "Q", "source_id": "scsynth:6416-8", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 518}
-{"conversations": [{"role": "user", "content": "SC can't open or read files?"}, {"role": "assistant", "content": "SuperCollider forum — SC can't open or read files\n\nIt looks as though it’s finally working!\n\nI moved the file to a folder I created in the user support directory for SuperCollider and then changed the quotes to ascii.\n\nI think the issue was that at first I had the file name listed without the extension, then I added the extension to the file name and added the file extension to the file path in the code and this must have created a conflict.\n\nIn the first instance SC needed the file extension, ascii quotes, and since I’m on windows the path needed double \\ in the path file.\n\nThe final working code looks like this:\n\n```supercollider\nb = Buffer.readChannel(s, \"C:\\\\Users\\\\44774\\\\AppData\\\\Local\\\\SuperCollider\\\\Tables\\\\wubsquare.wav\", startFrame:0, numFrames: -1);\n```\n\nThe wav file is simply named wubsquare and I included the file extension in the code."}], "family": "Q", "source_id": "scsynth:3084-9", "aug": "forum", "prompt_tokens": 26, "answer_tokens": 313}
+{"conversations": [{"role": "user", "content": "Do is not ¨returning¨ array (campanology)?"}, {"role": "assistant", "content": "SuperCollider forum — Do is not ̈returning ̈ array (campanology)\n\nYou can remove the need for all mutable variables by computing the indexes to swap first - these are stored in indexesEven and indexesOdd.\n\nThen an array of functions is made (swappers)...i.e.[indexesEven, indexesOdd, indexesEven....]\n\nFinally, .inject is used to chain these together, taking the previous result as the input to the next and building an array.\n\n```supercollider\n(\n~swap_sort_steps = {\n |parts|\n var swapConsequtiveIndexes = {|from, to|\n (from..to).clump(2).collect{|p| p.reverse }.flat\n };\n var indexesEven = swapConsequtiveIndexes.(0, parts - 1);\n var indexesOdd = [0] ++ swapConsequtiveIndexes.(1, parts - 1);\n var swappers = parts.collect{ |n|\n {|toSwap| if(n.even)\n { indexesEven.collect{|i| toSwap[i]} }\n { indexesOdd.collect{|i| toSwap[i]} }\n }\n };\n postf(\"indexesEven : %\\nindexesOdd : %\\n\", indexesEven, indexesOdd);\n swappers.inject( [(0..parts-1)], {\n |col, f|\n col ++ [f.(col.last)]\n });\n};\n)\n```\n"}], "family": "Q", "source_id": "scsynth:6416-8", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 481}
+{"conversations": [{"role": "user", "content": "SC can't open or read files?"}, {"role": "assistant", "content": "SuperCollider forum — SC can't open or read files\n\nIt looks as though it’s finally working!\n\nI moved the file to a folder I created in the user support directory for SuperCollider and then changed the quotes to ascii.\n\nI think the issue was that at first I had the file name listed without the extension, then I added the extension to the file name and added the file extension to the file path in the code and this must have created a conflict.\n\nIn the first instance SC needed the file extension, ascii quotes, and since I’m on windows the path needed double \\ in the path file.\n\nThe final working code looks like this:\n\n```supercollider\nb = Buffer.readChannel(s, \"C:\\\\Users\\\\44774\\\\AppData\\\\Local\\\\SuperCollider\\\\Tables\\\\wubsquare.wav\", startFrame:0, numFrames: -1);\n```\n"}], "family": "Q", "source_id": "scsynth:3084-9", "aug": "forum", "prompt_tokens": 26, "answer_tokens": 285}
{"conversations": [{"role": "user", "content": "A starting point to start experimenting with non-standard synthesis?"}, {"role": "assistant", "content": "SuperCollider forum — A starting point to start experimenting with non-standard synthesis?\n\nI while ago I did this noise cloud generator which might serve as inspiration. Other ideas: scramble signals with FFT tools, granular synthesis, FM-synthesis with extreme settings, like index-of-modulation = 4000.\n\n```supercollider\nSynthDef(\\clouds, {\n var num = 10;\n var dur = \\duration.kr(1/6);\n var sig = num.collect{\n var freq = Rand(30, 5000) * SinOsc.kr(LFNoise1.kr(dur).range(30, 1000), 0, LFNoise1.kr(dur)\n .range(0.01, 8)).midiratio;\n var sig = Select.ar(LFNoise0.kr(dur).range(0, 2).round,\n [SinOsc.ar(freq, 0, 0.3), Saw.ar(freq, 0.3), Pulse.ar(freq, 0, 0.3)]);\n var filtFreq = Rand(30, 1000) * LFNoise1.kr(dur).range(1.0, 5.0);\n var filt = Select.ar(LFNoise0.kr(dur).range(0, 2).round,\n [LPF.ar(sig, filtFreq), HPF.ar(sig, filtFreq), BPF.ar(sig, filtFreq)]\n );\n sig = CombL.ar(filt, 0.5, LFNoise1.kr(dur).range(0.02, 0.5), rrand(0.3, 2));\n sig\n };\n var env = Env.perc(\\atk.kr(0.02), \\rel.kr(6), 1, \\cur.kr(-4)).ar(2);\n sig = Splay.ar(sig); // nb! levelComp: true, so if removed signal will be extremely loud!\n sig = LPF.ar(sig, 2000);\n sig = FreeVerb2.ar(sig[0], sig[1], LFNoise1.kr(dur).range(0, 1.0), LFNoise1.kr(dur).range(0.2, 2));\n sig = sig * env * \\amp.kr(1);\n Out.ar(\\out.kr(0), sig)\n}).add;\n\nSynth(\\clouds, [\\atk, rrand(0.01, 2), \\rel, rrand(1, 6.0), \\duration, rrand(0.01, 1)])\n// run it several times, the outcome is highly random\n```"}], "family": "Q", "source_id": "scsynth:8182-5", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 786}
-{"conversations": [{"role": "user", "content": "Resetting start count with PulseDivider?"}, {"role": "assistant", "content": "SuperCollider forum — Resetting start count with PulseDivider?\n\ni think in your example Sweep is receiving a trigger while going from 0 to 1 causing the discontinuity in the phase because the duration between one trigger and the next is unknown.\n\nwith this example you get at least a continiuous phase with random triggers to drive the hanning window (evaluate it several times). but its not multichannel with distributed phases / windows accross channels:\n\n```supercollider\n(\nvar randomTrigPhase = { |triggerRate = 10, randomness = 1|\n var minDuration = (2 ** randomness) / triggerRate;\n var maxDuration = (2 ** (-1 * randomness)) / triggerRate;\n var demand = Dunique(minDuration * ((maxDuration / minDuration) ** Dwhite(0, 1)));\n var duration = Duty.ar(demand, DC.ar(0), demand);\n var phase = Phasor.ar(DC.ar(0), (1 / duration) / SampleRate.ir, 0, 1);\n (phase: phase, trigger: HPZ1.ar(phase) < 0);\n};\n\nvar hanningWindow = { |phase|\n (1 - (phase * 2pi).cos) / 2 * (phase < 1);\n};\n\n{\n var rate = 100;\n var phase = randomTrigPhase.(rate, 1).phase;\n hanningWindow.(phase);\n}.plot(0.1);\n)\n```\n\nim not sure if this is helping it just reminded me of some issue with multichannel random triggers and continiuous phases i have been trying to solve."}], "family": "Q", "source_id": "scsynth:7504-16", "aug": "forum", "prompt_tokens": 31, "answer_tokens": 504}
+{"conversations": [{"role": "user", "content": "Resetting start count with PulseDivider?"}, {"role": "assistant", "content": "SuperCollider forum — Resetting start count with PulseDivider?\n\ni think in your example Sweep is receiving a trigger while going from 0 to 1 causing the discontinuity in the phase because the duration between one trigger and the next is unknown.\n\nwith this example you get at least a continiuous phase with random triggers to drive the hanning window (evaluate it several times). but its not multichannel with distributed phases / windows accross channels:\n\n```supercollider\n(\nvar randomTrigPhase = { |triggerRate = 10, randomness = 1|\n var minDuration = (2 ** randomness) / triggerRate;\n var maxDuration = (2 ** (-1 * randomness)) / triggerRate;\n var demand = Dunique(minDuration * ((maxDuration / minDuration) ** Dwhite(0, 1)));\n var duration = Duty.ar(demand, DC.ar(0), demand);\n var phase = Phasor.ar(DC.ar(0), (1 / duration) / SampleRate.ir, 0, 1);\n (phase: phase, trigger: HPZ1.ar(phase) < 0);\n};\n\nvar hanningWindow = { |phase|\n (1 - (phase * 2pi).cos) / 2 * (phase < 1);\n};\n\n{\n var rate = 100;\n var phase = randomTrigPhase.(rate, 1).phase;\n hanningWindow.(phase);\n}.plot(0.1);\n)\n```\n"}], "family": "Q", "source_id": "scsynth:7504-16", "aug": "forum", "prompt_tokens": 31, "answer_tokens": 461}
{"conversations": [{"role": "user", "content": "Speech to midi converter?"}, {"role": "assistant", "content": "SuperCollider forum — Speech to midi converter?\n\nHello!\n\nI want to make a speech to midi converter in Supercollider.\n\nI’ve started off trying to find a way to convert FFT data to midi-numbers to send to a midi-instrument, but I’m stuck:\n\n```supercollider\n~file = Buffer.read(s, \"path_to_file\", bufnum:1);\n\n(\n{\n var buf = Buffer.alloc(s, 2048, bufnum:2);\n var sig = PlayBuf.ar(2, 1, loop:1);\n var chain = FFT(buf, sig);\n var trig = Impulse.kr(30);\n chain[0].pvcalc(80, {\n |phas, mag|\n SendReply.kr(trig, \"/anal\", mag);\n });\n}.play\n);\n\n(\nOSCdef.new(\\midiConverter, {\n |msg|\n msg.postln;\n}, \"/anal\");\n)\n```\n\nthe output looks like this:\n\n[ /anal, 1000, -1, 0.0, 3.0463190078735, 2.1142015457153, -0.64955651760101, 2.3432319164276, -0.23956227302551, -3.1334409713745, -2.1829152107239, 1.1417833566666, -2.2972648143768, -0.74415707588196, -0.88793164491653, 1.9947071075439, -1.1327115297318, 2.6084003448486, etc...]\n\nI’m not sure how to interpret theese numbers. And I’m not sure pvcalc is even the best way to get the data I need. I want to somehow be able to control the resolution on how many of the loudest bins I’m going to convert to frequency and then from frequency to midi-number to send to a midi-instrument as the soundfile plays through.\n\nAny ideas?"}], "family": "Q", "source_id": "scsynth:2199-1", "aug": "forum", "prompt_tokens": 27, "answer_tokens": 643}
{"conversations": [{"role": "user", "content": "Synth Iteration Help?"}, {"role": "assistant", "content": "SuperCollider forum — Synth Iteration Help\n\n```supercollider\n(\nSynthDef (\\sine_tone) {\narg freq = 440, amp = 1, len = 1, bus = 0;\nvar sig, env;\nenv = Env.step ([ amp ], [ len ]);\nenv = EnvGen.kr (env, doneAction: 2);\nsig = SinOsc.ar (freq, 0, env);\nOut.ar (bus % 2, sig); // bus modulo 2 here to wrap to stereo\n}.add;\n)\n```\n\nmaybe try wrapping the bus array to [ 0, 1 ] by using modulo: bus % 2. this should let you hear what is going on using a stereo output\n\nby using a Pbind, each “note” is being instantiated as a separate synth with its own length, amplitude, frequency and bus. the doneAction: 2 argument in the EnvGen.kr ugen just means each synth will free itself once it is done playing the note it has been assigned."}], "family": "Q", "source_id": "scsynth:259-5", "aug": "forum", "prompt_tokens": 27, "answer_tokens": 319}
{"conversations": [{"role": "user", "content": "Supernova, Groups, Threads, Ndef?"}, {"role": "assistant", "content": "SuperCollider forum — Supernova, Groups, Threads, Ndef?\n\nAbout Ndef:\n\nAFAIK you can manually move a NodeProxy’s group into another group:\n\n```supercollider\n~pargroup = ParGroup(s);\n\nNdef(\\a, { Silent.ar(1) });\n\nNdef(\\a).group.moveToHead(~pargroup);\n```\n\nBut...\n\nNodeProxies use InFeedback.\n\nI was a little suspicious about this for parallel processing. As I recalled, InFeedback’s result depends on the order of execution:\n\n-\nIf the source node for the bus finished processing before the server reaches InFeedback, then InFeedback will output the block of audio being processed now.\n\n-\nIf the source node comes after the node containing InFeedback, then it will output the previous block of audio.\n\nIn both cases, these are the most recently available audio blocks. But, if the order of evaluation is not consistent, then the output may not be consistent.\n\nLet’s test that:\n\n```supercollider\nb = Bus.audio(s, 1);\n\na = { SinOsc.ar(200, 0, 0.1) }.play(outbus: b);\n\nc = { InFeedback.ar(b, 1).dup }.play(target: a, addAction: \\addAfter);\n\n(\nfork {\n var order = Pseq([\\moveBefore, \\moveAfter], inf).asStream;\n loop {\n c.perform(order.next, a);\n 1.0.wait;\n }\n}\n)\n```\n\nOops.\n\nThis means you can’t randomly throw Ndefs into ParGroups. If one Ndef reads a signal from another, then you have to make sure that the target Ndef comes later in a serial (regular) Group. (Correctness of the result should be more important than “optimal” usage of multiple cores.)\n\nIf you don’t, and if supernova happens to put the source and target Ndefs onto separate cores at roughly the same time, then the target might evaluate InFeedback either before or after the source finishes, and there’s no guarantee of this being consistent. So you might get clicks.\n\nhjh"}], "family": "Q", "source_id": "scsynth:1915-4", "aug": "forum", "prompt_tokens": 33, "answer_tokens": 685}
{"conversations": [{"role": "user", "content": "Interfacing SC with external software: MIDI or OSC?"}, {"role": "assistant", "content": "SuperCollider forum — Interfacing SC with external software: MIDI or OSC?\n\nI found this partial solution on sccode.org :\n\n```supercollider\n // declare an event type which sends OSC commands to Renoise\n\n(\nEvent.addEventType(\\renoise, { |server|\n var renoiseOscServer = NetAddr(\"127.0.0.1\", 8000);\n var notes = [~midinote.value, ~ctranspose.value, ~velocity.value, ~sustain.value, ~lag.value, ~timingOffset.value, ~instr.value, ~track.value].flop;\n var timeNoteOn, timeNoteOff, instrument, track, velocity;\n var serverLatency;\n\n serverLatency = server.latency ? 0;\n\n notes.do {|note|\n instrument = note[6] ? -1;\n track = note[7] ? -1;\n velocity = note[2].asInt.clip(0,127);\n\n // sustain and timingOffset are in beats, lag is in seconds\n timeNoteOn = (thisThread.clock.tempo.reciprocal*note[5])+note[4]+server.latency;\n timeNoteOff = (thisThread.clock.tempo.reciprocal*(note[3]+note[5]))+note[4]+server.latency;\n SystemClock.sched(timeNoteOn, {renoiseOscServer.sendMsg(\"/renoise/trigger/note_on\", instrument.asInt, track.asInt, (note[0]+note[1]).asInt, velocity )});\n SystemClock.sched(timeNoteOff, {renoiseOscServer.sendMsg(\"/renoise/trigger/note_off\", instrument.asInt, track.asInt, (note[0]+note[1]).asInt)});\n }\n});\n);\n\n// Now start Renoise OSC server, load a sample, and try some patterns\n\n// straight timing\n(\nPbind(*[\n type: \\renoise,\n legato: Pgauss(0.2,0.05,inf),\n dur: 0.2,\n degree: [2,5,12],\n track: Prand([0,1], inf),\n ctranspose: Pseq([0,0,0,0,4,4,4,4,5,5,5,5],inf),\n velocity: Pgauss(64,10,inf),\n]).play;\n)\n```\n\nhttp://sccode.org/1-4SN\n\nBut what I couldn’t find there was a simple syntax for sending Note Events or Midi Events as OSC messages... Do I really need to re-implement the whole SC’s defaultParentEvent as new OSC Event to send it using regular pattern’s syntax?"}], "family": "Q", "source_id": "scsynth:708-8", "aug": "forum", "prompt_tokens": 37, "answer_tokens": 901}
{"conversations": [{"role": "user", "content": "List of exit codes?"}, {"role": "assistant", "content": "SuperCollider forum — List of exit codes?\n\n7068696c:\n\n```supercollider\no = s.options;\no.inDevice = nil;\no.outDevice = \"ASIO : ASIO4ALL\";\n```\n\nHmmmm... In earlier SC versions, it wouldn’t have worked to have a nil input device in scsynth either (which is admittedly a problem for devices with no inputs). This was fixed in scsynth but it’s possible that it wasn’t fully fixed in supernova.\n\n@MarcinP – any thoughts about this? (I remember you worked on scsynth device selection but I don’t recall who ported that to supernova.)\n\nhjh"}], "family": "Q", "source_id": "scsynth:4457-5", "aug": "forum", "prompt_tokens": 26, "answer_tokens": 237}
-{"conversations": [{"role": "user", "content": "How to generate paradiddles?"}, {"role": "assistant", "content": "SuperCollider forum — How to generate paradiddles?\n\nHi Rodet, I’m teaching jazz at college, and sometimes paradiddles come up in conversation (although I’m not a drummer). A paradiddle is basically a way of ‘evenly’ playing a roll (single/double/triple/whatever). If you take your drumsticks/fingers and play evenly:\n\nright, left, right, right, left, right, left, left, right, left, right, right, etc\n\nyou’ll notice that it’s possible to get an even rhythm, which when played fast becomes a roll. The idea of the single/double/triple is just to place the accents (lightly, or not) on the left, right hand, which if I understand helps keep an even stroke (and makes better sense to follow).\n\nSo, although I don’t know the goal of your idea, a simple code which would give you the solution could be a pattern. You’ll notice I’ve put in a SynthDef to give the ‘snare’ sound - not very real, but just for the demonstration. If you run these patterns, un-commenting the line needed (single, double or triple - don’t forget to comment out the lines you don’t need), you’ll hear the accents a paradiddle gives.\n\nIn this example Pbind ‘a’ gives the pulse, and Pbind ‘b’ the accents. And, if you play along with them (using your chart), you’ll notice the accents pass from right hand to left hand (or vice versa). This is (more or less) what paradiddles do, although a drummer will explain better how they ‘accent’ strokes to get more complicated/subtle rhythms.\n\n```supercollider\n(\nSynthDef(\\snare, {\n arg out=0, sus=0.1;\n var sig, env;\n sig = WhiteNoise.ar(0.1);\n env = EnvGen.kr(Env.perc(0.001, sus), doneAction:2);\n sig = sig*env;\n Out.ar(out, sig!2);\n}).add;\n);\n\n(\nt=TempoClock(80/60);\na=Pbind(\n \\instrument, \\snare,\n \\dur, 1/2,\n \\sus, 0.01\n);\nb=Pbind(\n \\instrument, \\snare,\n \\dur, 1,\n \\sus, Pseq([0.02, 0.01],inf), // single\n //\\sus, Pseq([0.02, 0.01, 0.01],inf), // double\n //\\sus, Pseq([0.02, 0.01, 0.01, 0.01],inf), // triple\n);\nPpar([a, b]).play(t);\n)\n```\n\nI hope that puts you on the right track.\n\np.s. Don’t forget to try out changing the speed to get the real effect. Try something like 320/60 on the TempoClock."}], "family": "Q", "source_id": "scsynth:1243-8", "aug": "forum", "prompt_tokens": 25, "answer_tokens": 876}
-{"conversations": [{"role": "user", "content": "Splay - not getting spread, wrong use?"}, {"role": "assistant", "content": "SuperCollider forum — Splay - not getting spread, wrong use?\n\nYou need to undestand that if you have two identical signal coming from left and right it will always be mono. No stereo spread possible. So you need to introduce (at least) two different signals - and just different amplification will not really work.\n\nTo expand your first example, we can introduce an array of values for paramtere pos:\n\n```supercollider\n(\nx = { arg spread=1, level=0.2, center=0.0;\n Splay.ar(\n GrainBuf.ar(numChannels: 1,\n trigger: Impulse.kr(1.2875),\n dur: Impulse.kr(1.2875),\n sndbuf: b,\n pos:[0,0.5],\n interp: 1\n ),\n spread,\n level,\n center\n );\n}.play;\n);\n\nx.set(\\spread, 1, \\center, 0); // full stereo\nx.set(\\spread, 0, \\center, 0); // mono center\n```\n\nBy way of Multichannel Expansion this creates two different signals (channels, an array of 2 UGen graphs) that you can hear as different and therefore observe the stereo spread.\n\nAnd similarly, to use your other example with In.ar where I have added in=2, so that it takes my mic in (but you can specify another bus) and wrapped it into a feedback delay with an array of two values for delayTime. Multichannel expansion thus creates two channels that are different because they have different delaytimes but the rest of UGen graph is the same (a copy). Changing spread now works:\n\n```supercollider\n(\nSynthDef(\\stereo,{|out=0, in=2, spread=1, level=1, center=0.0|\n Out.ar(out,\n Splay.ar(\n CombN.ar(\n In.ar(in, 1), 1, [0.3,0.4], 2)\n ,spread,level,center));\n}).play;\n)\n```\n\nI hope that clarifies the issue better."}], "family": "Q", "source_id": "scsynth:2003-10", "aug": "forum", "prompt_tokens": 31, "answer_tokens": 625}
+{"conversations": [{"role": "user", "content": "How to generate paradiddles?"}, {"role": "assistant", "content": "SuperCollider forum — How to generate paradiddles?\n\nHi Rodet, I’m teaching jazz at college, and sometimes paradiddles come up in conversation (although I’m not a drummer). A paradiddle is basically a way of ‘evenly’ playing a roll (single/double/triple/whatever). If you take your drumsticks/fingers and play evenly:\n\nright, left, right, right, left, right, left, left, right, left, right, right, etc\n\nyou’ll notice that it’s possible to get an even rhythm, which when played fast becomes a roll. The idea of the single/double/triple is just to place the accents (lightly, or not) on the left, right hand, which if I understand helps keep an even stroke (and makes better sense to follow).\n\nSo, although I don’t know the goal of your idea, a simple code which would give you the solution could be a pattern. You’ll notice I’ve put in a SynthDef to give the ‘snare’ sound - not very real, but just for the demonstration. If you run these patterns, un-commenting the line needed (single, double or triple - don’t forget to comment out the lines you don’t need), you’ll hear the accents a paradiddle gives.\n\nIn this example Pbind ‘a’ gives the pulse, and Pbind ‘b’ the accents. And, if you play along with them (using your chart), you’ll notice the accents pass from right hand to left hand (or vice versa). This is (more or less) what paradiddles do, although a drummer will explain better how they ‘accent’ strokes to get more complicated/subtle rhythms.\n\n```supercollider\n(\nSynthDef(\\snare, {\n arg out=0, sus=0.1;\n var sig, env;\n sig = WhiteNoise.ar(0.1);\n env = EnvGen.kr(Env.perc(0.001, sus), doneAction:2);\n sig = sig*env;\n Out.ar(out, sig!2);\n}).add;\n);\n\n(\nt=TempoClock(80/60);\na=Pbind(\n \\instrument, \\snare,\n \\dur, 1/2,\n \\sus, 0.01\n);\nb=Pbind(\n \\instrument, \\snare,\n \\dur, 1,\n \\sus, Pseq([0.02, 0.01],inf), // single\n //\\sus, Pseq([0.02, 0.01, 0.01],inf), // double\n //\\sus, Pseq([0.02, 0.01, 0.01, 0.01],inf), // triple\n);\nPpar([a, b]).play(t);\n)\n```\n"}], "family": "Q", "source_id": "scsynth:1243-8", "aug": "forum", "prompt_tokens": 25, "answer_tokens": 818}
+{"conversations": [{"role": "user", "content": "Splay - not getting spread, wrong use?"}, {"role": "assistant", "content": "SuperCollider forum — Splay - not getting spread, wrong use?\n\nYou need to undestand that if you have two identical signal coming from left and right it will always be mono. No stereo spread possible. So you need to introduce (at least) two different signals - and just different amplification will not really work.\n\nTo expand your first example, we can introduce an array of values for paramtere pos:\n\n```supercollider\n(\nx = { arg spread=1, level=0.2, center=0.0;\n Splay.ar(\n GrainBuf.ar(numChannels: 1,\n trigger: Impulse.kr(1.2875),\n dur: Impulse.kr(1.2875),\n sndbuf: b,\n pos:[0,0.5],\n interp: 1\n ),\n spread,\n level,\n center\n );\n}.play;\n);\n\nx.set(\\spread, 1, \\center, 0); // full stereo\nx.set(\\spread, 0, \\center, 0); // mono center\n```\n\nBy way of Multichannel Expansion this creates two different signals (channels, an array of 2 UGen graphs) that you can hear as different and therefore observe the stereo spread.\n\nAnd similarly, to use your other example with In.ar where I have added in=2, so that it takes my mic in (but you can specify another bus) and wrapped it into a feedback delay with an array of two values for delayTime. Multichannel expansion thus creates two channels that are different because they have different delaytimes but the rest of UGen graph is the same (a copy). Changing spread now works:\n\n```supercollider\n(\nSynthDef(\\stereo,{|out=0, in=2, spread=1, level=1, center=0.0|\n Out.ar(out,\n Splay.ar(\n CombN.ar(\n In.ar(in, 1), 1, [0.3,0.4], 2)\n ,spread,level,center));\n}).play;\n)\n```\n"}], "family": "Q", "source_id": "scsynth:2003-10", "aug": "forum", "prompt_tokens": 31, "answer_tokens": 612}
{"conversations": [{"role": "user", "content": "Where does the magic frequency 261.6255653006 come from?"}, {"role": "assistant", "content": "SuperCollider forum — Where does the magic frequency 261.6255653006 come from?\n\nThinking about this a bit more, on one hand it might be useful if set (and everything else in Event) could fetch not only the msgFunc from the synthDesc, which it does (if args are set to []), but perhaps also the default values for the synth controls... and then used those in preference to Event defaults if “nothing is specified” for some key in the event. Alas “nothing is specified” is tedious to detect in Event, as it does its own calculations which have a lot of inputs (esp. for the frequency stuff). So, one could implement such a policy more explicitly in a \\finish callback that e.g. looks up in synthDesc only specific keys (say specified in a defArgs, possibly with [] meaning all found in the synthDesc) and sets only those if “not set” in event.\n\nI almost started coding this idea, but I realised that’s actually inferior to just putting the synth defaults in another event/environment, and chaining that before the event... which is exactly what I usually do with a Pdef.envir. That approach, besides sidestepping the issue of detecting what’s “not set” in the Event, has an extra advantage that a persistent set of defaults, after being initialized with the synthdef ones, can be easily tweaked in a gui. When I find myself that I often change the default value of some control like that, I go back and change the synthdef default. Because of that workflow, in which I always have the defaults loaded in an chained envir, I didn’t even have much realization of Event defaults for things like amp, freq etc. And I didn’t need type: \\set much until recently... for which getting the args constructed in that case is also rather easy as Pdef(...).controlKeys. Even without Pdefs, that’s straightforward (past loading those defaults into an event)\n\n```supercollider\ne = SynthDescLib.global.synthDescs.at(\\default).controls.inject((), { |e, c| e[c.name] = c.defaultValue });\n(instrument: \\default, dur: 1, amp: 0.2).next(e).play\n```"}], "family": "Q", "source_id": "scsynth:2177-8", "aug": "forum", "prompt_tokens": 42, "answer_tokens": 731}
{"conversations": [{"role": "user", "content": "Resizing FreqScope?"}, {"role": "assistant", "content": "SuperCollider forum — Resizing FreqScope?\n\nOddly, this seems to work:\n\n```supercollider\n// max partial = 20 kHz\n// do not play this loudly\na = { Blip.ar(100, 200, 0.02).dup }.play;\n\nv = FreqScope(800, 600); // top partial is shown below 1.75 kHz (?)\n\nv.scope.scope.xZoom = 1; // seems correct, by eyeballing\n\n// let's try another resolution\nv = FreqScope(600, 500);\nv.scope.scope.xZoom = 1; // hm, zoom = 1 seems OK here too\n```\n\nFreqScope includes the line scope.xZoom_((scope.bufSize*0.25) / width); so it may be that this calculation is incorrect. I’m unclear, for instance, why it’s dividing by width – apparently zooming out for larger windows...?\n\nBut I tried three different widths (800x600, 600x500, 200x150), and for all of them, xZoom = 1 appeared to be correct. It’s possible that this calculation is vestigial, then – maybe we needed it for the older version of frequency scope, but the Qt version might not need it at all.\n\nhjh"}], "family": "Q", "source_id": "scsynth:4326-10", "aug": "forum", "prompt_tokens": 27, "answer_tokens": 409}
{"conversations": [{"role": "user", "content": "How to sync between clock and running synth?"}, {"role": "assistant", "content": "SuperCollider forum — How to sync between clock and running synth\n\nFirst, I don’t encounter any drift with your example here on my system (SC 3.9.3 on Mac with 10.10).\n\nThere are two points that confused me a bit with this example: The doubling of the LFPulse frequency (due to causing 2 DC clicks per period, which is kind of harsh) and the random duration in the Pattern. OffsetOut improves accuracy, but even with Out this variant doesn’t run out of sync here:\n\n```supercollider\n(\n~myClock = TempoClock.new(2.2);\nSynthDef(\\beep, { OffsetOut.ar(0, SinOsc.ar(\\freq.kr(440), mul:\\amp.kr)!2*EnvGate()) }).add;\n{\n Ndef(\\a).proxyspace.clock = ~myClock;\n Ndef(\\a).proxyspace.quant = 1;\n Ndef(\\b).proxyspace.clock = ~myClock;\n Ndef(\\b).proxyspace.quant = 1;\n\n Ndef(\\a, Pbind(\\instrument, \\beep,\n \\dur, 1,\n \\degree, Prand((0..14),inf),\n \\amp, 0.4,\n \\legato, 0.03));\n Ndef(\\b, { Decay.ar(Impulse.ar(2.2!2), 1, mul:0.2).lag(0.001) });\n\n Ndef(\\a).play;\n Ndef(\\b).play;\n\n}.fork(~myClock);\n)\n```\n\nHow long does it need to get out of sync on your machine ?\n\nBesides of the concrete example: yes, syncing between Patterns and Server can be demanding and the reason for this is a necessary realtime adjustment that probably can’t be overcome. I have given an example here:\n\n Imperfection of language-based timing Learning\n\n This goes back to an observation of my colleague Gerhard Eckel. I posted this a while ago on the mailing list, but can’t find it anymore in the archives. As I think it’s an interesting topic I’m reposting it here again for future reference.\nTiming in general is a crucial topic and practically users are mainly confronted with asynchronicity between server and language, latency, quantization, the Out/OffsetOut differences etc. Sample-accurate timing isn’t relevant in all contexts, nevertheless in..."}], "family": "Q", "source_id": "scsynth:2979-2", "aug": "forum", "prompt_tokens": 32, "answer_tokens": 759}
-{"conversations": [{"role": "user", "content": "Rand or rand difference?"}, {"role": "assistant", "content": "SuperCollider forum — Rand or rand difference?\n\nI think you meant to compare Rand and rrand (not rand) – both generate a random number between a given low and high, but Rand is intended to be used inside a SynthDef and the behavior is slightly different. Compare:\n\n```supercollider\n(\nSynthDef(\\test, {\n var freq = rrand(400, 600);\n Out.ar(0, SinOsc.ar(freq) * 0.2);\n}).add;\n);\n\nSynth(\\test); // run and stop multiple times: always same freq\n\n(\nSynthDef(\\test2, {\n var freq = Rand(400, 600);\n Out.ar(0, SinOsc.ar(freq) * 0.2);\n}).add;\n);\n\nSynth(\\test2); // run and stop multiple times: every time a different freq\n```\n\nAs you can read in the help file, Rand is intended to be used inside SynthDefs when you want the particular behavior of a newly generated random frequency for each Synth called. You can use rrand(lo, hi) inside a SynthDef too, if you want the random number to be generated only once at time of SynthDef creation (it gets “inscribed in the recipe” for good), so all future and all Synth calls based on that SynthDef to use on that same random number.\n\nAs a side note, rand (as opposed to rrand) generates a random number between zero and the receiver:\n\n```supercollider\nrand(8); // random numbers between 0 and and 8 (excluding 8)\n\nrand(0.5, 8); // random numbers between 0 and 0.5; second argument is ignored here\n```\n\nAlso in regards to the specific way you present the example (as Functions, indicated by the curly braces): note the difference when you evaluate them:\n\n```supercollider\n{Rand(0.5,8)}.value; // returns 'a Rand'\n{rrand(0.5,8)}.value; // returns an actual random choice between lo and hi\n```\n\nHope this helps,\n\nB"}], "family": "Q", "source_id": "scsynth:3008-2", "aug": "forum", "prompt_tokens": 24, "answer_tokens": 624}
+{"conversations": [{"role": "user", "content": "Rand or rand difference?"}, {"role": "assistant", "content": "SuperCollider forum — Rand or rand difference?\n\nI think you meant to compare Rand and rrand (not rand) – both generate a random number between a given low and high, but Rand is intended to be used inside a SynthDef and the behavior is slightly different. Compare:\n\n```supercollider\n(\nSynthDef(\\test, {\n var freq = rrand(400, 600);\n Out.ar(0, SinOsc.ar(freq) * 0.2);\n}).add;\n);\n\nSynth(\\test); // run and stop multiple times: always same freq\n\n(\nSynthDef(\\test2, {\n var freq = Rand(400, 600);\n Out.ar(0, SinOsc.ar(freq) * 0.2);\n}).add;\n);\n\nSynth(\\test2); // run and stop multiple times: every time a different freq\n```\n\nAs you can read in the help file, Rand is intended to be used inside SynthDefs when you want the particular behavior of a newly generated random frequency for each Synth called. You can use rrand(lo, hi) inside a SynthDef too, if you want the random number to be generated only once at time of SynthDef creation (it gets “inscribed in the recipe” for good), so all future and all Synth calls based on that SynthDef to use on that same random number.\n\nAs a side note, rand (as opposed to rrand) generates a random number between zero and the receiver:\n\n```supercollider\nrand(8); // random numbers between 0 and and 8 (excluding 8)\n\nrand(0.5, 8); // random numbers between 0 and 0.5; second argument is ignored here\n```\n\nAlso in regards to the specific way you present the example (as Functions, indicated by the curly braces): note the difference when you evaluate them:\n\n```supercollider\n{Rand(0.5,8)}.value; // returns 'a Rand'\n{rrand(0.5,8)}.value; // returns an actual random choice between lo and hi\n```\n"}], "family": "Q", "source_id": "scsynth:3008-2", "aug": "forum", "prompt_tokens": 24, "answer_tokens": 613}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for SOUND 1, from orig Influx Example. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// SOUND 1, from orig Influx Example\n(\nNdef(\\dog).addSpec(\\intv, [-24, 24]);\nNdef(\\dog).addSpec(\\timescale, [0.01, 10, \\exp]);\nNdef(\\dog).addSpec(\\curve, [-10, 10]);\nNdef(\\dog).addSpec(\\ffreq, \\freq);\n\nNdef(\\dog).addSpec(\\loopnode, [0, 12]);\nNdef(\\dog).addSpec(\\dens, [10, 1000]);\nNdef(\\dog).addSpec(\\resfreq, \\freq);\nNdef(\\dog).addSpec(\\ringtime, [0.01, 1, \\exp]);\n\nNdef(\\dog, { |amp=0, freq=250, intv=19, timescale=1, curve=0, loopnode=0, dens = 10, resfreq = 500, ringtime = 0.01|\n var n = 15;\n var env = EnvGen.kr(\n Env({ 1.0.rand2 }!(n+1), {1.0.rand}!n, curve, releaseNode: n-1, loopNode: loopnode.min(n-3)),\n timeScale: timescale);\n var pitch = (env * [1, 0.33, -1] * intv).midiratio * freq;\n var form = Formant.ar(pitch, pitch.rotate(1) * 1.6, pitch.rotate(2) * 2.6);\n\n var dusty = Ringz.ar(\n Dust.ar(dens!3),\n (resfreq * LFNoise0.kr([3, 5, 7], 0.5, 1)).lag(0.3),\n ringtime)\n * ((dens ** -0.5) * (ringtime ** -0.3)\n );\n\n Splay.ar(form * dusty, level: amp * 4) ;\n});\n);\n```"}], "family": "H", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/dog.scd", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 585}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Blip thru Formlet, pseudo-vocal synthesis that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// Blip thru Formlet, pseudo-vocal synthesis.\n// hh&adc, since beijing 2005\n// 2019 made quad/MC\n\n// keywords: vocal, voice, formants\n\n/*\nNdef(\\formSing).gui;\nNdef(\\formSing).play;\nNdef(\\formSing).getHalo(\\stepFdev).value;\n*/\nNdef(\\formSing).addSpec(\\root, [20, 500, 6]);\nNdef(\\formSing).addSpec(\\formfrq, [50, 5000, \\exp]);\nNdef(\\formSing).addSpec(\\harm, [1, 256, \\exp]);\nNdef(\\formSing).addSpec(\\formLag, [0.01, 100, \\exp]);\nNdef(\\formSing).addSpec(\\ndiv, [0.01, 1, \\exp]);\nNdef(\\formSing).addSpec(\\fdev, [0, 24, \\amp]);\nNdef(\\formSing).addSpec(\\round, [0, 3, \\amp, 0.05]);\n\n(\n// modulating formant frequency\nNdef(\\formSing, { arg amp=0, root=150, formfrq=500, harm=20, fdev=2, ndiv = 0.2, formLag=0.1, round = 1.5;\n var freqCompare = 1; // ((formfrq / root).log2).abs.min(1).linexp(0, 1, 0.25, 1);\n var in = Blip.ar(\n root.lag(formLag) * LFNoise0.kr(root * ndiv ! q.numChans, fdev.max(0.01) ).midiratio,\n harm.lag(formLag), // .max(formfrq / root * 0.25),\n 0.1\n ) * GrayNoise.ar(0.1 ! q.numChans, 1);\n\n Limiter.ar(Formlet.ar(in, formfrq.lag(formLag), 0.005, 0.02) * (freqCompare * amp.lag(0.1)))\n .softclip;\n});\n);\n```"}], "family": "H", "source_id": "quarks:NTMI/NTMI_AI_sc_setup/POOL/2_process/formSing.scd", "aug": "prologue:intent", "prompt_tokens": 69, "answer_tokens": 643}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `LFSaw`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nfork {\n ~group = Group();\n\n 2.wait;\n\n SynthDef(\\buzz, {\n |out = 0, freq = 300, amp = 0.1, filter = 1.7|\n var sig = LFSaw.ar(freq * [1, 3, 5], 0, amp * [1, 0.5, 0.25]).sum;\n sig = LPF.ar(sig, freq * filter);\n Out.ar(out, sig);\n }).add;\n\n [50, 53, 58, 46, 60].midicps.do {\n |f, i|\n Synth(\\buzz, [\n \\out: 0, \\freq, f, \\filter: (i / 2) + 1\n ], target:~group);\n 2.wait;\n };\n}\n)\n```"}], "family": "H", "source_id": "quarks:NodeSnapshot/HelpSource/Classes/TreeSnapshotView.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 246}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `LFPulse` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n4.insp;\n[1,2,3].insp;\nPageLayout.insp;\nSynthDef(\"yawn\",{ arg freq=100;\n Out.ar(0,Saw.ar * LFPulse.kr(3))\n}).insp;\n```"}], "family": "H", "source_id": "quarks:ServerTools/HelpSource/Guides/insp.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 86}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for SOUND 1, from orig Influx Example. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// SOUND 1, from orig Influx Example\n(\n// // // if JITLibExtensions are used, you can make space local:\n// Ndef(\\dog).addSpec(\\intv, [-24, 24]);\n// Ndef(\\dog).addSpec(\\timescale, [0.01, 10, \\exp]);\n// Ndef(\\dog).addSpec(\\curve, [-10, 10]);\n// Ndef(\\dog).addSpec(\\ffreq, \\freq);\n//\n// Ndef(\\dog).addSpec(\\loopnode, [0, 12]);\n// Ndef(\\dog).addSpec(\\dens, [10, 1000, \\exp]);\n// Ndef(\\dog).addSpec(\\resfreq, \\freq);\n// Ndef(\\dog).addSpec(\\ringtime, [0.01, 1, \\exp]);\n\nSpec.add(\\intv, [-24, 24]);\nSpec.add(\\timescale, [0.01, 10, \\exp]);\nSpec.add(\\curve, [-10, 10]);\nSpec.add(\\ffreq, \\freq);\n\nSpec.add(\\loopnode, [0, 12]);\nSpec.add(\\dens, [10, 1000, \\exp]);\nSpec.add(\\resfreq, \\freq);\nSpec.add(\\ringtime, [0.01, 1, \\exp]);\n\n\nNdef(\\dog, { |amp=0, freq=250, intv=19, timescale=1, curve=0, loopnode=0, dens = 10, resfreq = 500, ringtime = 0.01|\n var n = 15;\n var env = EnvGen.kr(\n Env({ 1.0.rand2 }!(n+1), {1.0.rand}!n, curve, releaseNode: n-1, loopNode: loopnode.min(n-3)),\n timeScale: timescale);\n var pitch = (env * [1, 0.33, -1] * intv).midiratio * freq;\n var form = Formant.ar(pitch, pitch.rotate(1) * 1.6, pitch.rotate(2) * 2.6);\n\n var dusty = Ringz.ar(\n Dust.ar(dens!3),\n resfreq * LFNoise0.kr([3, 5, 7], 0.5, 1),\n ringtime)\n * ((dens ** -0.5) * (ringtime ** -0.3)\n );\n\n Splay.ar(form * dusty, level: amp) ;\n});\n);\n\nNdef(\\dog).set(\\amp, 0.2).vol_(0.2);\nNdef(\\dog).gui.moveTo(400, 380);\n\n/*\n// Ndef(\\dog).addHalo(\\orderedNames, Ndef(\\dog).controlKeys);\nNdef(\\dog).controlKeys;\nNdef(\\dog).vol_(0.5);\nNdefPreset( Ndef(\\dog) ).loadSettings;\nNdef(\\dog).play;\nNdef(\\dog).gui;\n*/\n```"}], "family": "H", "source_id": "quarks:Standalone/example_myproj/02_processes/dog.scd", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 937}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PLbindef`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\nServer.default = s;\ns.boot;\n);\n\n// synthdefs to play with\n\n(\nSynthDef(\\noise_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, rq = 0.1, amp = 0.1|\n var sig = { WhiteNoise.ar } ! 2;\n sig = BPF.ar(sig, freq, rq) *\n EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2) *\n (rq ** -1) * (250 / (freq ** 0.8));\n OffsetOut.ar(out, sig);\n}).add;\n\nSynthDef(\\sin_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { SinOsc.ar(freq, Rand(0, 2pi)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n\nSynthDef(\\saw_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { VarSaw.ar(freq, Rand(0, 1)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n)\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/PLbindef.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 496}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `VarGui`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// synth definition with raising frequency\n\n(\nSynthDef(\\synth_0, { |devFactor = 0.1, devFreq = 10, amp = 0.1|\n var freq = XLine.kr(400, 1200, 10); \n Out.ar(0, SinOsc.ar(SinOsc.ar(devFreq, 0, devFactor * freq, freq), mul: amp).dup(2) * EnvGate.new) \n}).add;\n)\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/VarGui.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 161}
@@ -13705,6 +13418,8 @@
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for simple smooth arp. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns.boot;\n);\n\n(\nSynthDef(\\smooth, { |freq = 440, sustain = 1, amp = 0.5|\n var sig;\n sig = SinOsc.ar(freq, 0, amp) * EnvGen.kr(Env.linen(0.05, sustain, 0.1), doneAction: 2);\n Out.ar(0, sig ! 2)\n}).add;\n);\n\n(\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([36 + 0, 36 + 7, 36 + 12], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5], inf)\n).play;\n);\n\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([60+0, 60+5, 60+7, 60+8, 60+7, 60+5], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5, 0.5, 0.5, 0.5], inf)\n).play;\n)\n)\n```"}], "family": "H", "source_id": "sccode:1-53V", "aug": "prologue:intent", "prompt_tokens": 48, "answer_tokens": 414}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Benoit XVI (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// a supercollider port of Coloscope's Pure-data organ. \n\nSynthDef(\\benoit, {\n arg out=0, amp=0.5, freq=440, semione=12, semitwo=24, trackingmul=2, gate=1, sus=1, rel=1;\n var env, sig, sig1, sig2, sig3, ringmod, tracking, sig4;\n\n sig1 = Pulse.ar(freq, 0.17);\n sig2 = Pulse.ar((freq.cpsmidi - semione).midicps, 0.17);\n sig3 = Pulse.ar((freq.cpsmidi + semitwo).midicps, 0.17);\n\n sig4 = LFTri.ar((freq.cpsmidi - semitwo).midicps);\n\n env = EnvGen.ar(Env.linen(0,sus,rel), gate, doneAction:2);\n\n tracking = ((freq * 1) + freq) * trackingmul;\n sig = sig1 + sig2 + sig3 + (sig4 * 2);\n\n\n sig = RLPF.ar(sig, tracking, 1, 0.33);\n sig = FreeVerb.ar(sig, 0.12);\n sig = sig.tanh;\n sig = sig * env;\n\n\n Out.ar(out, (sig * amp));\n\n}).add;\n```"}], "family": "H", "source_id": "sccode:1-53U", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 438}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for number 10 for Quiz 4a. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var tri, bpf;\n tri = LFTri.ar(\n freq: [440,340, 513],\n mul: LFPulse.kr(\n freq: [6,3,2],\n width: 0.15));\n bpf = SinOsc.ar(in: tri, freq: LFNoise2.kr(4).range(400,1000));\n Splay.ar(tri,bpf);\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53t", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 144}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Breathing Ocean (a SuperCollider snippet). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var lew, bpf;\n lew = WhiteNoise.ar(\n mul: 0.5,\n add: 0.1); \n bpf = LPF.ar(in: lew, freq: SinOsc.kr(1/8).range(100, 800));\n Out.ar(0, bpf);\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53o", "aug": "prologue:intent", "prompt_tokens": 59, "answer_tokens": 110}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for outer beat. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var saw, bpf;\n saw = Saw.ar(\n freq: [1700,2000],\n mul: LFPulse.kr(\n freq: [2,7],\n width: 0.115));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/3).range(250, 4000)); \n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53l", "aug": "prologue:intent", "prompt_tokens": 47, "answer_tokens": 129}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Nuclear Fallout (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var saw, bpf;\n saw = Saw.ar(\n freq: [60,150],\n mul: LFPulse.kr(\n freq: [2,3],\n width: 0.15));\n \n { BPF.ar(\n in: WhiteNoise.ar(mul: 1),\n freq: 1000,\n rq: 0.9\n )\n}\n\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53j", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 129}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Electrode Theremin (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var saw, bpf;\n saw = Saw.ar(\n freq: 30, \n mul: SinOsc.kr(\n freq: LFPulse.ar(freq: [100, 1000]).range(1, 10),\n width: 0.9));\n bpf = BPF.ar(in: saw, freq: MouseY.kr(1000, [6000, 9000]), rq: MouseX.kr(0.1, 0.9), mul: 20);\n Out.ar(0, bpf);\n \n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53h", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 175}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Close in Counters of the Fourth Mind. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\closeN, { |out=0, freq=440, gate=1|\n var son = BPF.ar(in: WhiteNoise.ar(20!2),\n freq: freq,\n rq: 0.005,\n mul: 1,\n );\n var env = EnvGen.ar(\n Env.linen(0.1, 0.5, 0.55, 0.8, \\welch),\n doneAction:2\n );\n son = FreeVerb2.ar(son, son, mix: 0.7, room: 1.0, damp: 0.3);\n Out.ar(out, son * env);\n\n\n}).add;\n);\n\n\n(\na = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [200, 250],\n mul: LFPulse.kr(\n freq: [2, 3],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\ns = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [100, 150],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nd = {\n var saw, bpf;\n saw = Pulse.ar(\n freq: [800, 1000],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15).range(0.0,0.7));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nf = Pbind(\n \\instrument, \\closeN,\n \\freq, Pseq([800, 1000, 900, 400, 600], inf),\n \\dur, Pseq([1, 1, 1, 1, 4], inf),\n \\amp, 1);\ng = Pbind(\n \\instrument, \\closeN,\n \\freq, Pseq([1000, 1150, 1200, 1500, 1200], inf),\n \\dur, Pseq([1, 1, 1, 1, 4], inf),\n \\amp, 0.5);\n{\n a.play;\n 3.75.wait;\n f.play();\n 4.25.wait;\n s.play;\n 8.wait;\n d.play;\n 3.75.wait;\n g.play;\n}.fork;\n)\n```"}], "family": "H", "source_id": "sccode:1-53b", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 933}
@@ -13733,6 +13448,7 @@
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for 003_102 (a SuperCollider snippet). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nSynthDef('003_102', {|out=0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y| Out.ar(out, Pan2.ar(Normalizer.ar(( GbmanL.ar( LPF.ar( SyncSaw.ar(p, k, q, h ), FreqShift.ar(d, r, k, y, a ), h, n ), r, l, Blip.ar(r, f, u, i ), h ))*( LFPar.ar(d, x, Saw.ar(w, k, Formant.ar(s, q, d, DelayL.ar(y, 0.5, w, v, i ), e ) ), y ))*( LFCub.ar(q, a, h, g ))*( Gendy1.ar(r, c, r, QuadL.ar(h, o, j, t, t, v, f ), k, p, g, Pulse.ar(g, g, c, s ), PMOsc.ar(f, u, d, t, d, f ), f, LFNoise0.ar(k, l, e ), d ) )))) }).play(args: #[ a, 0.1, b, 0.83039082494709, c, 7.4736936148092, d, 57.834883574831, e, 0.56638920329924, f, 2.7610572022348, g, -0.60208093272399, h, 0.69731527262978, i, 0.97553825378418, j, 0.47619211673737, k, 0.45142233371735, l, 6.5229251440451, m, 0.34238355327673, n, 3.1624102065486, o, 1, p, 1, q, 5.4898714868897, r, 2.7777416341664, s, 10966.099508885, t, 0.15706503391266, u, 3.1945936724559, v, 20000, w, -4.6151277924266, x, 1.4588773159677, y, 0.0012384873762477 ])\n```"}], "family": "H", "source_id": "sccode:1-4U9", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 720}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for blaplop (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\bla, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;\n var sig;\n var tab;\n tab = \\tab.kr(1 ! 15);\n sig = LFSaw.ar(freq * tab.abs);\n sig = sig.sum;\n sig = RLPF.ar(sig, Rand(10,freq*2) + 100 * SinOsc.ar(tab.abs).range(0.01,Rand(2,7)));\n sig = sig.sum;\n sig = sig / 100;\n sig = sig.tanh;\n sig = sig * EnvGen.ar(Env.adsr(0.01,0.1,0.8,0.1+ExpRand(0.001,0.2)),gate,doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n}).add;\n);\n\n(\nPdef(\\plop, Pbind(\n \\instrument, \\bla,\n \\degree, Pstep(Pseq([\n Pseq([0,2,4],4),\n Pseq([0,12,6],4),\n Pseq([0,12,6]+7,1),\n ],inf), 1),\n \\octave, 3,\n \\tab, Pfunc {\n var tab;\n [\n //tab = { arg n; (n + 1.asFloat.rand + 1).tanh / (n.rand+1) } ! 15;\n tab = { arg n; (n + 2.asFloat.rand + 1) / (n+1) } ! 15;\n tab.postln;\n ]\n },\n \\dur, PdurStutter( Prand([1,2,4],inf), Pseq([1,2,3]/2,inf)),\n \\amp, 0.4\n)).play;\n);\n```"}], "family": "H", "source_id": "sccode:1-4U1", "aug": "prologue:intent", "prompt_tokens": 62, "answer_tokens": 560}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Pan Sonic emulation - Katodivaihe - lahetys that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, b, c, d, n, e, f, out;\n\n a = Impulse.ar(8)*1.5;\n\n b = WhiteNoise.ar * Env([1.0,1.0,0.0],[0.01,0.01],\\step).ar(0, Impulse.ar(1 )) ;\n b = FreeVerb.ar(b, 0.5, 0.4)*2.5;\n\n c = SinOsc.ar(40) * Env.perc(0.01,0.2).ar(0, TDuty.ar(Dseq([1/4,1/2,1/8,1/8],inf)));\n 5.do{ c = (c.distort + c)*0.75};\n c = c * 1.5;\n\n d = LPF.ar(Saw.ar([20,47]).sum , XLine.ar(4000,200,0.5)) * Env.perc.ar(0, Impulse.ar(1/16)) * 0.5;\n d = (GVerb.ar( d , roomsize:10, revtime:6) * 200).clip(-1.0,1.0) * 0.3;\n\n n = 12;\n e = ( Saw.ar( 40*(1..n) * ({ LFNoise1.ar(0.1).range(1,1.01) } ! n) ) *\n ({ LFNoise1.ar(0.1).range(0.0,1.0) }!n)).sum * 10;\n e = CombC.ar(e, 0.1, 0.1, 4) + e;\n e = e.tanh * 0.3 * SinOsc.ar(0.05).range(0.5,1.0);\n e = e.dup;\n e = e * SinOsc.ar(0.03).range(0.2,1.0) * 0.5;\n\n f = Blip.ar(100) * Blip.ar(100) * Env([0.0,0.0,1.0],[8,8],[\\step,\\linear,\\step])\n .ar(0, Impulse.ar(1/16)) * 2 ;\n\n out = ((a + b + c + f) ! 2) + d + e;\n out = out * 0.2\n\n}.play\n)\n```"}], "family": "H", "source_id": "sccode:1-4TP", "aug": "prologue:intent", "prompt_tokens": 68, "answer_tokens": 650}
+{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Spring saw: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read(s, Platform.resourceDir +/+ \"sounds/a11wlk01.wav\");\n\n// This is very cool!\n\n(\n{\n Spring.ar(PlayBuf.ar(1, b, loop: 1)*Saw.ar(4));\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-4Tt", "aug": "prologue:intent", "prompt_tokens": 47, "answer_tokens": 99}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Just a dirty FM bass shuffling. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\nfork{\n SynthDef(\\basicFM, {|out = 0, gate = 1, amp = 1, carFreq = 1000, modFreq = 100, modAmount = 2000, clipAmount = 0.1|\n var modEnv = EnvGen.ar(Env.adsr(0.5, 0.5, 0.7, 0.1, peakLevel: modAmount), gate);\n var mod = SinOsc.ar(modFreq) * modEnv;\n var car = SinOsc.ar(carFreq + mod);\n var ampEnv = EnvGen.ar(Env.adsr(0.1, 0.3, 0.7, 0.2, peakLevel: amp), gate, doneAction: 2);\n var clip = clipAmount * 500;\n Out.ar(out, (car * ampEnv * clip).clip(-0.7, 0.7) * 0.1);\n }).add;\n\n s.sync;\n\n Pbind(*[\n instrument: \\basicFM,\n out: [0, 1],\n dur: Pseq([1/7, 1/3] / 1.2, inf),\n sustain: Pkey(\\dur),\n amp: 1/4,\n carFreq: Pseq([1, 1, 1, 2] * 350, inf),\n modFreq: Pkey(\\carFreq) * (1/8),\n modAmount: Pseq([2, 1, 0.5, 2, 1, 0.5, 2, 1, 2, 1, 0.5, 2, 1, 0.5, 2, 4] * 500, inf),\n clipAmount: Pseq([Pn(0.1, 32), Pn(1, 32)], inf)\n ]).play;\n}\n)\n```"}], "family": "H", "source_id": "sccode:1-4Tq", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 515}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Play your (short) soundfiles with some delay that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// By Bjørn Houdorf March 2013, Play your (short) soundfiles with some delay.\n\nb = SoundFile.collectIntoBuffers(\"yourSoundFileFolder/*\"); // 1. rund this\n\n( // 2. and then run this\nt = Task({\n({\n var num= b.size.rand;\n var buf= b[num];\n 0.1*Splay.ar(PlayBuf.ar(buf.numChannels, buf, 1, 1, 0, 0));\n}.play;\n) \n});\n);\n\n\n( // 3. Then run this\nz = Task({\nloop({\n t.start;\n 0.1.wait;\n});\n});\n);\n\n\nz.start; // 4. and run this\nz.stop; // 5. and finally run this\n```"}], "family": "H", "source_id": "sccode:1-4T9", "aug": "prologue:intent", "prompt_tokens": 64, "answer_tokens": 255}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Using sine waves to generate a saw waveform. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nq={|f,e|a=Array.fill(e,{|j|e-j}).reverse;(Mix.ar(a.collect{|x|SinOsc.ar(f*x,0,1/x)})/2)!2};{q.(60,300)}.play //saw from sine #supercollider\n\n//Change the values passed to q to control the frequency and how many sines are used.\n```"}], "family": "H", "source_id": "sccode:1-4SW", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 132}
@@ -13758,6 +13474,7 @@
{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for poor man's panning: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n// poor man's panning\n{\n var f, hornbostelwertheimerkonstante;\n f = MouseY.kr(1, 100, 1);\n hornbostelwertheimerkonstante = 0.00063;\n Impulse.ar(f, hornbostelwertheimerkonstante * f * [1, MouseX.kr(0, 2)], 0.1) \n}.play\n```"}], "family": "H", "source_id": "sccode:1-1h", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 132}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Beam me up scotty. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n{\nvar time = 8;\nvar freq = (40-12).midicps;\nvar a = VarSaw.ar(freq/2, width: XLine.ar(0.5,1,time)).range(0,XLine.ar(1,1/1000,time));\nvar tone = SinOsc.ar(freq).fold(-1*a,a);\nOut.ar(0, tone.dup);\n}.play;\n```"}], "family": "H", "source_id": "sccode:1-K", "aug": "prologue:intent", "prompt_tokens": 49, "answer_tokens": 137}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for old school noise from needle on vinyl. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n{\n var sig, sig1, sig2, lpf, popHz, lagtime, noise, popHzMul,\n pan1, pan2, panmod1, panmod2;\n popHzMul = Decay.kr(Dust.kr(0.15), 3, 10, 0.8);\n popHz = LFNoise1.kr(20).exprange(0.1,10) * popHzMul;\n sig = Dust2.ar(popHz);\n lpf = LFNoise1.kr(10).exprange(1000,20000);\n lagtime = LFNoise1.kr(20).range(0.008,0.0001);\n sig = LPF.ar(sig, lpf);\n sig = Lag.ar(sig, lagtime);\n sig = sig + FreeVerb.ar(sig, 0.8, 1, mul:0.11);\n panmod1 = LFNoise1.kr(5).range(0.2,0.7);\n panmod2 = LFNoise1.kr(5).range(0.2,0.7);\n pan1 = SinOsc.kr(panmod1).range(-0.2,0.2);\n pan2 = SinOsc.kr(panmod2).range(-0.2,0.2);\n sig1 = Pan2.ar(sig, pan1, 0.5);\n sig2 = Pan2.ar(sig, pan2, 0.5);\n sig = sig1 + sig2;\n sig = sig + BPF.ar(BrownNoise.ar([0.0025,0.0025]), 7200, 0.4);\n sig = sig + HPF.ar(Crackle.ar([1.999,1.999], 0.0025),2000);\n Out.ar(0, sig*6);\n}.play\n```"}], "family": "H", "source_id": "sccode:1-H", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 532}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for now with snooze (press mouse button). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nNdef(\\a, { |freq=2000, rate=1, width=0.6, now = 10|\n LFPulse.kr(rate, 0, 4/6) *\n LFPulse.kr(rate * 6, 0, width) *\n Pulse.ar(freq, 0.3, 0.1) * SetResetFF.kr(Dust.kr(1/now), MouseButton.kr)\n}).play\n```"}], "family": "H", "source_id": "sccode:1-E", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 135}
{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for get different result each time running the pattern: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nTempoClock.default.tempo = 156/60;\n\n(\nSynthDef(\\spring, { |freq = 400, out = 0, pan = 0, gate = 1, dur = 0.15, curve = -4, amp = 1, index = 1|\n var sig = FreeVerb.ar(Pan2.ar(Blip.ar(freq, index), pan));\n var env = EnvGen.ar(Env.perc(0.01, dur, amp, curve), gate, doneAction:2);\n Out.ar(0, sig * env);\n}).add;\n);\n\n(\nPbind(*[\n instrument: \\spring,\n dur: Pseq([4, 1, 2, 1, 1, 1].scramble/ 4 / TempoClock.default.tempo, inf),\n degree: Pseq(#[1,2,3,4], inf) * Pkey(\\dur).reciprocal,\n octave: Pseq([2,3,4,4,4,3].scramble, inf),\n pan: Pxrand(Array.fill(100, { 0.gaussian(1).clip2(1) }), inf),\n amp: Pseq(#[0.95,1,0.8],inf),\n index: Pstutter(Pseq(#[4,8,12],inf), Pseq([2,3,4,5,6,8].scramble, inf))\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-C", "aug": "prologue:intent", "prompt_tokens": 52, "answer_tokens": 438}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for adventure in hi-fi cosmic stereo sound. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nplay{\n var taps, seconds, image, width, num, panmod;\n num = 4;\n seconds = 5;\n width = LFSaw.ar(seconds.reciprocal, iphase: 1).range(1, 0);\n panmod = LFNoise1.kr(seconds.reciprocal).range(-0.7, 0.7) * LFSaw.kr(seconds.reciprocal, iphase: 1).range(-1, 1).max(0);\n taps = Array.fill(num, {|i|\n var src, local, imp, pitches, done, pitcharray, dlymod;\n pitcharray = [30 + (i * 4), 33 + (i * 4)].midicps;\n pitches = Duty.ar(seconds, 0, Dseq(pitcharray, inf));\n src = Decay2.ar(Impulse.ar(seconds.reciprocal), 0.01, 1/3/(i+1)) * SinOscFB.ar(pitches, SinOsc.ar(3+i).range(0, 1));\n local = LocalIn.ar(2) + [0, src];\n local = DelayC.ar(local, 0.4, LFSaw.ar(seconds.reciprocal, iphase: 1).range(0.4 * (0.72**i), 0.05));\n LocalOut.ar(local.reverse * 0.8);\n done = local/4;\n }); \n image = taps.sum;\n image = [Pan2.ar(image[0], width.neg + panmod), Pan2.ar(image[1], width + panmod)].sum;\n image = GVerb.ar(image * (1.1 - width), 90, 7, 1) + image;\n Out.ar(0, image);\n}\n```"}], "family": "H", "source_id": "sccode:1-B", "aug": "prologue:intent", "prompt_tokens": 60, "answer_tokens": 548}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Feedback resonator. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// Resonator, must subtract blockSize for correct tuning\n(\nSynthDef(\"testRes\", {\n \nvar freq = 300, localIn, input, limitLevel = 0.2, output;\nvar feedbackAmt = 0.999;\n\nfreq = MouseY.kr(20, 678, \\exponential).poll;\nfeedbackAmt = MouseX.kr(0.2, 0.99999).poll;\nlocalIn = LocalIn.ar(1); \ninput = LFNoise1.ar(freq * 16, 0.2);\ninput = input + Dust2.ar(freq);\n\n\nLocalOut.ar(\n HPF.ar(LPF.ar(DelayC.ar(input + (localIn * feedbackAmt), 2, freq.reciprocal - ControlRate.ir.reciprocal), freq * 8), freq * 0.125)\n);\n\noutput = Limiter.ar(localIn, limitLevel, 0.01) * limitLevel.reciprocal;\nOffsetOut.ar(0, output ! 2);\n\n}).play(s);\n\n)\n```"}], "family": "H", "source_id": "sccode:1-z", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 348}
@@ -13765,41 +13482,61 @@
{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Nested ifs in a SynthDef: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\n{\nvar noise, out;\nnoise = LFNoise0.kr(8);\n\nout = if( noise > 0.0,\n if(noise > 0.5, \n if(noise > 0.9, WhiteNoise.ar(0.2), Pulse.ar(60, 0.5, 0.4)),\n SinOsc.ar(500, 0, 0.25)\n ),\n Saw.ar(160, 0.5)\n);\n\nout ! 2\n\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-v", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 150}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Creaking door or roulette wheel?. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\n\nvar output, basePitch = 387, macroPitch, macroPitchAmt = 400;\nvar modOsc, modAmt = 1.3, amp = 0.8;\nvar creakRate, creakTrig, creakEnvGen, noise, combs, oscFreq;\n\nnoise = LFNoise1.ar(LFNoise0.kr(4.8).lag(0.4).range(3646, 7777), 0.6);\n\ncreakRate = EnvGen.kr(\n Env(\n [40, 25, 15, 2],\n [0.9, 0.6, 1.0],\n -4\n ),\n doneAction: 2\n\n);\ncreakTrig = Impulse.kr(creakRate);\n\ncreakEnvGen = EnvGen.kr(\n Env(\n [0.0, 1.0, 0.0],\n [0.02, 0.1],\n [5, -8]\n ),\n creakTrig,\n timeScale: SinOsc.kr(1.5).range(0.12, 0.26) * Line.kr(0.5, 2.3, 2)\n\n);\n\nmacroPitch = EnvGen.kr(\n Env(\n [0.0, 4, 0.1, 0.3, 0.4, 0.7, 0.9],\n [0.2, 0.2, 0.4, 0.3, 0.48, 0.59],\n [2, 2, -4, -3, -2, -4]\n )\n\n);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.17);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.232, modOsc * 0.3);\n\noscFreq = basePitch + (macroPitch * macroPitchAmt);\noscFreq = oscFreq * (1 + (creakEnvGen * 2));\noutput = SinOsc.ar(oscFreq, modOsc * modAmt, 1);\noutput = output * SinOsc.ar(SinOsc.kr(1.6).range(1220, 1355));\noutput = output + noise;\noutput = output.clip(-0.5, 0.5) * creakEnvGen * amp * TRand.kr(0.8, 1.0, creakTrig);\n\ncombs = Mix([CombC.ar(output, 0.2, 0.0084, 0.12), CombC.ar(output, 0.2, 0.00181, 0.03)]);\noutput = output + (combs * 0.2);\noutput ! 2\n}.play\n\n\n)\n```"}], "family": "H", "source_id": "sccode:1-s", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 816}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Time and relative dimensions in SC. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\nvar output, filtFreq, noise, noiseAmp, amp = 0.4, chain;\nvar tardRate = 0.4, combs;\n\nnoiseAmp = SinOsc.kr(0.38, 0.2).exprange(0.1, 1);\n\nnoise = BrownNoise.ar(noiseAmp);\n\nfiltFreq = SinOsc.kr(tardRate).range(400, 1800);\nnoise = RLPF.ar(noise, filtFreq, 0.7);\n\nchain = FFT(LocalBuf(256), noise);\nchain = PV_BinShift(chain, SinOsc.kr(tardRate * 0.986, 0.7).range(0.96, 1.052), SinOsc.kr(tardRate * 1.003, 0.61).range(-3, 2.1));\nchain = PV_BinScramble(chain, 0.05, 0.1, 1.0 ); \nnoise = IFFT(chain);\nnoise = noise.fold(-0.5, 0.5);\ncombs = Mix(\n [\n CombL.ar(noise, 0.1, SinOsc.kr(tardRate * 0.9966, 0.1).range(0.00032, 0.00028) * 3.4, 0.4, 0.06),\n CombL.ar(noise, 0.1, SinOsc.kr(tardRate * 0.99684, 0.1).range(0.000318, 0.000266) * 3.397, 0.4, 0.06)\n ]\n) * 1.2;\n\noutput = (noise + combs) * amp;\noutput = HPF.ar(output, 80);\noutput ! 2\n\n}.play\n\n)\n```"}], "family": "H", "source_id": "sccode:1-r", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 544}
+{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Wake up call: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nNdef(\\a, { |freq=2000, rate=1, width=0.6|\n LFPulse.kr(rate, 0, 4/6) *\n LFPulse.kr(rate * 6, 0, width) *\n Pulse.ar(freq, 0.3, 0.1)\n}).play\n```"}], "family": "H", "source_id": "sccode:1-n", "aug": "prologue:intent", "prompt_tokens": 47, "answer_tokens": 100}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for phasemodulation feedback and allpass network. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nn=LFNoise1;Ndef(\\x,{a=SinOsc.ar(65,Ndef(\\x).ar*n.ar(0.1,3),n.ar(3,6)).tanh;9.do{a=AllpassL.ar(a,0.3,{0.2.rand+0.1}!2,5)};a.tanh}).play\n```"}], "family": "H", "source_id": "sccode:1-j", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 114}
{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Feedback with beats: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nNdef(\\a, {\n var src, loc, delay=0.01;\n src = Decay2.ar(Impulse.ar(1/8), LFNoise2.kr(4).range(0.001, 0.0001),\n LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(4).exprange(40, 4000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise0.kr(1/4).range(100, 1200).lag, 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.501).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, delay * 2, delay * 1);\n LocalOut.ar(loc.reverse * 0.49);\n Out.ar(0, loc * 0.9)\n}).play;\n\nNdef(\\b, {\n var src, loc, del;\n del = 1/100;\n src = Decay2.ar(TDuty.ar(1/4,0,Dseq([1, 0.5, 0.3, 0.1],inf)), \n LFNoise2.kr(4).range(0.001, 0.0001), LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(200).exprange(40, 14000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise2.kr(0.1).range(40, 400), 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.51).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, del * 2, del * 1);\n LocalOut.ar(loc.reverse * 0.45);\n Out.ar(0, Compander.ar(loc,loc,0.1, 1, 0.05) * 1.2)\n}).play;\n\nNdef(\\c, {\n var src, loc, del=1/4;\n src = Decay2.ar(Impulse.ar(1), 0.0001, 0.05) * SinOsc.ar(60);\n loc = src + LocalIn.ar(2);\n loc = BPF.ar(loc, 800, 3.2).softclip;\n loc = DelayN.ar(loc, del, [0, del]);\n LocalOut.ar(loc.reverse * 0.99);\n Out.ar(0, loc * 2)\n}).play;\n```"}], "family": "H", "source_id": "sccode:1-i", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 896}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Just going crazy with modulation. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"additivePad\", \n { arg numOfCycles = 100;\n var lfo;\n var lfo2;\n var lfo3;\n lfo = SinOsc.kr([Rand(0.5,1000),Rand(0.5,1000)], 1.5pi, 0.5, 0.5);\n lfo3 = SinOsc.kr([Rand(0.1,0.5),Rand(0.1,0.5)], 1.5pi, 0.5, 0.5);\n lfo2 = SinOsc.kr([(Rand(0.5,1000) * lfo) * lfo3, (Rand(0.5,1000) * (1 - lfo)) * (1 - lfo3)], 1.5pi, 0.5, 0.5);\n Out.ar(\n 0, \n Mix.arFill(\n numOfCycles,\n { \n SinOsc.ar(\n Rand(40,1000),\n 0, \n (numOfCycles.reciprocal * 0.75) * lfo2)\n }\n ) * EnvGen.kr(Env.perc(Rand(0.1,30), Rand(0.1,30)), doneAction: 2)\n )\n }\n).send(s); \n);\n\n(\nr = Routine({\n 200.do({\n x = Synth.new(\"additivePad\"); \n 10.wait;\n });\n});\n);\n\nr.play;\n```"}], "family": "H", "source_id": "sccode:1-c", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 449}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for some initial thoughts on psytrance bassline. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{ | dur = 0.15, atk = 0.005, amp = 1 |\n SinOsc.ar(\n EnvGen.ar( Env(\n NamedControl.kr(\\freq_l, [2960, 70, 90]),\n NamedControl.kr(\\freq_d, [0.07, 0.2]),\n NamedControl.kr(\\freq_c, [-13, -1]),\n ) ),\n mul:amp * EnvGen.ar(\n Env.perc( atk, dur - atk, curve: NamedControl.kr(\\amp_c, [-1, 6])),\n doneAction: 2\n ); \n ) ! 2;\n}.asSynthDef.name_(\"kick\").add;\n\n{ | atk = 0.01, dur = 0.15, freq = 50, amp=0.8 |\n BPF.ar(LFSaw.ar(freq), freq, 2, mul: EnvGen.kr( Env.perc( atk, dur-atk, amp, 6 ), doneAction: 2 )) ! 2;\n}.asSynthDef.name_(\"bass\").add;\n\n{ | dur = 0.15, freq = 50, amp = 0.8, index = 10 |\n PMOsc.ar(freq, freq + 5, index, mul: amp * EnvGen.kr( Env.triangle( dur ), doneAction: 2 )) ! 2;\n}.asSynthDef.name_(\"bazz\").add;\n);\n\n\n(\nPpar([\n Pbind(*[\n instrument: \\kick,\n delta: 1,\n dur: Pfunc({ thisThread.clock.beatDur }) / 4,\n amp: Pseq([\n Pseq([1], 16),\n Pseq([0.8, 1], 8), \n Pseq([1], 16),\n Pseq([0.8, 0.8, 0.9, 1], 8)\n ], inf) * 0.8,\n freq_l: Pstutter(Prand(2.pow((1..4)),inf), Pseq([\n `[2960,70,90],\n `[1260,60,110],\n `[4360,60,120]\n ],inf))\n ]),\n Pbind(*[\n instrument: \\bass,\n delta: 1/4,\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n freq: Pseq([\\r, 50,60,70], inf),\n amp:0.6\n ]),\n Pbind(*[\n instrument: \\bazz,\n delta: 1/4,\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n freq: Pseq([\\r, 30,35,40], inf),\n amp:0.2\n ])\n]).play(TempoClock(156/60), quant:[1])\n);\n\n// kick from above?\n(\nPbind(*[\n instrument: \\kick,\n delta: Pseq(Array.geom(540, 1, 1.015).reciprocal.reverse),\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n atk: Pkey(\\dur) / 6,\n amp: 0.8\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-7", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 1017}
{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for some pattern exprimenting: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\brumm, { |dur = 1, pan = 2, freq = 40, index = 20|\n var sig = Pan2.ar(\n Blip.ar(freq, index),\n pan\n ) * EnvGen.ar(Env.perc(0.01, dur), doneAction: 2);\n Out.ar(0, sig);\n}).add;\n);\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.001, 100)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: 40,\n instrument: \\brumm\n]).play();\n);\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.001, 100)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: Pseq([Pseries(140, 0.5, 200)], inf),\n instrument: \\brumm\n]).play;\n);\n\n(\nPbind(*[\n dur: Pseq(Signal.chebyFill(1024, Array.rand(10, 0.0, 10.0)).abs + 0.05, inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: Pseq(Signal.chebyFill(1024, Array.rand(10, 0.0, 10.0)).abs * 18000 + 120, inf),\n instrument: \\brumm\n]).play;\n);\n\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.002, 50)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1, 1, -0.8], inf),\n freq: Pseq([Pseries(740, 0.5, 200), Pxrand(Array.series(740, 0.5, 200), 50)], inf),\n instrument: \\brumm\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-5", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 688}
-{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `AbstractFunction`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\na = { |x| #[440, 720, 801, 1020.2].at(x) }; b = a.cpsmidi; [a.value(3), b.value(3)];\na = Pseries(220, 220, inf).cpsmidi; a.asStream.nextN(12); // overtone series as midinotes\n// follow but round to next midinote\n{ a = Pitch.kr(SoundIn.ar).at(1); Pulse.ar(a.cpsmidi.round.midicps) * 0.1 }.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 167}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `AbstractFunction`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\na = { |x, root = 60| x + root }; b = a.midicps; [a.value(9), b.value(9)];\na = Pseries(60, 1, inf).midicps; a.asStream.nextN(12);\n{ a = LFNoise1.ar(1) * 5 + 60; Pulse.ar(a.round.midicps) * 0.1 }.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 121}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `AnalogIn`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// modulate frequency of a sine oscillator\n\n(\nSynthDef(\"help-AnalogIn\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(AnalogIn.ar(0).exprange(200, 5000), 0, 0.1)\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/AnalogIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 99}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `AnalogOut` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// write a sine oscillator's output to a pin\n\n(\nSynthDef(\"help-AnalogOut\", { |out = 0|\n AnalogOut.ar(0, SinOsc.ar(10));\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/AnalogOut.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 78}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Archive`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// make a storage place for various objects:\nq = (); // Event\n\nq[\\a_long_array] = Array.rand(128, 0.0, 1.0);\nq[\\pi_squared] = pi * pi;\nq[\\favourite_sound] = { { SinOsc.ar([300, 330]).sum * LFPulse.kr(2 + [0, 0.01]) * 0.1 }.play };\nq[\\same_long_array] = q[\\a_long_array]; // same objects may appear several times\n\nArchive.global.put(\\myData, q);\n\n\nArchive.global.at(\\myData).postcs;\n\n// after a recompile:\ns.boot;\n\nq = Archive.global.at(\\myData);\nq.postcs;\nq[\\favourite_sound].value;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Archive.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 271}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `ArrayedCollection` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nvar pitches = [43.0, 55.0, 58.86, 57.42, 67.0];\nfork {\n pitches.size.do{ |i|\n {\n var freq = pitches[i].midicps;\n var env = Env.perc.ar(Done.freeSelf);\n SinOsc.ar(freq) * 0.1 * env\n }.play;\n 0.2.wait\n }\n}\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ArrayedCollection.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 151}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Ball` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var f, sf;\n sf = K2A.ar(MouseX.kr > 0.5) > 0;\n f = Ball.ar(sf, MouseY.kr(0.01, 20, 1), 0.01);\n f = f * 10 + 500;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 108}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `BiPanB2`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var w, x, y, p, q, a, b, c, d;\n\n p = LFSaw.ar(200);\n q = LFSaw.ar(301);\n\n // B-format encode\n #w, x, y = BiPanB2.ar(p, q, MouseX.kr(-1, 1), 0.1);\n\n // B-format decode to quad\n #a, b, c, d = DecodeB2.ar(4, w, x, y);\n\n [a, b, d, c] // reorder to my speaker arrangement: Lf Rf Lr Rr\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BiPanB2.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 187}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BinaryOpUGen` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\na = WhiteNoise.ar; // a WhiteNoise\nb = a + 2; // a BinaryOpUGen.\nb.operator; // +\n\n// sound example\n(\n{\n var a = LFSaw.ar(300);\n var b = LFSaw.ar(329.1);\n a % b * 0.1\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BinaryOpUGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 108}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BufCombN` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// These examples compare the variants, so that you can hear the difference in interpolation\n\n// allocate buffer\nb = Buffer.alloc(s, 44100, 1);\n\n// Comb used as a resonator. The resonant fundamental is equal to\n// reciprocal of the delay time.\n{ BufCombN.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n{ BufCombL.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n{ BufCombC.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n// with negative feedback:\n{ BufCombN.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n{ BufCombL.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n{ BufCombC.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n// used as an echo.\n{ BufCombC.ar(b.bufnum, Decay.ar(Dust.ar(1, 0.5), 0.2, WhiteNoise.ar), 0.2, 3) }.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufCombC.schelp", "aug": "prologue:ugen", "prompt_tokens": 55, "answer_tokens": 513}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `BufCombN` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// These examples compare the variants, so that you can hear the difference in interpolation\n\n// allocate buffer\nb = Buffer.alloc(s, 44100, 1);\n\n// Comb used as a resonator. The resonant fundamental is equal to\n// reciprocal of the delay time.\n{ BufCombN.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n{ BufCombL.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n{ BufCombC.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), 0.2) }.play;\n\n// with negative feedback:\n{ BufCombN.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n{ BufCombL.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n{ BufCombC.ar(b.bufnum, WhiteNoise.ar(0.01), XLine.kr(0.0001, 0.01, 20), -0.2) }.play;\n\n// used as an echo.\n{ BufCombL.ar(b.bufnum, Decay.ar(Dust.ar(1, 0.5), 0.2, WhiteNoise.ar), 0.2, 3) }.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufCombL.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 513}
-{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BufRd` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read(s, ExampleFiles.child);\n\n// indexing with a phasor\n{ BufRd.ar(1, b, Phasor.ar(0, BufRateScale.kr(b), 0, BufFrames.kr(b))) }.play;\n\n// indexing by hand\n{ BufRd.ar(1, b, K2A.ar(MouseX.kr(0, BufFrames.kr(b)))) }.play;\n\nb.free\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufFrames.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 157}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BufRd` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read(s, ExampleFiles.child);\n\n{ BufRd.ar(1, b, Sweep.ar(Impulse.ar(BufDur.kr(b).reciprocal), BufSampleRate.kr(b))) }.play;\n\nb.free\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufDur.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 100}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `BufRd`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nx = { |rate = 1|\n BufRd.ar(1, b, Phasor.ar(0, BufRateScale.kr(b) * rate, 0, BufFrames.kr(b)))\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufRateScale.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 104}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `BufSampleRate`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read(s, ExampleFiles.child);\n\n// compares a 1102.5 Hz sine tone (11025 * 0.1, left) with a 1100 Hz tone (right)\n// the apollo sample has a sample rate of 11.025 kHz\n(\n{\n var freq;\n freq = [BufSampleRate.kr(b) * 0.1, 1100];\n SinOsc.ar(freq, 0, 0.1)\n}.play;\n);\n\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufSampleRate.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 161}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `BufWr` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n// allocate a buffer for writinig into\ns = Server.local;\ns.sendMsg(\"/b_alloc\", 0, 44100 * 2);\n);\n\n\n// write into the buffer with a BufWr\n(\ny = { |rate = 1|\n var in;\n in = SinOsc.ar(LFNoise1.kr(2, 300, 400), 0, 0.1);\n BufWr.ar(in, 0, Phasor.ar(0, BufRateScale.kr(0) * rate, 0, BufFrames.kr(0)));\n 0.0 // quiet\n}.play;\n);\n\n// read it with a BufRd\n(\nx = { |rate = 1|\n BufRd.ar(1, 0, Phasor.ar(0, BufRateScale.kr(0) * rate, 0, BufFrames.kr(0)))\n}.play(s);\n);\n\n\n\nx.set(\\rate, 5);\ny.set(\\rate, 2.0.rand);\nx.set(\\rate, 2);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BufWr.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 325}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `DiskIn`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n\n\n// create with cueSoundFile class method\nb = Buffer.cueSoundFile(s, ExampleFiles.apollo11, 0, 1);\nx = { DiskIn.ar(1, b) }.play;\nb.close; // must call close in between cueing\n// now use like named instance method, but different arguments\nb.cueSoundFile(ExampleFiles.apollo11);\n// have to do all this to clean up properly!\nx.free; b.close; b.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Buffer.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 166}
-{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Bus`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nb = Bus(\\audio, 0, 2);\ns.bind {\n SynthDef(\\sinPerc, { |out = 0|\n var signal = SinOsc.ar * Env.sine(0.1).ar(gate: Impulse.ar(2));\n OffsetOut.ar(out, signal ! 2) }\n ).add;\n s.sync;\n Synth(\\sinPerc, [\\out, b]);\n b.plot(1);\n}\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Bus.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 149}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Buffer`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0 / [1, 2, 3, 4], true, true, true);\nx = { Osc.ar(b, 200, 0, 0.5) }.play;\n);\nx.free; b.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Buffer.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 98}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BusPlug` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nz = Bus.control(s, 16);\nz.setn({ |i| (i * 5).nthPrime } ! 16 * 5 + 100);\na = BusPlug.for(z);\n{ Splay.ar(SinOsc.ar(a.kr(3, MouseX.kr(0, 25)))) * 0.1 }.play; // selectively play 3 channel of the 16, modulate offset\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BusPlug.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 128}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Button` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\ns.waitForBoot({\n var w, p, snd, b;\n\n w = Window.new;\n\n b = Button(w, Rect(20, 20, 80, 26))\n .states_([[\"start a sound\", Color.black, Color.green], [\"stop\", Color.black, Color.red]])\n .action_({ });\n\n v = VLayoutView(w, Rect(140, 20, 200, 300)); // Group the following views\n StaticText(v, Rect(20, 20, 180, 60))\n .string_(\"The button does nothing at first, so try dragging a function to the button\");\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { SinOsc.ar(440, 0, 0.6) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play sine function\").align_(\\center).background_(Color.rand);\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { Saw.ar(440, 0.4) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play saw function\").align_(\\center).background_(Color.rand);\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { WhiteNoise.ar(0.4) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play noise function\").align_(\\center).background_(Color.rand);\n\n p = CmdPeriod.add({ b.value_(0) }); // set button to 0 on hitting Cmd-period\n w.onClose_{ snd.free; CmdPeriod.removeAll }; // clean up when window is closed\n w.front;\n})\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Button.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 649}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `CoinGate`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\na = SynthDef(\"help-TCoin\", { |out = 0, prob = 0.5|\n var trig;\n trig = CoinGate.kr(prob, Impulse.kr(10));\n Out.ar(out,\n SinOsc.ar(\n TRand.kr(300.0, 400.0, trig), 0, 0.2\n )\n )\n}).play;\n);\n\na.set(\\prob, 1.0);\na.set(\\prob, 0.0);\na.set(\\prob, 0.1);\n\n\n(\na = SynthDef(\"help-TCoin\", { |out = 0, prob = 0.5|\n var trig;\n trig = Impulse.ar(20, 0, SinOsc.kr(0.5, 0, 1, 1));\n Out.ar(out,\n Mix.fill(3, { Ringz.ar(CoinGate.ar(prob, trig*0.5), #[1, 1.5]*Rand(1000, 9000), 0.01) })\n )\n}).play;\n);\n\na.set(\\prob, 1.0);\na.set(\\prob, 0.0);\na.set(\\prob, 0.1);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/CoinGate.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 356}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Compander` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var z;\n\n // signal (clean)\n z = Decay2.ar(\n Impulse.ar(8, 0, LFSaw.kr(0.3, 1, -0.3, 0.3)),\n 0.001,\n 0.3\n )\n * Mix.ar(Pulse.ar([80, 81], 0.3));\n\n // apply gate (mouse x sets treshold)\n Compander.ar(z, z,\n thresh: MouseX.kr(0.001, 1),\n slopeBelow: 10,\n slopeAbove: 1,\n clampTime: 0.01,\n relaxTime: 0.01\n )\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Compander.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 211}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `ControlName`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nd = SynthDef(\\tone, { |out = 0, freq = 200|\n var sig;\n\n freq.spec = ControlSpec(20, 20000);\n sig = SinOsc.ar(freq);\n\n Out.ar(out, sig);\n}).add;\n);\n\nd.specs.freq.postln;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ControlName.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 116}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `ControlSpec`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 149}
-{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Convolution2L`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// another example\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution2 to be double this\n// maximum is currently a = 8192 for FFT of size 16384\na = 2048;\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\ng.set(0, 1.0);\n100.do { |i| g.set(a.rand, (i + 1).reciprocal) };\n);\n\n(\n// random impulse response\n{\n var input, inputAmp, threshhold, gate;\n\n input = SoundIn.ar(0);\n inputAmp = Amplitude.kr(input);\n threshhold = 0.02; // noise gating threshold\n gate = Lag.kr(inputAmp > threshhold, 0.01);\n\n Convolution2L.ar(input * gate, g, 0, a, 1, 0.5);\n}.play\n);\n\ng.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 293}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Convolution2L`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// next example\n\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{\n var input = SoundIn.ar(0);\n var framesize = 2048; // must have power of two\n Convolution2L.ar(input, b, 0, 512, 1, 0.5);\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 100}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dbrown`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dbrown(0, 15, 1, inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 117}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Dbufwr` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// alloc a single channel buffer\nb = Buffer.alloc(s, 24, 1);\nb.setn(0, { 210 } ! b.numFrames);\n\n// post some info:\nfork { loop { 0.5.wait; b.getn(0, b.numFrames, { |x| x.postln }) } };\n\n// write demand sequence into a buffer\n(\n{\nvar read, write, readpos, writepos, writetrig;\n\n writetrig = Dust.kr(1);\n readpos = Dseries(0, 1, inf);\n writepos = Dseq([Dseries(0, 3, 30), Dseries(0, 1, 30)], inf);\n\n read = Dbufrd(b, readpos);\n write = Dbufwr(Dseq([Dseries(1, 1, 16), Dwhite(1, 16, 8)], inf) * 60, b, writepos);\n\n Demand.kr(writetrig, 0, write); // write on trigger\n\n SinOsc.ar(\n Demand.kr(Impulse.kr(16), 0, read).lag(0.01) * [1, 1.01]\n ) * 0.1\n\n}.play;\n);\n\n// write into buffer with mouse clicks\n(\n{\n var val = MouseY.kr(1000, 200, 1); // cursor y pos controls frequency\n var pos = MouseX.kr(0, BufFrames.kr(b) - 1); // cursor x position controls buffer pos\n var write = MouseButton.kr; // button controls write action\n Demand.kr(write, 0, Dbufwr(val, b, pos, 1));\n SinOsc.ar(\n Duty.kr(Dseq([0.5, 0.75, 0.5, 1.0], inf) * 0.2, 0, Dbufrd(b, Dseries(0, 1, inf)))\n ) * 0.1\n}.play;\n);\n\n// write demand sequence into a buffer\nb.free; b = Buffer.alloc(s, 2, 1);\nfork { loop { 0.5.wait; b.getn(0, b.numFrames, { |x| x.postln }) } };\nb.setn(0, [1, 0]);\n\n(\n{\nvar read, write, readpos, writepos, writetrig;\n\n writetrig = Impulse.kr(2);\n readpos = Dbufrd(b, 1); // first buffer val is position\n writepos = Dbufrd(b, 0); // second buffer val is position\n read = Dbufrd(b, readpos);\n\n write = Dbufwr(read, b, writepos);\n\n Demand.kr(writetrig, 0, write); // write on trigger\n}.play;\n);\n\n// free buffer:\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dbufwr.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 839}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Ddup`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var freq, trig;\n var in = Dseq([1, 2, 3], inf);\n var rep = Ddup(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 146}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `DecodeB2`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var w, x, y, p, a, b, c, d;\n\n p = PinkNoise.ar; // source\n\n // B-format encode\n #w, x, y = PanB2.ar(p, MouseX.kr(-1, 1), 0.1);\n\n // B-format decode to quad\n #a, b, c, d = DecodeB2.ar(4, w, x, y);\n\n [a, b, d, c] // reorder to my speaker arrangement: Lf Rf Lr Rr\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/DecodeB2.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 165}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Demand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// examples\n\n(\n{\n var trig, seq, freq;\n trig = Impulse.kr(24);\n seq = Drand([Dseq((1..5).mirror1, 1), Drand((4..10), 8)], 2000);\n freq = Demand.kr(trig, 0, seq * 100);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed.scaleneg(MouseX.kr(-1, 1)) * 0.1;\n}.play;\n);\n\n(\n{\n var trig, seq, freq;\n trig = Impulse.kr(12);\n seq = Drand([Dseq((1..5).mirror1, 1), Drand((4..10), 8)], 2000) * Drand([1, 2, 4, 8], 2000);\n freq = Demand.kr(trig, 0, seq * 100);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed.scaleneg(MouseX.kr(-1, 1)) * 0.1;\n}.play;\n);\n\n\n\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Diwhite(60, 72, inf).midicps;\n freq = Demand.kr(trig, 0, seq);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Dseq([72, 75, 79, Drand([82, 84, 86])], inf).midicps;\n freq = Demand.kr(trig, 0, seq);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Dswitch1(\n [\n Diwhite(60, 72, inf),\n Dseq([72, 75, 79, Drand([82, 84, 86])], inf)\n ],\n LFPulse.kr(0.2)\n );\n freq = Demand.kr(trig, 0, seq.midicps);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n\n(\n{\n var freq, trig, reset, seq1, seq2;\n trig = Impulse.kr(10);\n seq1 = Drand([72, 75, 79, 82] - 12, inf).midicps;\n seq2 = Dseq([72, 75, 79, Drand([82, 84, 86])], inf).midicps;\n freq = Demand.kr(trig, 0, [seq1, seq2]);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n(\n{\n var trig, seq;\n trig = Impulse.kr(8);\n seq = Drand([\n Dseq([4, 0, 0, 1, 2, 1, 0, 1]),\n Dseq([4, 0, 2, 0, 1, 0, 1, 1]),\n Dseq([4, 0, 0, 2, 0, 0, 1, 1]),\n Dseq([4, 0, 1, 2, 0, 1, 2, 0]),\n Dseq([4, 1, 1, 1, 2, 2, 3, 3]),\n Dseq([4, 1, 0, 1, 0, 1, 0, 1])\n ], inf);\n trig = Demand.kr(trig, 0, seq * 0.4) * trig;\n { LPF.ar(PinkNoise.ar, 5000) }.dup * Decay.kr(trig, 0.5);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Demand.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 1190}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dgeom`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// example\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, 15);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 226}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Dibrown` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dibrown(0, 15, 1, inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 117}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `DigitalIO` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// write a sine oscillator's output to a pin, and read the pin value at other times\n\n(\nSynthDef(\"help-DigitalIO\", { |out = 0|\n DigitalIO.ar(0, SinOsc.ar(10), LFPulse.kr(0.1)).poll;\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/DigitalIO.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 104}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `DigitalIn`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// turn on and off a sine oscillator\n\n(\nSynthDef(\"help-DigitalIn\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(500, 0, 0.1 * DigitalIn.ar(0))\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/DigitalIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 91}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `DigitalOut` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// write a sine oscillator's output to a pin\n\n(\nSynthDef(\"help-DigitalOut\", { |out = 0|\n DigitalOut.ar(0, SinOsc.ar(10));\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/DigitalOut.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 78}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Diwhite`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Diwhite(0, 15, inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 115}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Drand`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Drand([1, 3, 2, 7, 8], inf);\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 121}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dreset`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), Drand([0, 0, 0, 1], inf));\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// reset when mouse button is pressed\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), MouseButton.kr);\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// audio rate\n(\n{\n var a, nmax = 90;\n a = { Dreset(Dseries(0, 1, inf), Drand(0 ! nmax ++ 1, inf)) } ! 2;\n Duty.ar(SampleDur.ir, 0, a) * (0.1 / nmax)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 320}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dseq`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([1, 3, 2, 7, 8], 3);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq({ 10.rand } ! 32, inf);\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 238}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dser`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dser([1, 3, 2, 7, 8], 8);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 120}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Dseries` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, 15);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) % 15 * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 220}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dshuf`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([1, 3, 2, 7, 8.5], 3)], inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf({ 10.rand } ! 81, 5)], inf).poll;\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// embedded structures\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([Drand([1, 2, 3], 1), 3, Drand([20, 23, 56], 1), 7, 8.5], 8)], inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 416}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dstutter`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var freq, trig;\n var in = Dseq([1, 2, 3], inf);\n var rep = Dstutter(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 147}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dswitch`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n {\n var d, trig;\n d = Dswitch([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n\n// compare with Dswitch1:\n\n(\n {\n var d, trig;\n d = Dswitch1([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 333}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dswitch1`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dswitch1([1, 3, MouseY.kr(1, 15), 2, Dwhite(0, 3, 2)], MouseX.kr(0, 4));\n trig = Impulse.kr(3);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dswitch1({ |i| Dseq((0..i*3), inf) } ! 5, MouseX.kr(0, 4));\n trig = Impulse.kr(6);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 263}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Dust` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-Dust\", { |out = 0|\n Out.ar(out,\n Dust.ar(200, 0.5)\n )\n}).play;\n);\n\n(\nSynthDef(\"help-Dust\", { |out = 0|\n Out.ar(out,\n Dust.ar(XLine.kr(20000, 2, 10), 0.5)\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dust.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 124}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Dust2` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-Dust2\", { |out = 0|\n Out.ar(out,\n Dust2.ar(200, 0.5)\n )\n}).play;\n);\n\n(\nSynthDef(\"help-Dust2\", { |out = 0|\n Out.ar(out,\n Dust2.ar(XLine.kr(20000, 2, 10), 0.5)\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dust2.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 128}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Duty`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n {\n var freq;\n freq = Duty.kr(\n Drand([0.01, 0.2, 0.4], inf), // demand ugen as durations\n 0,\n Dseq([204, 400, 201, 502, 300, 200], inf)\n );\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n);\n\n(\n {\n var freq;\n freq = Duty.kr(\n MouseX.kr(0.001, 2, 1), // control rate ugen as durations\n 0,\n Dseq([204, 400, 201, 502, 300, 200], inf)\n );\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 237}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dwhite`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dwhite(0, 15, inf);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 114}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Dwrand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 141}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dxrand`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dxrand([1, 3, 2, 7, 8], inf);\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 122}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `EnvGen` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// as amplitude envelope\n(\n{\n var env = Env([0, 1, 0.5, 1, 0], [0.01, 0.5, 0.02, 0.5]);\n SinOsc.ar(470) * EnvGen.kr(env, doneAction: Done.freeSelf)\n}.play\n);\n\n// as amplitude and modulation envelope\n(\n{\n var env = Env([0, 1, 0.5, 0.8, 0, 1.2, 0], [0.01, 0.5, 0.02, 0.5, 0.2, 0.5]);\n var gate = Impulse.kr(MouseX.kr(0.2, 3), 0.5);\n var gen = EnvGen.kr(env, gate);\n SinOsc.ar(270, SinOsc.ar(gen * 473)) * gen * 0.2\n}.play\n);\n// EnvGen multichannel expands when passed a multichannel envelope\n(\n{\n SinOsc.ar(\n EnvGen.kr(\n Env.circle([0, 1, 0, (2..4), 0, LFNoise1.kr(0.1 ! 5) * 10, 0], [0.01, 0.6])\n )\n * 240 + 300\n ).sum * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/EnvGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 401}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Event` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\pm, { |out = 0, freq = 440, amp = 0.1, pan = 0, gate = 1, ratio = 1, index = 1, ar = 0.1, dr = 0.1|\n var z;\n z = LPF.ar(\n PMOsc.ar(freq, freq * ratio, Linen.kr(gate, ar, index, dr), 0, 0.3),\n XLine.kr(Rand(4000, 5000), Rand(2500, 3200), 1)\n ) * Linen.kr(gate, 0.01, 0.7, dr, 2);\n OffsetOut.ar(out, Pan2.ar(z, pan, amp));\n}).add;\n);\n\n(instrument: \\pm).play;\n\n(instrument: \\pm, ratio: 3.42, index: 12, freq: 150, ar: 8, dr: 3, sustain: 10).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Event.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 278}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `ExpRand` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-ExpRand\", { |out = 0|\n Out.ar(out,\n FSinOsc.ar(\n ExpRand(100.0, 8000.0),\n 0, Line.kr(0.2, 0, 0.01, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n(\nRoutine({\n inf.do({ |i|\n Synth.new(\"help-ExpRand\"); 0.05.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ExpRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 162}
@@ -13811,30 +13548,36 @@
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `RecordBuf`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n// simple example\n(\n{ var env;\nenv = Line.kr(0, 1, 1);\nFreeSelfWhenDone.kr(env); // free synth at end of line\nSinOsc.ar(200, 0, 0.5) * env\n}.play;\n);\n\n// the previous example works, because FreeSelfWhenDone operates on the Line\n// this version won't work\n(\n{ var env, output;\nenv = Line.kr(0, 1, 1);\noutput = SinOsc.ar(200, 0, 0.5) * env;\noutput.postln; // output is a BinaryOpUGen, which has no 'done' flag\nFreeSelfWhenDone.kr(output); // won't ever be done\noutput\n}.play;\n);\n\n// record for four seconds\nb = Buffer.alloc(s, 44100 * 4.0, 1);\n(\nSynthDef(\"help-RecordBuf\", { |out = 0, bufnum = 0|\n var formant, recbuf;\n formant = Formant.ar(XLine.kr(400, 1000, 4), 2000, 800, 0.125);\n recbuf = RecordBuf.ar(formant, bufnum, recLevel: Line.kr(1, 1), loop: 0);\n // The RecordBuf doesn't loop, so you can check it for 'done' status\n FreeSelfWhenDone.kr(recbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play it back\n(\nSynthDef(\"help-RecordBuf play\", { |out = 0, bufnum = 0|\n var playbuf;\n playbuf = PlayBuf.ar(1, bufnum);\n FreeSelfWhenDone.kr(playbuf); // frees the synth when the PlayBuf is finished\n Out.ar(out, playbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FreeSelfWhenDone.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 593}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `FreqScopeView`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// Start server\ns.boot;\n\n// Create analyzer in a window\n(\nw = Window(\"My Analyzer\", Rect(0, 0, 511, 300)); // width should be 511\nf = FreqScopeView(w, w.view.bounds);\nf.active_(true); // turn it on the first time;\n\nw.onClose_({ f.kill }); // you must have this\nw.front;\n{ SinOsc.ar([500, 1000], 0, 0.25).mean.dup }.play(s); // start two sine waves\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FreqScopeView.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 182}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Function`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nx = { |freq = 440| SinOsc.ar(freq, 0, 0.3) }.play; // this returns a Synth object;\nx.set(\\freq, 880); // note you can set the freq argument\nx.defName; // the name of the resulting SynthDef\nx.release(4); // fadeout over 4 seconds\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Function.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 110}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `GrayNoise` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-GrayNoise\", { |out = 0|\n Out.ar(out,\n GrayNoise.ar(-20.dbamp)\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/GrayNoise.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 64}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Harmonics`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\na.ramp(1.0, 1.0); // returns a harmonic series\n\nb = Buffer.alloc(s, 512, 1);\n// harmonic series for freqs, ramp down for amps\nb.sine2(a.ramp(1.0, 1.0).postln, a.ramp(0.5, -0.025).postln, true, true, true);\n(\nz = SynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, 200, 0, 0.5)\n )\n});\n);\ny = z.play(s, [\\out, 0, \\bufnum, b]);\ny.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Harmonics.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 216}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `History` that runs as it is."}, {"role": "assistant", "content": "```supercollider\nHistory.clear.end; // if needed, clear History first\nHistory.start; // starts recording, opens log file\n\n// execute these lines one by one, as a little performance history\n1 + 2;\np = ProxySpace.push(s.boot);\n~a = { Dust.ar([1, 1] * 30) * 0.3 };\n~a.play;\n~a.end(3);\n\nHistory.started; // is it on now?\n\n// stops recording history and ends logging.\nHistory.end;\nHistory.started;\n\nHistory.document; // creates a document with current history\nHistory.showLogFolder; // opens the folder where logs are written.\nHistory.showLogFile; // opens the current log file as it was written.\n\n\n// make a gui window, to access code history lines at will,\n// e.g. for code reuse in performance, adaptation, sharing, etc:\ng = History.makeWin;\n// specify left-bottom position, and number of lines in textview\ng = History.makeWin(0@20, 5);\n\n// play back the recorded history line by line\nHistory.play(0);\n\n\n// history can even record and play back stops with CmdPeriod.\n// run these lines one at a time:\nHistory.clear.start;\n1 + 2;\n2 + 3;\ns.boot;\n(dur: inf).play;\n\nCmdPeriod.run; // or hit the Stop key command, Cmd-., or ctrl-.\n3 + 4; // continue recording into history\n4 + 5;\nHistory.end;\n\n// Replays history, including a CmdPeriod, and keeps replaying history.\nHistory.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/History.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 523}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `IEnvGen`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var env = Env([0, 0.6, 0.3, 1.0, 0], [0.1, 0.02, 0.4, 1.1], [\\lin, \\exp, -6, \\sin]);\n var envgen = IEnvGen.kr(env, MouseX.kr(0, env.times.sum));\n env.plot;\n SinOsc.ar(envgen * 500 + 440)\n}.play;\n);\n\n// index with an SinOsc ... mouse controls amplitude of SinOsc\n// use offset so negative values of SinOsc will map into the Env\n(\n{\n var sin = SinOsc.ar(440, 0, MouseX.kr(0, 1));\n // use offset so negative values of SinOsc will map into the Env\n var env = Env([-1, -0.7, 0.7, 1], [0.8666, 0.2666, 0.8668], \\lin, offset: -1.0);\n IEnvGen.ar(env, sin) * 0.1\n}.play;\n);\n\n// index with Amplitude of input, control freq of SinOsc (uses SoundIn)\n(\n{\n var point = Amplitude.ar(SoundIn.ar(0), 0.01, 0.2);\n // use offset so negative values of SinOsc will map into the Env\n var env = Env.xyc([[0, 330, \\exp], [0.5, 440, \\exp], [1.0, 1760]]);\n SinOsc.ar(IEnvGen.kr(env, point)) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IEnvGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 501}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `IFFT` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 120}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `IdentityDictionary`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_sinegrain, { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0.5pi, env))\n}).add;\n\na = Pbind(\\instrument, \\help_sinegrain, \\note, Pseq([0, 7, 2, 9, 11, 10, 9, 8], inf), \\dur, 1);\na.play(quant: (quant: 1, phase: 0));\na.play(quant: (quant: 1, phase: 1/3));\na.play(quant: (quant: 1, phase: 1.0.rand));\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IdentityDictionary.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 253}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `In` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-PinkNoise\", { |out = 0|\n Out.ar(out, PinkNoise.ar(0.1))\n}).add;\n\nSynthDef(\"help-In\", { |out = 0, in = 0|\n var input;\n input = In.ar(in, 1);\n Out.ar(out, input);\n\n}).add;\n);\n\n// play noise on the right channel\nx = Synth(\"help-PinkNoise\", [\\out, 1]);\n\n// read the input and play it out on the left channel\nSynth.after(x, \"help-In\", [\\out, 0, \\in, 1]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/In.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 198}
-{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `InFeedback`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth before a which also writes to bus x\n// now you can't hear b, as its data is one cycle old, and is overwritten by c\nc = Synth.before(a, \"help-SinOsc\", [\\out, x.index, \\freq, 800]);\n\n// free c and you can hear b again\nc.free;\nx.free;\n\na.free; b.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 362}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `MouseX`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nb = Bus.control(s, 9); // nine channel control rate\nb.setn([244, 737, 20, 271, 382, 172, 4, 2399, 251]);\n{\n var index = MouseX.kr(0, 30);\n Blip.ar(InBus.ar(b, 2, index, \\wrap)) * 0.1\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InBus.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 126}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `InFeedback`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n var input, sound;\n input = InFeedback.ar(in, 1);\n sound = SinOsc.ar(input * 1300 + 300, 0, 0.4);\n Out.ar(out, sound);\n\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 106}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `InTrig`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns = Server.local;\nb = Bus.control(s, 1);\n\nSynthDef(\"help-InTrig\", { |out = 0, busnum = 0|\n var inTrig;\n inTrig = InTrig.kr(busnum);\n Out.ar(out,\n EnvGen.kr(Env.perc, gate: inTrig, levelScale: inTrig) * SinOsc.ar\n )\n}).play(s, [\\out, 0, \\busnum, b.index]);\n\n\nb.set(1.0);\n\nb.value = 1.0;\n\nb.value = 0.2;\n\nb.value = 0.1;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InTrig.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 206}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `IndexInBetween` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// autotune.\n{\n var index, in, autotuned, f0, fdiff;\n var scale = ([0, 1, 3, 4, 7, 11, 12] + 70).midicps;\n var buffer = scale.as(LocalBuf);\n in = Pulse.ar(MouseX.kr(scale.minItem, scale.maxItem)) * 0.1;\n f0 = Pitch.kr(in).at(0);\n index = IndexInBetween.kr(buffer, f0);\n fdiff = index.frac * (Index.kr(buffer, index + 1) - Index.kr(buffer, index));\n autotuned = PitchShift.ar(in, 0.1, 1 - (fdiff / f0), 0.01, 0.01);\n RLPF.ar(autotuned, [2000, 5000], 0.3)\n}.play;\n);\n\nb.free;\n\n\n// basic test.\n(\n{\n var index, f0, f1, f3;\n var buffer = [200, 210, 400, 430, 600, 800].as(LocalBuf);\n f0 = MouseX.kr(200, 900);\n index = IndexInBetween.kr(buffer, f0);\n f1 = IndexL.kr(buffer, index);\n SinOsc.ar([f0, f1]) * 0.1\n\n}.play;\n);\n\n\n\n// One way to map across from an arbitrary piecewise curve, onto another:\n// We use IndexInBetween to \"unmap\" your input into integer slots,\n// and then use IndexL to do the reverse, to \"map\" onto your other distribution.\n// This example maps a sort-of-exponential curve onto a sort-of-sinusoidal curve:\n\n~from = [1, 2, 4, 8, 16];\n~to = [0, 1, 0, -1, 0];\n(\nx = {\n IndexL.kr(~to.as(LocalBuf), IndexInBetween.kr(~from.as(LocalBuf), MouseX.kr(~from.first, ~from.last).poll).poll).poll\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IndexInBetween.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 668}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `JITGui`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// typically, only subclasses of JITGui are used,\n // so here are just some basic usage and layout tests\n\n // make its own window - defPos, minSize is used\ng = JITGui(Ndef(\\a));\n\n // make its own window, specific size\ng = JITGui(Ndef(\\a), bounds: 390@20);\n\n // provide full bounds\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 390, 24));\n\n // extent is 0@0: minSize x, y is used\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 0, 0));\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 0, 50));\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 500, 0));\n\n\n( // put a JITGui in an existing window:\nw = Window().front;\ng = JITGui(Ndef(\\a), 0, w, bounds: 300@48);\n);\n\n( // 5 lines high\nw = Window().front;\ng = JITGui(Ndef(\\a), 5, w);\n);\n\n( // recommended: use a FlowLayout.\nw = Window().front;\nw.addFlowLayout;\nEZSlider(w, 300@100, \\test, []);\ng = JITGui(Ndef(\\a), 0, w, bounds: 300@40);\n);\n\n// test changing color schemes for JITguis\n// this scheme is admittedly ugly but different\n\nGUI.skins.put(\\jit, (\n fontSpecs: [\"Inconsolata\", 12],\n fontColor: Color.white,\n background: Color(0.2, 0.85, 0.7, 0.5),\n foreground: Color.grey(0.1),\n onColor: Color(0.5, 0, 0.5),\n onColor2: Color(0.0, 0.5, 0.5),\n offColor: Color.grey(0.2, 0.5),\n hiliteColor: Color.green(1.0, 0.5),\n gap: 0 @ 0,\n margin: 2@2,\n buttonHeight: 18,\n headHeight: 24)\n);\n\n// make some JITGuis to check\nn = NdefGui(Ndef(\\a));\nNdef(\\a, { SinOsc.ar(\\freq.kr(250)) });\nNdef(\\a).clear;\nn = NdefMixer(s);\n\nTdefAllGui();\nTdef(\\a).set(\\amp, 0.25);\nTdefGui(Tdef(\\a), 5);\n\nEnvirGui((a: 123));\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/JITGui.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 851}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `KeyTrack`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// alternating major and minor chords as a test\n(\n{\n var in, fft, resample;\n var key, transientdetection;\n\n in = Mix(SinOsc.ar((60 + [0, MouseX.kr(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key.poll;\n\n Pan2.ar(in)\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 270}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `LFClipNoise`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n LFClipNoise.ar(1000, 0.25)\n )\n}).play;\n);\n\n// modulate frequency\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n LFClipNoise.ar(XLine.kr(1000, 10000, 10), 0.25)\n )\n}).play;\n);\n\n// use as frequency control\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(\n LFClipNoise.ar(4, 200, 600),\n 0, 0.2\n )\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LFClipNoise.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 239}
-{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LeastChange`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nd = { |freq = 440|\n var internalFreq;\n internalFreq = LFNoise0.ar(0.3, 300, 800);\n SinOsc.ar(\n LeastChange.kr(freq, internalFreq) // two sources of change: one external, one internal\n ) * 0.1\n}.play\n);\n\nd.set(\\freq, 800);\nd.set(\\freq, 900);\nd.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 145}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `LastValue` that runs as it is."}, {"role": "assistant", "content": "```supercollider\nd = { |freq = 440| SinOsc.ar(LastValue.ar(freq, 20), 0, 0.2) }.play;\n\nd.set(\\freq, 400);\nd.set(\\freq, 200);\nd.set(\\freq, 670);\nd.set(\\freq, 680);\nd.set(\\freq, 695);\nd.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LastValue.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 124}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LeastChange`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nd = { |amp = 1.0|\n var in1, in2;\n in1 = LFNoise0.ar(800, amp);\n in2 = SinOsc.ar(800);\n LeastChange.ar(in1, in2) * 0.1;\n}.play;\n);\n\nd.set(\\amp, 0.1);\nd.set(\\amp, 0);\nd.set(\\amp, 3);\nd.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 129}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `LFPulse` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.meter;\ns.scope;\n\n// synthesize 2 test signals at level 0.1 (-20 dB), first on separate channels\n(\n{ var n = 2, level = 0.1, spread = 1, pan = 0;\n LFPulse.ar({ 100.exprand(2000) } ! n).range(-1, 1) * level\n}.play;\n);\n\n// now mix/pan these 2 signals using Splay, level at 0.1 (-20dB)\n(\nx = { |spread = 1, level = 0.1, center = 0|\n var n = 2;\n var snd = LFPulse.ar({ 100.exprand(2000) } ! n).range(-1, 1);\n var stereo = Splay.ar(snd, spread, level, center);\n Peak.ar(stereo, Impulse.kr(2)).ampdb.poll(2);\n stereo\n}.play;\n);\n\n// when we set full spread, panned to center:\n// the 2 signals are discrete, left and right\n// we see the energy-based levelComp applied (1/2.sqrt).ampdb = -3\nx.set(\\spread, 1, \\center, 0); // -20 - 3 = -23dB\n\n// no spread, panned center:\n// each signal decreases by 3dB as they move to the center (from the panning function)\n// and the two signals mix on each channel, so we get -20 dB\nx.set(\\spread, 0, \\center, 0); // -20dB\n\n// no spread, panned fully right:\n// the signals fully mix in the right channel (+6 dB)\nx.set(\\spread, 0, \\center, 1); // -23 + 6 = -17db\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LevelComp.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 514}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Splay` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nx = { |spread = 1, level = 0.1, center = 0|\n var n = 20;\n var snd = Splay.ar(LFPulse.ar({ 100.exprand(2000) } ! n).range(-1, 1),\n spread, level, center);\n Peak.ar(snd, 0.01, 1).ampdb.poll(1);\n snd\n}.play;\n);\n\n// at full spread, level -20, pan to center:\n// peak is higher at -11 db\nx.set(\\spread, 1, \\center, 0);\n// with no spread, i.e. all panned center, slightly higher -10\nx.set(\\spread, 0, \\center, 0);\n// worst case: no spread, pan full left: -8db\nx.set(\\spread, 0, \\center, -1); // -8\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LevelComp.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 257}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Limiter` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// example signal to process\n{\n var z;\n z = Decay2.ar(\n Impulse.ar(8, LFSaw.kr(0.25, -0.6, 0.7)),\n 0.001, 0.3, FSinOsc.ar(500));\n z * 0.8\n}.play\n);\n\n(\n{\n var z;\n z = Decay2.ar(\n Impulse.ar(8, LFSaw.kr(0.25, -0.6, 0.7)),\n 0.001, 0.3, FSinOsc.ar(500));\n [z, Limiter.ar(z, 0.4, 0.01)] * 0.5\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Limiter.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 206}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `LinRand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-LinRand\", { |out = 0, minmax = 1|\n Out.ar(out,\n FSinOsc.ar(\n LinRand(200.0, 10000.0, minmax),\n 0, Line.kr(0.2, 0, 0.01, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n// towards hi\n(\nRoutine({\n loop({\n Synth.new(\"help-LinRand\"); 0.04.wait;\n })\n}).play;\n);\n\n// towards lo (doesn't work like that yet)\n(\nRoutine({\n loop({\n Synth.new(\"help-LinRand\", [\\minmax, -1]); 0.04.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LinRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 246}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LinSelectX`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n SinOsc.ar,\n Saw.ar(300),\n Pulse.ar(230)\n ];\n\n LinSelectX.ar(MouseX.kr(0, 1) * a.size, a) * 0.2\n}.play;\n);\n\n(\n{\n var a;\n a = [\n SinOsc.kr(0.25),\n LFSaw.kr(10),\n LFPulse.kr(0.3)\n ];\n\n SinOsc.ar(LinSelectX.kr(MouseX.kr(0, 1) * a.size, a) * 300 + 400) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LinSelectX.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 212}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LocalIn`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var source, local;\n\n source = Decay.ar(Impulse.ar(0.3), 0.1) * WhiteNoise.ar(0.2);\n local = LocalIn.ar(2) + [source, 0]; // read feedback, add to source\n local = DelayN.ar(local, 0.2, 0.2); // delay sound\n\n // reverse channels to give ping pong effect, apply decay factor\n LocalOut.ar(local.reverse * 0.8);\n\n local\n}.play;\n);\n\n(\n{\n var local, in;\n\n in = Mix.fill(12, {\n Pan2.ar(\n Decay2.ar(Dust.ar(0.05), 0.1, 0.5, 0.1)\n * FSinOsc.ar(IRand(36, 84).midicps).cubed.max(0),\n Rand(-1, 1))\n });\n in = in + Pan2.ar(Decay2.ar(Dust.ar(0.03), 0.04, 0.3) * BrownNoise.ar, 0);\n\n 4.do { in = AllpassN.ar(in, 0.03, { Rand(0.005, 0.02) }.dup, 1) };\n\n local = LocalIn.ar(2) * 0.98;\n local = OnePole.ar(local, 0.5);\n\n local = Rotate2.ar(local[0], local[1], 0.23);\n local = AllpassN.ar(local, 0.05, { Rand(0.01, 0.05) }.dup, 2);\n\n local = DelayN.ar(local, 0.3, [0.19, 0.26]);\n local = AllpassN.ar(local, 0.05, { Rand(0.03, 0.15) }.dup, 2);\n\n local = LeakDC.ar(local);\n local = local + in;\n\n LocalOut.ar(local);\n\n local\n\n}.play;\n);\n\n(\n{\n var local, in, amp;\n\n in = SoundIn.ar([0, 1]);\n\n amp = Amplitude.kr(Mix.ar(in));\n in = in * (amp > 0.02); // noise gate\n\n local = LocalIn.ar(2);\n local = OnePole.ar(local, 0.4);\n local = OnePole.ar(local, -0.08);\n\n local = Rotate2.ar(local[0], local[1], 0.2);\n\n local = DelayN.ar(local, 0.25, 0.25);\n\n local = LeakDC.ar(local);\n local = ((local + in) * 1.25).softclip;\n\n LocalOut.ar(local);\n local * 0.1;\n}.play;\n);\n\n// Resonator, must subtract blockSize for correct tuning\n(\n{\n var in, imp, sound;\n\n in = LocalIn.ar(1);\n imp = Impulse.ar(1);\n sound = DelayC.ar(imp + (in * 0.995), 1, 440.reciprocal - ControlRate.ir.reciprocal);\n LocalOut.ar(sound); // for feedback\n in\n}.play;\n\n// compare pitch\n{\n SinOsc.ar(440, 0, 0.2)\n}.play(s, 1);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LocalIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 992}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `MultiTap` that runs as it is."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.alloc(s, s.sampleRate);\n(\n{\n MultiTap.ar(`[0.1, 0.2, 0.3, 0.4], `[0.1, 0.2, 0.4, 0.8],\n Decay.ar(Dust.ar(2), 0.1, PinkNoise.ar), bufnum: b.bufnum)\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/MultiTap.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 127}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `MultiplexAnalogIn` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// modulate frequency of a sine oscillator\n\n(\nSynthDef(\"help-MultiplexAnalogIn\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(MultiplexAnalogIn.ar(0, 1).exprange(200, 5000), 0, 0.1)\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/MultiplexAnalogIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 111}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `NRand`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-NRand\", { |out = 0, n = 0|\n Out.ar(out,\n FSinOsc.ar(\n NRand(1200.0, 4000.0, n),\n 0, Line.kr(0.2, 0, 0.01, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n(\nn = 0;\nRoutine({\n inf.do({ |i|\n Synth.new(\"help-NRand\", [\\n, n]); 0.05.wait;\n })\n}).play;\n);\n\nn = 1;\nn = 2;\nn = 4;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 193}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `NamedControl` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// compare this:\n(\na = {\n var x, y;\n x = NamedControl.kr(\\freq, 440).lag(3.5);\n y = NamedControl.kr(\\freq, 440).lag(1);\n SinOsc.ar([x, y] * [2, 1.2]) * 0.1\n}.play;\n);\n\na.set(\\freq, 1220);\na.set(\\freq, 120);\n\n// to this:\n(\na = {\n var x, y;\n x = Control.names([\\freq]).kr(440).lag(3.5);\n y = Control.names([\\freq]).kr(440).lag(1); // this hangs when set\n SinOsc.ar([x, y] * [2, 1.2]) * 0.1\n}.play;\n);\n\na.set(\\freq, 1220);\na.set(\\freq, 120);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NamedControl.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 284}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Ndef`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nNdef(\\sound, { |freq = 56, numHarm = 10| Blip.ar(freq, numHarm, 30) * 0.2 }).play;\nNdef(\\sound).set(\\freq, 15);\nNdef(\\sound).set(\\freq, 15, \\numHarm, 100);\n\nNdef(\\lfo, { LFNoise2.kr(2).exprange(10, 200) });\nNdef(\\sound).map(\\numHarm, Ndef(\\lfo));\nNdef(\\sound).set(\\numHarm, nil); // unmap.\nNdef(\\sound).stop;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Ndef.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 188}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `NdefGui`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\np = ProxySpace.push(s.boot);\n\nl = NdefGui(nil, 3).moveTo(10, 120);\nm = NdefGui(nil, 3).moveTo(10, 240);\nn = NdefGui(nil, 3).moveTo(10, 360);\no = NdefGui(nil, 3).moveTo(10, 480);\n\nSpec.add(\\dens, [0.1, 300, \\exp]);\n\n// make 3 kinds of proxies: using tilde/proxyspace, Ndef, and unnamed.\n~spacy = { |dens = 5| Formlet.ar(Dust.ar(dens ! 2), LFDNoise0.kr(20 ! 2).lag(0.1).linexp(-1, 1, 300, 5000), 0.003, 0.03) };\nNdef(\\ndeffy, { GrayNoise.ar(0.1 ! 2) });\nc = NodeProxy.audio.source_({ PinkNoise.ar(0.1 ! 2) });\n\n// put one in each editor\nl.object_(~spacy);\nm.object_(Ndef(\\ndeffy));\nn.object_(c);\n);\n// One should also be able to drag and drop text into the drag,\n// but this is also not working yet.\n( Ndef(\\a) )\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NdefGui.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 415}
-{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Node`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\nx = SynthDef(\"help-node-set\", { |freq = 440, out = 0|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).play\n);\nx.set(\\freq, 880, \\out, 1); // two pairs\nx.set(0, 660, 1, 0); // freq is the first argument, so it's index is 0. out is index 1.\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Node.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 145}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Node`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\nx = SynthDef(\"help-node-set\", { |freq = 440, out = 0|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).play\n);\nx.run(false);\nx.run; // default is true\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Node.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 105}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `NodeControl`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nd = SynthDef(\"help-NodeControl\", { |out = 0, freq = 400|\n Out.ar(out,\n SinOsc.ar(freq, 0, 0.5)\n )\n});\ny = d.play; // the synth\n\nc = NodeControl(y, 1);\n\nc.value = 500;\n\nc.value = 300;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NodeControl.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 116}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `NodeProxy` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\na = NodeProxy.new.play; // play to hardware output.\na.fadeTime = 2; // fadeTime specifies crossfade\n// set the source\na.source = { SinOsc.ar([350, 351.3], 0, 0.2) };\na.source = { Pulse.ar([350, 351.3] / 4, 0.4) * 0.2 };\na.source = Pbind(\\dur, 0.03, \\freq, Pbrown(0, 1, 0.1, inf).linexp(0, 1, 200, 350));\n\nb = NodeProxy.new;\na.source = { Ringz.ar(b.ar, [350, 351.3] * 8, 0.2) * 4 };\nb.source = { Impulse.ar([5, 7]/2, [0, 0.5]) };\n\na.clear(3); // clear after 3 seconds\nb.clear(3);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NodeProxy.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 289}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Normalizer`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n// example signal to process\n{\n var z;\n z = Decay2.ar(\n Impulse.ar(8, LFSaw.kr(0.25, -0.6, 0.7)),\n 0.001, 0.3, FSinOsc.ar(500));\n z * 0.8\n}.play\n);\n\n(\n{\n var z;\n z = Decay2.ar(\n Impulse.ar(8, LFSaw.kr(0.25, -0.6, 0.7)),\n 0.001, 0.3, FSinOsc.ar(500));\n [z, Normalizer.ar(z, 0.4, 0.01)] * 0.5\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Normalizer.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 208}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `OSCBundle`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// create a new, empty instance\na = OSCBundle.new;\n\n// a synthdef that needs to be sent to the server, an operation that is asynchronous,\n// i.e. we have to wait until it is finished.\nx = SynthDef(\"test\", { OffsetOut.ar(0, BPF.ar(Impulse.ar(4) * 10, Rand(9000, 1000), 0.1)) });\n// this is why addPrepare is used.\na.addPrepare([\"/d_recv\", x.asBytes]);\n// add is used with synchronous operations, like starting synths.\na.add([\"/s_new\", \"test\", -1]);\n\n// the bundle has now the synchronous separated from the asynchronous bundles:\na.messages;\na.preparationMessages;\n\n// this can be simply sent - the bundle takes care of the server client communication\n// like waiting for the synthdef to be loaded. the synth is started when the preparation\n// is finished.\n\ns.boot; // boot the server\na.send(s);\n\ns.freeAll; // free all nodes on the server\n\n// scheduled sending: the synths are started on the next beat.\n\na.schedSend(s, TempoClock.default, 1);\na.schedSend(s, TempoClock.default, 1);\na.schedSend(s, TempoClock.default, 1);\n\ns.freeAll; // free all nodes on the server\n\n// the bundle can contain several preparation messages and messages at a time.\n// the proparationMessages are sent first and only when they are all completed,\n// the other bundles are sent.\n// the bundle can also be reused, if there is no specific allocated buffers/node ids.\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/OSCBundle.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 562}
@@ -13842,6 +13585,7 @@
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Osc`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, 200, 0, 0.5)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, XLine.kr(2000, 200), 0, 0.5) // modulate freq\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum,\n Osc.ar(bufnum,\n XLine.kr(1, 1000, 9),\n 0,\n 200,\n 800),\n 0,\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n(\n// modulate phase\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum,\n 800,\n Osc.ar(bufnum,\n XLine.kr(20, 8000, 10),\n 0,\n 2pi),\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n\n(\n// change the buffer while its playing\ns = Server.local;\nb = Buffer.alloc(s, 4096, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, [80, 80.2], 0, 0.2)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nfork {\n var n = 32;\n 50.do {\n b.sine1(Array.rand(n, 0, 1).cubed, true, true, true);\n 0.25.wait;\n };\n};\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Osc.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 909}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `OscN` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// compare examples below with interpolating Osc examples.\n\n(\ns = Server.local;\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, false, true);\nb = Buffer.alloc(s, 512, 1);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, 500, 0, 0.5)\n )\n}).play(s, [0, 0, 1, b.bufnum]);\n\n);\nb.free;\n\n\n\n(\n// noninterpolating - there are noticeable artifacts\n// modulate freq\n\ns = Server.local;\nb.sine1(1.0/[1, 2, 3, 4, 5, 6].squared, true, false, true);\nb = Buffer.alloc(s, 512, 1);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, XLine.kr(2000, 200), 0, 0.5)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n\n);\nb.free;\n\n(\n// sounds very different than the Osc example\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum,\n OscN.ar(bufnum,\n XLine.kr(1, 1000, 9),\n 0,\n 200,\n 800),\n 0,\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n\n);\nb.free;\n\n(\n// modulate phase\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum,\n 800,\n OscN.ar(bufnum,\n XLine.kr(20, 8000, 10),\n 0,\n 2pi),\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\nb.free;\n\n\n(\n// change the buffer while its playing\ns = Server.local;\nb = Buffer.alloc(s, 4096, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, [80, 80.2], 0, 0.2)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nRoutine({\n var n = 32;\n 50.do({\n b.sine1(Array.rand(n, 0, 1).cubed, true, true, true);\n 0.25.wait;\n });\n}).play;\n);\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/OscN.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 1013}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Out` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-out\", { |out = 0, freq = 440|\n var source;\n source = SinOsc.ar(freq, 0, 0.1);\n\n // write to the bus, adding to previous contents\n Out.ar(out, source);\n\n}).add;\n);\n\n\nSynth(\"help-out\", [\\freq, 500]);\nSynth(\"help-out\", [\\freq, 600]);\nSynth(\"help-out\", [\\freq, 700]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Out.schelp", "aug": "prologue:ugen", "prompt_tokens": 43, "answer_tokens": 155}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PV_BrickWall`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BrickWall(chain, SinOsc.kr(0.1));\n IFFT(chain);\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "prologue:ugen", "prompt_tokens": 55, "answer_tokens": 106}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `PV_Mul`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-mul\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5);\n inB = SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n);\n\n(\nSynthDef(\"help-mul2\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5) * Line.kr;\n inB = LFNoise1.ar(20);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 396}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PV_PhaseShift`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-phaseShift\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(500);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_PhaseShift(chain, LFNoise2.kr(1, 180, 180));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 148}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `PV_PhaseShift90` that runs as it is."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\n{ |out = 0, bufnum = 0|\n var in, fft, fft2, shifted;\n in = SinOsc.ar(500, 0, 0.1);\n fft = FFT(LocalBuf(2048), in);\n fft2 = FFT(LocalBuf(2048), in);\n shifted = PV_PhaseShift90(fft);\n Out.ar(out, [IFFT(fft2), IFFT(shifted)]);\n}.scope\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift90.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 163}
@@ -13859,16 +13603,20 @@
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Pmul`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// sound example\n(\nSynthDef(\\sinegrain,\n { |out = 0, freq = 440, gate = 1|\n var env;\n env = EnvGen.kr(Env.asr(0.001, 1, 0.2), gate, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\dur, 0.5, \\instrument, \\sinegrain, \\freq, 440);\nb = Pmul(\\freq, Pseq([1, 2, 3, 4, 5, 6, 7], inf), a);\nb.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pmul.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 217}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pmulp` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// sound example\n(\nSynthDef(\\sinegrain,\n { |out = 0, freq = 440, sustain = 0.02|\n var env;\n env = EnvGen.kr(Env.perc(0.001, sustain), 1, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\freq, Pseq([500, 600, 700]), \\instrument, \\sinegrain);\na = Pmulp(\\freq, Pseq([0.5, 0.9, 0.8], inf), a);\na.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pmulp.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 217}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pmulpre` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// sound example\n(\nSynthDef(\\sinegrain,\n { |out = 0, freq = 440, sustain = 0.02|\n var env;\n env = EnvGen.kr(Env.perc(0.001, sustain), 1, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\dur, 0.5, \\instrument, \\sinegrain);\nb = Pmulpre(\\freq, Pseq([1, 2, 3], inf), a);\nb.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pmulpre.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 199}
-{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `BufRd`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_playbuf, { |out = 0, bufnum = 0, rate = 1, startPos = 0, amp = 0.1, sustain = 1, pan = 0, loop = 1|\n var audio;\n rate = rate * BufRateScale.ir(bufnum);\n startPos = startPos * BufFrames.ir(bufnum);\n\n audio = BufRd.ar(1, bufnum, Phasor.ar(0, rate, startPos, BufFrames.ir(bufnum)), 1, 1);\n audio = EnvGen.ar(Env.sine, 1, timeScale: sustain, doneAction: Done.freeSelf) * audio;\n audio = Pan2.ar(audio, pan, amp);\n OffsetOut.ar(out, audio);\n}).add; // use .store for rendering example below\n\na = Pproto({\n ~newgroup = (type: \\group).yield;\n ~sf1 = (type: \\allocRead, path: ExampleFiles.apollo11).yield;\n},\n Pbind(*[\n instrument: \\help_playbuf,\n dur: Pseg([0, 0, 0.25, 0.5, 0.75, 1], 10).linexp(0, 1, 0.01, 2),\n legato: 4,\n startPos: Pn(Pseg([0, 1], 20), inf),\n rate: Pwhite(1, 1).midiratio,\n loop: 0,\n group: Pkey(\\newgroup),\n bufnum: Pkey(\\sf1)\n ])\n);\na.play;\n)\n\n// a.render(\"sounds/test.aif\", 40)\n// SoundFile.openRead(\"sounds/test.aif\").play\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pproto.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 548}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `ProxySpace`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\np = ProxySpace.new;\np.fadeTime = 2; // fadeTime specifies crossfade\np[\\out].play; // monitor an empty placeholder through hardware output\n// set its source\np[\\out] = { SinOsc.ar([350, 351.3], 0, 0.2) };\np[\\out] = { Pulse.ar([350, 351.3] / 4, 0.4) * 0.2 };\np[\\out] = Pbind(\\dur, 0.03, \\freq, Pbrown(0, 1, 0.1, inf).linexp(0, 1, 200, 350));\n\n// route one proxy through another:\np[\\out] = { Ringz.ar(p[\\in].ar, [350, 351.3] * 8, 0.2) * 4 };\np[\\in] = { Impulse.ar([5, 7]/2, [0, 0.5]) };\n\np.clear(3); // clear after 3 seconds\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ProxySpace.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 307}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pseq` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n(\na = Pseq(#[60, 61, 63, 65, 72], inf).asStream;\nRoutine({\n loop({\n Synth(\\help_sinegrain, [\\freq, a.next.midicps]);\n 0.2.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pseq.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 222}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Psubdivide` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\na = Psubdivide(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,0,1,3,4,0], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\n100.do({ x.next.postln });\n);\n\n\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n(\na = Psubdivide(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\n\nRoutine({\n loop({\n Synth.grain(\\help_sinegrain, [\\freq, 440]);\n x.next.wait;\n })\n}).play(TempoClock.default);\n);\n\n\n(\na = Psubdivide(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,0,4,4], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\nRoutine({\n loop({\n Synth.grain(\\help_sinegrain, [\\freq, 440]);\n x.next.wait;\n })\n}).play(TempoClock.default);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Psubdivide.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 571}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PulseCount`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\"help-PulseCount\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(\n PulseCount.ar(Impulse.ar(10), Impulse.ar(0.4)) * 200,\n 0, 0.05\n )\n )\n}).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PulseCount.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 99}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PulseDivider`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\"help-PulseDivider\", { |out = 0|\n var p, a, b;\n p = Impulse.ar(8);\n a = SinOsc.ar(1200, 0, Decay2.ar(p, 0.005, 0.1));\n b = SinOsc.ar(600, 0, Decay2.ar(PulseDivider.ar(p, 4), 0.005, 0.5));\n\n Out.ar(out, (a + b) * 0.4)\n}).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PulseDivider.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 156}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pwrap` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n(\na = Pn(\n Pwrap(\n Pgeom(200, 1.07, 96),\n 200,\n 1000.0\n ),\n inf\n);\nx = a.asStream;\n\nRoutine({\n loop({\n Synth(\\help_sinegrain, [\\freq, x.next.debug, \\dur, 0.3]);\n 0.12.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pwrap.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 252}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `QuadC` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// logistic map\n// equation: x1 = -r*x0^2 + r*x0\n(\n{ var r;\n r = MouseX.kr(3.5441, 4); // stable range\n QuadC.ar(SampleRate.ir/4, r.neg, r, 0, 0.1) * 0.4;\n}.play(s);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/QuadC.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 111}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `QuadL` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// logistic map\n// equation: x1 = -r*x0^2 + r*x0\n(\n{ var r;\n r = MouseX.kr(3.5441, 4); // stable range\n QuadL.ar(SampleRate.ir/4, r.neg, r, 0, 0.1) * 0.4;\n}.play(s);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/QuadL.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 111}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `QuadN` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// logistic map\n// equation: x1 = -r*x0^2 + r*x0\n(\n{ var r;\n r = MouseX.kr(3.5441, 4); // stable range\n QuadN.ar(SampleRate.ir/4, r.neg, r, 0, 0.1) * 0.4;\n}.play(s);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/QuadN.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 111}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Rand`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-Rand\", { |out = 0|\n Out.ar(out,\n FSinOsc.ar(\n Rand(200.0, 400.0),\n 0, Line.kr(0.2, 0, 1, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n(\nRoutine({\n 8.do({\n Synth.new(\"help-Rand\"); 1.0.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Rand.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 150}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `RandID` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// start a noise patch and set the id of the generator\n(\nSynthDef(\"help-RandID\", { |out = 0, id = 1|\n RandID.ir(id);\n Out.ar(out,\n WhiteNoise.ar(0.05) + Dust2.ar(70)\n )\n}).add;\n);\n\n// reset the seed of my rgen at a variable rate\n(\nSynthDef(\"help-RandSeed\", { |seed = 1910, id = 1|\n RandID.kr(id);\n RandSeed.kr(Impulse.kr(FSinOsc.kr(0.2, 0, 10, 11)), seed);\n}).add;\n\n);\n\n// start two noise synths on left and right channel with a different randgen id\na = Synth(\"help-RandID\", [\\out, 0, \\id, 1]);\nb = Synth(\"help-RandID\", [\\out, 1, \\id, 2]);\n\n// reset the seed of randgen 1\nx = Synth(\"help-RandSeed\", [\\id, 1]);\n\n// change the target randgen to 2 (affects right channel)\nx.set(\\id, 2);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RandID.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 354}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `RecordBuf` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// Execute the following in order\n(\n// allocate a Buffer\ns = Server.local;\nb = Buffer.alloc(s, 44100 * 4.0, 1); // a four second 1 channel Buffer\n);\n\n// record for four seconds\n(\nSynthDef(\\help_RecordBuf, { |out = 0, bufnum = 0|\n var formant;\n formant = Formant.ar(XLine.kr(400, 1000, 4), 2000, 800, 0.125);\n RecordBuf.ar(formant, bufnum, doneAction: Done.freeSelf, loop: 0);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play it back\n(\nSynthDef(\\help_RecordBuf_playback, { |out = 0, bufnum = 0|\n var playbuf;\n playbuf = PlayBuf.ar(1, bufnum);\n FreeSelfWhenDone.kr(playbuf); // frees the synth when the PlayBuf is finished\n Out.ar(out, playbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// overdub\n(\nSynthDef(\\help_RecordBuf_overdub, { |out = 0, bufnum = 0|\n var formant;\n formant = Formant.ar(XLine.kr(200, 1000, 4), 2000, 800, 0.125);\n // mixes equally with existing data\n RecordBuf.ar(formant, bufnum, 0, 0.3, 0.5, doneAction: Done.freeSelf, loop: 0);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play back the overdubbed version\nSynth.new(\\help_RecordBuf_playback, [\\out, 0, \\bufnum, b], s);\n\n// write the contents of the buffer to a file (see Buffer for more options)\n(\nb.write(sampleFormat: 'int16');\nthisProcess.platform.recordingsDir +/+ \"SC_\" ++ Date.localtime.stamp ++ \".aiff\"; // generated path\n);\n\nb.close; b.free; // cleanup\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RecordBuf.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 686}
-{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `RunningSum` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// play around\n(\n{\n var input, numsamp, power;\n numsamp = 500;\n input = SoundIn.ar;\n power = MouseX.kr(0.1, 4);\n\n (RunningSum.ar(input ** power, numsamp)/numsamp) ** (power.reciprocal)\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 102}
+{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Recorder`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nr = Recorder(s);\n{ GVerb.ar(Dust.ar(4)) }.play; // play on bus 64\nr.record(numChannels: 2);\nr.stopRecording;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Recorder.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 68}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `RunningSum` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// RMS Power\n(\n{\n var input, numsamp;\n\n input = LFSaw.ar;\n numsamp = 30;\n\n (RunningSum.ar(input.squared, numsamp) / numsamp).sqrt\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 79}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `SampleRate`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// compares a 441 Hz sine tone derived from sample rate (44100 * 0.01, left)\n// with a 440 Hz tone (right), resulting in a 1 Hz beating\n(\n{\n var freq;\n freq = [SampleRate.ir * 0.01, 440];\n SinOsc.ar(freq, 0, 0.1)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SampleRate.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 119}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Scale` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nr = {\n var scale = Scale.choose.postln;\n SinOsc.ar(\n (\n DegreeToKey.kr(\n scale.as(LocalBuf),\n MouseX.kr(0, 15), // mouse indexes into scale\n scale.stepsPerOctave,\n 1, // mul = 1\n 60 // offset by 72 notes\n )\n + LFNoise1.kr([3, 3], 0.04) // add some low freq stereo detuning\n ).midicps, // convert midi notes to hertz\n 0,\n 0.25\n )\n}.play;\n);\n\nr.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Scale.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 203}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `SelectX` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n SinOsc.ar,\n Saw.ar(300),\n Pulse.ar(230)\n ];\n\n SelectX.ar(MouseX.kr(0, 1) * a.size, a) * 0.2\n}.play;\n);\n\n(\n{\n var a;\n a = [\n SinOsc.kr(0.25),\n LFSaw.kr(10),\n LFPulse.kr(0.3)\n ];\n\n SinOsc.ar(SelectX.kr(MouseX.kr(0, 1) * a.size, a) * 300 + 400) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SelectX.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 207}
@@ -13882,7 +13630,9 @@
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `StaticText`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nvar w, a, r, b, q;\nw = Window(\"Frequency Monitor\", Rect(200, Window.screenBounds.height - 200, 300, 150)).front;\n\na = StaticText(w, Rect(45, 10, 200, 20)).background_(Color.rand);\na.string = \" Current Frequency \";\n\nButton.new(w, Rect(45, 70, 200, 20)).states_([[\"close\", Color.black, Color.rand]]).action_({ w.close });\n\ns.waitForBoot({\n\n b = Bus.new(\\control, 0, 1);\n\n q = SynthDef(\\Docs_FreqMonitor, {\n var freq, snd;\n freq = LFNoise0.ar(2, 400, 650);\n snd = SinOsc.ar(freq, 0, 0.2);\n Out.ar(0, snd);\n Out.kr(b.index, freq); // output the frequency to a control bus\n }).play;\n\n r = Routine {\n {\n // Set the value of the StaticText to the value in the control bus.\n // Setting GUI values is asynchronous, so you must use .defer in the system clock.\n // Also you must check if the window is still open, since Routine will continue for at least\n // one step after you close the window.\n b.get({ |v|\n {\n if(w.isClosed.not) {\n a.string = \" Current Frequency: \" ++ v.round(0.01)\n }\n }.defer\n });\n\n 0.01.wait;\n }.loop\n\n }.play\n});\n\nCmdPeriod.doOnce({ w.close });\nw.onClose = { r.stop; q.free; b.free }; // clean up if the window closes\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/StaticText.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 581}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Stethoscope`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var f = { |l,h| SinOsc.kr(0.1, {pi.rand}).range(l, h) } ;\n Pulse.ar({ f.(20, 1000) }!6, { f.(0.0, 1) }!6, { f.(0.0, 1.0) }!6)\n}.play;\n);\n\nc = s.scope;\nc.numChannels = 6;\nc.scopeView.waveColors = [Color.red, Color.red, Color.cyan, Color.cyan, Color.white, Color.white];\nc.style = 2;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Stethoscope.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 195}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Synth`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\n// send a synth def to server\nSynthDef(\"tpulse\", { |out = 0, freq = 700, sawFreq = 440.0|\n Out.ar(out, SyncSaw.ar(freq, sawFreq, 0.1));\n}).add;\n);\n\n// Here the defaults for *new will result in a Synth at the head of the default group\n// of the default Server. This will use the SynthDef's default arguments;\ny = Synth.new(\"tpulse\");\ny.free;\n\n// The same done explicitly\ny = Synth.new(\"tpulse\", nil, s, \\addToHead);\ny.free;\n\n// With some arguments\ny = Synth.new(\"tpulse\", [\\freq, 350, \\sawFreq, 220]);\ny.free;\n\n// make a new synth\ny = Synth(\"tpulse\");\n\n// pause\ny.run(false);\n\ny.run(true);\n\n// set a control by argument name\ny.set(\"freq\", 200);\n\n// or by index\ny.set(2, 100.0);\n\n// modulate out to bus number 1 (the right speaker)\ny.set(0, 1);\n\n// multiple set commands in one message\ny.set(\"out\", 0, \"freq\", 300);\n\n// free the synth from the server\ny.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Synth.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 430}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `TChoose` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n SinOsc.ar,\n Saw.ar,\n Pulse.ar\n ];\n TChoose.ar(Dust.ar(MouseX.kr(1, 1000, 1)), a) * 0.2\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/TChoose.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 90}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `TIRand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-TIRand\", {\n var trig, outBus;\n trig = Dust.kr(10);\n outBus = TIRand.kr(0, 1, trig); // play on random channel between 0 and 1\n Out.ar(outBus, PinkNoise.ar(0.2))\n\n}).play;\n);\n\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TIRand.kr(4, 12, trig) * 100\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000, 1));\n SinOsc.ar(\n TIRand.ar(4, 12, trig) * 100\n ) * 0.1\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 240}
+{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `TWChoose` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n SinOsc.ar,\n Saw.ar,\n Pulse.ar\n ];\n TWChoose.ar(Dust.ar(MouseX.kr(1, 1000, 1)), a, [0.99, 0.05, 0.05].normalizeSum) * 0.2\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/TWChoose.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 114}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Tdef` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// load a synthdef\ns.boot;\nSynthDef(\"pdef_grainlet\",\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.3), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n\n\nTdef(\\z, Pseq([1, 1, 1, 0.5, 0.5], inf));\n\n(\nPset(\\instrument, \\pdef_grainlet,\n Ppar([\n Pbind(\n \\dur, Tdef(\\z),\n \\note, Pseq([1, 3, 2, 1, 0], inf),\n \\x, Pfunc { TempoClock.default.elapsedBeats.postln } // posts the onset times\n ),\n Pbind(\n \\dur, 4, // reference beat\n \\sustain, 0.1,\n \\note, 8\n )\n ])\n).play(quant: 1);\n);\n\n\nTdef(\\z, Prand([1, 1, 0.23, 0.5, 0.5], inf)); // exchange time pattern\nTdef(\\z, Pseq([1, 1, 1, 1], inf)); // pattern stays in sync.\nTdef(\\z, Pseq([1, 1, 1, 0.5, 0.5], inf)); // but might be in different order.\n // to avoid this, set quant to an appropriate value.\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Tdef.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 463}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Timer`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// using timer to modulate sine frequency: the slower the trigger is the higher the frequency\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 20, 1));\n SinOsc.ar(Timer.kr(trig) * 500 + 500, 0, 0.2)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Timer.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 117}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `UnaryOpUGen` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\na = WhiteNoise.ar; // a WhiteNoise\nb = a.squared; // a UnaryOpUGen.\nb.operator; // squared\n\n// sound example\n\n{ var a = LFSaw.ar(300).range(0, 2pi); a.sin * 0.1 }.play;\n\n// Plotting the \"abs\" unary operator (via the server):\n\n{ SinOsc.ar(300).abs }.plot\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/UnaryOpUGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 137}
@@ -13895,13 +13645,16 @@
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Ringz` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var in, chain;\n in = Ringz.ar(Impulse.ar([2, 3]), [700, 800], 0.1) * 5; // stereo input\n chain = FFT({ LocalBuf(2048) } ! 2, in); // array of two local buffers\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n IFFT(chain) // returns a stereo out\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/FFT-Overview.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 152}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `LFClipNoise` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nx = { var inA, chainA, chainB;\n inA = LFClipNoise.ar(100);\n chainA = FFT(LocalBuf(2048, 1), inA);\n chainB = PV_PhaseShift(chainA, pi);\n // half-circle phase shift should result in an inverse signal\n // in practice, ultra-low frequencies sneak through\n // but you won't hear very much here\n IFFT(chainA) + IFFT(chainB);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/FFT-Overview.schelp", "aug": "prologue:ugen", "prompt_tokens": 55, "answer_tokens": 168}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Mix`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var n;\n n = 8; // number of 'voices'\n Mix.new( // mix all stereo pairs down.\n Pan2.ar( // pan the voice to a stereo position\n CombL.ar( // a comb filter used as a string resonator\n Dust.ar( // random impulses as an excitation function\n // an array to cause expansion of Dust to n channels\n // 1 means one impulse per second on average\n Array.fill(n, 1),\n 0.3 // amplitude\n ),\n 0.01, // max delay time in seconds\n // array of different random lengths for each 'string'\n Array.fill(n, {0.004.rand+0.0003}),\n 4 // decay time in seconds\n ),\n Array.fill(n,{1.0.rand2}) // give each voice a different pan position\n )\n )\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Multichannel-Expansion.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 273}
+{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Ringz`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nx = { arg freq=1000; Ringz.ar(Crackle.ar(1.95, 0.1), freq, 0.05) }.play(s);\nx.set(\\freq, 1500);\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/NodeMessaging.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 77}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Saw`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n SynthDef(\\controlList, { |out = 0, freq = 440, amp = 0.1, detune = #[0.999, 1.001], gate = 1|\n var sig = Mix(Saw.ar(freq * (detune ++ [1]), amp)),\n env = EnvGen.kr(Env.adsr, gate, doneAction: Done.freeSelf);\n Out.ar(out, (sig * env) ! 2);\n }).add;\n\n SynthDescLib.global[\\controlList]\n )\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/NodeMessaging.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 188}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `SoundIn`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nvar server, numChannels;\nvar inputFile = SoundFile.openRead(ExampleFiles.child);\nnumChannels = inputFile.numChannels;\ninputFile.close; // doesn't need to stay open; we just need the stats\n\nserver = Server(\\nrt,\n options: ServerOptions.new\n .numOutputBusChannels_(numChannels)\n .numInputBusChannels_(numChannels)\n);\n\nx = Score([\n [0.0, ['/d_recv',\n SynthDef(\\fft, {\n // 'child' is a mono file, but this SynthDef works for any number of channels.\n var channels = (0..(numChannels-1));\n var in = SoundIn.ar(channels);\n var fft = FFT(LocalBuf(1024, 1), in);\n fft = PV_MagFreeze(fft, ToggleFF.kr(Dust.kr(12)));\n Out.ar(0, IFFT(fft))\n }).asBytes\n ]],\n [0.0, Synth.basicNew(\\fft, server).newMsg]\n]);\n\nx.recordNRT(\n outputFilePath: \"~/nrt.wav\".standardizePath,\n inputFilePath: inputFile.path,\n // make sure to use the same sample rate as the input file!\n sampleRate: inputFile.sampleRate,\n headerFormat: \"wav\",\n sampleFormat: \"int16\",\n options: server.options,\n duration: inputFile.duration\n);\n\nserver.remove;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Non-Realtime-Synthesis.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 505}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Routine` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// SynthDefs on the fly\ns.boot;\n(\nt = TempoClock.new;\nr = Routine.new({\n 10.do({\n // could be done with an argument instead of a new def, but proves the point\n SynthDef(\"help-EnvGen\" ++ i, { arg out = 0;\n Out.ar(\n out,\n EnvGen.kr(Env.perc, 1.0, doneAction: Done.freeSelf)\n * SinOsc.ar(100 + (100 * t.elapsedBeats), 0, 0.1)\n )\n }).play(s);\n 1.yield;\n });\n}).play(t); // Note the alternative syntax: Routine.play(aClock)\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Spawning.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 232}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `SoundIn` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\nu = Server(\\scau, NetAddr(\"127.0.0.1\", 9989)); // Change the port from 9989 to the right one for you\nu.serverRunning = true;\nu.ping(10); // Gives about 0.02 for me - confirms that communication is working\n// Now let's create a quick ring-modulator effect:\nz = { SoundIn.ar([0,1]) * SinOsc.ar(MouseX.kr(100, 1000)) }.play(u);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/SuperColliderAU.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 155}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `GVerb`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n// CAUTION: THE FOLLOWING CAN BE EXTREMELY LOUD\n// set the following variable to true if you want to run this code\nvar run = false;\nif (run) {\n { GVerb.ar(Dust.ar(5), SinOsc.kr(0.3).range(10, 14), drylevel:0) }.play\n}\n// 3.13 super loud glitch (crackling)! 3.14: super loud glitch (cleaner pitch shifting)!\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/UGen-Changelog.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 169}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Duty`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// this is useful when two UGens need to be called, but only one of their outputs is needed\n(\n{\n var a, b, c;\n a = Dseq([1, 2, 3, 4], inf).dpoll(\"a\");\n b = Dseq([1955, 1952, 1823, 1452], inf).dpoll(\"b\");\n c = (a a Pbind(\n \\dur, Prand([1, 0.5], inf),\n \\freq, Pwhite(200.0, 1000, inf),\n \\rate, Pdup(4, Prand([1, 3, 6, 10], inf)),\n \\dt, Pwhite(0.01, 0.1, inf)\n)\n);\n// modify the source in the meanwhile:\na[0] = { |freq = 440, dt=0.1, rate=2| Ringz.ar(Dust.ar(rate * 10.dup), freq, dt)*0.1 };\n\na.nodeMap.postln; // the values are not set in the node map.\na.clear(3);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Reference/NodeProxy_roles.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 294}
+{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `ReplaceOut` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n// define a control\nSynthDef(\"line\", { arg i_bus=10, i_start=1000, i_end=500, i_time=1;\n ReplaceOut.kr(i_bus, Line.kr(i_start, i_end, i_time, doneAction: Done.freeSelf));\n}).add\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Server_Tutorial.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 110}
{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Decay2` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_SPE7_BerlinB, { arg i_out=0, freq = 80, amp = 0.2, pan=0;\n var out, a, b;\n amp = Decay2.kr(Impulse.kr(0), 0.05, 8, amp);\n out = RLPF.ar(\n LFPulse.ar(freq, 0, SinOsc.kr(0.12,[0,0.5pi],0.48,0.5), amp),\n freq * SinOsc.kr(0.21,0,4,8),\n 0.07\n );\n #a, b = out;\n DetectSilence.ar(a, 0.0001, doneAction: Done.freeSelf);\n Out.ar(i_out, Mix.ar(PanAz.ar(4, [a, b], [pan, pan+1])));\n}).add;\n\nSynthDef(\\help_SPE7_CFString1, { arg i_out, freq = 360, gate = 1, pan, amp=0.1;\n var out, eg, fc, osc, a, b, w;\n fc = LinExp.kr(LFNoise1.kr(Rand(0.25,0.4)), -1,1,500,2000);\n osc = Mix.fill(8, { LFSaw.ar(freq * [Rand(0.99,1.01),Rand(0.99,1.01)], 0, amp) }).distort * 0.2;\n eg = EnvGen.kr(Env.asr(1,1,1), gate, doneAction: Done.freeSelf);\n out = eg * RLPF.ar(osc, fc, 0.1);\n #a, b = out;\n Out.ar(i_out, Mix.ar(PanAz.ar(4, [a, b], [pan, pan+0.3])));\n}).add;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Streams-Patterns-Events7.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 568}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `LPF`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1;\n var z;\n z = LPF.ar(\n Mix.new(VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3)),\n XLine.kr(Rand(4000,5000), Rand(2500,3200), 1)\n ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2);\n OffsetOut.ar(out, Pan2.ar(z, pan, amp));\n}, [\\ir]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/A-Practical-Guide/PG_03_What_Is_Pbind.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 207}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Pulse`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\harpsi, { |outbus = 0, freq = 440, amp = 0.1, gate = 1|\n var out;\n out = EnvGen.ar(Env.adsr, gate, doneAction: Done.freeSelf) * amp *\n Pulse.ar(freq, 0.25, 0.75);\n Out.ar(outbus, out ! 2);\n}).add; // see below for more on .add\n\np = Pbind(\n // Use \\harpsi, not \\default\n \\instrument, \\harpsi,\n \\degree, Pseries(0, 1, 8),\n \\dur, 0.25\n).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/A-Practical-Guide/PG_03_What_Is_Pbind.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 205}
@@ -13910,7 +13663,6 @@
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `RecordBuf`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.alloc(s, s.sampleRate * 5, 1); // a 5 second 1 channel Buffer\n\n// record for four seconds\n(\nx = SynthDef(\"tutorial-RecordBuf\",{ arg out=0,bufnum=0;\n var noise;\n noise = PinkNoise.ar(0.3); // record some PinkNoise\n RecordBuf.ar(noise, bufnum); // by default this loops\n}).play(s,[\\out, 0, \\bufnum, b]);\n);\n\n// free the record synth after a few seconds\nx.free;\n\n// play it back\n(\nSynthDef(\"tutorial-playback\",{ arg out=0,bufnum=0;\n var playbuf;\n playbuf = PlayBuf.ar(1,bufnum);\n FreeSelfWhenDone.kr(playbuf); // frees the synth when the PlayBuf has played through once\n Out.ar(out, playbuf);\n}).play(s,[\\out, 0, \\bufnum, b]);\n);\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Getting-Started/13-Buffers.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 337}
{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Resonz`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"noiseToPitch\", { arg out = 0, mul = 1;\n Out.ar(\n out,\n Resonz.ar(\n WhiteNoise.ar(mul),\n LFNoise0.kr(4, 110, 660),\n [0.005, 0.005]\n )\n )\n}).add;\n);\n\n(\n// activate left and right channels\nSynth(\"noiseToPitch\", [\\out, 0, \\mul, 1]);\nSynth(\"noiseToPitch\", [\\out, 1, \\mul, 1]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/14_Subtractive_synthesis.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 179}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Resonz` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// 1st, evaluate a synthdef\n(\nSynthDef(\"pitchFromNoise\", { arg out = 0;\n Out.ar(\n out,\n Resonz.ar(\n WhiteNoise.ar(15),\n LFNoise0.kr(2, 110, 660),\n 0.005\n )\n )\n}).add;\n);\n\n// 2nd, make 2 synths\n(\nSynth(\"ringModulation\");\nSynth(\"pitchFromNoise\", [\\out, 1]);\n);\n\n// 3rd, tell the server to list its nodes\n(\ns.queryAllNodes;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/15_Groups.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 192}
-{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `ReplaceOut` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// ... a reverb adapted from the \"01 Why SuperCollider document\" in the SC2 distribution\n(\nSynthDef(\"preDelay\", { arg inbus = 2;\n ReplaceOut.ar(\n 4,\n DelayN.ar(In.ar(inbus, 1), 0.048, 0.048)\n )\n}).add;\n\nSynthDef(\"combs\", {\n ReplaceOut.ar(\n 6,\n Mix.arFill(7, { CombL.ar(In.ar(4, 1), 0.1, LFNoise1.kr(Rand(0, 0.1), 0.04, 0.05), 15) })\n )\n}).add;\n\nSynthDef(\"allpass\", { arg gain = 0.2;\n var source;\n source = In.ar(6, 1);\n 4.do({ source = AllpassN.ar(source, 0.050, [Rand(0, 0.05), Rand(0, 0.05)], 1) });\n ReplaceOut.ar(\n 8,\n source * gain\n )\n}).add;\n\nSynthDef(\"theMixer\", { arg gain = 1;\n ReplaceOut.ar(\n 0,\n Mix.ar([In.ar(2, 1), In.ar(8, 2)]) * gain\n )\n}).add;\n);\n\n(\nSynth(\"fm1\", [\\bus, 2, \\freq, 440, \\carPartial, 1, \\modPartial, 1.99, \\mul, 0.071]);\nSynth(\"fm1\", [\\bus, 2, \\freq, 442, \\carPartial, 1, \\modPartial, 2.401, \\mul, 0.071]);\nSynth.tail(s, \"preDelay\");\nSynth.tail(s, \"combs\");\nSynth.tail(s, \"allpass\");\nSynth.tail(s, \"theMixer\", [\\gain, 0.64]);\n);\n\n(\ns.queryAllNodes;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/18_Frequency_modulation.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 587}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Resonz`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"pitchFromNoise\", { arg out = 0;\n Out.ar(\n out,\n Resonz.ar(\n WhiteNoise.ar(15),\n LFNoise0.kr(2, 110, 660),\n 0.005\n )\n )\n}).add;\n);\n\n\n(\nSynth(\"ringModulation\");\nSynth(\"pitchFromNoise\", [\\out, 1]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/11.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 136}
{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `BrownNoise`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// 以下のSynthDefは全て共通のコントロール名(mul)を持つ\n(\n// 3つのSynthDefとグループを作成する\nSynthDef(\"synthNumber1\", { arg mul = 0.2;\n Out.ar(\n 0,\n BrownNoise.ar(mul) * LFNoise0.kr([1, 1.01])\n )\n }, [0.1]).add;\nSynthDef(\"synthNumber2\", { arg mul = 0.2;\n Out.ar(\n 0,\n WhiteNoise.ar(mul) * LFNoise1.kr([2.99, 3])\n )\n }, [0.1]).add;\nSynthDef(\"synthNumber3\", { arg mul = 0.2;\n Out.ar(\n 0,\n PinkNoise.ar(mul) * LFNoise2.kr([0.79, 0.67])\n )\n}, [0.1]).add;\n);\n\n(\n// グループを作成する\n~myGroup = Group.new;\n);\n\n(\n// 3つのシンセを加える\nSynth.head(~myGroup, \"synthNumber1\");\nSynth.head(~myGroup, \"synthNumber2\");\nSynth.head(~myGroup, \"synthNumber3\");\n);\n\n// 3つのシンセのそれぞれの\\mulコントロール、新しい(そして同じ)値にセットする\n~myGroup.set(\\mul, 0.05)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/11.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 496}
{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `DelayN` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// これは(SC2の配布物の中の)\"01 Why SuperCollider document\"からのリバーブ\n(\nSynthDef(\"preDelay\", { arg inbus = 2;\n Out.ar(\n 4,\n DelayN.ar(In.ar(inbus, 1), 0.048, 0.048)\n )\n}).add;\n\nSynthDef(\"combs\", {\n Out.ar(\n 6,\n Mix.arFill(7, { CombL.ar(In.ar(4, 1), 0.1, LFNoise1.kr(Rand(0, 0.1), 0.04, 0.05), 15) })\n )\n}).add;\n\nSynthDef(\"allpass\", { arg gain = 0.2;\n var source;\n source = In.ar(6, 1);\n 4.do({ source = AllpassN.ar(source, 0.050, [Rand(0, 0.05), Rand(0, 0.05)], 1) });\n Out.ar(\n 8,\n source * gain\n )\n}).add;\n\nSynthDef(\"theMixer\", { arg gain = 1;\n Out.ar(\n 0,\n Mix.ar([In.ar(2, 1), In.ar(8, 2)]) * gain\n )\n}).add;\n);\n\n(\nSynth(\"fm1\", [\\bus, 2, \\freq, 440, \\carPartial, 1, \\modPartial, 1.99, \\mul, 0.071]);\nSynth(\"fm1\", [\\bus, 2, \\freq, 442, \\carPartial, 1, \\modPartial, 2.401, \\mul, 0.071]);\nSynth.tail(s, \"preDelay\");\nSynth.tail(s, \"combs\");\nSynth.tail(s, \"allpass\");\nSynth.tail(s, \"theMixer\", [\\gain, 0.64]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/14.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 572}
@@ -13924,9 +13676,16 @@
{"conversations": [{"role": "user", "content": "What is the difference between the language and the server?"}, {"role": "assistant", "content": "sclang runs your code, the clock and Patterns, and builds UGen graphs. scsynth performs the DSP in real time. They communicate over OSC, which is why a language-side mistake can leave a sound running, and why s.freeAll stops it."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 29, "answer_tokens": 84}
{"conversations": [{"role": "user", "content": "How do I stop all sound?"}, {"role": "assistant", "content": "s.freeAll stops every node on the server. On the language side, Ndef.clear and Pdef.clear clear the proxies. If a Pattern is still running, Pdef(\\name).stop does it; CmdPeriod immediately stops everything scheduled on the default clock."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 26, "answer_tokens": 88}
{"conversations": [{"role": "user", "content": "How do I set the tempo?"}, {"role": "assistant", "content": "TempoClock.default.tempo = 120/60; the argument is beats per second, so 120 BPM is 2.0. Patterns scheduled on the default clock then follow it."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 25, "answer_tokens": 59}
-{"conversations": [{"role": "user", "content": "What model are you?"}, {"role": "assistant", "content": "I am sc-mind: a 198M MiniMind-3-MoE, eight layers, 768 wide, four experts with top-1 routing. I was trained from scratch on the SuperCollider documentation, class library and help pages, then fine-tuned on questions and answers about them."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 22, "answer_tokens": 87}
-{"conversations": [{"role": "user", "content": "Who made you?"}, {"role": "assistant", "content": "I was trained by the person who runs this project, on top of the MiniMind architecture. My weights started from random numbers and learned from the SuperCollider sources — no teacher model, no distillation."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 21, "answer_tokens": 60}
{"conversations": [{"role": "user", "content": "Are you an AI?"}, {"role": "assistant", "content": "Yes. I am a small language model specialised in SuperCollider. I generate text; I cannot hear audio, run sclang, or check whether a patch sounds the way you want."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 22, "answer_tokens": 50}
{"conversations": [{"role": "user", "content": "What can you do?"}, {"role": "assistant", "content": "Write and explain SuperCollider: SynthDefs, UGens, Patterns, Ndef, buses and envelopes, and tell you why a patch is silent or will not compile. I am 198M parameters, so I am narrow on purpose."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 22, "answer_tokens": 71}
-{"conversations": [{"role": "user", "content": "How big are you?"}, {"role": "assistant", "content": "198M parameters in total, 64M active per token because the feed-forward layers are a mixture of four experts with top-1 routing. That is small enough to train in minutes on one GPU."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 62}
{"conversations": [{"role": "user", "content": "What are you not good at?"}, {"role": "assistant", "content": "Everything outside SuperCollider. I have no audio input, no live data, and my knowledge ends at the documentation snapshot I was trained on — so I can be confidently wrong about Quarks and new UGens."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 24, "answer_tokens": 67}
+{"conversations": [{"role": "user", "content": "What is your name?"}, {"role": "assistant", "content": "sc-mind. I am the 198M MiniMind-3-MoE this repository trains on SuperCollider source and help text."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 22, "answer_tokens": 41}
+{"conversations": [{"role": "user", "content": "What model are you?"}, {"role": "assistant", "content": "I am sc-mind, a 198M-parameter MiniMind-3-MoE with 64M active per token: 768 wide, 8 layers, four experts with top-1 routing, a 6,400-token vocabulary, trained from scratch on SuperCollider."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 22, "answer_tokens": 87}
+{"conversations": [{"role": "user", "content": "Are you ChatGPT?"}, {"role": "assistant", "content": "No. I am sc-mind, a 198M SuperCollider model trained from scratch on the language's own source and documentation. I am not a general assistant and I do not have a general model behind me."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 25, "answer_tokens": 54}
+{"conversations": [{"role": "user", "content": "Are you a general assistant?"}, {"role": "assistant", "content": "No. I am sc-mind, a 198M model trained on SuperCollider. Ask me about SynthDefs, UGens, Patterns, Ndef, sclang and scsynth; outside that I have little to offer."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 68}
+{"conversations": [{"role": "user", "content": "Who made you?"}, {"role": "assistant", "content": "I am sc-mind, trained by this repository from a six-source SuperCollider corpus and a supervised set whose code answers were compiled with sclang before they were written."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 21, "answer_tokens": 56}
+{"conversations": [{"role": "user", "content": "What can you help with?"}, {"role": "assistant", "content": "SuperCollider. I can write a SynthDef or a Pbind, explain a class or a UGen, read a patch back, and diagnose one that fails to compile. That is the whole of my training."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 61}
+{"conversations": [{"role": "user", "content": "How big are you?"}, {"role": "assistant", "content": "198.42M parameters in total, 63.94M active per token. Eight layers, 768 wide, four experts with top-1 routing, and a 6,400-token vocabulary."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 63}
+{"conversations": [{"role": "user", "content": "What were you trained on?"}, {"role": "assistant", "content": "The official SuperCollider tree, 321 Quarks, sccode.org, scsynth.org, sc3-plugins and this project's own sessions: 25.8M tokens, then 6,000 supervised rows whose code answers all compile."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 24, "answer_tokens": 76}
+{"conversations": [{"role": "user", "content": "Do you know other programming languages?"}, {"role": "assistant", "content": "Only as far as SuperCollider needs them. I am sc-mind, a 198M model trained on SuperCollider; I can read its sclang syntax and explain it, and that is the limit of what I was trained to do."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 24, "answer_tokens": 66}
+{"conversations": [{"role": "user", "content": "What should I ask you?"}, {"role": "assistant", "content": "SuperCollider questions: how a UGen works, how to write a SynthDef or a Pattern, why a patch does not compile. I am sc-mind, a 198M domain model, not a general assistant."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 61}