conversations
listlengths
2
6
[ { "role": "user", "content": "What does `RedMixerChannel.eqHi` do?" }, { "role": "assistant", "content": "Activate channel equalizer high band (0=off, 1=on). Also" } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Ball`." }, { "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}...
[ { "role": "user", "content": "Write a Pbind whose degrees repeat every Prand cycle. (scale majorPentatonic, seq Prand, dur 0.4, octave 5, instr sine, root 0)" }, { "role": "assistant", "content": "`Pbind` sequences an Event per beat, and `\\degree` + `\\scale` does the pitch:\n\n```supercollider...
[ { "role": "user", "content": "Write a kick at amp 0.8 with a click. (osc fm, sweep 0.06, decay 0.12, f0 150, f1 48, amp 0.8, rev 1)" }, { "role": "assistant", "content": "The pitch envelope is what makes it read as a drum, not the oscillator:\n\n```supercollider\n// kick drum: fm oscillator, 0.0...
[ { "role": "user", "content": "Write a random pentatonic melody that plays by itself." }, { "role": "assistant", "content": "Pick degrees from a pentatonic scale; `\\scale` and `\\root` define the pitch space, and `\\degree`\npicks within it.\n\n```supercollider\n(\nPbind(\n \\instrument, \\de...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nfork {\n { SinOsc.ar(440 ! 2) * Line.kr(0, 1, 5, doneAction: Done.freeSelf) }.play.waitForFree;\n { PinkNoise.ar(1) * Line.kr(1, 0, 2, doneAction: Done.freeSelf) }.play....
[ { "role": "user", "content": "What is `Rational` in SuperCollider?" }, { "role": "assistant", "content": "Rational — Rational number A rational number. Alternative syntax: `x %/ y` Category: Math." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// won't work (the output is 0.5*0.0), which is why we need the DC UGen!\n{ 0.5 }.play\n\n// constantly zero\n{ DC.ar(0.0) }.play;\n\n\n// DC offset; will click on start and fini...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Dbrown`." }, { "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 SinO...
[ { "role": "user", "content": "What does `EnvelopeView.value` do? What arguments does it take?" }, { "role": "assistant", "content": "`value` retrieves the node positions, returning an array in the format of the Argument below. `value_(anArray)` Sets the positions of the nodes, creating them if n...
[ { "role": "user", "content": "What are the arguments of PlayBuf.ar?" }, { "role": "assistant", "content": "`PlayBuf.ar(numChannels, bufnum, rate, trigger, startPos, loop)`. numChannels must match what is in the buffer, or you get a channel mismatch; bufnum is the Buffer's integer number; rate is...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Lorenz2DC.ar(8800, 16000) }.play(s);\n\n// randomly modulate params\n(\n{ Lorenz2DC.ar(\n 110, 22050,\n LFNoise2.kr(1, 2, 10),\n 20,\n LFNoise2.kr(1, 1.5, 2),\n 0.01\n) * ...
[ { "role": "user", "content": "How do I put a bell in a reverb at mix 0.45? (verb gverb, room 0.5, damp 0.5, mix 0.45, source bell)" }, { "role": "assistant", "content": "`FreeVerb` is in the core library; the room and damp arguments do the work:\n\n```supercollider\n// reverb: gverb on a bell\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": "Write a minimal SuperCollider example that uses `BufSampleRate`." }, { "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 samp...
[ { "role": "user", "content": "Explain `RedAbstractMix` in SuperCollider briefly." }, { "role": "assistant", "content": "RedAbstractMix — abstract class Category: Red > redMix." } ]
[ { "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 = 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...
[ { "role": "user", "content": "What does Lag do?" }, { "role": "assistant", "content": "`Lag.ar(in, lagTime)` and `Lag.kr(in, lagTime)` smooth a signal with an exponential lag towards its target, which removes the clicks and zipper noise a stepped control would produce. Lag.kr on a mouse or MIDI ...
[ { "role": "user", "content": "How do I build a live drone with Ndef at 110 Hz? (ugens saw, cutoff 400, lfo 0.3, freq 110, amp 0.12)" }, { "role": "assistant", "content": "`Ndef` holds the synth and the environment, so you can edit it live:\n\n```supercollider\n// Ndef drone: saw source through a...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `TWChoose`." }, { "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]...
[ { "role": "user", "content": "Write a kick drum with a 0.18 s decay." }, { "role": "assistant", "content": "Start with a swept sine, then shorten the decay to taste:\n\n```supercollider\n// kick drum: sine oscillator, 0.06 s pitch sweep\n(\nSynthDef(\\kick_synth, { |out = 0, amp = 0.6|\n var ...
[ { "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...
[ { "role": "user", "content": "What is `Method` in SuperCollider?" }, { "role": "assistant", "content": "Method — Code that implements an operation upon instances of a Class. A Method is code that is a part of the set of operations upon instances of a Class. Category: Core > Kernel." } ]
[ { "role": "user", "content": "What is `LevelIndicator` in SuperCollider?" }, { "role": "assistant", "content": "LevelIndicator — a level indicator GUI widget A level indicator view, suitable for use as a level or peak meter, etc. Category: GUI > Views." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-LFNoise2\", { arg out=0;\n Out.ar(out,\n LFBrownNoise2.ar(1000, 1, MouseX.kr(0, 5), 0.25)\n )\n}).play;\n);\n\n//use as frequency control\n(\nSynthDef(\"h...
[ { "role": "user", "content": "Explain this code:\n```supercollider\nx = { |freq = 440, amp = 0.2| SinOsc.ar(freq) * amp }.play;\nx.set(\\freq, 660);\n```" }, { "role": "assistant", "content": "Starts an anonymous synth with two controls, then changes one of them while it plays.\n\nThe `|freq = 4...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ TwoPole.ar(WhiteNoise.ar(0.005), 2000, 0.95) }.play\n\n{ TwoPole.ar(WhiteNoise.ar(0.005), XLine.kr(800, 8000, 8), 0.95) }.play\n\n{ TwoPole.ar(WhiteNoise.ar(0.005), MouseX.kr(8...
[ { "role": "user", "content": "How do I pan notes around the stereo field in a pattern?" }, { "role": "assistant", "content": "Put `\\pan` in the Pbind: the default instrument understands it and passes it to Pan2.\n\n```supercollider\n(\nPbind(\n \\scale, Scale.minorPentatonic,\n \\degree, ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\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(SinO...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `SinOscFB`." }, { "role": "assistant", "content": "```supercollider\n{ SinOscFB.ar(440, MouseX.kr(0, 4))*0.1 }.play\n\n\n{ SinOscFB.ar(MouseY.kr(10, 1000, 'exponential'), MouseX.kr(0.5pi, pi))*0.1 }.play\n\n\n{ SinOscF...
[ { "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...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// It might also be desirable to start with a fade from silence.\n// This can be done with a negative initOutOffset:\n\n(\nx = {\n var lfo = XLine.ar(1, 0.5, 60);\n DXMix.ar(\n Dseq([0, 4, 1, 5, 2, 6, 3, 7], inf),\n ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nSynthDef(\"help-PrintVal\",{PrintVal.kr(SinOsc.kr(440,0,0.1), 100)}).play\n\n\n//two at once\n(\nSynthDef(\"help-PrintVal\",{\n\nPrintVal.kr(SinOsc.kr(440,0,0.1), 100, 1);\n\nPri...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Diwhite`." }, { "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 SinOs...
[ { "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 =...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\n// connect a MIDI device, allNotesOff with CmdPeriod useful\n\nMIDIClient.init;\nm = MIDIOut(0);\ng = { 16.do({ |i| m.allNotesOff(i) }) };\nCmdPeriod.add(g); \n\n\np = Pbind(\n \\type, \\midi,\n \\midiout, m, \n ...
[ { "role": "user", "content": "Write a SuperCollider patch for sound of an alien weapon firing. Start by defining the values the patch depends on." }, { "role": "assistant", "content": "```supercollider\n(\nSynthDef(\"raygun\", {arg amp = 0.5, sinfreq = 1000, glissf = 0.001, att = 0.01, rel = 0.9...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `BufDur`." }, { "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```"...
[ { "role": "user", "content": "How do I use a metronome or check my timing?" }, { "role": "assistant", "content": "A click on the clock you are using, plus a counter to see where you are in the bar:\n\n```supercollider\n(\nTdef(\\click, {\n var count = 0;\n loop {\n (Synth(\\hat, [\\...
[ { "role": "user", "content": "What is `IdentityBag`?" }, { "role": "assistant", "content": "IdentityBag — A Bag according to identity" }, { "role": "user", "content": "What does `IdentityBag.add` do?" }, { "role": "assistant", "content": "Add anObject to the Bag. A Bag ma...
[ { "role": "user", "content": "Build a slowly evolving drone with Ndef." }, { "role": "assistant", "content": "Ndef gives you a named patch you can redefine while it plays; the filter is a separate node in the\nchain so you can change it on its own.\n\n```supercollider\n(\nNdef(\\drone, { |freq =...
[ { "role": "user", "content": "What is `Rand` in SuperCollider?" }, { "role": "assistant", "content": "Rand — Single random number generator. Generates a single random float value in uniform distribution from `lo` to `hi` . It generates this when the SynthDef first starts playing, and remains fix...
[ { "role": "user", "content": "Explain this code:\n```supercollider\n{ Pan2.ar(SinOsc.ar(440) * 0.2, SinOsc.kr(0.1)) }.play;\n```" }, { "role": "assistant", "content": "A sine that slowly moves between the speakers.\n\n`SinOsc.kr(0.1)` is a control-rate sine at 0.1 Hz — one cycle every 10 seconds...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Rand`." }, { "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)...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Amplitude`." }, { "role": "assistant", "content": "```supercollider\n(\n{\n // LFSaw begins at 0, illustrates attack time better\n var sig = LFSaw.ar(440);\n var amps = Amplitude.ar(\n sig,\n attackTime: [0.0...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\ns.boot;\n\n// excitation signal is WhiteNoise, triggered twice a second with varying OnePole coef\n(\n { Pluck.ar(WhiteNoise.ar(0.1), Impulse.kr(2), 440.reciprocal, 440.reciprocal, 10,\n coef: MouseX.kr(-0.999, 0.999)...
[ { "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": "Explain `ContiguousBlockAllocator` in SuperCollider briefly." }, { "role": "assistant", "content": "ContiguousBlockAllocator — for better handling of dynamic allocation The default allocator used in servers to allocate bus numbers and buffer numbers. Compared to its...
[ { "role": "user", "content": "What is `EaseOutInBack` in SuperCollider?" }, { "role": "assistant", "content": "EaseOutInBack — Back ease-out/in Easing equation for a back (overshooting cubic easing: (a+1)*t^3 - a*t^2) ease-out/in, decelerating until halfway, then accelerating. The a parameter co...
[ { "role": "user", "content": "What does `PPulseCount.new` do? What arguments does it take?" }, { "role": "assistant", "content": "UGenPatterns quark library Arguments: pattern; reset." } ]
[ { "role": "user", "content": "Write a SuperCollider patch that uses `PackFFT` and actually plays. Assume nothing about the session." }, { "role": "assistant", "content": "```supercollider\n// Reminder: This isn't the intended typical usage! It's OK to do this though.\n(\nx = {\n var mags, phase...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{Formants.ar(100, Vowel([\\e, \\o], [\\bass])) * 0.1 }.play\n{Formants.ar(100, Vowel(\\e, [\\bass,\\alto])) * 0.1 }.play\n{Formants.ar(100, Vowel([\\e, \\o], [\\bass,\\alto]) * 0...
[ { "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 frame...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// use input amplitude to control Pulse amplitude - use headphones to prevent feedback.\n{ Pulse.ar(90, 0.3, Amplitude.kr(SoundIn.ar(0)) }.play;\n```" }, { "role": "assis...
[ { "role": "user", "content": "What is `CondVar`?" }, { "role": "assistant", "content": "CondVar — Condition variable: block one or more threads until some condition is true" }, { "role": "user", "content": "What does `CondVar.wait` do?" }, { "role": "assistant", "content"...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LinSelectX`." }, { "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}...
[ { "role": "user", "content": "How do I play a random majorPentatonic scale at octave 6? (scale majorPentatonic, seq Pshuf, dur 0.3, octave 6, instr sine, root 0)" }, { "role": "assistant", "content": "Put the scale and the degree pattern in the `Pbind` and it will pick notes for you:\n\n```super...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Pan2`." }, { "role": "assistant", "content": "```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 mo...
[ { "role": "user", "content": "Explain `LorenzTrig` in SuperCollider briefly." }, { "role": "assistant", "content": "LorenzTrig — lorenz chaotic trigger generator `x' = s(y - x)` Category: UGens > Generators > Stochastic." } ]
[ { "role": "user", "content": "Write a SuperCollider patch that uses `FOS` and actually plays. Assume nothing about the session." }, { "role": "assistant", "content": "```supercollider\n(\n// same as OnePole\n{ var x;\n x = LFTri.ar(0.4, 0, 0.99);\n FOS.ar(LFSaw.ar(200, 0, 0.2), 1 - x.abs, 0.0...
[ { "role": "user", "content": "How do I make an additive bell with Klank?" }, { "role": "assistant", "content": "Klank is a bank of resonant filters excited by a short impulse: you describe the partials as\nfrequencies, amplitudes and decay times.\n\n```supercollider\n(\nSynthDef(\\klank, { |out ...
[ { "role": "user", "content": "What are the arguments of PlayBuf.ar?" }, { "role": "assistant", "content": "`PlayBuf.ar(numChannels, bufnum, rate, trigger, startPos, loop)`. numChannels must match what is in the buffer, or you get a channel mismatch; bufnum is the Buffer's integer number; rate is...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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;\...
[ { "role": "user", "content": "Write a GrainBuf synth at 16 grains per second. (rate 16, dur 0.07, interp 4, mode sweep, rev 1)" }, { "role": "assistant", "content": "`GrainBuf` needs a buffer, a trigger and a grain duration:\n\n```supercollider\n// granular synth with GrainBuf\n(\ns.waitForBoot ...
[ { "role": "user", "content": "Give me a saw kick with a 0.06 s pitch sweep. (osc saw, sweep 0.06, decay 0.12, f0 220, f1 40, amp 0.6, rev 1)" }, { "role": "assistant", "content": "Start with a swept sine, then shorten the decay to taste:\n\n```supercollider\n// kick drum: saw oscillator, 0.06 s ...
[ { "role": "user", "content": "What does `UChain.gui` do? What arguments does it take?" }, { "role": "assistant", "content": "Create a Arguments: parent — A view; bounds — A Rect. Returns: UChaiGUI" } ]
[ { "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....
[ { "role": "user", "content": "What is `CutFXSwap1` in SuperCollider?" }, { "role": "assistant", "content": "CutFXSwap1 — adds and removes random effects in a BBCut2 CutFXSwap1 randomly adds and removes instances of CutBRF1, CutBPF1, CutMod1, CutBit1, CutComb1, CutRev1 to the CutGroup it is in. E...
[ { "role": "user", "content": "My Synth runs but I hear nothing. How do I debug it?" }, { "role": "assistant", "content": "Check in this order, because each step eliminates a whole class of causes:\n\n1. **Is anything coming out of the bus you write to?** `Out.ar(0, sig)` for the master. A typo l...
[ { "role": "user", "content": "How do I granulate a sample with 0.2 s grains? (rate 20, dur 0.2, interp 2, mode noise, rev 0)" }, { "role": "assistant", "content": "Granulation is `GrainBuf` plus a trigger rate; the position can move:\n\n```supercollider\n// granular synth with GrainBuf\n(\ns.wai...
[ { "role": "user", "content": "What is `RedDifferentialManchesterCode` in SuperCollider?" }, { "role": "assistant", "content": "RedDifferentialManchesterCode — Differential manchester encoding Also known as biphase mark code (BMC). See http://en.wikipedia.org/wiki/Differential_Manchester_encoding...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LinExp`." }, { "role": "assistant", "content": "```supercollider\n// compare:\n(\n{\n var mod = SinOsc.kr(Line.kr(1, 10, 10));\n SinOsc.ar(mod * 400 + 500) * 0.1\n}.play;\n);\n\n(\n{\n var mod = SinOsc.kr(Line.kr(1...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nSynthDef(\"mini\",{\n Out.ar( 0,\n Instr.ar(\"minimoog.two\", SinOsc.kr(1.0).range(300,500) )\n )\n}).send(s;\n```" }, { "role": "assistant", "content": "A closi...
[ { "role": "user", "content": "Give me an Ndef with an LFO at 0.3 Hz. (ugens sine, cutoff 400, lfo 0.3, freq 165, amp 0.12)" }, { "role": "assistant", "content": "`Ndef` is a named proxy you can redefine while it is playing:\n\n```supercollider\n// Ndef drone: sine source through a 400 Hz low-pas...
[ { "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": "What is a UGen?" }, { "role": "assistant", "content": "A UGen is a unit generator: the primitive signal-processing node of the server. SinOsc, Saw, WhiteNoise, LPF and EnvGen are UGens, and they are wired into a graph inside a SynthDef." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `OnePole`." }, { "role": "assistant", "content": "```supercollider\n{ OnePole.ar(WhiteNoise.ar(0.5), 0.95) }.play\n\n{ OnePole.ar(WhiteNoise.ar(0.5), -0.95) }.play\n\n{ OnePole.ar(WhiteNoise.ar(0.5), Line.kr(-0.99, 0.9...
[ { "role": "user", "content": "How do I granulate a sample with 0.1 s grains? (rate 6, dur 0.1, interp 2, mode noise, rev 1)" }, { "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...
[ { "role": "user", "content": "How do I pan notes around the stereo field in a pattern?" }, { "role": "assistant", "content": "Put `\\pan` in the Pbind: the default instrument understands it and passes it to Pan2.\n\n```supercollider\n(\nPbind(\n \\scale, Scale.minorPentatonic,\n \\degree, ...
[ { "role": "user", "content": "Write a Pbind whose degrees repeat every Pseq cycle. (scale minorPentatonic, seq Pseq, dur 0.4, octave 4, 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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// default params\n{ QuadL.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 blip, cutoff 400, lfo 0.3, freq 82.5, amp 0.12)" }, { "role": "assistant", "content": "Use `Ndef` when the patch has to change without stopping:\n\n```supercollider\n// Ndef drone: blip 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\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 resul...
[ { "role": "user", "content": "Show another SuperCollider example using `RunningSum`." }, { "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}.p...
[ { "role": "user", "content": "How do I build a live drone with Ndef at 110 Hz? (ugens blip, cutoff 1400, lfo 0.8, freq 110, amp 0.12)" }, { "role": "assistant", "content": "`Ndef` holds the synth and the environment, so you can edit it live:\n\n```supercollider\n// Ndef drone: blip source throug...
[ { "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 Digita...
[ { "role": "user", "content": "What does `KeyCodeResponder.put` do? What arguments does it take?" }, { "role": "assistant", "content": "register responder functions for keycode and modifier combinations Arguments: address; val." } ]
[ { "role": "user", "content": "What does `AbstractVector.clip` do? What arguments does it take?" }, { "role": "assistant", "content": "Clips a vector in all Arguments: min — The minimum. ARGUMENT: max The maximum. `RealVector[10,-4,2].clip(-2,5);`." } ]
[ { "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": "user", "content": "Write a minimal SuperCollider example that uses `FSinOsc`." }, { "role": "assistant", "content": "```supercollider\n{ FSinOsc.ar(800) * 0.2 }.play;\n\n{ FSinOsc.ar(XLine.kr(200, 4000, 1)) * 0.2 }.play;\n\n// loses amplitude towards the end\n{ FSinOsc.ar(FSinOsc.ar(X...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// vary frequency\n{ StandardL.ar(MouseX.kr(20, SampleRate.ir)) * 0.3 }.play(s;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthe...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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 exter...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `HilbertFIR`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\ns.scope;\na = { HilbertFIR.ar(SinOsc.ar(100) * -20.dbamp, LocalBuf(2048)) }.play;\na.release;\n```" } ]
[ { "role": "user", "content": "What are the arguments of PlayBuf.ar?" }, { "role": "assistant", "content": "`PlayBuf.ar(numChannels, bufnum, rate, trigger, startPos, loop)`. numChannels must match what is in the buffer, or you get a channel mismatch; bufnum is the Buffer's integer number; rate is...
[ { "role": "user", "content": "Explain `ArrayBuffer` in SuperCollider briefly." }, { "role": "assistant", "content": "ArrayBuffer — given an array, will allocate and fill a Buffer for use in Patch etc Passes an array into a Patch for use in UGens which need an array supplied as a buffer index. If...
[ { "role": "user", "content": "What is `LTI` in SuperCollider?" }, { "role": "assistant", "content": "LTI — Linear Time Invariant General Filter Equation General Linear Time-Invariant (LTI) filter UGen where you specify any coefficient set via a Buffer Represents the general LTI filter difference...
[ { "role": "user", "content": "Explain this code:\n```supercollider\nMix.ar([SinOsc.ar(220, 0, 0.1), SinOsc.ar(330, 0, 0.1)])\n```" }, { "role": "assistant", "content": "Sums two sine waves into one signal — a perfect fifth, 220 Hz and 330 Hz, at 0.1 amplitude each.\n\n`[SinOsc.ar(220, 0, 0.1), S...
[ { "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 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,...
[ { "role": "user", "content": "What does `KeyCodeResponder.maskToString` do? What arguments does it take?" }, { "role": "assistant", "content": "register responder functions for keycode and modifier combinations Arguments: m." } ]