conversations
listlengths
2
6
[ { "role": "user", "content": "What are the arguments of EnvGen?" }, { "role": "assistant", "content": "`EnvGen.ar(envelope, gate, levelScale, levelBias, timeScale, doneAction)` — or the .kr form. Envelope is an Env; gate is the signal that holds the envelope open (a number for a one-shot, a trig...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Formant`." }, { "role": "assistant", "content": "```supercollider\n// modulate fundamental frequency, formant freq stays constant\n{ Formant.ar(XLine.kr(400, 1000, 8), 2000, 800, 0.125) }.play\n\n// modulate formant f...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\ns = Server.local;\nServer.default = s;\ns.boot;\n);\n\n\n// definition for future reference in arbitrary Environments,\n// Cauchy distribution is not bounded, so do clip !\n\n(\np = Pbind(\n \\midinote, PLcauchy(\\m...
[ { "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": "Write a minimal SuperCollider example that uses `LinPan2`." }, { "role": "assistant", "content": "```supercollider\n// hear the difference, LinPan having a slight drop in the middle (yeah, it's subtle)...\n{ LinPan2.ar(SinOsc.ar(440), Line.kr(-1, 1, 5)) }.play;\n\n/...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Dust2`." }, { "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(o...
[ { "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 bell whose tail uses freeverb2." }, { "role": "assistant", "content": "Put the reverb inside the `SynthDef` so it is part of the voice:\n\n```supercollider\n// reverb: freeverb2 on a bell\n(\nSynthDef(\\reverb_synth, { |out = 0, freq = 330, amp = 0.2|\n v...
[ { "role": "user", "content": "What is `Platform` in SuperCollider?" }, { "role": "assistant", "content": "Platform — handle cross-platform differencies The Platform class (along with its subclasses) handles things which differ between operating systems (mac/linux/windows/...), to simplify cross-...
[ { "role": "user", "content": "How do I build a live drone with Ndef at 110 Hz? (ugens saw, cutoff 2400, lfo 0.1, 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 ...
[ { "role": "user", "content": "Write an Ndef at 110 Hz I can retune while it plays. (ugens tri, cutoff 2400, lfo 0.1, 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: tri source through a 2...
[ { "role": "user", "content": "What is `BHiPass`?" }, { "role": "assistant", "content": "BHiPass — 12db/oct rolloff - 2nd order resonant Hi Pass Filter" }, { "role": "user", "content": "What does `BHiPass.sc` do?" }, { "role": "assistant", "content": "calculate filter coef...
[ { "role": "user", "content": "Write a closed hi-hat in SuperCollider." }, { "role": "assistant", "content": "High-passed noise with a very short envelope — the filter is what makes it a hat rather than a hiss.\n\n```supercollider\n(\nSynthDef(\\hat, { |out = 0, amp = 0.3, dur = 0.06|\n var en...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `LinCongL`." }, { "role": "assistant", "content": "```supercollider\n// default initial params\n{ LinCongL.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }.play(s);\n```" } ]
[ { "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 (RunningS...
[ { "role": "user", "content": "Explain this SuperCollider code.\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;\n ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `PulseCount`." }, { "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.0...
[ { "role": "user", "content": "What does `Red3D.rotationX` do? What arguments does it take?" }, { "role": "assistant", "content": "Set the angle of rotation around the X Arguments: theta — In radians.." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-LFNoise0\", { arg out=0;\n Out.ar(out,\n LFBrownNoise0.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": "Write a minimal SuperCollider example that uses `Timer`." }, { "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)...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n//you must have run this line before any of the examples below\nf= BBCutBuffer(Platform.resourceDir +/+ \"sounds/break.aiff\",8);\n\nTempoClock.default.tempo_(2.3);\n\n//default\na=BBCut2(CutBuf1(f),CageCut.new).play;\n\n...
[ { "role": "user", "content": "What does `BusPlug.defaultNumAudio` do?" }, { "role": "assistant", "content": "Default number of channels when initializing in audio rate and no specific number is given (default:" } ]
[ { "role": "user", "content": "What is `LinearGridLines` in SuperCollider?" }, { "role": "assistant", "content": "LinearGridLines — Calculates the numerical values suitable for linearly-spaced grid lines to be used for plotting or other UI elements. `LinearGridLines` is a strategy object that fin...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Latch`." }, { "role": "assistant", "content": "```supercollider\n{ Blip.ar(Latch.ar(WhiteNoise.ar, Impulse.ar(9)) * 400 + 500, 4, 0.2) }.play;\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{ BufRd.ar(1, b, Sweep.ar(Impulse.ar(BufDur.kr(b).reciprocal), BufSampleRate.kr(b)) }.play;\n\nb.free\n```" }, { "role": "assis...
[ { "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.m...
[ { "role": "user", "content": "What does `PLFTri.new` do? What arguments does it take?" }, { "role": "assistant", "content": "UGenPatterns quark library Arguments: freq; iphase — Fixed.; mul; add; length — Number of values produced.." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `CuspL`." }, { "role": "assistant", "content": "```supercollider\n// vary frequency\n{ CuspL.ar(MouseX.kr(20, SampleRate.ir), 1.0, 1.99) * 0.3 }.play(s);\n\n// mouse-controlled params\n{ CuspL.ar(SampleRate.ir/4, Mouse...
[ { "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 everyth...
[ { "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 cod...
[ { "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 cro...
[ { "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.k...
[ { "role": "user", "content": "What does `Updater.updateFunc` do?" }, { "role": "assistant", "content": "simple MVC utility; calls an update handler when the model changes" } ]
[ { "role": "user", "content": "Explain `Breakcore` in SuperCollider briefly." }, { "role": "assistant", "content": "Breakcore — breakcore simulator This is noisy. Category: UGens > Generators > Chaotic." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Limiter`." }, { "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 ...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// given a UGen graph ...\n(\n{ Splay.ar(SinOsc.ar({ exprand(300.0, 10000.0) } ! 17, 0, { 1.0.rand } ! 17)) * 0.1 }.play\n);\n\n// ... all existing UGen inputs can be replaced or modified with an arbitrary function\n// e....
[ { "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...
[ { "role": "user", "content": "Write a Pbind whose degrees repeat every Prand cycle. (scale majorPentatonic, seq Prand, dur 0.3, octave 6, instr pluck, root 0)" }, { "role": "assistant", "content": "Put the scale and the degree pattern in the `Pbind` and it will pick notes for you:\n\n```supercol...
[ { "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 ...
[ { "role": "user", "content": "Write a kick drum with a 0.5 s decay. (osc sine, sweep 0.06, decay 0.5, f0 220, f1 48, 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: sine oscillator, 0.06 s pitch s...
[ { "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\no...
[ { "role": "user", "content": "What is a bus, in one sentence?" }, { "role": "assistant", "content": "A numbered channel on the server that nodes write signal into and read signal out of, which is how sounds are chained without cables." }, { "role": "user", "content": "Show me using o...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{Decimator.ar(SinOsc.ar([400, 404], 0, 0.2), MouseX.kr(0, 44100), MouseY.kr(0, 31))}.play\n\n{Decimator.ar(SoundIn.ar, MouseX.kr(0, 44100), MouseY.kr(0, 31)}.play\n```" }, { ...
[ { "role": "user", "content": "Explain `CondVar` in SuperCollider briefly." }, { "role": "assistant", "content": "CondVar — Condition variable: block one or more threads until some condition is true Category: Scheduling." } ]
[ { "role": "user", "content": "What does `Pgeom.new` do? What arguments does it take?" }, { "role": "assistant", "content": "geometric series pattern Arguments: start — start value.; grow — multiplication factor.; length — number of values produced.." } ]
[ { "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": "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": "Write a minimal SuperCollider example that uses `GbmanL`." }, { "role": "assistant", "content": "```supercollider\n// default initial params\n{ GbmanL.ar(MouseX.kr(20, SampleRate.ir)) * 0.1 }.play(s);\n\n// different initial params\n{ GbmanL.ar(MouseX.kr(20, SampleR...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Lag`." }, { "role": "assistant", "content": "```supercollider\n(\n// used to lag pitch\n{\n SinOsc.ar( // sine wave\n Lag.kr( // lag the modulator\n ...
[ { "role": "user", "content": "Show another SuperCollider example using `Demand`." }, { "role": "assistant", "content": "```supercollider\n{\nvar a, b, t = Impulse.kr(2);\na = { Dseq([1, 2, 3, 4, 5], inf) } * 100;\nb = a + 1;\nDemand.kr(t, 0, [a, b]).poll(t)\n}.play\n```" } ]
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\ns = Server.local;\nServer.default = s;\ns.boot;\n);\n \n \n// definition for future reference in arbitrary Environments\n\np = PLlprand(\\lo, \\hi);\n\n\n// prepare current Environment\n// PLseq repeats a...
[ { "role": "user", "content": "How do I make a kick that starts at 150 Hz and falls to 40 Hz? (osc saw, sweep 0.06, decay 0.5, f0 150, f1 40, amp 0.8, 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": "What does `Synth.replace` do?" }, { "role": "assistant", "content": "Create and return a Synth and use it to replace `nodeToReplace`, taking its place in its server's node" } ]
[ { "role": "user", "content": "What does `Function.inEnvirWithArgs` do?" }, { "role": "assistant", "content": "Like #inEnvir, but returns a function which takes keyword arguments. Building this function makes a call to the interpreter and is less efficient than inEnvir `e = (a: \"get it\", b:" ...
[ { "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": "Write a kick at amp 0.8 with no click. (osc fm, sweep 0.06, decay 0.12, f0 180, f1 48, amp 0.8, 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 drum: fm oscillator, 0....
[ { "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, 4...
[ { "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": "What does `Tempo.beatsPerBar` do? What arguments does it take?" }, { "role": "assistant", "content": "Bored with the old 4/4 ? Tempo.beatsPerBar = Arguments: b." } ]
[ { "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 m...
[ { "role": "user", "content": "Show another SuperCollider example using `Warp1`." }, { "role": "assistant", "content": "```supercollider\n(\nb.free;\nb = Buffer.read(s, ExampleFiles.apollo11);\n{\n var pointer = Phasor.ar(0, SampleDur.ir / BufDur.ir(b) * XLine.kr(1, 0.25, 20));\n var sound = Wa...
[ { "role": "user", "content": "Explain `CircleRamp` in SuperCollider briefly." }, { "role": "assistant", "content": "CircleRamp — circular linear lag This is just like Ramp, but always takes the shortest way around a defined circle, wrapping values where appropriate. This can be useful when smoot...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// modulate frequency and index multiplier\n{ FBSineC.ar(LFNoise2.kr(1, 1e4, 1e4), LFNoise2.kr(1, 16, 17), 1, 1.005, 0.7) * 0.2 }.play(s;\n```" }, { "role": "assistant", ...
[ { "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 b...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `TExpRand`." }, { "role": "assistant", "content": "```supercollider\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TExpRand.kr(300.0, 3000.0, trig)\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX....
[ { "role": "user", "content": "Write a GrainBuf synth at 14 grains per second. (rate 14, dur 0.07, interp 4, mode sweep, rev 1)" }, { "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": "Explain `PanAz` in SuperCollider briefly." }, { "role": "assistant", "content": "PanAz — Azimuth panner Multichannel equal power panner. Category: UGens > Multichannel > Panners." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Condition`." }, { "role": "assistant", "content": "```supercollider\n(\nc = Condition.new(false);\n\nRoutine {\n 1.wait;\n \"waited for 1 second\".postln;\n 1.wait;\n \"waited for another second, now waiting for y...
[ { "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": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// modulate frequency and index multiplier\n{ FBSineL.ar(LFNoise2.kr(1, 1e4, 1e4), LFNoise2.kr(1, 16, 17), 1, 1.005, 0.7) * 0.2 }.play(s;\n```" }, { "role": "assistant", ...
[ { "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...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Trig.ar(Dust.ar(1), 0.2) * FSinOsc.ar(800, 0.5) }.play\n\n{ Trig.ar(Dust.ar(4), 0.1 }.play\n```" }, { "role": "assistant", "content": "A closing bracket is missing:...
[ { "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: \\addA...
[ { "role": "user", "content": "What does `Window.onClose` do?" }, { "role": "assistant", "content": "The action object to be evaluated when the window is" } ]
[ { "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": "Give me an Ndef with an LFO at 0.1 Hz. (ugens blip, cutoff 1400, lfo 0.1, freq 110, 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 1400 Hz low-pass\...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n/*\n( // PlayerBinop not yet implemented\n\nPatch(\\monosynth,[\n BeatClockPlayer.new(16) * MIDIGatePlayer.new,\n MIDIFreqPlayer.new,\n CCPlayer(50,[100,3000,\\exp,0.0,1500.0]...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Ndef\nNdef(\\a, { Saw.ar(12) }).asCode;\n\n// in a pushed proxy space\np = ProxySpace.push(s.boot);\n~x = { Saw.ar(123, 0.1 };\n~x.play;\n~x.asCode;\n\np.end.pop;\n\n// anonym...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// modulate frequency\n{ Pulse.ar(XLine.kr(40, 4000, 6), 0.1, 0.2) }.play;\n\n// modulate pulse width\n{ Pulse.ar(200, SinOsc.kr(0.2).range(0.01, 0.99), 0.2) }.play;\n\n// two ba...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-PinkNoise\", { |out = 0|\n Out.ar(out,\n PinkNoise.ar(0.4)\n )\n}).play;\n```" }, { "role": "assistant", "content": "A closing bracket is miss...
[ { "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 = Sy...
[ { "role": "user", "content": "Write a kick at amp 0.6 with a click. (osc fm, sweep 0.06, decay 0.5, f0 150, f1 40, amp 0.6, rev 1)" }, { "role": "assistant", "content": "A kick is a sine with a fast pitch drop and a short amplitude envelope:\n\n```supercollider\n// kick drum: fm oscillator, 0.06...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `XFade2`." }, { "role": "assistant", "content": "```supercollider\n{ XFade2.ar(Saw.ar, SinOsc.ar, LFTri.kr(0.1)) }.play\n```" } ]
[ { "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....
[ { "role": "user", "content": "What does `PlayerAmp.spec` do?" }, { "role": "assistant", "content": "adds a simple amplitude control to a Player" } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Lag3`." }, { "role": "assistant", "content": "```supercollider\n(\n// used to lag pitch\n{\n SinOsc.ar( // sine wave\n Lag3.kr( // lag the modulator\n LFPulse.kr(4, 0, 0.5, 50, 400), // frequency mod...
[ { "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 = Sin...
[ { "role": "user", "content": "What is `SynthDesc`?" }, { "role": "assistant", "content": "SynthDesc — Description of a synth definition" }, { "role": "user", "content": "What does `SynthDesc.read` do?" }, { "role": "assistant", "content": "Adds all synthDescs in a path to...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// as frequency control...\n(\n{\nSinOsc.ar(\n LinCongL.ar(\n 40,\n LFNoise2.kr(0.1, 0.1, 1),\n LFNoise2.kr(0.1, 0.1, 0.1),\n LFNoise2.kr(0.1),\n 0, 500, 600\n )...
[ { "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-MouseButton.kr(lag:0.001))[0]), 0, 0.1)}.play //notice how I am taking the [0th channel of the Maths and ignoring th...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `CuspL`." }, { "role": "assistant", "content": "```supercollider\n// vary frequency\n{ CuspL.ar(MouseX.kr(20, SampleRate.ir), 1.0, 1.99) * 0.3 }.play(s);\n\n// mouse-controlled params\n{ CuspL.ar(SampleRate.ir/4, Mouse...
[ { "role": "user", "content": "Write a granular texture in SuperCollider." }, { "role": "assistant", "content": "Read a sound file into a buffer, then trigger grains from it. Grain density is the Impulse rate and\ngrain length is dur; keep the density times the length under maxGrains or raise it....
[ { "role": "user", "content": "Show another SuperCollider example using `SelectXFocus`." }, { "role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n Saw.ar(LFSaw.kr(3 * [1, 1.01], 0, 100, 230)),\n SinOsc.ar,\n Pulse.ar(LFPulse.kr(3 * [1, 1.02], 0, 0.4, 100, 23...
[ { "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": "Write an Ndef with a saw source and a 400 Hz low-pass. (ugens saw, cutoff 400, lfo 0.1, 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 thr...
[ { "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 va...
[ { "role": "user", "content": "What is the difference between Line and XLine?" }, { "role": "assistant", "content": "Both are ramps: `Line.kr(start, end, dur, mul, add, doneAction)` moves linearly, `XLine.kr(...)` moves exponentially in a fixed ratio per unit time. Use Line for amplitude and XLin...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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) }\...
[ { "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 SinOs...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Condition`." }, { "role": "assistant", "content": "```supercollider\n(\nc = Condition.new(false);\n\nRoutine {\n 1.wait;\n \"waited for 1 second\".postln;\n 1.wait;\n \"waited for another second, now waiting for y...