conversations
listlengths
2
6
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nx = { SinOsc.ar((Line.kr(0, 10, 10).snap(1, 0.3, 1) + 60).poll.midicps, 0, -24.dbamp }.play\n```" }, { "role": "assistant", "content": "A closing bracket is ...
[ { "role": "user", "content": "What does `BezierSpline.controlPoints` do?" }, { "role": "assistant", "content": "set the controlPoints, which is an array of arrays of control" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// randomly modulate params\n(\n{ FBSineN.ar(\n LFNoise2.kr(1, 1e4, 1e4),\n LFNoise2.kr(1, 32, 33),\n LFNoise2.kr(1, 0.5),\n LFNoise2.kr(1, 0.05, 1.05),\n LFNoise2.kr(1, 0.3...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// randomly modulate all params\n(\n{ LatoocarfianC.ar(\n SampleRate.ir/4,\n LFNoise2.kr(2, 1.5, 1.5),\n LFNoise2.kr(2, 1.5, 1.5),\n LFNoise2.kr(2, 0.5, 1.5),\n LFNoise2.kr(...
[ { "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...
[ { "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,...
[ { "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": "Write a minimal SuperCollider example that uses `FreqScope`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\n// create a new analyzer\nFreqScope.new(400, 200, 0, server: s);\n\n// basic sine\n{ SinOsc.ar(2000, 0, 0.25) }.play(s);\n\n// random saw...
[ { "role": "user", "content": "What is `EaseInOutQuad` in SuperCollider?" }, { "role": "assistant", "content": "EaseInOutQuad — Quadratic ease-in/out Easing equation for a quadratic (t^2) ease-in/out, accelerating until halfway, then decelerating. Category: Ease." } ]
[ { "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": "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": "Write a minimal SuperCollider example that uses `Archive`." }, { "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[\\favo...
[ { "role": "user", "content": "Explain `ExpRand` in SuperCollider briefly." }, { "role": "assistant", "content": "ExpRand — Exponential single random number generator. Generates a single random float value in an exponential distributions from `lo` to `hi` . It generates this when the SynthDef fir...
[ { "role": "user", "content": "What is `NoteOnBank` in SuperCollider?" }, { "role": "assistant", "content": "NoteOnBank — a set of named MIDI note responders Category: External Control > MIDI, Libraries > crucial > MIDI." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// default params\n{ QuadN.ar(SampleRate.ir/4) * 0.2 }.play(s;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlie...
[ { "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 =...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// same as above, but we use a NetAddr with a port of nil, so we can receive from a specific host, but from any port\n\nn = NetAddr(\"127.0.0.1\", nil); // the url should be the one of computer of app 2\no = OSCresponderN...
[ { "role": "user", "content": "Write a self-contained SuperCollider patch that uses `WrapIndex`. Define every value it uses." }, { "role": "assistant", "content": "```supercollider\n// indexing into a table\n(\n{\n var buf = LocalBuf.newFrom([200, 300, 400, 500, 600, 800]);\n var freq = WrapInd...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nv = Vowel()\nv.addFormants([3000,4000], -6, [200, 200])\n\n{Formants.ar(100, v) * 0.1 }.play\n{Formants.ar(100, Vowel()) * 0.1}.play\n \n{[Formants.ar(100, Vowel()) * 0.1, For...
[ { "role": "user", "content": "What does `ToggleButton.init` do? What arguments does it take?" }, { "role": "assistant", "content": "simple two state button Arguments: layout; init; title; minWidth; minHeight; onc; offc." } ]
[ { "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 t...
[ { "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, levelSca...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// This SynthDef has a harder attack than the default, illustrating rearticulation more clearly.\n(\nSynthDef(\\sawpulse, { |out, freq = 440, gate = 0.5, plfofreq = 6, mw = 0, ffreq = 2000, rq = 0.3, freqlag = 0.05, amp =...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `In`." }, { "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...
[ { "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 inT...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nx = {\n SinOsc.ar([0.1, 0.2], 0).poll * 0.1\n}.play;\n;\nx.trace; // By tracing the Synth you can see the two Poll units we created\nx.free\n```" }, { "role": "assist...
[ { "role": "user", "content": "How do I play a random majorPentatonic scale at octave 5? (scale majorPentatonic, seq Pshuf, dur 0.25, octave 5, instr pluck, root 0)" }, { "role": "assistant", "content": "`Pbind` sequences an Event per beat, and `\\degree` + `\\scale` does the pitch:\n\n```superco...
[ { "role": "user", "content": "What is `UnaryOpUGen`?" }, { "role": "assistant", "content": "UnaryOpUGen — Apply a unary operation to the values of an input ugen" }, { "role": "user", "content": "What does `UnaryOpUGen.new` do?" }, { "role": "assistant", "content": "return...
[ { "role": "user", "content": "What does `MxChannelApp.at` do? What arguments does it take?" }, { "role": "assistant", "content": "get the unit by slot Arguments: i — slot number. Returns: an MxUnitApp" } ]
[ { "role": "user", "content": "What does `PatternProxy.envir` do?" }, { "role": "assistant", "content": "provide a default environment for the proxy. If given, it is used as an environment for the routine function. When set for the first time, the routine pattern is" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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/...
[ { "role": "user", "content": "How do I granulate a sample with 0.1 s grains? (rate 16, dur 0.1, interp 2, mode noise, 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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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-form...
[ { "role": "user", "content": "What does `Thread.deferAwayFrom` do? What arguments does it take?" }, { "role": "assistant", "content": "Executes a given function, guaranteeing that it will not execute on the same thread as `this`. That Arguments: func — The function to evaluate. It will not be pa...
[ { "role": "user", "content": "Write a GrainBuf synth at 28 grains per second. (rate 28, dur 0.2, interp 4, mode sweep, 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.wa...
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// implicitly, the composition operator <> returns a Pchain when applied to a pattern.\n// so that a <> b creates a Pchain (a, b).\n// as seen above, in Pchain(a, b), a specifies (and overrides) b: b is the input to a.\n\n// t...
[ { "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, 0, 1, MouseButton.kr(lag:0.001))[0]), 0, 0.1}.play\n```" }, { "role": "assistant", "content": "A closing b...
[ { "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],[tim...
[ { "role": "user", "content": "What is `AbstractServerAction`?" }, { "role": "assistant", "content": "AbstractServerAction — register actions to be taken for a server" }, { "role": "user", "content": "What does `AbstractServerAction.functionSelector` do?" }, { "role": "assista...
[ { "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 = D...
[ { "role": "user", "content": "My sustained synth never stops, even when I set the gate to 0." }, { "role": "assistant", "content": "A sustained EnvGen only releases when the gate goes from positive to non-positive *after* the envelope has started, and the Synth only disappears if that EnvGen has...
[ { "role": "user", "content": "Show another SuperCollider example using `MIDIFreqPlayer`." }, { "role": "assistant", "content": "```supercollider\n/*\n( // PlayerBinop not yet implemented\n\nPatch(\\monosynth,[\n BeatClockPlayer.new(16) * MIDIGatePlayer.new,\n MIDIFreqPlayer.new,\n CCPlayer(50...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Dstutter`." }, { "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...
[ { "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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nx = { SinOsc.ar(440, 0, 0.3) }.asDefName; // this must complete first\ny = Synth(x;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the pare...
[ { "role": "user", "content": "Give me a fm kick with a 0.06 s pitch sweep. (osc fm, sweep 0.06, decay 0.12, f0 150, f1 55, amp 0.6, rev 0)" }, { "role": "assistant", "content": "The pitch envelope is what makes it read as a drum, not the oscillator:\n\n```supercollider\n// kick drum: fm oscillat...
[ { "role": "user", "content": "What does `PlayerSocket.lastPlayer` do?" }, { "role": "assistant", "content": "a player that can play other players using a cross-faded and fuse-protected socket" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ SinOsc.ar(BrownNoise.ar(100, 200) * 0.1 }.play;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never cl...
[ { "role": "user", "content": "What does `SoundFileView.scrollPos` do?" }, { "role": "assistant", "content": "The scrolling position of the view, as a fraction of the total scrolling range. The total scrolling range is `totalDuration - Returns: A Float in the range of 0.0 to 1.0." } ]
[ { "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": "What does `SplayZ.ar` do? What arguments does it take?" }, { "role": "assistant", "content": "Spreads an array of channels across a ring of channels Arguments: numChans; inArray; spread; level; width; center; orientation; levelComp." } ]
[ { "role": "user", "content": "What does `Collection.asPairs` do? What arguments does it take?" }, { "role": "assistant", "content": "Answer an array with alternating key value pairs, like `[\\freq, 1848, \\amp, 0.2]`. This is part of the Key-Value-Pairs Arguments: class — The class of the collec...
[ { "role": "user", "content": "Write a complete SuperCollider patch built around `Ringz` that runs as it is." }, { "role": "assistant", "content": "```supercollider\na = NodeProxy(s);\na[0] = { |freq = 440, dt=0.1, rate=2| Ringz.ar(Impulse.ar(rate * [1, 1.2]), freq, dt)*0.1 };\na.play;\n(\na[1] =...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// modulate frequency\n{ Pulse .ar(XLine.kr(40,4000,6),0.1, 0.2) }.play;\n{ PulseDPW.ar(XLine.kr(40,4000,6),0.1, 0.2) }.play;\n\n// two band limited square waves thru a resonant low pass filter\n{ RLPF.ar(Pulse .ar([1...
[ { "role": "user", "content": "Give me an Ndef with an LFO at 0.3 Hz. (ugens blip, cutoff 800, lfo 0.3, freq 110, amp 0.12)" }, { "role": "assistant", "content": "`Ndef` is a named proxy you can redefine while it is playing:\n\n```supercollider\n// Ndef drone: blip source through a 800 Hz low-pas...
[ { "role": "user", "content": "Why does every UGen have mul and add arguments?" }, { "role": "assistant", "content": "They are a convenience applied to the UGen's output: the result is `ugens_result * mul + add`. So `SinOsc.ar(440, 0, 0.2)` is the same as `SinOsc.ar(440) * 0.2`, and `SinOsc.ar(44...
[ { "role": "user", "content": "What is `BLowPass`?" }, { "role": "assistant", "content": "BLowPass — 12db/oct rolloff - 2nd order resonant Low Pass Filter" }, { "role": "user", "content": "What does `BLowPass.sc` do?" }, { "role": "assistant", "content": "calculate filter ...
[ { "role": "user", "content": "What does `EnvelopedPlayer.env` do?" }, { "role": "assistant", "content": "takes a Player as input and plays it through an Env with fused protection" } ]
[ { "role": "user", "content": "What does `MxUnitApp.>>` do? What arguments does it take?" }, { "role": "assistant", "content": "Connect the default out of this unit to \"that\". `u >> Arguments: that — an inlet, a channel fader." } ]
[ { "role": "user", "content": "How do I see what a signal is doing?" }, { "role": "assistant", "content": "`.poll` prints values to the post window — `SinOsc.kr(1).poll` prints once per control block, and `.poll(10)` limits it to every 10th. `s.scope` opens an oscilloscope on the main output, and...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `BPF`." }, { "role": "assistant", "content": "```supercollider\n{ BPF.ar(Saw.ar(200, 0.5), FSinOsc.kr(XLine.kr(0.7, 300, 20), 0, 3600, 4000), 0.3) }.play;\n\n{ BPF.ar(Saw.ar(200, 0.5), MouseX.kr(100, 10000, 1), 0.3) }....
[ { "role": "user", "content": "Write a SuperCollider patch for We all could use a little more that runs as it is, with nothing assumed about the session." }, { "role": "assistant", "content": "```supercollider\n(\nSynthDef(\\cowbell, {\n | out=0, amp=0.3, gate=1, fund_freq=540, pan=0.0 |\n ...
[ { "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": "What does `EventPatternProxy.isPlaying` do?" }, { "role": "assistant", "content": "returns true if Pdef is running. if a Pdef is playing and its stream ends, it will schedule a stream for playing as soon as a new one is assigned to" } ]
[ { "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 (...
[ { "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\", { ...
[ { "role": "user", "content": "What is `ClientOnTrigResponder` in SuperCollider?" }, { "role": "assistant", "content": "ClientOnTrigResponder — a helper object used by Instr to implement { }.onTrig inside of Instr functions Category: Libraries > crucial > Instr." } ]
[ { "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\", { ...
[ { "role": "user", "content": "What does `PopUpTreeMenu.tree` do?" }, { "role": "assistant", "content": "Dictionary of dictionaries. Branches terminate if they have an empty dictionary as a value (=" } ]
[ { "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": "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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ LorenzTrig.ar(11025, 44100) }.play(s);\n\n// randomly modulate params\n(\n{ LorenzTrig.ar(\n 11025, 44100,\n LFNoise0.kr(1, 2, 10),\n 20,\n LFNoise0.kr(1, 1.5, 2),\n 0.02\...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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...
[ { "role": "user", "content": "How should I check an answer you give me?" }, { "role": "assistant", "content": "Three quick checks, cheapest first. Does it evaluate without a syntax error — the post window points at the exact character. Does the node appear in `s.plotTree` — if yes, the problem i...
[ { "role": "user", "content": "How do I put a bell in a reverb at mix 0.45? (verb gverb, room 0.7, damp 0.2, 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 is `ControlSpec`?" }, { "role": "assistant", "content": "ControlSpec — numerical input specification" }, { "role": "user", "content": "What does `ControlSpec.map` do?" }, { "role": "assistant", "content": "Maps and constrains a value bet...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Unpack1FFT`." }, { "role": "assistant", "content": "```supercollider\n// Let's extract the DC component - i.e. the magnitude at binindex zero.\n(\n{\n var sig, chain, stream, windowStarts, demand;\n var fftsize = 10...
[ { "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 `Dxrand`." }, { "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;...
[ { "role": "user", "content": "Explain `ObjectInsp` in SuperCollider briefly." }, { "role": "assistant", "content": "ObjectInsp — displays all the variables and internals of an object for debugging purposes This is the (somewhat private) implementation class that displays an object's innards when...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LFDNoise3`." }, { "role": "assistant", "content": "```supercollider\n// try wiggling mouse quickly:\n// LFNoise2 overshoots when going from high to low freqs, LFDNoise changes smoothly.\n\n{ SinOsc.ar(LFNoise2.ar(Mou...
[ { "role": "user", "content": "How do I add a reverb send to a whole group?" }, { "role": "assistant", "content": "Same shape as the delay: a private stereo bus, one effect reading it, instruments writing both dry\nand wet.\n\n```supercollider\n(\n~verbBus = Bus.audio(s, 2);\nSynthDef(\\verb, { |...
[ { "role": "user", "content": "Explain `PTDelay` in SuperCollider briefly." }, { "role": "assistant", "content": "PTDelay — UGenPatterns quark library Based on TDelay Category: Streams-Patterns-Events > UGenPatterns > Modifiers." } ]
[ { "role": "user", "content": "What does `FoaDecoderKernel.newCIPIC` do? What arguments does it take?" }, { "role": "assistant", "content": "Measured HRTF decoder, with measurements from the University of California Davis' linkhttp://interface.cipic.ucdavis.edu/sound/hrtf.html##CIPIC HRTF databas...
[ { "role": "user", "content": "Write a GrainBuf synth at 28 grains per second. (rate 28, dur 0.07, interp 4, 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.w...
[ { "role": "user", "content": "What does `Latoocarfian2DL.ar` do? What arguments does it take?" }, { "role": "assistant", "content": "latoocarfian 2D chaotic generator Arguments: minfreq, maxfreq — iteration frequency in Hertz; a, b, c, d — equation variables; x0 — initial value of x; y0 — initia...
[ { "role": "user", "content": "Write a Pbind whose degrees repeat every Pseq cycle. (scale minorPentatonic, seq Pseq, dur 0.2, octave 6, instr sine, 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 an Ndef with a sine source and a 800 Hz low-pass. (ugens sine, cutoff 800, lfo 0.8, freq 110, 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...
[ { "role": "user", "content": "What is `HairCell` in SuperCollider?" }, { "role": "assistant", "content": "HairCell — Simple cochlear hair cell model Simple hair cell model. Greater size input (positive values only, ie only in one direction as in real inner hair cells) opens the ion channels more...
[ { "role": "user", "content": "Write a SuperCollider patch that uses `SpecFlatness` and actually plays. Assume nothing about the session." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\n(\n{ // Example - vary mixture of white noise and pure tone with the mouse\n var in, chain...
[ { "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....
[ { "role": "user", "content": "How do I build a live drone with Ndef at 220 Hz? (ugens tri, cutoff 2400, lfo 0.3, freq 220, amp 0.12)" }, { "role": "assistant", "content": "Use `Ndef` when the patch has to change without stopping:\n\n```supercollider\n// Ndef drone: tri source through a 2400 Hz l...
[ { "role": "user", "content": "What does `QPenPrinter.pageRect` do?" }, { "role": "assistant", "content": "Get the page bounds, which is the printable area and usually smaller than #-paperRect due to Returns: a Rect" } ]
[ { "role": "user", "content": "I get 'Message not understood' on a nil variable." }, { "role": "assistant", "content": "`~buffer` (or any variable) was never assigned, or it was assigned in a different environment. Environment variables are per-environment: a `~buf` set in one server-side file bl...
[ { "role": "user", "content": "Write a SuperCollider patch for We all could use a little more that runs as it is, with nothing assumed about the session." }, { "role": "assistant", "content": "```supercollider\n(\nSynthDef(\\cowbell, {\n | out=0, amp=0.3, gate=1, fund_freq=540, pan=0.0 |\n ...
[ { "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// 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{ Buf...
[ { "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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-GaussTrig\", { arg out=0;\n Out.ar(out,\n Ringz.ar(\n WhiteNoise.ar(\n Decay.kr(\n GaussTrig.kr(10.dup, MouseX.kr(0, 0.9), 0.5),\n ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Standard2DC.ar(220, 11025, mul:0.3) }.play(s);\n\n// mouse-controlled param\n{ Standard2DC.ar(8000, 20000, MouseX.kr(0.9,4), mul:0.3) }.play(s);\n\n// as a frequency control\n{...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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)/n...