conversations
listlengths
2
6
[ { "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...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// example; this buffer is mono, so the number of samples matches the number of frames\nb = Buffer.read(s, ExampleFiles.child);\n\n// indexing with a phasor\n{ BufRd.ar(1, b, Phasor.ar(0, BufRateScale.kr(b), 0, BufSamples...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LatoocarfianN`." }, { "role": "assistant", "content": "```supercollider\n// default initial params\n{ LatoocarfianN.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }.play(s);\n```" } ]
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\n// Function to check an array for repetitions within a maximum test span\n\n~repetitionCheck = { |array, maxTestSpan|\n maxTestSpan.do { |i|\n var result = (array.drop(i+1) - array).drop((i+1).neg).includes(0).not;...
[ { "role": "user", "content": "Give me a complete SuperCollider patch for Will nobody switch the damn thing off?: bind everything it needs before it is used." }, { "role": "assistant", "content": "```supercollider\n(\n\n{\nvar dseq, trig;\n\ndseq = Dseq([SinOsc.ar(45).range(-5, 12), SinOsc.ar(Sin...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\np = Pbind(\n \\instrument, \\synth_1a,\n \\preAmp, PL(\\preAmp), \n \\amp, PL(\\amp), \n \\midinote, PLseq(\\seq) + PL(\\seqAdd), \n \\dur, 0.2\n);\n\nq = Pbindf(p, \\midinote, PLseq(\\seq));\n\nv = VarG...
[ { "role": "user", "content": "What is `Object`?" }, { "role": "assistant", "content": "Object — abstract superclass of all objects" }, { "role": "user", "content": "What does `Object.readArchive` do?" }, { "role": "assistant", "content": "Read in an object from a text arc...
[ { "role": "user", "content": "Explain `OrderedIdentitySet` in SuperCollider briefly." }, { "role": "assistant", "content": "OrderedIdentitySet — a set according to identity An OrderedIdentitySet is a collection of objects, no two of which are the same object (aka. \"identical\"). Most of its met...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Hasher`." }, { "role": "assistant", "content": "```supercollider\n{ Hasher.ar(Line.ar(0, 1, 1), 0.2) }.play;\n\n// Even adding a small amount to the input can result in a very different output. Compare these two examp...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LFTri`." }, { "role": "assistant", "content": "```supercollider\n// plot:\n{ LFTri.ar(40) }.plot(0.1);\n{ LFTri.ar(XLine.kr(1, 800, 0.1)) }.plot(0.1);\n\n{ LFTri.ar(500, 0, 0.1) }.play\n\n// used as both Oscillator an...
[ { "role": "user", "content": "Write a GrainBuf synth at 16 grains per second. (rate 16, dur 0.1, interp 4, mode sweep, rev 1)" }, { "role": "assistant", "content": "A working granular patch, with the buffer loaded before the synth starts:\n\n```supercollider\n// granular synth with GrainBuf\n(\n...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ SinOsc.ar(SinOsc.ar(0.3).exprange(440, 6600), 0, 0.5 * 0.1 }.play;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened ...
[ { "role": "user", "content": "Write a SuperCollider patch that uses `Pan2` and actually plays. Assume nothing about the session." }, { "role": "assistant", "content": "```supercollider\ng = Group.new;\n\n// make 4 synths in g\n// 1.0.rand2 returns a random number from -1 to 1.\n4.do({ { arg amp ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\na = ProxySynthDef(\"xtest\", { SinOsc.ar(400) * 0.1 });\n\na.add;\n\nx = Synth(\"xtest\");\nx.release;\n\n\n/*\n\n if the resulting number of channels is larger than a given cha...
[ { "role": "user", "content": "How do I play a sample from disk?" }, { "role": "assistant", "content": "Load it into a Buffer on the server, then play the buffer. `BufRateScale` keeps the pitch right when\nthe file's sample rate differs from the server's.\n\n```supercollider\n(\ns.waitForBoot {\n...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n var freq;\n\n freq = StreamKrDur(\n Pbrown(40,100,100,inf),\n `[ 1,2, 0.25], // an array\n 0.05);\n\n Tempo.bpm = 100; // times are in beats\n Patch...
[ { "role": "user", "content": "Write a SuperCollider patch for batuhan's buzzer parametrized that runs as it is, with nothing assumed about the session." }, { "role": "assistant", "content": "```supercollider\n// A beautiful sc140 tweet by Batuhan Bozkurt, parametrized for real-time changes\n(\n/...
[ { "role": "user", "content": "How do I play a random minorPentatonic scale at octave 6? (scale minorPentatonic, seq Prand, dur 0.3, octave 6, instr fm, root 0)" }, { "role": "assistant", "content": "The pattern is the composition here; `\\strum` spreads the chord:\n\n```supercollider\n(\nSynthDe...
[ { "role": "user", "content": "How do I add reverb with FreeVerb?" }, { "role": "assistant", "content": "`FreeVerb.ar(in, mix, room, damp)` — mix 0..1 is dry/wet, room 0..1 is the size (0.5 is a small room, 0.9 is a hall), damp 0..1 rolls off the high end of the tail. Put it after your sound: `Fr...
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// put can be used with the array indexing syntax:\na = NodeProxy.new.play;\na[0] = { SinOsc.ar(Rand(200, 899)) * 0.1.dup };\na[2] = { SinOsc.ar(Rand(200, 899)) * 0.1.dup };\na.sources.do(_.postcs);\n// using multiple index ex...
[ { "role": "user", "content": "What is `Server`?" }, { "role": "assistant", "content": "Server — Object representing a server application" }, { "role": "user", "content": "What does `Server.new` do?" }, { "role": "assistant", "content": "Create a new Server instance." },...
[ { "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 ?? { SynthDe...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Duty`." }, { "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, 5...
[ { "role": "user", "content": "How do I make a kick that starts at 180 Hz and falls to 48 Hz? (osc fm, sweep 0.06, decay 0.18, f0 180, f1 48, amp 0.6, rev 0)" }, { "role": "assistant", "content": "A kick is a sine with a fast pitch drop and a short amplitude envelope:\n\n```supercollider\n// kick...
[ { "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...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// vary frequency\n{ LorenzL.ar(MouseX.kr(20, SampleRate.ir)) * 0.3 }.play(s;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesi...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `HPZ1`." }, { "role": "assistant", "content": "```supercollider\n// Compare:\n\n{ WhiteNoise.ar(0.25) }.play;\n\n{ HPZ1.ar(WhiteNoise.ar(0.25)) }.play;\n\n// HPZ1 is useful to detect changes in a signal:\n// see also H...
[ { "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*Maths.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": ...
[ { "role": "user", "content": "Give me a granular patch with noise grain position and interp 2. (rate 20, dur 0.2, interp 2, mode noise, rev 1)" }, { "role": "assistant", "content": "Granulation is `GrainBuf` plus a trigger rate; the position can move:\n\n```supercollider\n// granular synth with ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Normalizer`." }, { "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 ...
[ { "role": "user", "content": "What is `PV_Add` in SuperCollider?" }, { "role": "assistant", "content": "PV_Add — Complex addition. Complex addition: Category: UGens > FFT." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `RandID`." }, { "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 WhiteNoi...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ MoogLadder.ar(Mix(LFSaw.ar([120, 180], 0, 0.33)), LinExp.kr(LFCub.kr(0.1, 0.5*pi), -1, 1, 180, 8500), 0.75.dup }.play\n```" }, { "role": "assistant", "content": "A ...
[ { "role": "user", "content": "What is `Array2D` in SuperCollider?" }, { "role": "assistant", "content": "Array2D — two-dimensional array Represents a two-dimensional array of data. The number of rows and columns is fixed. Category: Collections > Ordered." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `PulseDivider`." }, { "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 = Sin...
[ { "role": "user", "content": "Write a kick whose tail uses freeverb2. (verb freeverb2, room 0.7, damp 0.2, mix 0.3, source kick)" }, { "role": "assistant", "content": "Put the reverb inside the `SynthDef` so it is part of the voice:\n\n```supercollider\n// reverb: freeverb2 on a kick\n(\nSynthDe...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `NRand`." }, { "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, doneActi...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// define two Pbinds of same length, play first\n\n// data sharing with rhythms of coinciding entry points is sure as streams are time-shifted\n\n(\np = PmonoPar([\n [\n \\dur, Prand([1, 1, 2]/3, inf).collect(~dur = _...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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```" }, { "role": ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LastValue`." }, { "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,...
[ { "role": "user", "content": "Explain `PV_MagAbove` in SuperCollider briefly." }, { "role": "assistant", "content": "PV_MagAbove — Pass bins above a threshold. Passes only bins whose magnitude is above a threshold. Category: UGens > FFT." } ]
[ { "role": "user", "content": "Write a granular texture, dry. (rate 20, dur 0.15, interp 2, mode sweep, rev 0)" }, { "role": "assistant", "content": "`GrainBuf` needs a buffer, a trigger and a grain duration:\n\n```supercollider\n// granular synth with GrainBuf\n(\ns.waitForBoot {\n var buf = ...
[ { "role": "user", "content": "What does `MIDIFuncChanArrayMessageMatcher.value` do? What arguments does it take?" }, { "role": "assistant", "content": "Check to see if a message matches, and evaluate func if it Arguments: value — The message value (e.g. velocity, etc.) of the MIDI message as an ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// modulate frequency\n{ Blip.ar(XLine.kr(20000, 200, 6), 100, 0.2) }.play;\n\n// modulate numharmonics\n{ Blip.ar(200, Line.kr(1, 100, 20), 0.2 }.play;\n```" }, { "role"...
[ { "role": "user", "content": "Can you listen to the sound you generate?" }, { "role": "assistant", "content": "No. I am 198M parameters trained on SuperCollider's documentation and class library; I have no audio input and no way to hear a result. What I can do is reason about the code: whether i...
[ { "role": "user", "content": "What does `FoaTransform.ar` do? What arguments does it take?" }, { "role": "assistant", "content": "First Order Ambisonic (FOA) transformer Arguments: in — The input signal, an array: [in0, in1, ... inN]; kind — The kind of transform to apply.; ... args — Arguments ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Recorder`." }, { "role": "assistant", "content": "```supercollider\n(\n{ SinOsc.ar(\n SinOsc.ar(\n XLine.kr(1, 100, 5)).exprange(*XLine.kr([20, 800], [7000, 200], 10)\n )\n ) * 0.1\n\n}.play;\ns.record(durati...
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// playing two interval lines in parallel\n\n(\n~a = Pseq([4, 2, 0]) + [0, -5];\n~b = Pseq([7, 5, 4]) + [0, 5];\n \np = Pbind(\n \\dur, Pseq([0.4, 0.2, 0.2], inf),\n \\note, PLn(\\a)\n);\n \nq = Pbindf(p, \\note, PLn(\...
[ { "role": "user", "content": "What does `Sieve.>!` do? What arguments does it take?" }, { "role": "assistant", "content": "Binary operator for Arguments: lo — Integer.." } ]
[ { "role": "user", "content": "Write a Pbind whose degrees repeat every Pseq cycle. (scale minorPentatonic, seq Pseq, dur 0.25, octave 5, instr fm, root 0)" }, { "role": "assistant", "content": "`Pbind` sequences an Event per beat, and `\\degree` + `\\scale` does the pitch:\n\n```supercollider\n(...
[ { "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)...
[ { "role": "user", "content": "What is `HoaDominate` in SuperCollider?" }, { "role": "assistant", "content": "HoaDominate — Higher Order Ambisonic (HOA) dominance transformer Apply dominance to a Higher Order Ambisonic signal (HOA) along an arbitrary axis & radius. Category: Libraries > Ambisonic...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `TRand`." }, { "role": "assistant", "content": "```supercollider\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TRand.kr(300, 3000, trig)\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000...
[ { "role": "user", "content": "What is `SendPeakRMS`?" }, { "role": "assistant", "content": "SendPeakRMS — Track peak and power of a signal for GUI applications." }, { "role": "user", "content": "What does `SendPeakRMS.ar` do?" }, { "role": "assistant", "content": "Unlike ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagSquared`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSquared\", { |out = 0, bufnum ...
[ { "role": "user", "content": "How do I play a random majorPentatonic scale at octave 5? (scale majorPentatonic, seq Pseq, dur 0.2, octave 5, instr fm, root 0)" }, { "role": "assistant", "content": "The pattern is the composition here; `\\strum` spreads the chord:\n\n```supercollider\n(\nSynthDef...
[ { "role": "user", "content": "Explain `PMouseY` in SuperCollider briefly." }, { "role": "assistant", "content": "PMouseY — UGenPatterns quark library Based on MouseY Category: Streams-Patterns-Events > UGenPatterns > Generators." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Impulse.ar(4, [0, MouseX.kr(0, 1)], 0.2 }.play;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never cl...
[ { "role": "user", "content": "What is the difference between TempoClock and SystemClock?" }, { "role": "assistant", "content": "SystemClock runs in real time and is what `.wait` uses by default. TempoClock runs in beats and has a tempo, so it can be changed while things are playing and Patterns ...
[ { "role": "user", "content": "Explain `NTube` in SuperCollider briefly." }, { "role": "assistant", "content": "NTube — physical modeling simulation; N tubes Physical model; N tube sections with N-1 scattering junctions inbetween; relative areas determine k for each junction, where each junction ...
[ { "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 ch...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Impulse`." }, { "role": "assistant", "content": "```supercollider\n{ Impulse.ar(800, 0.0, 0.5, 0) }.play\n\n{ Impulse.ar(XLine.kr(800, 100, 5), 0.0, 0.5, 0) }.play\n```" } ]
[ { "role": "user", "content": "What does `PV_ChainUGen.pvcalc` do? What arguments does it take?" }, { "role": "assistant", "content": "pvcalc applies a function to the frequency-domain data of an FFT chain. See #-pvcollect below for discussion of efficiency considerations. See also #-pvcalc2 belo...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// hear the difference, LinPan having a slight drop in the middle...\n{ LinPan2.ar(SinOsc.ar(440), Line.kr(-1, 1, 5)) }.play\n\n// ... whereas Pan2 is more smooth\n{ Pan2.ar(SinOsc.ar(440), Line.kr(-1, 1, 5)) }.play\n\n//...
[ { "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 = N...
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\ns.boot;\n(\n{\n SinOsc.ar([225, 450, 900], 0, 0.2)\n + LPF.ar(\n LFPulse.ar(226 * [1, 2, 5], [0, 0.1, 0.1], 0.2, 0.2),\n MouseX.kr(20, 10000, 1)\n )\n}.scope;\n);\n\n// server.scope only changes the ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dbrown2(0, 15, 1, [1, 4], 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...
[ { "role": "user", "content": "What does `MIDIdef.cc` do?" }, { "role": "assistant", "content": "A convenience method to create a new MIDIdef which responds to MIDI control messages. See #*new for argument Returns: An instance of MIDIdef which responds to MIDI control messages." } ]
[ { "role": "user", "content": "What is `FixNumChannelsPlayer` in SuperCollider?" }, { "role": "assistant", "content": "FixNumChannelsPlayer — a utility Player that wraps another player with NumChannels Ensure that a player is stereo (or mono or whatever you like) by wrapping it in this. Category:...
[ { "role": "user", "content": "Explain `CutRev1` in SuperCollider briefly." }, { "role": "assistant", "content": "CutRev1 — BBCut2 reverb CutRev1 adds a ring modulator effect to BBCut2 Category: Libraries > BBCut > Cut FX." } ]
[ { "role": "user", "content": "What does `Instr.explicitSpecs` do?" }, { "role": "assistant", "content": "those that were declared when creating the Instr, as opposed to those that were not supplied and were guessed by using the" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// default params\n{ QuadC.ar(SampleRate.ir/4) * 0.2 }.play(s;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlie...
[ { "role": "user", "content": "Give me an Ndef with an LFO at 0.3 Hz. (ugens sine, cutoff 400, lfo 0.3, freq 110, amp 0.12)" }, { "role": "assistant", "content": "Use `Ndef` when the patch has to change without stopping:\n\n```supercollider\n// Ndef drone: sine source through a 400 Hz low-pass\n(...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n SinOsc.ar(\n RunningMax.ar(Dust.ar(20), Impulse.ar(0.4)) * 500 + 200,\n 0, 0.2\n )\n\n}.play;\n);\n\n// follow a sine lfo, reset rate controlled by mouse x\n(\...
[ { "role": "user", "content": "Show another SuperCollider example using `ControlRate`." }, { "role": "assistant", "content": "```supercollider\n{ SinOsc.ar(ControlRate.ir) * 0.1 }.play;\n```" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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```" }, { "role": "ass...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var env = Env([0.0, 0.5, 0.0, 1.0, 0.9, 0.0], [0.05, 0.1, 0.01, 1.0, 1.5], -4);\n var envgen = EnvGen.ar(env, doneAction: Done.freeSelf);\n env.plot;\n SinOsc.ar(\n ...
[ { "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 accidentall...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// needs Buffer c prepared above\n\n(\ny = {\n var add = LFDNoise3.ar(0.3) * [0.05, 0.0505];\n GFIS.ar(\n { |x| BufRd.ar(1, c, c.numFrames * (x + add)) }, \n (LFDNoise3.a...
[ { "role": "user", "content": "How do I make a piece reproducible instead of a different take every time?" }, { "role": "assistant", "content": "Three things make a SuperCollider piece repeatable: a fixed seed, a fixed tempo, and no live input.\n\n```supercollider\n(\nthisThread.randSeed = 1234;\...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n Instr(\\helpTempoPlayer,{\n Impulse.ar( Tempo.kr )\n });\n\n Patch(\\helpTempoPlayer).play(atTime:1)\n;\nTempo.bpm = 100;\n\nTempo.bpm = 180;\n```" }, { "role":...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `BufFrames`." }, { "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;...
[ { "role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n//spinning box / cube\n//after Shiffman https://codingtrain.github.io/website-archive/CodingChallenges/112-3d-rendering.html\n\n(\nvar width= 640, height= 480, w,\ntheta= 0, speed= 0.01, box;\n\nw= RedWindow(\"3Dbox\", Rect(1...
[ { "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 Spri...
[ { "role": "user", "content": "What is `PSVop_o` in SuperCollider?" }, { "role": "assistant", "content": "PSVop_o — Sieve pattern for arbitrary set operations of integer generators with offsets and point output Pattern for arbitrary set operations of integer generators with offsets and point outp...
[ { "role": "user", "content": "Explain `FoaProximity` in SuperCollider briefly." }, { "role": "assistant", "content": "FoaProximity — First Order Ambisonic (FOA) proximity effect filter Apply proximity filtering to a First Order Ambisonic signal (B-format). Category: Libraries > Ambisonic Toolkit...
[ { "role": "user", "content": "Explain `BufDur` in SuperCollider briefly." }, { "role": "assistant", "content": "BufDur — Current duration of soundfile in buffer. Get the current duration of soundfile. Category: UGens > Buffer > Info." } ]
[ { "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, a...
[ { "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*Maths.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...
[ { "role": "user", "content": "What is the difference between .ar, .kr and .ir?" }, { "role": "assistant", "content": "The rate method decides how often a UGen is evaluated. `.ar` runs at the audio rate, once per sample, and produces an audio signal. `.kr` runs at the control rate, once per block...
[ { "role": "user", "content": "Write a GrainBuf synth at 6 grains per second. (rate 6, dur 0.1, interp 4, mode sweep, rev 0)" }, { "role": "assistant", "content": "A working granular patch, with the buffer loaded before the synth starts:\n\n```supercollider\n// granular synth with GrainBuf\n(\ns....
[ { "role": "user", "content": "Write an Ndef at 82.5 Hz I can retune while it plays. (ugens saw, cutoff 3200, lfo 0.3, freq 82.5, amp 0.12)" }, { "role": "assistant", "content": "`Ndef` is a named proxy you can redefine while it is playing:\n\n```supercollider\n// Ndef drone: saw source through a...
[ { "role": "user", "content": "What is `SystemSynthDefs`?" }, { "role": "assistant", "content": "SystemSynthDefs — SynthDefs assumed to exist on the server" }, { "role": "user", "content": "What does `SystemSynthDefs.numChannels` do?" }, { "role": "assistant", "content": "...
[ { "role": "user", "content": "What is `Buffer`?" }, { "role": "assistant", "content": "Buffer — Client-side representation of a buffer on a server" }, { "role": "user", "content": "What does `Buffer.alloc` do?" }, { "role": "assistant", "content": "Create and return a Buf...
[ { "role": "user", "content": "What does `Tuning.ratios` do?" }, { "role": "assistant", "content": "Returns a tuned array of ratios for the pitch" } ]
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// play SinOscs silently and wait for granulation envelopes\n\n(\na = Bus.audio(s, 10);\nx = { Splay.ar(In.ar(a, 10) * SinOsc.ar((3..12) * 100, 0, 0.05)) }.play\n);\n\n// send envelope to buses in parallel\n\n(\nz = {\n DXE...
[ { "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 wi...
[ { "role": "user", "content": "What does `TempoClock.etempo` do?" }, { "role": "assistant", "content": "Sets or gets the current tempo at the current elapsed" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// create a window for a given Ndef\nNdef(\\sound).edit\n(\nNdef(\\sound, { |freq = 440, rate = 2|\n SinOsc.ar(freq * [1, 1.625]) * SinOsc.kr(rate).max(0) * 0.2\n}).play;\n);\n\...
[ { "role": "user", "content": "Write a snare drum in SuperCollider." }, { "role": "assistant", "content": "Two ingredients: a short tonal body and band-passed noise for the rattle.\n\n```supercollider\n(\nSynthDef(\\snare, { |out = 0, amp = 0.6|\n var env = EnvGen.kr(Env.perc(0.001, 0.18, 1, -...