conversations
listlengths
2
6
[ { "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 `MIDIFunc.cc` do?" }, { "role": "assistant", "content": "A convenience method to create a new MIDIFunc which responds to MIDI control messages. See #*new for argument Returns: A new instance of MIDIFunc which responds to MIDI control messages." } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `MulAdd`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\n// The mul and add arguments of SinOsc themselves use MulAdd!\n// These two examples will create precisely the same synth graph:\nx = { SinO...
[ { "role": "user", "content": "What is `SDrone` in SuperCollider?" }, { "role": "assistant", "content": "SDrone — a droning sInstrument Based on the Ndef used for 'Strange Foreign Bodies'. Category: SInstruments." } ]
[ { "role": "user", "content": "What is `IdentitySet`?" }, { "role": "assistant", "content": "IdentitySet — a set according to identity" }, { "role": "user", "content": "What does `IdentitySet.add` do?" }, { "role": "assistant", "content": "Add anObject to the IdentitySet. ...
[ { "role": "user", "content": "I made a synth and I hear nothing. Where do I start?" }, { "role": "assistant", "content": "Start with the node tree, not the code: evaluate `s.plotTree`. If your Synth is not there, it never started or it already freed itself; if it is there, the problem is in the ...
[ { "role": "user", "content": "Give me a granular patch with noise grain position and interp 4. (rate 10, dur 0.15, interp 4, mode noise, rev 0)" }, { "role": "assistant", "content": "`GrainBuf` needs a buffer, a trigger and a grain duration:\n\n```supercollider\n// granular synth with GrainBuf\n...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.new(s);\n// read only the first channel (a Sine wave) of a stereo file\nb.allocReadChannel(ExampleFiles.sinedPink, channels: [0]);\nx = { PlayBuf.ar(1, b, Buf...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\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, Pha...
[ { "role": "user", "content": "Explain `Layout` in SuperCollider briefly." }, { "role": "assistant", "content": "Layout — Superclass of all GUI layouts Layout is the abstract superclass of all layouts. Any layout can be installed on a view with the view's View#-layout#'layout' setter method. See ...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// Change MembraneHexagon to MembraneCircle for a different shaped\n// circular drum head\ns.boot;\ns.reboot;\n(\n{ var excitation = EnvGen.kr(Env.perc,\n MouseButton.kr(0, 1, 0),\n ...
[ { "role": "user", "content": "How do I granulate a sample with 0.15 s grains? (rate 14, dur 0.15, 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 this SuperCollider code do?\n```supercollider\n// Reminder: This isn't the intended typical usage! It's OK to do this though.\n(\nx = {\n var mags, phases, chain, sig;\n // Create simple undulating magnitudes\n mags = { FSinOsc.kr(ExpRand(0.1, 1)).range(0, 1) }.dup...
[ { "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": "What is `Event`?" }, { "role": "assistant", "content": "Event — an environment that represents an action" }, { "role": "user", "content": "What does `Event.parentEvents` do?" }, { "role": "assistant", "content": "An extendible IdentityDiction...
[ { "role": "user", "content": "Add freeverb to a bell patch at room 0.5. (verb freeverb, room 0.5, damp 0.2, mix 0.3, source bell)" }, { "role": "assistant", "content": "A send-style patch: dry signal plus the reverb on the tail:\n\n```supercollider\n// reverb: freeverb on a bell\n(\nSynthDef(\\r...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Latoocarfian2DN.ar(MouseX.kr(20, SampleRate.ir * 0.5), MouseX.kr(40, SampleRate.ir), mul:0.2) }.play(s);\n\n\n(\n{ Latoocarfian2DN.ar(\n SampleRate.ir/4,\n SampleRate.ir,\n ...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n//Can be very noisy, high pitched and aliases badly: e.g., great fun, but watch out for your ears, filter, try out odd param settings. I've turned all the amplitudes down in the following\n\n\n//defaults, high pitched! WA...
[ { "role": "user", "content": "What is `Onsets` in SuperCollider?" }, { "role": "assistant", "content": "Onsets — Onset detector An onset detector for musical audio signals - detects the beginning of notes/drumbeats/etc. Outputs a control-rate trigger signal which is 1 when an onset is detected, ...
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Free`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\nSynthDef(\"a\", { Out.ar(0, SinOsc.ar(800, 0, 0.2)) }).add;\n\nSynthDef(\"b\", { |t_t = 0| Out.ar(1, PinkNoise.ar(0.3)); Free.kr(t_t, 1001) })...
[ { "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\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": "Show another SuperCollider example using `Monitor`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\ns.scope(16);\n\n{ Out.ar(87, SinOsc.ar(MouseX.kr(40, 10000, 1) * [1, 2, 3], 0, 0.2)) }.play;\nx = Monitor.new;\nx.play(87, 3, 1, 2);\nx.out = 0;\nx....
[ { "role": "user", "content": "Explain `MIDIFuncChanMessageMatcher` in SuperCollider briefly." }, { "role": "assistant", "content": "MIDIFuncChanMessageMatcher — Matches incoming MIDI messages to responder funcs based on message channel This is used by MIDIMessageDispatcher to match incoming MIDI...
[ { "role": "user", "content": "Write a kick at amp 0.6 with no click. (osc fm, sweep 0.06, decay 0.5, f0 150, f1 55, amp 0.6, rev 0)" }, { "role": "assistant", "content": "Start with a swept sine, then shorten the decay to taste:\n\n```supercollider\n// kick drum: fm oscillator, 0.06 s pitch swee...
[ { "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 the difference between an audio bus and a control bus?" }, { "role": "assistant", "content": "Both are numbered channels on the server used to move signal between nodes. An audio bus carries audio-rate signal and holds one or more audio channels; a control b...
[ { "role": "user", "content": "Which keys does a Pbind understand?" }, { "role": "assistant", "content": "The ones you use constantly are \\instrument (a SynthDef name), \\dur (seconds), \\degree (scale degree), \\midinote, \\freq, \\amp, \\legato (note length as a fraction of \\dur), and \\scale...
[ { "role": "user", "content": "What does `ControlPrototypes.listForSpec` do? What arguments does it take?" }, { "role": "assistant", "content": "creates default objects for Spec / argName combinations Arguments: argName; spec." } ]
[ { "role": "user", "content": "What is the difference between \\degree, \\midinote and \\freq in a Pbind?" }, { "role": "assistant", "content": "`\\freq` is the frequency in Hz and is used as-is. `\\midinote` is a MIDI note number, converted to frequency by the default instrument. `\\degree` is a...
[ { "role": "user", "content": "What does `AbstractResponderFunc.free` do?" }, { "role": "assistant", "content": "Disable this object and remove it from the global lists. This should be done when you are finished using this" } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Dser`." }, { "role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dser([1, 3, 2, 7, 8], 8);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n Sin...
[ { "role": "user", "content": "Show another SuperCollider example using `KeyTrack`." }, { "role": "assistant", "content": "```supercollider\n// alternating major and minor chords as a test\n(\n{\n var in, fft, resample;\n var key, transientdetection;\n\n in = Mix(SinOsc.ar((60 + [0, MouseX.kr(...
[ { "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 play a random majorPentatonic scale at octave 4? (scale majorPentatonic, seq Pshuf, dur 0.4, octave 4, instr sine, root 0)" }, { "role": "assistant", "content": "`Pbind` sequences an Event per beat, and `\\degree` + `\\scale` does the pitch:\n\n```supercoll...
[ { "role": "user", "content": "Write a kick at amp 0.6 with no click. (osc fm, sweep 0.06, decay 0.18, f0 180, f1 55, amp 0.6, rev 0)" }, { "role": "assistant", "content": "Start with a swept sine, then shorten the decay to taste:\n\n```supercollider\n// kick drum: fm oscillator, 0.06 s pitch swe...
[ { "role": "user", "content": "Write a self-contained SuperCollider patch that uses `Padd`. Define every value it uses." }, { "role": "assistant", "content": "```supercollider\n// sound example\n(\nSynthDef(\\sinegrain,\n { |out = 0, freq = 440, gate = 1|\n var env;\n env = EnvGen.kr(Env.a...
[ { "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": "What does `EZLists.valueAction` do? What arguments does it take?" }, { "role": "assistant", "content": "Sets the value and performs the action at the index value and the global Arguments: val — An Integer.." } ]
[ { "role": "user", "content": "What does `StreamSpec.defaultControl` do? What arguments does it take?" }, { "role": "assistant", "content": "datatype specifying that the input or output is stream or pattern Arguments: val." } ]
[ { "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": "What does this SuperCollider code do?\n```supercollider\n// allocate buffer\nb = Buffer.alloc(s, 44100, 1);\n\n(\n// Dust randomly triggers Decay to create an exponential\n// decay envelope for the WhiteNoise input source\n{\nz = Decay.ar(Dust.ar(1, 0.5), 0.3, WhiteNoise.ar);\n...
[ { "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": "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": "What is `TempoClock` in SuperCollider?" }, { "role": "assistant", "content": "TempoClock — tempo based scheduler TempoClock is a scheduler like SystemClock, but it schedules relative to a Category: Scheduling > Clocks." } ]
[ { "role": "user", "content": "Give me a Pbind with pluck voices and a 0.25 rhythm." }, { "role": "assistant", "content": "Put the scale and the degree pattern in the `Pbind` and it will pick notes for you:\n\n```supercollider\n(\nSynthDef(\\pluck, { |out = 0, freq = 440, amp = 0.2|\n var env ...
[ { "role": "user", "content": "How do I make a kick that starts at 150 Hz and falls to 48 Hz? (osc sine, sweep 0.06, decay 0.25, f0 150, f1 48, amp 0.6, rev 1)" }, { "role": "assistant", "content": "The pitch envelope is what makes it read as a drum, not the oscillator:\n\n```supercollider\n// ki...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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 = Warp1.ar(1, b, pointe...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// increase phase multiplier\n{ FBSineL.ar(SampleRate.ir, 1, 0, XLine.kr(1, 2, 10), 0.1) * 0.2 }.play(s;\n```" }, { "role": "assistant", "content": "A closing bracket...
[ { "role": "user", "content": "Write a complete SuperCollider patch built around `SyncSaw` that runs as it is." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n(\n// send a synth def to server\nSynthDef(\"tpulse\", { arg out=0,freq=700,sawFreq=440.0;\n Out.ar(out, SyncSaw.ar(fre...
[ { "role": "user", "content": "Write an Ndef at 220 Hz I can retune while it plays. (ugens saw, cutoff 400, lfo 0.1, freq 220, 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 40...
[ { "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// Compare:\n\n{ WhiteNoise.ar(0.25) }.play;\n\n{ HPZ2.ar(WhiteNoise.ar(0.25)) }.play;\n\n// HPZ2 is useful to detect changes in a signal:\n// see also HPZ1\n(\n{\n var changing...
[ { "role": "user", "content": "What is `NodeWatcher` in SuperCollider?" }, { "role": "assistant", "content": "NodeWatcher — notify sc-lang side node objects of their server sided state Node instances (Synths and Groups) can be registered with the NodeWatcher. It watches for server node status mes...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 512, 1);\nb.sine2([1.0, 3], [1, 0.5]);\nx = { Osc.ar(b, 200, 0, 0.5) }.play;\n;\nx.free; b.free;\n```" }, { "role": "assistant", "cont...
[ { "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 GrainBuf synth at 6 grains per second. (rate 6, dur 0.07, interp 2, 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.wai...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// one last example\n(\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n);\n\n(\n{\n var input = SoundIn.ar(0);\n var framesize = 512;\n Conv...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// Very artificial example - just filtering some noise.\ns.boot;\nb = Buffer.alloc(s,2048,1);\n(\nx = {\nvar in, chain, freq, rq, val;\n//freq = LFPar.kr(0.3).exprange(100, 1000);\nfreq = MouseY.kr(1000, 100, 1);\nrq = Mo...
[ { "role": "user", "content": "What does `View.setContextMenuActions` do? What arguments does it take?" }, { "role": "assistant", "content": "Set the MenuActions that should appear in the context menu for this view. This implicitly calls Arguments: A list of one or more MenuActions. These will be...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\na = {LFTri.ar(50+(1000*Maths.ar(10, 10, 0.5, 1)[0]), 0, 0.1)}.play //notice how I am taking the [0]th channel of the Maths and ignoring the [1st channel.\n```" }, { "role...
[ { "role": "user", "content": "Write a complete SuperCollider patch built around `Pseq` that runs as it is." }, { "role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, ...
[ { "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": "What does `AbstractPlayer.guiClass` do?" }, { "role": "assistant", "content": "the base class for all Players : a playable object" } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `Balance2`." }, { "role": "assistant", "content": "```supercollider\n// a stereo signal, both channels at 0dB\n{ [SinOsc.ar(440), SinOsc.ar(440)] }.play\n\n// using Balance on a stereo signal with the position paramete...
[ { "role": "user", "content": "How do I granulate a sample with 0.15 s grains? (rate 28, dur 0.15, interp 4, 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 GrainBuf\n(\ns.w...
[ { "role": "user", "content": "What does `Pstutter.new` do? What arguments does it take?" }, { "role": "assistant", "content": "repeat input stream values Arguments: n — The number of repeats for each new element. n may be a pattern, so the number of times can vary each iteration.; pattern — the ...
[ { "role": "user", "content": "Give me a bell with damping 0.2 on the reverb." }, { "role": "assistant", "content": "Put the reverb inside the `SynthDef` so it is part of the voice:\n\n```supercollider\n// reverb: freeverb on a bell\n(\nSynthDef(\\reverb_synth, { |out = 0, freq = 330, amp = 0.2|\...
[ { "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": "Explain `EaseInOutAtan` in SuperCollider briefly." }, { "role": "assistant", "content": "EaseInOutAtan — Atan ease-in/out Easing equation for an atan ease-in/out, accelerating until halfway, then decelerating. The a parameter is curvature. Category: Ease." } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Blip.ar(Blip.kr(4, 5, 500, 60), 59, 0.1 }.play;\n```" }, { "role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never cl...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Out.ar(87, SinOsc.ar(MouseX.kr(340, 1000, 1) * [1, 2, 3], 0, 0.2)) }.play;\nx = Monitor.new.play(87, 3, 0, fadeTime: 3;\nx.vol = 0.3;\nx.stop;\n```" }, { "role": "assis...
[ { "role": "user", "content": "What does `Atk.getMatrixExtensionSubPath` do?" }, { "role": "assistant", "content": "A shortcut for `Atk.getExtensionSubPath(set, op," } ]
[ { "role": "user", "content": "Give me a Pbind with sine voices and a 0.3 rhythm. (scale minorPentatonic, seq Pshuf, dur 0.3, octave 5, 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```supercollide...
[ { "role": "user", "content": "Write a self-contained SuperCollider patch that uses `LFNoise1`. Define every value it uses." }, { "role": "assistant", "content": "```supercollider\nb = Bus.control(s, 1);\n\na = {\n var freq;\n freq = LFNoise1.kr(2, 600, 800);\n Out.kr(b, freq); // no need ...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot\nb = Bus.audio(s, 2);\na = { SinOsc.ar([330, 440], 0, 0.4) }.play(s, b // you won't hear this if you only have two channels\nb.scope\n\na.free;\nb.free;\n```" }, { ...
[ { "role": "user", "content": "Write a SuperCollider patch that uses `EnvGen` and actually plays. Assume nothing about the session." }, { "role": "assistant", "content": "```supercollider\n// as amplitude envelope\n(\n{\n var env = Env([0, 1, 0.5, 1, 0], [0.01, 0.5, 0.02, 0.5]);\n SinOsc.ar(470...
[ { "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```" }, { "role": "assistant", "content": "A closing b...
[ { "role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n{ BlitB3Square.ar(XLine.kr(1000, 20, 10)) }.play;\n\n{ BlitB3Square.ar(MouseX.kr(20,1000,'exponential'),MouseY.kr(0.001,0.999)) }.play;\n\n//comparison\n//blit version is cheaper, but aliases once pushed over 4000 or so a...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// compares a 441 Hz sine tone derived from sample rate (44100 * 0.01, left)\n// with a 440 Hz tone (right), resulting in a 1 Hz beating\n(\n{\n var freq;\n freq = [SampleRate....
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `WhiteNoise`." }, { "role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-WhiteNoise\", { |out = 0|\n Out.ar(out,\n WhiteNoise.ar(0.25)\n )\n}).play;\n)\n```" } ]
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Standard2DN.ar(220, 11025, mul:0.3) }.play(s);\n\n// mouse-controlled param\n{ Standard2DN.ar(SampleRate.ir/2, SampleRate.ir, MouseX.kr(0.9,4), mul:0.3) }.play(s);\n\n// as a f...
[ { "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": "What does this SuperCollider patch do?\n```supercollider\nt = TempoClock(120/60).permanent_(true);\n\n(\n~change_clock_tempo = {|clock, tempo, beats=1|\n beats.do {|beat|\n var stepTempo = beat.linexp(0, beats-1, clock.tempo, tempo);\n clock.schedAbs(clock.next...
[ { "role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// no, it doesn't take a ugen in ...\n(\n{\n EnvGen.kr(\n Env.asr(0.1, 1.0, 0.5, \\welch),\n 1.0,\n FSinOsc.ar(1.0).range(0.0, 1.0),\n timeScale: 0.1\n ) * SinOsc.ar(440, 0, 0.3)\n}.play;\n);\...
[ { "role": "user", "content": "Show another SuperCollider example using `LatoocarfianC`." }, { "role": "assistant", "content": "```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,...
[ { "role": "user", "content": "What does `RedAutoScale.ar` do? What arguments does it take?" }, { "role": "assistant", "content": "scales an unknown signal to a known range Arguments: in — Input signal.; lo — Desired output range minimum.; hi — Desired output range maximum.; inLo — Predefined min...
[ { "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{ FBSineL.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": "What does `ArrayedCollection.replace` do?" }, { "role": "assistant", "content": "Return a new array in which a number of elements have been replaced by another. Elements are checked for equality (not for identity). `a = (0..10) ++ (0..10);` this method is inherited ...
[ { "role": "user", "content": "I get \"Message 'ar' not understood\". Why?" }, { "role": "assistant", "content": "You called a rate method on something that is not a UGen. `Env.ar(...)` and `Buffer.ar(...)` are the classic cases: Env is a language-side description and is played by `EnvGen.ar(env,...
[ { "role": "user", "content": "What does `CmdPeriod.objects` do?" }, { "role": "assistant", "content": "Get or set the list of objects that are called when CmdPeriod is" } ]
[ { "role": "user", "content": "Write a minimal SuperCollider example that uses `NodeProxy`." }, { "role": "assistant", "content": "```supercollider\ns.boot;\n\na = NodeProxy.new.play; // play to hardware output.\na.fadeTime = 2; // fadeTime specifies crossfade\n// set the source\na.source = { Sin...
[ { "role": "user", "content": "Write an FM bell in SuperCollider." }, { "role": "assistant", "content": "PMOsc is phase modulation: a non-integer modulator ratio gives the inharmonic clang.\n\n```supercollider\n(\nSynthDef(\\fmBell, { |out = 0, freq = 440, amp = 0.2, dur = 4|\n var index = Env...
[ { "role": "user", "content": "What are the arguments of GrainBuf.ar?" }, { "role": "assistant", "content": "`GrainBuf.ar(numChannels, trigger, dur, sndbuf, rate, pos, interp, pan, envbufnum, maxGrains, mul, add)`. The ones you always pass are numChannels (1 or 2), trigger (a UGen that fires grai...
[ { "role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{ Latoocarfian2DC.ar(\n SampleRate.ir/8,\n SampleRate.ir/2,\n LFNoise2.kr(2.dup, 1.5, 1.5),\n d:LFNoise2.kr(2.dup, 0.5, 1.5),\n mul:0.2\n) }.play(s);\n```" }, { "...
[ { "role": "user", "content": "Write a complete SuperCollider patch built around `TChoose` that runs as it is." }, { "role": "assistant", "content": "```supercollider\n(\n{\n var a;\n a = [\n SinOsc.ar,\n Saw.ar,\n Pulse.ar\n ];\n TChoose.ar(Dust.ar(MouseX.kr(1, 1000, 1)), a)...
[ { "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": "Explain this SuperCollider patch.\n```supercollider\n// (thor magnusson) (2006)\n\n// An instrumentalist inside a synthdef.\n\n(\nSynthDef(\\drummer, { arg out=0, tempo=4;\n var snare, base, hihat;\n tempo = Impulse.ar(tempo); // for a drunk drummer replace Impulse with Dust ...
[ { "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": "Write a kick at amp 0.6 with a click. (osc fm, sweep 0.06, decay 0.25, f0 180, f1 55, amp 0.6, 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...