diff --git "a/data/sft/pool.jsonl" "b/data/sft/pool.jsonl" --- "a/data/sft/pool.jsonl" +++ "b/data/sft/pool.jsonl" @@ -2087,6 +2087,7 @@ {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nVowel().brightenRel(1 ).dBs.postln; \nVowel().brightenRel(0.1).dBs.postln;\nVowel().brightenRel(1.5).dBs.postln;\n\n// refFormant = 0 loud on the left\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 0 )) * 0.1}.play\n// refFormant = 1\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 1 )) * 0.1}.play\n// refFormant = 2\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 2 )) * 0.1}.play\n// refFormant = 3\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nVowel().brightenRel(1 ).dBs.postln; \nVowel().brightenRel(0.1).dBs.postln;\nVowel().brightenRel(1.5).dBs.postln;\n\n// refFormant = 0 loud on the left\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 0 )) * 0.1}.play\n// refFormant = 1\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 1 )) * 0.1}.play\n// refFormant = 2\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 2 )) * 0.1}.play\n// refFormant = 3\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 3 )) * 0.1}.play\n// refFormant = 4 loud on the right\n{Formants.ar(100, Vowel().brightenRel(MouseX.kr(0, 2), 4 )) * 0.1}.play\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 387} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nVowel().brightenLin(-1).dBs.postln; \nVowel().brightenLin( 0).dBs.postln;\nVowel().brightenLin( 1).dBs.postln;\n\n// refFormant = 0 loud on the left\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 0 )) * 0.1}.play\n// refFormant = 1\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 1 )) * 0.1}.play\n// refFormant = 2\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 2 )) * 0.1}.play\n// refFormant = 3\n{Formants.ar\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nVowel().brightenLin(-1).dBs.postln; \nVowel().brightenLin( 0).dBs.postln;\nVowel().brightenLin( 1).dBs.postln;\n\n// refFormant = 0 loud on the left\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 0 )) * 0.1}.play\n// refFormant = 1\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 1 )) * 0.1}.play\n// refFormant = 2\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 2 )) * 0.1}.play\n// refFormant = 3\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 3 )) * 0.1}.play\n// refFormant = 4 loud on the right\n{Formants.ar(100, Vowel().brightenLin(MouseX.kr(0, 20), 4 )) * 0.1}.play\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 381} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nVowel().brightenExp(1).dBs.postln; \nVowel().brightenExp(0.1).dBs.postln;\nVowel().brightenExp(1.5).dBs.postln;\n\n{Formants.ar(100, Vowel(\\a, \\bass).brightenExp(MouseX.kr(0,5)) * 0.1 }.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nVowel().brightenExp(1).dBs.postln; \nVowel().brightenExp(0.1).dBs.postln;\nVowel().brightenExp(1.5).dBs.postln;\n\n{Formants.ar(100, Vowel(\\a, \\bass).brightenExp(MouseX.kr(0,5))) * 0.1 }.play;\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 174, "answer_tokens": 173} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\\vowblend,{|freq = 100, b1 = 0.5, b2 = 0.5, b3 = 0.5, b4 = 0.5 bright = 0, pan = 0|\n var va = Vowel(\\a, \\bass),\n ve = Vowel(\\e, \\tenor),\n vi = Vowel(\\i, \\counterTenor),\n vo = Vowel(\\o, \\alto),\n vu = Vowel(\\u, \\soprano),\n sig;\n \n sig = Formants.ar(\n freq, \n va\n .blend(ve, b1)\n .blend(vi, b2)\n .blend(vo, b3)\n .blend(vu, b4)\n .brightenExp(bright, 1)\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\\vowblend,{|freq = 100, b1 = 0.5, b2 = 0.5, b3 = 0.5, b4 = 0.5 bright = 0, pan = 0|\n var va = Vowel(\\a, \\bass),\n ve = Vowel(\\e, \\tenor),\n vi = Vowel(\\i, \\counterTenor),\n vo = Vowel(\\o, \\alto),\n vu = Vowel(\\u, \\soprano),\n sig;\n \n sig = Formants.ar(\n freq, \n va\n .blend(ve, b1)\n .blend(vi, b2)\n .blend(vo, b3)\n .blend(vu, b4)\n .brightenExp(bright, 1) \n ) \n * EnvGen.kr(Env.perc, 3.0, doneAction: 2);\n\n Out.ar(0, Pan2.ar(sig, pan, 0.1));\n}).add\n);\n\n\n(\nTask({ 32.do({ arg i; \n Synth(\\vowblend, [ \n \\pan, i.linlin(0,32, -1, 1 ),\n \\freq, i.linlin(0,32, 30, 66 ).midicps,\n \\b1, 2.rand,\n \\b2, 2.rand, \n \\b3, 2.rand,\n \\b4, 2.rand, \n \\bright, 1.5.rand\n ]); \n 0.25.wait\n\n});}).play\n)\n```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 516} {"conversations": [{"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": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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```"}], "family": "E", "source_id": "quarks:Vowel/HelpSource/Classes/Vowel.schelp", "aug": "mut:missing_paren", "prompt_tokens": 149, "answer_tokens": 148} {"conversations": [{"role": "user", "content": "Explain this SuperCollider patch.\n```supercollider\n// The code below generates a series of test signals for each speaker of \n// the currently active setup. In the default settings this generates \n// short pink noise bursts, twice on each group of 8 speakers.\n\n(\nn = 8; // size of speaker groups\nz = 1/4; // duration per burst\nt = \\pinkNoise; // udef name for sound generation\nr = 2; // number of repeats per group\nx = UScore();\n\n(WFSSpeakerConf.default.speakerCount / n).ceil.do({ |i|\n var folder;\n folder = UScore( i * (r * (n + 1) * z) );\n x.add( folder );\n r.do({ |ii|\n n.do({ |iii|\n folder.add( UChain( ((ii * (n + 1)) + iii) * z, iii, z * (3/4), \n [ t, [ \\seed, 12345 ] ],\n [ \\wfsIndex, [ \\index, (i * 8) + iii, \\gain, 0 ] ]\n )\n );\n });\n });\n folder.name = ([1,n] + (i*8)).join(\"-\"); \n});\n\nx.gui;\n)\n```"}, {"role": "assistant", "content": "The code below generates a series of test signals for each speaker of the currently active setup. In the default settings this generates short pink noise bursts, twice on each group of 8 speakers."}], "family": "D3", "source_id": "quarks:WFSCollider-Class-Library/Examples/code examples/speaker test generator.scd", "aug": "patch", "prompt_tokens": 417, "answer_tokens": 58} {"conversations": [{"role": "user", "content": "What is `ZArchive` in SuperCollider?"}, {"role": "assistant", "content": "ZArchive — Compressed binary file format for saving large datasets and SuperCollider objects A compressed binary safe archive format. Supports very large file sizes and is fairly fast. Category: Files."}], "family": "A", "source_id": "quarks:ZArchive/HelpSource/Classes/ZArchive.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 71} @@ -5908,6 +5909,7 @@ {"conversations": [{"role": "user", "content": "What is `Dbrown2` in SuperCollider?"}, {"role": "assistant", "content": "Dbrown2 — demand rate brownian movement with Gendyn distributions Dbrown2 returns numbers in the continuous range between lo and hi. The arguments can be a number or any other ugen. Category: UGens > Demand."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Dbrown2.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "Explain `Dbrown2` in SuperCollider briefly."}, {"role": "assistant", "content": "Dbrown2 — demand rate brownian movement with Gendyn distributions Dbrown2 returns numbers in the continuous range between lo and hi. The arguments can be a number or any other ugen. Category: UGens > Demand."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Dbrown2.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "What does `Dbrown2.new` do? What arguments does it take?"}, {"role": "assistant", "content": "demand rate brownian movement with Gendyn distributions Arguments: lo — minimum value; hi — maximum value; step — maximum step for each new value; dist — gendyn distribution (see Gendy1); length — number of values to create."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Dbrown2.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 75} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dbrown2(0, 15, 1, [1, 4], inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dbrown2(0, 15, 1, [1, 4], inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Dbrown2.schelp", "aug": "mut:missing_paren", "prompt_tokens": 162, "answer_tokens": 162} {"conversations": [{"role": "user", "content": "What is `DoubleNestedAllpassC` in SuperCollider?"}, {"role": "assistant", "content": "DoubleNestedAllpassC — Nested Allpass filters as proposed by Vercoe and Pluckett Useful for reverberation, especially implementing Gardner reverbs. Category: UGens > Delays."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/DoubleNestedAllpassC.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "Explain `DoubleNestedAllpassC` in SuperCollider briefly."}, {"role": "assistant", "content": "DoubleNestedAllpassC — Nested Allpass filters as proposed by Vercoe and Pluckett Useful for reverberation, especially implementing Gardner reverbs. Category: UGens > Delays."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/DoubleNestedAllpassC.schelp", "aug": "para:1", "prompt_tokens": 44, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "What does `DoubleNestedAllpassC.ar` do?"}, {"role": "assistant", "content": "Nested Allpass filters as proposed by Vercoe and Pluckett"}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/DoubleNestedAllpassC.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 23} @@ -5920,12 +5922,15 @@ {"conversations": [{"role": "user", "content": "What is `Fhn2DC` in SuperCollider?"}, {"role": "assistant", "content": "Fhn2DC — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DC.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "Explain `Fhn2DC` in SuperCollider briefly."}, {"role": "assistant", "content": "Fhn2DC — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DC.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "What does `Fhn2DC.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "FitzHughNagumo Neuron Firing Oscillator Arguments: minfreq, maxfreq — freq iteration; rateu — update rate for u; ratew — update rate for w; b0 — equation constant; b1 — equation constant; i — arbitrary external impulse; i.e. pulse wave, trigger, lfnoise, or nothing.; initu — reset value for u; initw — reset value for w."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DC.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 136} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.3*Fhn2DC.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DC.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.3*Fhn2DC.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DC.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.kr(3)), mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n);\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig, trig1, trig2, b0, b1;\n trig1=FhnTrig.kr(5, 8, 0.3, 0.3, 1, 1);\n trig2=FhnTrig.kr(8, 13, 0.27, 0.27, 0.6, 0.8);\n b0=Fhn2DN.kr(3, 5, 0.29, 0.29, 0.5, 1.1, mul:0.23, add:0.25);\n b1=Fhn2DN.kr(2, 3, 0.25, 0.25, 0.2, 1.5, mul:0.48, add:0.5);\n sig=Fhn2DC.ar(110, 22050, TExpRand.kr(0.001, 0.3, trig1), TExpRand.kr(0.001, 0.3, trig2), b0, b1, mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DC.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 644} {"conversations": [{"role": "user", "content": "What is `Fhn2DL` in SuperCollider?"}, {"role": "assistant", "content": "Fhn2DL — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DL.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "Explain `Fhn2DL` in SuperCollider briefly."}, {"role": "assistant", "content": "Fhn2DL — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DL.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "What does `Fhn2DL.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "FitzHughNagumo Neuron Firing Oscillator Arguments: minfreq, maxfreq — freq iteration; rateu — update rate for u; ratew — update rate for w; b0 — equation constant; b1 — equation constant; i — arbitrary external impulse; i.e. pulse wave, trigger, lfnoise, or nothing.; initu — reset value for u; initw — reset value for w."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DL.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 136} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.5*Fhn2DL.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DL.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.5*Fhn2DL.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DL.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.kr(3)), mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n);\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig, trig1, trig2, b0, b1;\n trig1=FhnTrig.kr(5, 8, 0.3, 0.3, 1, 1);\n trig2=FhnTrig.kr(8, 13, 0.27, 0.27, 0.6, 0.8);\n b0=Fhn2DN.kr(3, 5, 0.29, 0.29, 0.5, 1.1, mul:0.23, add:0.25);\n b1=Fhn2DN.kr(2, 3, 0.25, 0.25, 0.2, 1.5, mul:0.48, add:0.5);\n sig=Fhn2DL.ar(110, 22050, TExpRand.kr(0.001, 0.3, trig1), TExpRand.kr(0.001, 0.3, trig2), b0, b1, mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DL.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 644} {"conversations": [{"role": "user", "content": "What is `Fhn2DN` in SuperCollider?"}, {"role": "assistant", "content": "Fhn2DN — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DN.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "Explain `Fhn2DN` in SuperCollider briefly."}, {"role": "assistant", "content": "Fhn2DN — FitzHughNagumo Neuron Firing Oscillator `du/dt= rateu*(u-0.3333*u^3 - w)` Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DN.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 71} {"conversations": [{"role": "user", "content": "What does `Fhn2DN.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "FitzHughNagumo Neuron Firing Oscillator Arguments: minfreq, maxfreq — freq iteration; rateu — update rate for u; ratew — update rate for w; b0 — equation constant; b1 — equation constant; i — arbitrary external impulse; i.e. pulse wave, trigger, lfnoise, or nothing.; initu — reset value for u; initw — reset value for w."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DN.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 136} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.5*Fhn2DN.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DN.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n{ Out.ar(0,Pan2.ar(0.5*Fhn2DN.ar(220,800,0.3,0.3,0.6,0.8,LFPulse.kr(MouseX.kr(1, 10, 1), 0, 0.1)),0.0)) }.play\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig;\n sig=Fhn2DN.ar(110, 22050, TExpRand.kr(0.001, 0.2, Dust.kr(8)), TExpRand.kr(0.001, 0.2, Dust.kr(13)), TRand.kr(0.1, 0.4, Dust.kr(5)),TRand.kr(0.1, 1.9, Dust.kr(3)), mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n);\n\n(\nSynthDef(\\fhn, {|out=0, pan=0, amp=0.1|\n var sig, trig1, trig2, b0, b1;\n trig1=FhnTrig.kr(5, 8, 0.3, 0.3, 1, 1);\n trig2=FhnTrig.kr(8, 13, 0.27, 0.27, 0.6, 0.8);\n b0=Fhn2DN.kr(3, 5, 0.29, 0.29, 0.5, 1.1, mul:0.23, add:0.25);\n b1=Fhn2DN.kr(2, 3, 0.25, 0.25, 0.2, 1.5, mul:0.48, add:0.5);\n sig=Fhn2DN.ar(110, 22050, TExpRand.kr(0.001, 0.3, trig1), TExpRand.kr(0.001, 0.3, trig2), b0, b1, mul:amp);\n Out.ar(0,Pan2.ar(sig, pan))\n}).play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/Fhn2DN.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 644} {"conversations": [{"role": "user", "content": "What is `GaussTrig` in SuperCollider?"}, {"role": "assistant", "content": "GaussTrig — impulses around a certain frequency Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/GaussTrig.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "Explain `GaussTrig` in SuperCollider briefly."}, {"role": "assistant", "content": "GaussTrig — impulses around a certain frequency Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/GaussTrig.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "What does `GaussTrig.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "impulses around a certain frequency Arguments: freq — mean frequency; dev — random deviation from mean (0 <= dev < 1)."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/GaussTrig.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 42} @@ -6022,21 +6027,26 @@ {"conversations": [{"role": "user", "content": "What is `PV_CommonMag` in SuperCollider?"}, {"role": "assistant", "content": "PV_CommonMag — returns common magnitudes Returns magnitudes common to bufferA & bufferB within a tolerance level. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMag.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 59} {"conversations": [{"role": "user", "content": "Explain `PV_CommonMag` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_CommonMag — returns common magnitudes Returns magnitudes common to bufferA & bufferB within a tolerance level. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMag.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 59} {"conversations": [{"role": "user", "content": "What does `PV_CommonMag.new` do? What arguments does it take?"}, {"role": "assistant", "content": "returns common magnitudes Arguments: bufferA — fft buffer A.; bufferB — fft buffer B.; tolerance — magnitudes within which test will pass; remove — scale uncommon magnitudes."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMag.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 78} +{"conversations": [{"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, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-commonMag\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = HPF.ar(Mix(LFSaw.ar([100, 150], 0, 0.2)), 1200);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnumA, inA);\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-commonMag\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = HPF.ar(Mix(LFSaw.ar([100, 150], 0, 0.2)), 1200);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnumA, inA);\n chainB = FFT(bufnumB, inB);\n chain = PV_CommonMag(chainA, chainB, MouseX.kr(0, 50), MouseY.kr);\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnumA, b.bufnum, \\bufnumB, c.bufnum, \\soundBufnum, d.bufnum]);\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMag.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 426} {"conversations": [{"role": "user", "content": "What is `PV_CommonMul` in SuperCollider?"}, {"role": "assistant", "content": "PV_CommonMul — multiplies common magnitudes Returns magnitudes common to bufferA & bufferB within a tolerance level. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMul.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 61} {"conversations": [{"role": "user", "content": "Explain `PV_CommonMul` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_CommonMul — multiplies common magnitudes Returns magnitudes common to bufferA & bufferB within a tolerance level. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMul.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 61} {"conversations": [{"role": "user", "content": "What does `PV_CommonMul.new` do? What arguments does it take?"}, {"role": "assistant", "content": "multiplies common magnitudes Arguments: bufferA — fft buffer A.; bufferB — fft buffer B.; tolerance — magnitudes within which test will pass; remove — scale uncommon magnitudes."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMul.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 79} +{"conversations": [{"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, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-commonMul\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = HPF.ar(Mix(LFSaw.ar([100, 150], 0, 0.2)), 1200);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnumA, inA);\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-commonMul\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = HPF.ar(Mix(LFSaw.ar([100, 150], 0, 0.2)), 1200);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnumA, inA);\n chainB = FFT(bufnumB, inB);\n chain = PV_CommonMul(chainA, chainB, MouseX.kr(0, 50), MouseY.kr);\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnumA, b.bufnum, \\bufnumB, c.bufnum, \\soundBufnum, d.bufnum]);\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_CommonMul.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 425} {"conversations": [{"role": "user", "content": "What is `PV_Compander` in SuperCollider?"}, {"role": "assistant", "content": "PV_Compander — simple spectral compression/expansion Applies compression/expansion to individual magnitudes. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Compander.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "Explain `PV_Compander` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Compander — simple spectral compression/expansion Applies compression/expansion to individual magnitudes. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Compander.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "What does `PV_Compander.new` do? What arguments does it take?"}, {"role": "assistant", "content": "simple spectral compression/expansion Arguments: buffer — fft buffer; thresh — mag thresh; slopeBelow, slopeAbove — same as Compander."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Compander.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 63} {"conversations": [{"role": "user", "content": "What is `PV_Cutoff` in SuperCollider?"}, {"role": "assistant", "content": "PV_Cutoff — zero bins with interpolation Clears bins above or below a cutoff point. Interpolate. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Cutoff.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "Explain `PV_Cutoff` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Cutoff — zero bins with interpolation Clears bins above or below a cutoff point. Interpolate. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Cutoff.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "What does `PV_Cutoff.new` do? What arguments does it take?"}, {"role": "assistant", "content": "zero bins with interpolation Arguments: buffer — fft buffer; wipe — can range between -1 and +1. if wipe == 0 then there is no effect. if wipe > 0 then it acts like a high pass filter, clearing bins from the bottom up. if wipe < 0 then it acts like a low pass filter, clearing bins from the top down.."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Cutoff.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 107} +{"conversations": [{"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,2048,1);\n\n(\nSynthDef(\"help-brick\", { arg out=0, bufnum=0;\n var in, chain;\n in = {WhiteNoise.ar(0.2)}.dup;\n chain = FFT(bufnum, in);\n chain = PV_Cutoff(chain, SinOsc.kr(0.1));\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnum, b.bufnum]);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\nb = Buffer.alloc(s,2048,1);\n\n(\nSynthDef(\"help-brick\", { arg out=0, bufnum=0;\n var in, chain;\n in = {WhiteNoise.ar(0.2)}.dup;\n chain = FFT(bufnum, in);\n chain = PV_Cutoff(chain, SinOsc.kr(0.1));\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnum, b.bufnum]);\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Cutoff.schelp", "aug": "mut:missing_paren", "prompt_tokens": 224, "answer_tokens": 224} {"conversations": [{"role": "user", "content": "What is `PV_MagGate` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagGate — reduces magnitudes above or below thresh For positive values of thresh, acts something like a noise reduction. For negative values, highlights smaller sounds. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagGate.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 67} {"conversations": [{"role": "user", "content": "Explain `PV_MagGate` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagGate — reduces magnitudes above or below thresh For positive values of thresh, acts something like a noise reduction. For negative values, highlights smaller sounds. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagGate.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 67} {"conversations": [{"role": "user", "content": "What does `PV_MagGate.new` do? What arguments does it take?"}, {"role": "assistant", "content": "reduces magnitudes above or below thresh Arguments: buffer — fft buffer; thresh — if positive, scales magnitudes below thresh. if negative scales magnitudes above abs(thresh); remove — amount to scale magnitudes.."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagGate.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 88} +{"conversations": [{"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, 2048, 1);\nc = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-magGate\", { arg out=0, bufnum=0, soundBufnum=2;\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagGate(chain, MouseX.kr(0, 100), MouseY.kr(0, 1));\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnum, b.b\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-magGate\", { arg out=0, bufnum=0, soundBufnum=2;\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagGate(chain, MouseX.kr(0, 100), MouseY.kr(0, 1));\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n);\n\n(\nSynthDef(\"help-magGate2\", { arg out=0, bufnum=0, soundBufnum=2;\n var in, chain, remove;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n remove = MouseY.kr(0, 1);\n chain = PV_MagGate(chain, MouseX.kr(-50, 0), remove);\n Out.ar(out, (remove * 3 - 2) * IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagGate.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 540} {"conversations": [{"role": "user", "content": "What is `PV_MagMinus` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagMinus — subtract spectral energy Subtracts buffer B's magnitudes from buffer A. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagMinus.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "Explain `PV_MagMinus` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagMinus — subtract spectral energy Subtracts buffer B's magnitudes from buffer A. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagMinus.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "What does `PV_MagMinus.new` do? What arguments does it take?"}, {"role": "assistant", "content": "subtract spectral energy Arguments: bufferA — fft buffer A.; bufferB — fft buffer B.; remove — scale the removal process.."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagMinus.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 52} +{"conversations": [{"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, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-magMinus\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n inB = WhiteNoise.ar(LFNoise2.kr(20).max(0));\n chainA = FFT(bufnumA, inA);\n chainB = FFT(\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.alloc(s, 2048, 1);\nd = Buffer.read(s, \"sounds/a11wlk01.wav\");\n);\n\n(\nSynthDef(\"help-magMinus\", { arg out=0, bufnumA=0, bufnumB=1, soundBufnum=2;\n var inA, inB, chainA, chainB, chain;\n inA = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n inB = WhiteNoise.ar(LFNoise2.kr(20).max(0));\n chainA = FFT(bufnumA, inA);\n chainB = FFT(bufnumB, inB);\n chain = PV_MagMinus(chainA, chainB, MouseX.kr(0, 1));\n Out.ar(out, IFFT(chain).dup);\n}).play(s,[\\out, 0, \\bufnumA, b.bufnum, \\bufnumB, c.bufnum, \\soundBufnum, d.bufnum]);\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_MagMinus.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 412} {"conversations": [{"role": "user", "content": "What is `PV_Morph` in SuperCollider?"}, {"role": "assistant", "content": "PV_Morph — one kind of spectral morphing Morphs between two fft buffers by interpolating each bin's polar coordinates. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Morph.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 58} {"conversations": [{"role": "user", "content": "Explain `PV_Morph` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Morph — one kind of spectral morphing Morphs between two fft buffers by interpolating each bin's polar coordinates. Category: UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Morph.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 58} {"conversations": [{"role": "user", "content": "What does `PV_Morph.new` do? What arguments does it take?"}, {"role": "assistant", "content": "one kind of spectral morphing Arguments: bufferA — fft buffer A.; bufferB — fft buffer B.; morph — 0-1."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/PV_Morph.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 53} @@ -6072,6 +6082,7 @@ {"conversations": [{"role": "user", "content": "What is `TBetaRand` in SuperCollider?"}, {"role": "assistant", "content": "TBetaRand — triggered beta random distribution Generates a random float value in beta distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBetaRand.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 80} {"conversations": [{"role": "user", "content": "Explain `TBetaRand` in SuperCollider briefly."}, {"role": "assistant", "content": "TBetaRand — triggered beta random distribution Generates a random float value in beta distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBetaRand.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 80} {"conversations": [{"role": "user", "content": "What does `TBetaRand.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "triggered beta random distribution Arguments: lo — minimum value; hi — maximum value; prob1, prob2 — if prob1 & prob2 are less than 1, values tend towards lo & hi. if they are equal to 1, there is a linear random distribution. higher than 1, the distribution tends towards gaussian, with the possibility of a mean skewed towards the prob of the lowest value.; trig — trigger signal."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBetaRand.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 138} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TBetaRand.kr(300, 3000, 0.1, 0.1, trig)\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig, prob1, prob2;\n trig = Dust.kr(10);\n prob1 = MouseX.kr(1, 5);\n prob2 = MouseY.kr(1, 5);\n SinOsc.ar(\n TBetaRand.kr(300, 3000, prob1, prob2, trig)\n ) * 0.1\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TBetaRand.kr(300, 3000, 0.1, 0.1, trig)\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig, prob1, prob2;\n trig = Dust.kr(10);\n prob1 = MouseX.kr(1, 5);\n prob2 = MouseY.kr(1, 5);\n SinOsc.ar(\n TBetaRand.kr(300, 3000, prob1, prob2, trig)\n ) * 0.1\n}.play;\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBetaRand.schelp", "aug": "mut:missing_paren", "prompt_tokens": 231, "answer_tokens": 231} {"conversations": [{"role": "user", "content": "What is `TBrownRand` in SuperCollider?"}, {"role": "assistant", "content": "TBrownRand — triggered random walk generator Generates a random walk from lo to hi with a Gendyn distribution each time the trig signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBrownRand.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 76} {"conversations": [{"role": "user", "content": "Explain `TBrownRand` in SuperCollider briefly."}, {"role": "assistant", "content": "TBrownRand — triggered random walk generator Generates a random walk from lo to hi with a Gendyn distribution each time the trig signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBrownRand.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 76} {"conversations": [{"role": "user", "content": "What does `TBrownRand.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "triggered random walk generator Arguments: lo — minimum value; hi — maximum value; dev — maximum step (0-1); dist — Gendyn distribution (0-5: see Gendy1 for details); trig — trigger signal."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TBrownRand.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 73} @@ -6083,6 +6094,7 @@ {"conversations": [{"role": "user", "content": "What is `TGrains2` in SuperCollider?"}, {"role": "assistant", "content": "TGrains2 — buffer granulator with linear att/dec Triggers generate grains from a buffer. Each grain has a linear and is panned between two channels of multiple outputs. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains2.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 86} {"conversations": [{"role": "user", "content": "Explain `TGrains2` in SuperCollider briefly."}, {"role": "assistant", "content": "TGrains2 — buffer granulator with linear att/dec Triggers generate grains from a buffer. Each grain has a linear and is panned between two channels of multiple outputs. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains2.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 86} {"conversations": [{"role": "user", "content": "What does `TGrains2.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "buffer granulator with linear att/dec Arguments: numChannels — number of output channels.; trigger — at each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs when a signal changes from <= 0 to > 0. If the trigger is audio rate then the grains will start with sample accuracy.; bufnum — the index of the buffer to use. It must be a one channel (mono) buffer.; rate — 1.0 is normal, 2.0 is one octave up, 0.5 is one octave down. -1.0 is backwards normal rate ... etc. Unlike PlayBuf, the rate is multiplied by BufRate, so you needn't do that yourself.; centerPos — the position in the buffer in seconds at which the grain envelope will reach maximum amplitude.; dur — duration of the grain in seconds.; pan — determines where to pan the output.; amp — amplitude of the grain.."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains2.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 304} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.sendMsg(\\b_allocRead, 10, \"sounds/a11wlk01.wav\");\n\n(\n{\n var b = 10, trate, dur, clk;\n trate = MouseY.kr(2,200,1);\n dur = 4 / trate;\n clk = Dust.kr(trate);\n TGrains2.ar(2, clk, 10, 1.0, LFNoise2.kr(0.5).range(0, BufDur.kr(b)), dur, 0, TRand.kr(0.1, 0.2, clk), MouseX.kr(0.003, 0.01), 0.007, 4);\n}.play;\n);\n\n(\n{\n var b = 10, trate, dur, clk, pos, pan;\n trate = MouseY.kr(8,120,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.sendMsg(\\b_allocRead, 10, \"sounds/a11wlk01.wav\");\n\n(\n{\n var b = 10, trate, dur, clk;\n trate = MouseY.kr(2,200,1);\n dur = 4 / trate;\n clk = Dust.kr(trate);\n TGrains2.ar(2, clk, 10, 1.0, LFNoise2.kr(0.5).range(0, BufDur.kr(b)), dur, 0, TRand.kr(0.1, 0.2, clk), MouseX.kr(0.003, 0.01), 0.007, 4);\n}.play;\n);\n\n(\n{\n var b = 10, trate, dur, clk, pos, pan;\n trate = MouseY.kr(8,120,1);\n dur = 12 / trate;\n clk = Impulse.kr(trate);\n pos = MouseX.kr(0,BufDur.kr(b)) + TRand.kr(0, 0.01, clk);\n pan = WhiteNoise.kr(0.6);\n TGrains2.ar(2, clk, b, 1, pos, dur, pan, 0.1, dur * 0.3, dur * 0.5);\n}.play;\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains2.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 425} {"conversations": [{"role": "user", "content": "What is `TGrains3` in SuperCollider?"}, {"role": "assistant", "content": "TGrains3 — buffer granulator with user envelope Triggers generate grains from a buffer. Each grain has a user-defined rise/decay shape and is panned between two channels of multiple outputs. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains3.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 95} {"conversations": [{"role": "user", "content": "Explain `TGrains3` in SuperCollider briefly."}, {"role": "assistant", "content": "TGrains3 — buffer granulator with user envelope Triggers generate grains from a buffer. Each grain has a user-defined rise/decay shape and is panned between two channels of multiple outputs. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains3.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 95} {"conversations": [{"role": "user", "content": "What does `TGrains3.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "buffer granulator with user envelope Arguments: numChannels — number of output channels.; trigger — at each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs when a signal changes from <= 0 to > 0. If the trigger is audio rate then the grains will start with sample accuracy.; bufnum — the index of the buffer to use. It must be a one channel (mono) buffer.; rate — 1.0 is normal, 2.0 is one octave up, 0.5 is one octave down. -1.0 is backwards normal rate ... etc. Unlike PlayBuf, the rate is multiplied by BufRate, so you needn't do that yourself.; centerPos — the position in the buffer in seconds at which the grain envelope will reach maximum amplitude.; dur — duration of the grain in seconds.; pan — determines where to pan the output.; amp — amplitude of the grain.."}], "family": "B", "source_id": "sc3-plugins:source/BhobUGens/sc/HelpSource/Classes/TGrains3.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 303} @@ -6097,6 +6109,7 @@ {"conversations": [{"role": "user", "content": "What is `IIRFilter` in SuperCollider?"}, {"role": "assistant", "content": "IIRFilter — 24db/oct rolloff, 4nd order resonant Low Pass Filter BlackRain. Category: UGens > Filters."}], "family": "A", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/IIRFilter.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 50} {"conversations": [{"role": "user", "content": "Explain `IIRFilter` in SuperCollider briefly."}, {"role": "assistant", "content": "IIRFilter — 24db/oct rolloff, 4nd order resonant Low Pass Filter BlackRain. Category: UGens > Filters."}], "family": "A", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/IIRFilter.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 50} {"conversations": [{"role": "user", "content": "What does `IIRFilter.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "24db/oct rolloff, 4nd order resonant Low Pass Filter Arguments: in — input signal to be processed; freq — cutoff frequency; rq — the reciprocal of Q. bandwidth / cutoffFreq."}], "family": "B", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/IIRFilter.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 78} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n(\nz = {\n IIRFilter.ar(\n SoundIn.ar([0,1]),\n MouseX.kr(20,20000,\\exponential), // cutoff freq.\n MouseY.kr(0.01, 1.0, \\linear), // rq\n 0.5); // mul\n}.play)\nz.release;\n\n(\nz = {\n var sig, freq;\n freq = MouseX.kr(20,12000,\\exponential);\n sig = IIRFilter.ar(\n LFSaw.ar([freq * 0.99, freq * 1.01], 0, 0.1) ! 2,\n SinOsc.kr(SinOsc.kr(0.1),1.5pi,1550,1800),\n MouseY.kr(0.01,1,\\linear));\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n(\nz = {\n IIRFilter.ar(\n SoundIn.ar([0,1]),\n MouseX.kr(20,20000,\\exponential), // cutoff freq.\n MouseY.kr(0.01, 1.0, \\linear), // rq\n 0.5); // mul\n}.play)\nz.release;\n\n(\nz = {\n var sig, freq;\n freq = MouseX.kr(20,12000,\\exponential);\n sig = IIRFilter.ar(\n LFSaw.ar([freq * 0.99, freq * 1.01], 0, 0.1) ! 2,\n SinOsc.kr(SinOsc.kr(0.1),1.5pi,1550,1800),\n MouseY.kr(0.01,1,\\linear));\n (CombN.ar(sig, 0.4, [0.4,0.35],2) * 0.4) + (sig * 0.5);\n}.play)\nz.release\n```"}], "family": "E", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/IIRFilter.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 342} {"conversations": [{"role": "user", "content": "What is `SVF` in SuperCollider?"}, {"role": "assistant", "content": "SVF — 12db/Oct State Variable Filter Total, 100% Plastic... Category: UGens > Filters."}], "family": "A", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/SVF.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 40} {"conversations": [{"role": "user", "content": "Explain `SVF` in SuperCollider briefly."}, {"role": "assistant", "content": "SVF — 12db/Oct State Variable Filter Total, 100% Plastic... Category: UGens > Filters."}], "family": "A", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/SVF.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 40} {"conversations": [{"role": "user", "content": "What does `SVF.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "12db/Oct State Variable Filter Arguments: signal — audio in; cutoff — cutoff frequency; res — resonance. 0.0 - 1.0; lowpass — lowpass filter output level. 0.0 - 1.0; bandpass — bandpass filter output level. 0.0 - 1.0; highpass — high filter output level. 0.0 - 1.0; notch — notchfilter output level. 0.0 - 1.0; peak — peak filter output level. 0.0 - 1.0."}], "family": "B", "source_id": "sc3-plugins:source/BlackrainUGens/sc/HelpSource/Classes/SVF.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 159} @@ -6195,21 +6208,26 @@ {"conversations": [{"role": "user", "content": "What is `FFTCrest` in SuperCollider?"}, {"role": "assistant", "content": "FFTCrest — Spectral crest measure Given an FFT chain, this produces the spectral crest measure, which is an indicator of the \"peakiness\" of the spectral energy distribution. For example, white noise should produce a flat (non-peaky) spectrum, and therefore a low value for the spectral crest. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTCrest.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 119} {"conversations": [{"role": "user", "content": "Explain `FFTCrest` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTCrest — Spectral crest measure Given an FFT chain, this produces the spectral crest measure, which is an indicator of the \"peakiness\" of the spectral energy distribution. For example, white noise should produce a flat (non-peaky) spectrum, and therefore a low value for the spectral crest. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTCrest.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 119} {"conversations": [{"role": "user", "content": "What does `FFTCrest.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral crest measure Arguments: chain — FFT chain; freqlo; freqhi."}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTCrest.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 33} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s,2048,1);\n\n(\n{ // Example - vary mixture of white noise and pure tone with the mouse\nvar in, chain, crest;\nin = XFade2.ar(WhiteNoise.ar, SinOsc.ar, MouseX.kr(-1,1));\nchain = FFT(b.bufnum, in);\nOut.ar(0, in.dup * 0.1);\n\ncrest = FFTCrest.kr(chain);\n\nOut.kr(0, crest.poll(10, \"crest\"));\n}.play;\n);\n\n(\n{ // Same as above but subbands rather than whole spectrum. move mouse up&down too...\nvar in, chain, crest1, crest2;\nin = XFade2.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s,2048,1);\n\n(\n{ // Example - vary mixture of white noise and pure tone with the mouse\nvar in, chain, crest;\nin = XFade2.ar(WhiteNoise.ar, SinOsc.ar, MouseX.kr(-1,1));\nchain = FFT(b.bufnum, in);\nOut.ar(0, in.dup * 0.1);\n\ncrest = FFTCrest.kr(chain);\n\nOut.kr(0, crest.poll(10, \"crest\"));\n}.play;\n);\n\n(\n{ // Same as above but subbands rather than whole spectrum. move mouse up&down too...\nvar in, chain, crest1, crest2;\nin = XFade2.ar(WhiteNoise.ar, Blip.ar(numharm: MouseY.kr(200, 1, 1)), MouseX.kr(-1,1));\nchain = FFT(b.bufnum, in);\nOut.ar(0, in.dup * 0.1);\n\ncrest1 = FFTCrest.kr(chain, 100, 2000);\ncrest2 = FFTCrest.kr(chain, 2000, 10000);\n\nOut.kr(0, [crest1.poll(10, \"crest1\"), crest2.poll(10, \"crest2\")]);\n}.play;\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTCrest.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 465} {"conversations": [{"role": "user", "content": "What is `FFTPeak` in SuperCollider?"}, {"role": "assistant", "content": "FFTPeak — Find peak value in an FFT frame Given an FFT chain, this finds the bin with the strongest magnitude. It outputs the frequency of that bin, and its magnitude. No interpolation is done on the values. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPeak.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 99} {"conversations": [{"role": "user", "content": "Explain `FFTPeak` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTPeak — Find peak value in an FFT frame Given an FFT chain, this finds the bin with the strongest magnitude. It outputs the frequency of that bin, and its magnitude. No interpolation is done on the values. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPeak.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 99} {"conversations": [{"role": "user", "content": "What does `FFTPeak.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Find peak value in an FFT frame Arguments: buffer; freqlo; freqhi. Returns: # freq, mag."}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPeak.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 45} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Let's see how good it is at tracking the \"pitch\" of a sinewave!\ns.boot;\nb = Buffer.alloc(s,2048,1);\n(\nx = {\nvar in, chain, pitch, freq, mag;\n\npitch = MouseX.kr(100, 1000, 1);\nin = SinOsc.ar(pitch);\nchain = FFT(b.bufnum, in);\n\n# freq, mag = FFTPeak.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\npitch.poll(label: \"Tru freq\");\nfreq .poll(label: \"Inferred\");\n}.play(s);\n;\n\nx.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// Let's see how good it is at tracking the \"pitch\" of a sinewave!\ns.boot;\nb = Buffer.alloc(s,2048,1);\n(\nx = {\nvar in, chain, pitch, freq, mag;\n\npitch = MouseX.kr(100, 1000, 1);\nin = SinOsc.ar(pitch);\nchain = FFT(b.bufnum, in);\n\n# freq, mag = FFTPeak.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\npitch.poll(label: \"Tru freq\");\nfreq .poll(label: \"Inferred\");\n}.play(s);\n);\n\nx.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPeak.schelp", "aug": "mut:missing_paren", "prompt_tokens": 274, "answer_tokens": 272} {"conversations": [{"role": "user", "content": "What is `FFTPower` in SuperCollider?"}, {"role": "assistant", "content": "FFTPower — Instantaneous spectral power Outputs a power measurement (sum of squared magnitudes) taken from an FFT chain. It can be used for similar purposes as the Amplitude UGen but has different characteristics since it operates on the frequency-domain rather than time-domain representation. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPower.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "Explain `FFTPower` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTPower — Instantaneous spectral power Outputs a power measurement (sum of squared magnitudes) taken from an FFT chain. It can be used for similar purposes as the Amplitude UGen but has different characteristics since it operates on the frequency-domain rather than time-domain representation. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPower.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "What does `FFTPower.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Instantaneous spectral power Arguments: buffer; square."}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTPower.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 20} {"conversations": [{"role": "user", "content": "What is `FFTSlope` in SuperCollider?"}, {"role": "assistant", "content": "FFTSlope — Spectral slope Given an FFT chain, this measures the spectral slope, which is the slope of the linear correlation line derived from the spectral magnitudes. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSlope.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 84} {"conversations": [{"role": "user", "content": "Explain `FFTSlope` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTSlope — Spectral slope Given an FFT chain, this measures the spectral slope, which is the slope of the linear correlation line derived from the spectral magnitudes. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSlope.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 84} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Very artificial example - just filtering some noise.\ns.boot;\nb = Buffer.alloc(s,2048,1);\n(\nx = {\nvar in, chain, freq, val;\nfreq = MouseX.kr(20000, 1000, 1);\nin = LPF.ar(WhiteNoise.ar, freq);\nchain = FFT(b.bufnum, in);\n\nval = FFTSlope.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\n(val * 10000).poll(10); // Poll but scaled so more readable!\n}.play(s);\n;\nx.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// Very artificial example - just filtering some noise.\ns.boot;\nb = Buffer.alloc(s,2048,1);\n(\nx = {\nvar in, chain, freq, val;\nfreq = MouseX.kr(20000, 1000, 1);\nin = LPF.ar(WhiteNoise.ar, freq);\nchain = FFT(b.bufnum, in);\n\nval = FFTSlope.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\n(val * 10000).poll(10); // Poll but scaled so more readable!\n}.play(s);\n);\nx.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSlope.schelp", "aug": "mut:missing_paren", "prompt_tokens": 243, "answer_tokens": 241} {"conversations": [{"role": "user", "content": "What is `FFTSpread` in SuperCollider?"}, {"role": "assistant", "content": "FFTSpread — Spectral spread Given an FFT chain, this measures the spectral spread, which is the magnitude-weighted variance. This measure can serve as an (approximate) clue towards the bandwidth of a signal (although the value is not a frequency). Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSpread.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 109} {"conversations": [{"role": "user", "content": "Explain `FFTSpread` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTSpread — Spectral spread Given an FFT chain, this measures the spectral spread, which is the magnitude-weighted variance. This measure can serve as an (approximate) clue towards the bandwidth of a signal (although the value is not a frequency). Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSpread.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 109} {"conversations": [{"role": "user", "content": "What does `FFTSpread.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral spread Arguments: buffer; centroid."}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSpread.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 17} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\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 = MouseX.kr(0.001, 10, 1);\nin = BPF.ar(WhiteNoise.ar, freq, rq);\nchain = FFT(b.bufnum, in);\n\nval = FFTSpread.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\n(val * 0.000001).poll(10); // Poll but scaled down so more readable!\n}.play(s);\n;\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\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 = MouseX.kr(0.001, 10, 1);\nin = BPF.ar(WhiteNoise.ar, freq, rq);\nchain = FFT(b.bufnum, in);\n\nval = FFTSpread.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\n(val * 0.000001).poll(10); // Poll but scaled down so more readable!\n}.play(s);\n);\n\nx.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSpread.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 297} {"conversations": [{"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 = MouseX.kr(0.001, 10, 1);\nin = BPF.ar(WhiteNoise.ar, freq, rq);\nchain = FFT(b.bufnum, in);\n\nval = FFTSpread.kr(chain);\n\nOut.ar(0, in.dup * 0.1);\n(val * 0.000001).poll(10); // Poll but scaled down so more readable!\n}.play(s);\n);\n// …\n```"}, {"role": "assistant", "content": "Very artificial example - just filtering some noise. freq = LFPar.kr(0.3).exprange(100, 1000); (FFTSpread: Spectral spread)"}], "family": "D", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSpread.schelp", "aug": "none", "prompt_tokens": 284, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "What is `FFTSubbandFlatness` in SuperCollider?"}, {"role": "assistant", "content": "FFTSubbandFlatness — Spectral flatness, divided into subbands Calculates the spectral flatness measure, in the same manner as FFTFlatness, but divides the spectrum into (adjacent, non-overlapping) subbands, so returns separate measures for the different subbands. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandFlatness.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 118} {"conversations": [{"role": "user", "content": "Explain `FFTSubbandFlatness` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTSubbandFlatness — Spectral flatness, divided into subbands Calculates the spectral flatness measure, in the same manner as FFTFlatness, but divides the spectrum into (adjacent, non-overlapping) subbands, so returns separate measures for the different subbands. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandFlatness.schelp", "aug": "para:1", "prompt_tokens": 44, "answer_tokens": 118} {"conversations": [{"role": "user", "content": "What does `FFTSubbandFlatness.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral flatness, divided into subbands Arguments: chain; cutfreqs — must be an array of frequencies. For example, to divide a 44100Hz signal into three subbands we might specify [ 5512, 11025 ] as the cutfreqs, giving subbands of 0-5512Hz, 5512-11025Hz, and 11025-22050Hz. (Frequencies above the Nyquist frequency are not included.). Returns: #[flatness1, flatness2, ... flatnessN+1]"}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandFlatness.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 164} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s,2048,1);\nc = Buffer.alloc(s,2048,1);\n(\nx = {\nvar inA, inB, chainA, chainB, chain, vals, cutfreqs;\n//in = LPF.ar(WhiteNoise.ar, MouseX.kr(10,10000, 1));\n\ninA = WhiteNoise.ar;\ninB = Saw.ar;\n\nchainA = FFT(b.bufnum, inA);\nchainB = FFT(c.bufnum, inB);\n\nchain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n\nvals = FFTSubbandPower.kr(chain, [300, 500, 1500]);\n\nvals[\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s,2048,1);\nc = Buffer.alloc(s,2048,1);\n(\nx = {\nvar inA, inB, chainA, chainB, chain, vals, cutfreqs;\n//in = LPF.ar(WhiteNoise.ar, MouseX.kr(10,10000, 1));\n\ninA = WhiteNoise.ar;\ninB = Saw.ar;\n\nchainA = FFT(b.bufnum, inA);\nchainB = FFT(c.bufnum, inB);\n\nchain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n\nvals = FFTSubbandPower.kr(chain, [300, 500, 1500]);\n\nvals[3].poll(10, \"hi \");\nvals[2].poll(10, \"med\");\nvals[1].poll(10, \"low\");\n\nOut.ar(0, IFFT(chain).dup * 0.2);\n}.play(s);\n);\nx.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandFlatness.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 375} {"conversations": [{"role": "user", "content": "What is `FFTSubbandPower` in SuperCollider?"}, {"role": "assistant", "content": "FFTSubbandPower — Spectral power, divided into subbands Calculates the spectral power measure, in the same manner as FFTPower, but divides the spectrum into (adjacent, non-overlapping) subbands, so returns separate power measures for the different subbands. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandPower.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 110} {"conversations": [{"role": "user", "content": "Explain `FFTSubbandPower` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTSubbandPower — Spectral power, divided into subbands Calculates the spectral power measure, in the same manner as FFTPower, but divides the spectrum into (adjacent, non-overlapping) subbands, so returns separate power measures for the different subbands. Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandPower.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 110} {"conversations": [{"role": "user", "content": "What does `FFTSubbandPower.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral power, divided into subbands Arguments: chain; cutfreqs — must be an array of frequencies. For example, to divide a 44100Hz signal into three subbands we might specify [ 5512, 11025 ] as the cutfreqs, giving subbands of 0-5512Hz, 5512-11025Hz, and 11025-22050Hz. (Frequencies above the Nyquist frequency are not included.); square — performs the same role as in FFTPower.; scalemode — specifies how the band powers are scaled: Mode 1 (default) is to scale the same way as FFTPower does (according to the total number of bins in the FFT). This means that if you add up the power from the various bins, you'll get the same result as if you'd just used FFTPower. This gives the best impre. Returns: #[power1, power2, ... powerN+1]"}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/FFTSubbandPower.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 270} @@ -6218,6 +6236,7 @@ {"conversations": [{"role": "user", "content": "What is `GaussClass` in SuperCollider?"}, {"role": "assistant", "content": "GaussClass — Gaussian classifier A Gaussian classifier, which classifies an input vector as belonging to one of the gaussian distributions defined in a specially-formatted Buffer. Category: UGens."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/GaussClass.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "Explain `GaussClass` in SuperCollider briefly."}, {"role": "assistant", "content": "GaussClass — Gaussian classifier A Gaussian classifier, which classifies an input vector as belonging to one of the gaussian distributions defined in a specially-formatted Buffer. Category: UGens."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/GaussClass.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "What does `GaussClass.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Gaussian classifier Arguments: in — input signal, a multichannel signal specifying a co-ordinate in the space (i.e. a vector).; bufnum — the buffer in which the shapes and weights of the gaussian components are specified.; gate — the classifier is only active when this is greater than 0 (otherwise, previous value is held constant). Its default value is 1.."}], "family": "B", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/GaussClass.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 119} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n~classes = [\n[ // First class's mean, covariance, weight:\n[2, 8], [[1, 0], [0, 1]], 0.3\n],[ // Second class's mean, covariance, weight:\n[8, 2], [[1, 0], [0, 1]], 0.3\n],[ // Third class's mean, covariance, weight:\n[8, 8], [[0.75, 0.5], [0.5, 0.75]], 0.4\n]\n];\n~serialised = GaussClass.classesToFloatArray(~classes);\n);\n\n// Now let's use it:\ns.boot;\nb = Buffer.loadCollection(s, ~serialised);\n(\nx = {\nvar rate = 20, input, result, gate;\n//input = {LFNoise2\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n~classes = [\n[ // First class's mean, covariance, weight:\n[2, 8], [[1, 0], [0, 1]], 0.3\n],[ // Second class's mean, covariance, weight:\n[8, 2], [[1, 0], [0, 1]], 0.3\n],[ // Third class's mean, covariance, weight:\n[8, 8], [[0.75, 0.5], [0.5, 0.75]], 0.4\n]\n];\n~serialised = GaussClass.classesToFloatArray(~classes);\n);\n\n// Now let's use it:\ns.boot;\nb = Buffer.loadCollection(s, ~serialised);\n(\nx = {\nvar rate = 20, input, result, gate;\n//input = {LFNoise2.kr(rate).range(0, 10)}.dup(2); // Our \"query point\" wanders around in space\ninput = [MouseX.kr(0, 10), MouseY.kr(0, 10)]; // Or you can wander yourself using the mouse\ngate = Impulse.kr(rate);\nresult = GaussClass.kr(input, b, gate);\ninput.poll(gate, \"input\");\nresult.poll(gate, \"result\");\nOut.ar(0, SinOsc.ar(result.linexp(0, ~classes.size-1, 440, 880), 0, 0.1).dup); // sonify\n}.play(s)\n);\nx.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/GaussClass.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 494} {"conversations": [{"role": "user", "content": "What is `Getenv` in SuperCollider?"}, {"role": "assistant", "content": "Getenv — Read (numeric) shell environment variables into a synth Tries to grab a shell environment variable (with name key) and convert it to a floating-point value, which is output. Category: UGens."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/Getenv.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 63} {"conversations": [{"role": "user", "content": "Explain `Getenv` in SuperCollider briefly."}, {"role": "assistant", "content": "Getenv — Read (numeric) shell environment variables into a synth Tries to grab a shell environment variable (with name key) and convert it to a floating-point value, which is output. Category: UGens."}], "family": "A", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/Getenv.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 63} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nServer.local.quit; // If server running, need to stop it for this example\n\n// We'll modify the server boot procedure to set our env var...\n~realserverprogram = Server.program;\nServer.program = \"export PANCREAS=220;\" + Server.program\ns.boot;\n\n(\nx = {\n// Env var specifies frequency.\n// If you change the env var name to one that isn't set, 440 is used.\nSinOsc.ar(Getenv(\\PANCREAS, 440), 0, 0.1);\n}.play(Server.local);\n;\nx.free;\n\n// This should restore the variable to what it was\nServer.program = ~realserverprogram;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nServer.local.quit; // If server running, need to stop it for this example\n\n// We'll modify the server boot procedure to set our env var...\n~realserverprogram = Server.program;\nServer.program = \"export PANCREAS=220;\" + Server.program\ns.boot;\n\n(\nx = {\n// Env var specifies frequency.\n// If you change the env var name to one that isn't set, 440 is used.\nSinOsc.ar(Getenv(\\PANCREAS, 440), 0, 0.1);\n}.play(Server.local);\n);\nx.free;\n\n// This should restore the variable to what it was\nServer.program = ~realserverprogram;\n```"}], "family": "E", "source_id": "sc3-plugins:source/MCLDUGens/sc/HelpSource/Classes/Getenv.schelp", "aug": "mut:missing_paren", "prompt_tokens": 279, "answer_tokens": 277} @@ -6372,16 +6391,20 @@ {"conversations": [{"role": "user", "content": "What is `KeyClarity` in SuperCollider?"}, {"role": "assistant", "content": "KeyClarity — Running score of maximum correlation of chromagram with key profiles A (12TET major/minor) key tracker based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is the strength of the match to scales, e.g. maximal correlation with key profiles. Provides a measure of the level of key clarity, e.g. unambiguous key. Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyClarity.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 169} {"conversations": [{"role": "user", "content": "Explain `KeyClarity` in SuperCollider briefly."}, {"role": "assistant", "content": "KeyClarity — Running score of maximum correlation of chromagram with key profiles A (12TET major/minor) key tracker based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is the strength of the match to scales, e.g. maximal correlation with key profiles. Provides a measure of the level of key clarity, e.g. unambiguous key. Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyClarity.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 169} {"conversations": [{"role": "user", "content": "What does `KeyClarity.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Running score of maximum correlation of chromagram with key profiles Arguments: chain — [fft] Audio input to track. This must have been pre-analysed by a 4096 size FFT. No other FFT sizes are valid except as noted below. `// With standard hop of half FFT size = 2048 samples`; keydecay — [sk] Number of seconds for the influence of a window on the final key decision to decay by 40dB (to 0.01 its original value).; chromaleak — [sk] Each frame, the chroma values are set to the previous value multiplied by the chromadecay. 0.0 will start each frame afresh with no memory.."}], "family": "B", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyClarity.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 206} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nd = Buffer.read(s, \"/data/audio/mirdata/pixiesivebeentired.wav\")\n\nd = Buffer.read(s,\"/data/audio/mirdata/Beethoven8mvt4.wav\")\n\nb = Buffer.alloc(s, 4096, 1); // for sampling rates 44100 and 48000\n\n(\n{\nvar in, fft, resample;\nvar key, transientdetection;\n\nin = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\nfft = FFT(b, in);\n\nkey=KeyClarity.kr(fft, 2.0, 0.5);\n\nkey.poll;\n\nOut.ar(0,Pan2.ar(in));\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nd = Buffer.read(s, \"/data/audio/mirdata/pixiesivebeentired.wav\")\n\nd = Buffer.read(s,\"/data/audio/mirdata/Beethoven8mvt4.wav\")\n\nb = Buffer.alloc(s, 4096, 1); // for sampling rates 44100 and 48000\n\n(\n{\nvar in, fft, resample;\nvar key, transientdetection;\n\nin = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\nfft = FFT(b, in);\n\nkey=KeyClarity.kr(fft, 2.0, 0.5);\n\nkey.poll;\n\nOut.ar(0,Pan2.ar(in));\n}.play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyClarity.schelp", "aug": "mut:missing_paren", "prompt_tokens": 293, "answer_tokens": 293} {"conversations": [{"role": "user", "content": "What is `KeyMode` in SuperCollider?"}, {"role": "assistant", "content": "KeyMode — Find best correlated key mode with chromagram between major, minor and chromatic cluster A key mode tracker where output 0 = major, 1 = minor, 2 = chromatic (cluster). Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyMode.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 78} {"conversations": [{"role": "user", "content": "Explain `KeyMode` in SuperCollider briefly."}, {"role": "assistant", "content": "KeyMode — Find best correlated key mode with chromagram between major, minor and chromatic cluster A key mode tracker where output 0 = major, 1 = minor, 2 = chromatic (cluster). Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyMode.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 78} {"conversations": [{"role": "user", "content": "What does `KeyMode.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Find best correlated key mode with chromagram between major, minor and chromatic cluster Arguments: chain — [fft] Audio input to track. This must have been pre-analysed by a 4096 size FFT. No other FFT sizes are valid except as noted below. `// With standard hop of half FFT size = 2048 samples`; keydecay — [sk] Number of seconds for the influence of a window on the final key decision to decay by 40dB (to 0.01 its original value).; chromaleak — [sk] Each frame, the chroma values are set to the previous value multiplied by the chromadecay. 0.0 will start each frame afresh with no memory.."}], "family": "B", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyMode.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 212} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\nd = Buffer.read(s, \"/data/audio/mirdata/pixiesivebeentired.wav\")\n\nd = Buffer.read(s,\"/data/audio/mirdata/Beethoven8mvt4.wav\")\n\nb = Buffer.alloc(s, 4096, 1); // for sampling rates 44100 and 48000\n\n(\n{\nvar in, fft, resample;\nvar mode;\n\nin = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\nfft = FFT(b, in);\n\nmode=KeyMode.kr(fft, 2.0, 0.5);\n\nmode.poll;\n\nOut.ar(0,Pan2.ar(in));\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\nd = Buffer.read(s, \"/data/audio/mirdata/pixiesivebeentired.wav\")\n\nd = Buffer.read(s,\"/data/audio/mirdata/Beethoven8mvt4.wav\")\n\nb = Buffer.alloc(s, 4096, 1); // for sampling rates 44100 and 48000\n\n(\n{\nvar in, fft, resample;\nvar mode;\n\nin = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\nfft = FFT(b, in);\n\nmode=KeyMode.kr(fft, 2.0, 0.5);\n\nmode.poll;\n\nOut.ar(0,Pan2.ar(in));\n}.play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/KeyMode.schelp", "aug": "mut:missing_paren", "prompt_tokens": 288, "answer_tokens": 288} {"conversations": [{"role": "user", "content": "What is `SensoryDissonance` in SuperCollider?"}, {"role": "assistant", "content": "SensoryDissonance — Perceptual feature modeling sensory dissonance Sensory Dissonance model, measuring roughness between pairs of prominent spectral peaks. Follows the algorithm in William A. Sethares (1998) Consonance-Based Spectral Mappings. CMJ 22(1): 56-72. Category: UGens > Analysis."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SensoryDissonance.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 113} {"conversations": [{"role": "user", "content": "Explain `SensoryDissonance` in SuperCollider briefly."}, {"role": "assistant", "content": "SensoryDissonance — Perceptual feature modeling sensory dissonance Sensory Dissonance model, measuring roughness between pairs of prominent spectral peaks. Follows the algorithm in William A. Sethares (1998) Consonance-Based Spectral Mappings. CMJ 22(1): 56-72. Category: UGens > Analysis."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SensoryDissonance.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 113} {"conversations": [{"role": "user", "content": "What does `SensoryDissonance.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Perceptual feature modeling sensory dissonance Arguments: fft — input fft chain, that is, from an FFT UGen; maxpeaks — Maximum number of spectral peaks detected; cannot be modulated, initialisation only.; peakthreshold — Minimum spectral power detection threshold for a peak; norm — Normalisation factor. Calculated for you in the UGen class if you don't provide one, but you can experiment here. In combination with the next argument and maxpeaks, allows you to have alternative range outputs if you so desire.; clamp — Clamps very high dissonances, in default mode will end up with sensory dissonance measure in range 0.0 to 1.0."}], "family": "B", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SensoryDissonance.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 212} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n\nvar in, fft, dissonance;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\ndissonance=SensoryDissonance.kr(fft);\n\ndissonance.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,(dissonance.sqrt)*200))); \n}.play\n);\n\n\n\n//different fftsize, max num peaks, own normalisation, avoid clamping by setting high value (more CPU cost) \n(\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n\nvar in, fft, dissonance;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\ndissonance=SensoryDissonance.kr(fft);\n\ndissonance.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,(dissonance.sqrt)*200))); \n}.play\n);\n\n\n\n//different fftsize, max num peaks, own normalisation, avoid clamping by setting high value (more CPU cost) \n(\n{\n\nvar in, fft, dissonance;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(4096), in);\n\ndissonance=SensoryDissonance.kr(fft,500,1.0,1.0,999999);\n\ndissonance.poll; \n\nOut.ar(0,SinOsc.ar(dissonance*0.1,0,0.1)); \n}.play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SensoryDissonance.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 492} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\n{\n\nvar in, fft, dissonance;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\ndissonance=SensoryDissonance.kr(fft);\n\ndissonance.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,(dissonance.sqrt)*200))); \n}.play\n);\n\n\n\n//different fftsize, max num peaks, own normalisation, avoid clamping by setting high value (more CPU cost) \n(\n// …\n```"}, {"role": "assistant", "content": "in = SinOsc.ar(MouseX.kr(100,1000),0,0.1); in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); (SensoryDissonance: Perceptual feature modeling sensory dissonance)"}], "family": "D", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SensoryDissonance.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 86} {"conversations": [{"role": "user", "content": "What is `SpectralEntropy` in SuperCollider?"}, {"role": "assistant", "content": "SpectralEntropy — Spectral feature extraction Spectral Entropy, with a choice of number of sub-bands. If one band, a measure of general peakiness of the spectral distribution. Category: UGens > Analysis."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SpectralEntropy.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 72} {"conversations": [{"role": "user", "content": "Explain `SpectralEntropy` in SuperCollider briefly."}, {"role": "assistant", "content": "SpectralEntropy — Spectral feature extraction Spectral Entropy, with a choice of number of sub-bands. If one band, a measure of general peakiness of the spectral distribution. Category: UGens > Analysis."}], "family": "A", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SpectralEntropy.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 72} {"conversations": [{"role": "user", "content": "What does `SpectralEntropy.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral feature extraction Arguments: fft — input fft chain, that is, from an FFT UGen; fftsize — Size of FFT buffer must be known in advance for pre-calculation; numbands — Number of sub-bands for entropy calculation; spectral bins are collected in sub-bands, and the number of outputs of the UGen is numbands."}], "family": "B", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SpectralEntropy.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 115} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n\nvar in, fft, entropy;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\nentropy=SpectralEntropy.kr(fft,2048,1); //one output band (so full spectrum's entropy)\n\nentropy.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,10*(entropy.sqrt)))); \n}.play\n);\n\n\n\n\n(\n{\n\nvar in, fft, entropy;\nvar amplit\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n\nvar in, fft, entropy;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\nentropy=SpectralEntropy.kr(fft,2048,1); //one output band (so full spectrum's entropy)\n\nentropy.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,10*(entropy.sqrt)))); \n}.play\n);\n\n\n\n\n(\n{\n\nvar in, fft, entropy;\nvar amplitude; \n\nin= SoundIn.ar; \n\namplitude = Amplitude.kr(in); \n\nfft = FFT(LocalBuf(1024), in);\n\nentropy=SpectralEntropy.kr(fft,1024,10);//10 bands\n\nentropy = entropy * (amplitude.min(0.2)*5.0); //scale by amplitude to avoid low amplitude noise issues\n\nentropy.poll; \n\n//Out.ar(0,Pan2.ar(0.1*Blip.ar((entropy[0])*200,entropy[1].sqrt))); \n\nOut.ar(0,Splay.ar(0.1*Blip.ar((entropy)*200,entropy.sqrt)));\n}.play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SpectralEntropy.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 519} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\n{\n\nvar in, fft, entropy;\n\n//in = SinOsc.ar(MouseX.kr(100,1000),0,0.1);\n//in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); \nin= SoundIn.ar; \n\nfft = FFT(LocalBuf(2048), in);\n\nentropy=SpectralEntropy.kr(fft,2048,1); //one output band (so full spectrum's entropy)\n\nentropy.poll; \n\nOut.ar(0,Pan2.ar(0.1*Blip.ar(100,10*(entropy.sqrt)))); \n}.play\n);\n\n\n\n\n(\n{\n\nvar in, fft, entropy;\nvar amplit\n// …\n```"}, {"role": "assistant", "content": "in = SinOsc.ar(MouseX.kr(100,1000),0,0.1); in = Mix(SinOsc.ar([440,MouseX.kr(440,880)],0,0.1)); (SpectralEntropy: Spectral feature extraction)"}], "family": "D", "source_id": "sc3-plugins:source/SCMIRUGens/sc/HelpSource/Classes/SpectralEntropy.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 81} {"conversations": [{"role": "user", "content": "What is `Breakcore` in SuperCollider?"}, {"role": "assistant", "content": "Breakcore — breakcore simulator This is noisy. Category: UGens > Generators > Chaotic."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/Breakcore.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "Explain `Breakcore` in SuperCollider briefly."}, {"role": "assistant", "content": "Breakcore — breakcore simulator This is noisy. Category: UGens > Generators > Chaotic."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/Breakcore.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 37} @@ -6453,6 +6476,7 @@ {"conversations": [{"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\nPrintVal.kr(LFNoise1.kr(100,0.1), 10, 2);\n\n}).play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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\nPrintVal.kr(LFNoise1.kr(100,0.1), 10, 2);\n\n}).play\n)\n```"}], "family": "E", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/PrintVal.schelp", "aug": "mut:missing_paren", "prompt_tokens": 191, "answer_tokens": 191} {"conversations": [{"role": "user", "content": "What is `SLOnset` in SuperCollider?"}, {"role": "assistant", "content": "SLOnset — experimental time domain onset detector Purely time domain onset detector Category: UGens > Analysis //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/SLOnset.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 100} {"conversations": [{"role": "user", "content": "Explain `SLOnset` in SuperCollider briefly."}, {"role": "assistant", "content": "SLOnset — experimental time domain onset detector Purely time domain onset detector Category: UGens > Analysis //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/SLOnset.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 100} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nx = {arg threshold=10.0; \n\nvar input, onsets; \n\ninput = SoundIn.ar(0); \n\nonsets= SLOnset.kr(input,20,5,5,threshold); \n\nOut.ar(0, SinOsc.ar(440,0,0.1)*Decay2.ar(K2A.ar(onsets), 0.01, 0.1)); \n\n}.play;\n);\n\n\nx.set(\\threshold, 10.0)\n\n\nx.free;\n\n\nb = Buffer.read(s,\"sounds/a11wlk01.wav\"); // remember to free the buffer later.\nb = Buffer.read(s,\"sounds/break2\"); // remember to free the buffer later.\n\n\n(\nx = {arg threshold=10.0\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nx = {arg threshold=10.0; \n\nvar input, onsets; \n\ninput = SoundIn.ar(0); \n\nonsets= SLOnset.kr(input,20,5,5,threshold); \n\nOut.ar(0, SinOsc.ar(440,0,0.1)*Decay2.ar(K2A.ar(onsets), 0.01, 0.1)); \n\n}.play;\n);\n\n\nx.set(\\threshold, 10.0)\n\n\nx.free;\n\n\nb = Buffer.read(s,\"sounds/a11wlk01.wav\"); // remember to free the buffer later.\nb = Buffer.read(s,\"sounds/break2\"); // remember to free the buffer later.\n\n\n(\nx = {arg threshold=10.0, hysteresis=20; \n\nvar input, onsets; \n\ninput = PlayBuf.ar(1, b, BufRateScale.kr(b), loop:1);\n\nonsets= SLOnset.kr(input,20,5,5,threshold,hysteresis); \n\nOut.ar(0, input + (SinOsc.ar(440,0,0.1)*Decay2.ar(K2A.ar(onsets), 0.01, 0.05))); \n\n}.play;\n);\n\n\n//by setting these appropriately can get somewhere...\nx.set(\\threshold, 50.0)\nx.set(\\hysteresis, 10.0)\n\nb.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/SLOnset.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 497} {"conversations": [{"role": "user", "content": "What is `Sieve1` in SuperCollider?"}, {"role": "assistant", "content": "Sieve1 — Fuzzy sieve based synthesis Implementation of Xenakis's idea of sieve based synthesis, generalized to use fuzzy (probabilistic) sieves. Sieves are stored in buffers and can be dynamically swapped. Category: UGens > Generators > Stochastic //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/Sieve1.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 158} {"conversations": [{"role": "user", "content": "Explain `Sieve1` in SuperCollider briefly."}, {"role": "assistant", "content": "Sieve1 — Fuzzy sieve based synthesis Implementation of Xenakis's idea of sieve based synthesis, generalized to use fuzzy (probabilistic) sieves. Sieves are stored in buffers and can be dynamically swapped. Category: UGens > Generators > Stochastic //SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html."}], "family": "A", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/Sieve1.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 158} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n//MUST be a buffer with data in format [sizeofcurrentsieve,sieveentry1,sieveentry2,...] where currentsize always less than initially allocated buffer length -1. \n\n{ Sieve1.ar(LocalBuf.newFrom([10]++({0.75.rand}!10)),MouseX.kr(2,100))*0.2}.play\n\n{ Sieve1.ar(LocalBuf.newFrom([88]++({[0.1.rand,0.5.rand].wchoose([0.8,0.2])}!88)),MouseX.kr(1,100))*0.2}.play\n\nb = Buffer.alloc(s,300); \n\nb.setn(0, [88]++({[0.1.rand,0.5.rand]\n// …\n```"}, {"role": "assistant", "content": "MUST be a buffer with data in format [sizeofcurrentsieve,sieveentry1,sieveentry2,...] where currentsize always less than initially allocated buffer length -1. dynamically swap buffer (Sieve1: Fuzzy sieve based synthesis)"}], "family": "D", "source_id": "sc3-plugins:source/SLUGens/sc/HelpSource/Classes/Sieve1.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 88} @@ -6529,6 +6553,7 @@ {"conversations": [{"role": "user", "content": "What is `VOSIM` in SuperCollider?"}, {"role": "assistant", "content": "VOSIM — vosim pulse generator Category: UGens > Generators."}], "family": "A", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 27} {"conversations": [{"role": "user", "content": "Explain `VOSIM` in SuperCollider briefly."}, {"role": "assistant", "content": "VOSIM — vosim pulse generator Category: UGens > Generators."}], "family": "A", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 27} {"conversations": [{"role": "user", "content": "What does `VOSIM.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "vosim pulse generator Arguments: trig — [ar kr] starts a vosim pulse when a transition from non-positive to positive occurs and no other vosim is still going. audio rate input will produce sample accurate triggering.; freq — [ar kr] the frequency of the squared sinewave.; nCycles — the number of squared sinewaves to use in one vosim pulse. nCycles gets checked when VOSIM receives a trigger.; decay — the decay factor.."}], "family": "B", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 155} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\nz = {VOSIM.ar(Impulse.ar(100), MouseX.kr(440, 880, 1), 3, 0.99)}.play;\n\nz.free;\n\n(\nz = { \n var p,t,f,n,d,a,l,x,y,z,x_,y_;\n p = TRand.ar(0.0,1.0,Impulse.ar(6.0));\n t = Impulse.ar(9*(1+(p>0.95)));\n f = TRand.ar([40.0,120.0,220.0],[440.0,990.0,880.0],t);\n n = TRand.ar(4.0,[8.0, 16.0, 32.0],t);\n d = TRand.ar([0.2,0.4,0.6\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\nz = {VOSIM.ar(Impulse.ar(100), MouseX.kr(440, 880, 1), 3, 0.99)}.play;\n\nz.free;\n\n(\nz = { \n var p,t,f,n,d,a,l,x,y,z,x_,y_;\n p = TRand.ar(0.0,1.0,Impulse.ar(6.0));\n t = Impulse.ar(9*(1+(p>0.95)));\n f = TRand.ar([40.0,120.0,220.0],[440.0,990.0,880.0],t);\n n = TRand.ar(4.0,[8.0, 16.0, 32.0],t);\n d = TRand.ar([0.2,0.4,0.6],[0.6, 0.8, 1.0],t);\n a = TRand.ar(0.0,[0.2, 0.6, 1.0],t);\n l = TRand.ar(-1.0,1.0,t);\n x = MouseX.kr(0.25,2.0);\n y = MouseY.kr(0.25,1.5);\n z = 9.0;\n x_ = x * LFNoise2.kr(z).range(0.25,2.0);\n y_ = y * LFNoise2.kr(z).range(0.25,2.0);\n Out.ar(0, Pan2.ar(Mix.ar(VOSIM.ar(t, f*x_, n, d*y_) * a),l,1));\n}.play;\n);\n\nz.free;\n```"}], "family": "E", "source_id": "sc3-plugins:source/VOSIMUGens/sc/HelpSource/Classes/VOSIM.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 515} {"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nf = ();\nf.beatAndBar = {\n var t = currentEnvironment.clock; // t= TempoClock.new;\n var text = \"xB: \";\n\n var nBeatsPerBar = { arg n, beats, clock;\n var nBpb = clock.beatsPerBar * n;\n \"\" ++ n ++ text ++ (nBpb - (beats%(nBpb))).asInteger\n };\n\n t.play({arg beats, time, clock;\n ( //[\"beat: \" ++ (t.beatInBar + 1).asInteger] ++ //uncomment for beat in bar\n [1,2,4,8,16,32].collect( {|n,i| nBeatsPerBar.value(n, beats, clock)})\n ).postln;\n 1});\n \"beatAntBar\";\n}\n);\n\nf[\\beatAndBar].value;\n\n(\nf[\\beatAndBar].value;\nCmdPeriod.add(f[\\beatAndBar]);\n)\n```"}, {"role": "assistant", "content": "Prints beats to bars for a mutiple of bar.\r\nHow many beats left until next 1, 2, 4, 8, 16, 32, etc bar."}], "family": "D3", "source_id": "sccode:1-5ig", "aug": "patch", "prompt_tokens": 357, "answer_tokens": 46} {"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\n\n~remapConfig = IdentityDictionary[\n 0 -> 1,\n 1 -> 2,\n 2 -> 3,\n 3 -> 4,\n 4 -> 5,\n 5 -> 6,\n 6 -> 7,\n 7 -> 8,\n 8 -> 9,\n 9 -> 12,\n 10 -> 13,\n 11 -> 14,\n 12 -> 15,\n 13 -> 16,\n 14 -> 17\n];\n\n\n~generateRemapSynthDef = { |numInputChannels, numOutputChannels|\n SynthDef(\\remapOutputs, {\n var sig = In.ar(0, numInputChannels); \n var remapped = Array.fill(numOutputChannels, { Silent.ar(1) }); \n\n ~remapConfig.keysValuesDo { |src, dest|\n if (src < numInputChannels and: { dest < numOutputChannels }) {\n remapped[dest] = sig[src];\n }\n };\n\n ReplaceOut.ar(0, remapped);\n }).add;\n};\n\n~generateRemapSynthDef.(16, 18); \n);\n\n(\n~createRemapSynth = {\n ~remapSynth = Synth(\\remapOutputs, target: s.defaultGroup, addAction: \\addAfter);\n};\n\nServerTree.add( ~createRemapSynth);\n\n)\n```"}, {"role": "assistant", "content": "This code sets up a remapping system where input channels are mapped to output channels based on a predefined configuration. The remapping is done using a SynthDef that reads input signals, applies the remapping, and outputs the remapped signals. The ServerTree.add ensures that the remap synth is created and added to the server's node tree upon server startup and cmd-. and ctrl-.\r\n\r\nBased on discu."}], "family": "D3", "source_id": "sccode:1-5i0", "aug": "patch", "prompt_tokens": 478, "answer_tokens": 134} {"conversations": [{"role": "user", "content": "What does this SuperCollider patch do?\n```supercollider\n(\nPdef(\\zed, \n Pbind(\n \\osc, Pseq([SinOsc, LFSaw],inf),\n \\instrument, Prout({ arg ev;\n SynthDef(\\zed, { arg out=0, gate=1, amp=0.1, pan=0, freq=200;\n var sig;\n sig = ev[\\osc].ar(freq);\n sig = sig * EnvGen.kr(\\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n }).add.yield;\n }).loop,\n \\degree, Pseq([0],inf),\n \\dur, 1,\n \\amp, 0.1,\n )\n).play;\n);\n```"}, {"role": "assistant", "content": "synthdef building should take less time than s.latency for this to work."}], "family": "D3", "source_id": "sccode:1-5hA", "aug": "patch", "prompt_tokens": 309, "answer_tokens": 22} @@ -6715,6 +6740,7 @@ {"conversations": [{"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// follow but round to next midinote\n{ a = Pitch.kr(SoundIn.ar).at(1); Pulse.ar(a.cpsmidi.round.midicps * 0.1 }.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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// follow but round to next midinote\n{ a = Pitch.kr(SoundIn.ar).at(1); Pulse.ar(a.cpsmidi.round.midicps) * 0.1 }.play;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "mut:missing_paren", "prompt_tokens": 209, "answer_tokens": 208} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Add two UGens\n{ SinOsc.ar(440, 0, 0.2) + PinkNoise.ar(0.1; }.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// Add two UGens\n{ SinOsc.ar(440, 0, 0.2) + PinkNoise.ar(0.1); }.play\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "mut:missing_paren", "prompt_tokens": 93, "answer_tokens": 91} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Add two NodeProxies\nNdef(\\x, { SinOsc.ar(440, 0, 0.2) });\nNdef(\\y, { PinkNoise.ar(0.1) });\nNdef(\\z, Ndef(\\x) + Ndef(\\y).play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// Add two NodeProxies\nNdef(\\x, { SinOsc.ar(440, 0, 0.2) });\nNdef(\\y, { PinkNoise.ar(0.1) });\nNdef(\\z, Ndef(\\x) + Ndef(\\y)).play;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "mut:missing_paren", "prompt_tokens": 131, "answer_tokens": 130} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// example:\n(\nvar f, g, product;\nf = { SinOsc.ar(400) };\ng = { LFPulse.kr(8) };\nproduct = f * g * 0.1;\n{ Pan2.ar(product, SinOsc.kr(0.3)) }.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// example:\n(\nvar f, g, product;\nf = { SinOsc.ar(400) };\ng = { LFPulse.kr(8) };\nproduct = f * g * 0.1;\n{ Pan2.ar(product, SinOsc.kr(0.3)) }.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "mut:missing_paren", "prompt_tokens": 139, "answer_tokens": 139} {"conversations": [{"role": "user", "content": "What is `AbstractFunction`?"}, {"role": "assistant", "content": "AbstractFunction — An object which responds to a set of messages that represent mathematical functions"}, {"role": "user", "content": "What does `AbstractFunction.neg` do?"}, {"role": "assistant", "content": "`a = { 10.rand.postln }; b = a.neg; b.value;`"}, {"role": "user", "content": "Show me a working example."}, {"role": "assistant", "content": "```supercollider\na = { |x, root = 60| x + root }; b = a.midicps; [a.value(9), b.value(9)];\na = Pseries(60, 1, inf).midicps; a.asStream.nextN(12);\n{ a = LFNoise1.ar(1) * 5 + 60; Pulse.ar(a.round.midicps) * 0.1 }.play;\n```"}], "family": "G", "source_id": "supercollider:HelpSource/Classes/AbstractFunction.schelp", "aug": "none", "prompt_tokens": 139, "answer_tokens": 121} {"conversations": [{"role": "user", "content": "What is `AbstractGridLines` in SuperCollider?"}, {"role": "assistant", "content": "AbstractGridLines — Calculates the numerical values suitable for grid lines to be used for plotting or other UI elements. `AbstractGridLines` and its subclasses are strategy objects that find suitable intervals for plotting grid lines and labels. The data range and warping behavior (e.g. linear or exponential) are derived from the corresponding ControlSpec. The instance methods of `AbstractGridLines` are used by DrawGrid (which is in turn used by Plotter) for getting logically spaced intervals that span the data for Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/AbstractGridLines.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 193} {"conversations": [{"role": "user", "content": "Explain `AbstractGridLines` in SuperCollider briefly."}, {"role": "assistant", "content": "AbstractGridLines — Calculates the numerical values suitable for grid lines to be used for plotting or other UI elements. `AbstractGridLines` and its subclasses are strategy objects that find suitable intervals for plotting grid lines and labels. The data range and warping behavior (e.g. linear or exponential) are derived from the corresponding ControlSpec. The instance methods of `AbstractGridLines` are used by DrawGrid (which is in turn used by Plotter) for getting logically spaced intervals that span the data for Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/AbstractGridLines.schelp", "aug": "para:1", "prompt_tokens": 43, "answer_tokens": 193} @@ -7041,6 +7067,11 @@ {"conversations": [{"role": "user", "content": "What is `Ball` in SuperCollider?"}, {"role": "assistant", "content": "Ball — physical model of bouncing object Ball models the path of a bouncing object that is reflected by a vibrating surface. Category: UGens > Filters > Nonlinear, UGens > Generators > PhysicalModels."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "Explain `Ball` in SuperCollider briefly."}, {"role": "assistant", "content": "Ball — physical model of bouncing object Ball models the path of a bouncing object that is reflected by a vibrating surface. Category: UGens > Filters > Nonlinear, UGens > Generators > PhysicalModels."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 69} {"conversations": [{"role": "user", "content": "What does `Ball.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "physical model of bouncing object Arguments: in — modulated surface level; g — gravity; damp — damping on impact; friction — proximity from which on attraction to surface starts."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 61} +{"conversations": [{"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}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 108} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "mut:missing_paren", "prompt_tokens": 149, "answer_tokens": 149} +{"conversations": [{"role": "user", "content": "Show another SuperCollider example using `Ball`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var f, sf, g;\n sf = LFNoise0.ar(MouseX.kr(1, 100, 1));\n g = MouseY.kr(0.1, 10, 1);\n f = Ball.ar(sf, g, 0.01, 0.01);\n f = f * 140 + 500;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 122} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var f, sf, g;\n sf = LFNoise0.ar(MouseX.kr(1, 100, 1));\n g = MouseY.kr(0.1, 10, 1);\n f = Ball.ar(sf, g, 0.01, 0.01);\n f = f * 140 + 500;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var f, sf, g;\n sf = LFNoise0.ar(MouseX.kr(1, 100, 1));\n g = MouseY.kr(0.1, 10, 1);\n f = Ball.ar(sf, g, 0.01, 0.01);\n f = f * 140 + 500;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "mut:missing_paren", "prompt_tokens": 163, "answer_tokens": 163} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var f, sf, g;\n sf = LFPulse.ar(0.6, 0.2, 0.5);\n g = MouseY.kr(0.1, 10, 1);\n d = MouseX.kr(0.0001, 1, 1);\n f = Ball.ar(sf, g, d);\n f = f * 140 + 400;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var f, sf, g;\n sf = LFPulse.ar(0.6, 0.2, 0.5);\n g = MouseY.kr(0.1, 10, 1);\n d = MouseX.kr(0.0001, 1, 1);\n f = Ball.ar(sf, g, d);\n f = f * 140 + 400;\n SinOsc.ar(f, 0, 0.2)\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Ball.schelp", "aug": "mut:missing_paren", "prompt_tokens": 174, "answer_tokens": 174} {"conversations": [{"role": "user", "content": "What is `BasicOpUGen` in SuperCollider?"}, {"role": "assistant", "content": "BasicOpUGen — Common superclass to operations on UGen Common superclass to operations on UGens Category: UGens > Algebraic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/BasicOpUGen.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "Explain `BasicOpUGen` in SuperCollider briefly."}, {"role": "assistant", "content": "BasicOpUGen — Common superclass to operations on UGen Common superclass to operations on UGens Category: UGens > Algebraic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/BasicOpUGen.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "What is `BeatTrack` in SuperCollider?"}, {"role": "assistant", "content": "BeatTrack — Autocorrelation beat tracker Autocorrelation based beat tracker; foot Research note: This UGen is a derivation following: Davies, M. E. P. and Plumbley, M. D. Beat Tracking With A Two State Model. Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP 2005), Philadelphia, USA, March 19-23, 2005 Category: UGens > Analysis, UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/BeatTrack.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 169} @@ -7614,10 +7645,14 @@ {"conversations": [{"role": "user", "content": "What does `ControlSpec.gridClass` do?"}, {"role": "assistant", "content": "Returns the AbstractGridLines subclass corresponding to the current spec, in particular its warp"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 31} {"conversations": [{"role": "user", "content": "What does `ControlSpec.grid` do?"}, {"role": "assistant", "content": "Get/set an instance of the AbstractGridLines subclass that describes the range and warp behavior of the current spec, e.g. for use by DrawGrid for drawing grids in"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 60} {"conversations": [{"role": "user", "content": "How is `ControlSpec` typically used in SuperCollider?"}, {"role": "assistant", "content": "```supercollider\n// using spec for sliders:\n(\nvar w, c, d;\nw = Window.new(\"control\", Rect(128, 64, 340, 160));\nw.front;\nc = Slider.new(w, Rect(10, 10, 300, 30));\nd = StaticText.new(w, Rect(10, 40, 300, 30));\nc.action = {\n d.string = \"unmapped value\"\n + c.value.round(0.01)\n + \"......\"\n + \"mapped value\"\n + a.map(c.value)\n};\n)\n```"}], "family": "C2", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 175} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `ControlSpec`."}, {"role": "assistant", "content": "```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 149} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "mut:missing_paren", "prompt_tokens": 190, "answer_tokens": 190} {"conversations": [{"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 between 0 and 1 to the range between minval and maxval."}, {"role": "user", "content": "Show me a working example."}, {"role": "assistant", "content": "```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n)\n```"}], "family": "G", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "none", "prompt_tokens": 125, "answer_tokens": 149} {"conversations": [{"role": "user", "content": "What is `Convolution` in SuperCollider?"}, {"role": "assistant", "content": "Convolution — Real-time convolver. Strict convolution of two continuously changing inputs. Also see Category: UGens > FFT, UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 54} {"conversations": [{"role": "user", "content": "Explain `Convolution` in SuperCollider briefly."}, {"role": "assistant", "content": "Convolution — Real-time convolver. Strict convolution of two continuously changing inputs. Also see Category: UGens > FFT, UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 54} {"conversations": [{"role": "user", "content": "What does `Convolution.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Real-time convolver. Arguments: in — Processing target.; kernel — Processing kernel.; framesize — Size of FFT frame, must be a power of two (512, 1024, 2048, 4096 are standard choices). Convolution uses twice this number internally. Note that the convolution gets progressively more expensive to run for higher powers! The maximum value you can use is 2^16 = 16384. (This upper limit is half of \"SC; mul — Output will be multiplied by this value.; add — This value will be added to the output.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 172} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Convolution`."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = Mix.ar(LFSaw.ar([300, 500, 800, 1000] * MouseX.kr(1.0, 2.0), 0, 1.0));\n\n // must have power of two framesize\n Convolution.ar(input, kernel, 1024, 0.5)\n}.play;\n\n);\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution to be double this\n// maximum is currently a = 8192 for FFT of size 16384\n\na = 2048;\ns = Server.local;\n\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\n\n// random impulse response\n\ng.set(0, 1.0);\n\n100.do({ |i| g.set(a.rand, 1.0.rand) });\n\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = PlayBuf.ar(1, g.bufnum, BufRateScale.kr(g.bufnum), 1, 0, 1);\n\n Convolution.ar(input, kernel, 2 * a, 0.5)\n}.play;\n\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 381} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = Mix.ar(LFSaw.ar([300, 500, 800, 1000] * MouseX.kr(1.0, 2.0), 0, 1.0));\n\n // must have power of two framesize\n Convolution.ar(input, kernel, 1024, 0.5)\n}.play;\n\n);\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution to be double this\n// maximum is currently a = 8192 for FFT of size 16384\n\na = 2048;\ns = Server.local;\n\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\n\n// random impulse response\n\ng.set(0, 1.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = Mix.ar(LFSaw.ar([300, 500, 800, 1000] * MouseX.kr(1.0, 2.0), 0, 1.0));\n\n // must have power of two framesize\n Convolution.ar(input, kernel, 1024, 0.5)\n}.play;\n\n);\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution to be double this\n// maximum is currently a = 8192 for FFT of size 16384\n\na = 2048;\ns = Server.local;\n\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\n\n// random impulse response\n\ng.set(0, 1.0);\n\n100.do({ |i| g.set(a.rand, 1.0.rand) });\n\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = PlayBuf.ar(1, g.bufnum, BufRateScale.kr(g.bufnum), 1, 0, 1);\n\n Convolution.ar(input, kernel, 2 * a, 0.5)\n}.play;\n\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 422} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n(\n\n{\n var input, kernel;\n\n input = SoundIn.ar(0);\n kernel = Mix.ar(LFSaw.ar([300, 500, 800, 1000] * MouseX.kr(1.0, 2.0), 0, 1.0));\n\n // must have power of two framesize\n Convolution.ar(input, kernel, 1024, 0.5)\n}.play;\n\n);\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution to be double this\n// maximum is currently a = 8192 for FFT of size 16384\n\na = 2048;\ns = Server.local;\n\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\n\n// random impulse response\n\ng.set(0, 1.\n// …\n```"}, {"role": "assistant", "content": "must have power of two framesize must have power of two framesize- FFT size will be sorted by Convolution to be double this (Convolution: Real-time convolver.)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Convolution.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 54} {"conversations": [{"role": "user", "content": "What is `Convolution2` in SuperCollider?"}, {"role": "assistant", "content": "Convolution2 — Real-time fixed kernel convolver. Strict convolution with fixed kernel which can be updated using a trigger signal. Category: UGens > FFT, UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution2.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 68} {"conversations": [{"role": "user", "content": "Explain `Convolution2` in SuperCollider briefly."}, {"role": "assistant", "content": "Convolution2 — Real-time fixed kernel convolver. Strict convolution with fixed kernel which can be updated using a trigger signal. Category: UGens > FFT, UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution2.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 68} @@ -7626,6 +7661,7 @@ {"conversations": [{"role": "user", "content": "Explain `Convolution2L` in SuperCollider briefly."}, {"role": "assistant", "content": "Convolution2L — Real-time convolver with linear interpolation Strict convolution with fixed kernel which can be updated using a trigger signal. There is a linear crossfade between the buffers upon change. Category: UGens > FFT, UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 88} {"conversations": [{"role": "user", "content": "What does `Convolution2L.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Real-time convolver with linear interpolation Arguments: in — processing target; kernel — buffer index for the fixed kernel, may be modulated in combination with the trigger; trigger — update the kernel on a change from <=0 to >0; framesize — size of FFT frame, must be a power of two (512, 1024, 2048, 4096 are standard choices). Convolution uses twice this number internally. Note that the convolution gets progressively more expensive to run for higher powers! The maximum value you can use is 2^16 = 16384. (This upper limit is half of \"SC; crossfade — The number of periods over which a crossfade is made. The default is 1. This must be an integer.; mul; add."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 226} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// next example\n\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{\n var input = SoundIn.ar(0);\n var framesize = 2048; // must have power of two\n Convolution2L.ar(input, b, 0, 512, 1, 0.5);\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// next example\n\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{\n var input = SoundIn.ar(0);\n var framesize = 2048; // must have power of two\n Convolution2L.ar(input, b, 0, 512, 1, 0.5);\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "mut:missing_paren", "prompt_tokens": 141, "answer_tokens": 141} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// another example\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution2 to be double this\n// maximum is currently a = 8192 for FFT of size 16384\na = 2048;\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\ng.set(0, 1.0);\n100.do { |i| g.set(a.rand, (i + 1).reciprocal) };\n);\n\n(\n// random impulse response\n{\n var input, inputAmp, threshhold, gate;\n\n input = SoundIn.ar(0);\n inputAmp = Amplitude.kr(input);\n threshhold = 0.02; // noise gating threshold\n gate = Lag.kr(inputAmp > threshhold, 0\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// another example\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution2 to be double this\n// maximum is currently a = 8192 for FFT of size 16384\na = 2048;\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\ng.set(0, 1.0);\n100.do { |i| g.set(a.rand, (i + 1).reciprocal) };\n);\n\n(\n// random impulse response\n{\n var input, inputAmp, threshhold, gate;\n\n input = SoundIn.ar(0);\n inputAmp = Amplitude.kr(input);\n threshhold = 0.02; // noise gating threshold\n gate = Lag.kr(inputAmp > threshhold, 0.01);\n\n Convolution2L.ar(input * gate, g, 0, a, 1, 0.5);\n}.play\n);\n\ng.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 334} {"conversations": [{"role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n// another example\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution2 to be double this\n// maximum is currently a = 8192 for FFT of size 16384\na = 2048;\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\ng.set(0, 1.0);\n100.do { |i| g.set(a.rand, (i + 1).reciprocal) };\n);\n\n(\n// random impulse response\n{\n var input, inputAmp, threshhold, gate;\n\n input = SoundIn.ar(0);\n inputAmp = Amplitude.kr(input);\n threshhold = 0.02; // noise gating threshold\n gate = Lag.kr(inputAmp > threshhold, 0\n// …\n```"}, {"role": "assistant", "content": "must have power of two framesize- FFT size will be sorted by Convolution2 to be double this maximum is currently a = 8192 for FFT of size 16384 (Convolution2L: Real-time convolver with linear interpolation)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 73} {"conversations": [{"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 Convolution2L.ar(input, b, 0, framesize, 1, 0.5);\n}.play\n;\n\nb.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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 Convolution2L.ar(input, b, 0, framesize, 1, 0.5);\n}.play\n);\n\nb.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "mut:missing_paren", "prompt_tokens": 178, "answer_tokens": 176} {"conversations": [{"role": "user", "content": "What is `Convolution3` in SuperCollider?"}, {"role": "assistant", "content": "Convolution3 — Time based convolver. Strict convolution with fixed kernel which can be updated using a trigger signal. The convolution is performed in the time domain. Category: UGens > Convolution."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Convolution3.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 67} @@ -7671,6 +7707,8 @@ {"conversations": [{"role": "user", "content": "What is `Dbrown` in SuperCollider?"}, {"role": "assistant", "content": "Dbrown — Demand rate brownian movement generator. Dbrown returns numbers in the continuous range between `lo` and `hi`, Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "Explain `Dbrown` in SuperCollider briefly."}, {"role": "assistant", "content": "Dbrown — Demand rate brownian movement generator. Dbrown returns numbers in the continuous range between `lo` and `hi`, Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "What does `Dbrown.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate brownian movement generator. Arguments: lo — Minimum value.; hi — Maximum value.; step — Maximum step for each new value.; length — Number of values to create. Use `inf` for an infinite number.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 77} +{"conversations": [{"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 SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 117} +{"conversations": [{"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;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dbrown.schelp", "aug": "mut:missing_paren", "prompt_tokens": 158, "answer_tokens": 158} {"conversations": [{"role": "user", "content": "What is `Dbufrd` in SuperCollider?"}, {"role": "assistant", "content": "Dbufrd — Buffer read demand ugen Category: UGens > Buffer, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dbufrd.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 38} {"conversations": [{"role": "user", "content": "Explain `Dbufrd` in SuperCollider briefly."}, {"role": "assistant", "content": "Dbufrd — Buffer read demand ugen Category: UGens > Buffer, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dbufrd.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 38} {"conversations": [{"role": "user", "content": "What does `Dbufrd.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Buffer read demand ugen Arguments: bufnum — buffer number to read from; phase — index into the buffer; loop — when phase exceeds number of frames in buffer, loops when set to 1 (default :1)."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dbufrd.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 73} @@ -7680,6 +7718,8 @@ {"conversations": [{"role": "user", "content": "What is `Ddup` in SuperCollider?"}, {"role": "assistant", "content": "Ddup — Demand rate input replicator Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "Explain `Ddup` in SuperCollider briefly."}, {"role": "assistant", "content": "Ddup — Demand rate input replicator Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "What does `Ddup.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate input replicator Arguments: n — number of repeats (can be a demand ugen); in — input ugen."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 38} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Ddup`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var freq, trig;\n var in = Dseq([1, 2, 3], inf);\n var rep = Ddup(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 146} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var freq, trig;\n var in = Dseq([1, 2, 3], inf);\n var rep = Ddup(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var freq, trig;\n var in = Dseq([1, 2, 3], inf);\n var rep = Ddup(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "mut:missing_paren", "prompt_tokens": 187, "answer_tokens": 187} {"conversations": [{"role": "user", "content": "What is `DebugFrame` in SuperCollider?"}, {"role": "assistant", "content": "DebugFrame — A representation of the call frame A representation of the call frame. Can be used to reconstruct a backtrace by using #-caller. Category: Core."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DebugFrame.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "Explain `DebugFrame` in SuperCollider briefly."}, {"role": "assistant", "content": "DebugFrame — A representation of the call frame A representation of the call frame. Can be used to reconstruct a backtrace by using #-caller. Category: Core."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DebugFrame.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "What does `DebugFrame.functionDef` do?"}, {"role": "assistant", "content": "Returns a FunctionDef or a Method of the current function or"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/DebugFrame.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 18} @@ -7749,6 +7789,7 @@ {"conversations": [{"role": "user", "content": "What is `DetectIndex` in SuperCollider?"}, {"role": "assistant", "content": "DetectIndex — Search a buffer for a value Linearly searches a buffer for a value (i.e., loops over the frames in the buffer from the beginning, checking for float equality), and returns index of first occurrence of said value. Returns -1 if value is not found. The object performs a search whenever a change in the in argument is detected; changes in the bufnum argument do not trigger searches. Checks for changes occur at the selected rate Category: UGens > Buffer."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DetectIndex.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 156} {"conversations": [{"role": "user", "content": "Explain `DetectIndex` in SuperCollider briefly."}, {"role": "assistant", "content": "DetectIndex — Search a buffer for a value Linearly searches a buffer for a value (i.e., loops over the frames in the buffer from the beginning, checking for float equality), and returns index of first occurrence of said value. Returns -1 if value is not found. The object performs a search whenever a change in the in argument is detected; changes in the bufnum argument do not trigger searches. Checks for changes occur at the selected rate Category: UGens > Buffer."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DetectIndex.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 156} {"conversations": [{"role": "user", "content": "What does `DetectIndex.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Search a buffer for a value Arguments: bufnum — index of the buffer; in — the input signal.. Returns: index of first occurrence of value, or -1 if value is not found."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/DetectIndex.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 60} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nvar max = 300;\nt = Array.series(max, 0, 1).curdle(0.06).scramble.flat;\nb = Buffer(s, t.size, 1);\n\n// alloc and set the values\ns.listSendMsg(b.allocMsg(b.setnMsg(0, t)));\n\n\n{\n var index, in, out, f0, fdiff;\n var bufnum = b;\n var input;\n input = MouseX.kr(0, max).round(1); // round to integer\n index = DetectIndex.kr(bufnum, input);\n index.poll;\n SinOsc.ar(index.linexp(0, max, 200, 700)) * 0.1\n}.play;\n;\n\nb.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nvar max = 300;\nt = Array.series(max, 0, 1).curdle(0.06).scramble.flat;\nb = Buffer(s, t.size, 1);\n\n// alloc and set the values\ns.listSendMsg(b.allocMsg(b.setnMsg(0, t)));\n\n\n{\n var index, in, out, f0, fdiff;\n var bufnum = b;\n var input;\n input = MouseX.kr(0, max).round(1); // round to integer\n index = DetectIndex.kr(bufnum, input);\n index.poll;\n SinOsc.ar(index.linexp(0, max, 200, 700)) * 0.1\n}.play;\n);\n\nb.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/DetectIndex.schelp", "aug": "mut:missing_paren", "prompt_tokens": 284, "answer_tokens": 282} {"conversations": [{"role": "user", "content": "What is `DetectSilence` in SuperCollider?"}, {"role": "assistant", "content": "DetectSilence — Detect when input falls below an amplitude threshold When the absolute value of the input signal remains below the threshold for a given window of time, output 1. Otherwise, output 0. If the output transitions from 0 to 1, doneAction is also evaluated. Category: UGens > Synth control, UGens > Analysis > Amplitude."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DetectSilence.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "Explain `DetectSilence` in SuperCollider briefly."}, {"role": "assistant", "content": "DetectSilence — Detect when input falls below an amplitude threshold When the absolute value of the input signal remains below the threshold for a given window of time, output 1. Otherwise, output 0. If the output transitions from 0 to 1, doneAction is also evaluated. Category: UGens > Synth control, UGens > Analysis > Amplitude."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DetectSilence.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "What does `DetectSilence.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Detect when input falls below an amplitude threshold Arguments: in — The input signal.; amp — When input falls below this for long enough, evaluate `doneAction` .; time — The minimum duration for which input must fall below `amp` before this triggers.; doneAction — An integer representing the doneAction. See. Returns: This UGen outputs 1 if silence is detected, otherwise 0."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/DetectSilence.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 133} @@ -7757,6 +7798,8 @@ {"conversations": [{"role": "user", "content": "What is `Dgeom` in SuperCollider?"}, {"role": "assistant", "content": "Dgeom — Demand rate geometric series UGen. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 31} {"conversations": [{"role": "user", "content": "Explain `Dgeom` in SuperCollider briefly."}, {"role": "assistant", "content": "Dgeom — Demand rate geometric series UGen. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 31} {"conversations": [{"role": "user", "content": "What does `Dgeom.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate geometric series UGen. Arguments: start — Start value. Can be a number or any other UGen.; grow — Value by which to grow (x = x[-1] * grow). Can be a number or any other UGen.; length — Number of values to create.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 82} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dgeom`."}, {"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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 226} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "mut:missing_paren", "prompt_tokens": 267, "answer_tokens": 267} {"conversations": [{"role": "user", "content": "What is `Dialog` in SuperCollider?"}, {"role": "assistant", "content": "Dialog — Shows various system dialogs This class allows to show various system dialogs. #*openPanel will show a dialog for selecting a file to open, and #*savePanel will show a dialog for selecting or creating a file to save to. Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dialog.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 86} {"conversations": [{"role": "user", "content": "Explain `Dialog` in SuperCollider briefly."}, {"role": "assistant", "content": "Dialog — Shows various system dialogs This class allows to show various system dialogs. #*openPanel will show a dialog for selecting a file to open, and #*savePanel will show a dialog for selecting or creating a file to save to. Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dialog.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 86} {"conversations": [{"role": "user", "content": "What does `Dialog.openPanel` do? What arguments does it take?"}, {"role": "assistant", "content": "Shows a dialog for selection of an existing file (or multiple files) to open. It does not do anything with the file, instead it just passes the chosen filenames to the given result Arguments: okFunc — An object to be evaluated when OK is pressed. As argument, either a single filename is passed as a String, or an Array of Strings for multiple selected items is passed, depending on the multipleSelection argument. The paths will always be absolute paths.; cancelFunc — An object to be evaluated when Cancel is pressed.; multipleSelection — A Boolean indicating whether multiple files can be selected.; path — A string. The dialog will initially display the contents of this path. The default is the current user's home directory.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dialog.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 227} @@ -7764,6 +7807,8 @@ {"conversations": [{"role": "user", "content": "What is `Dibrown` in SuperCollider?"}, {"role": "assistant", "content": "Dibrown — Demand rate brownian movement generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 32} {"conversations": [{"role": "user", "content": "Explain `Dibrown` in SuperCollider briefly."}, {"role": "assistant", "content": "Dibrown — Demand rate brownian movement generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 32} {"conversations": [{"role": "user", "content": "What does `Dibrown.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate brownian movement generator. Arguments: lo — Minimum value.; hi — Maximum value.; step — Maximum step for each new value.; length — Number of values to create. Use `inf` for an infinite number.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 77} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dibrown`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dibrown(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;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 117} +{"conversations": [{"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 = Dibrown(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;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dibrown(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;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dibrown.schelp", "aug": "mut:missing_paren", "prompt_tokens": 158, "answer_tokens": 158} {"conversations": [{"role": "user", "content": "What is `Dictionary` in SuperCollider?"}, {"role": "assistant", "content": "Dictionary — associative collection mapping keys to values A Dictionary is an associative collection mapping keys to values. Two keys match if they are equal. (i.e. == returns true.) Category: Collections > Unordered."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dictionary.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 74} {"conversations": [{"role": "user", "content": "Explain `Dictionary` in SuperCollider briefly."}, {"role": "assistant", "content": "Dictionary — associative collection mapping keys to values A Dictionary is an associative collection mapping keys to values. Two keys match if they are equal. (i.e. == returns true.) Category: Collections > Unordered."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dictionary.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 74} {"conversations": [{"role": "user", "content": "What does `Dictionary.new` do?"}, {"role": "assistant", "content": "Creates a Dictionary with an initial capacity for n key value"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dictionary.schelp", "aug": "none", "prompt_tokens": 27, "answer_tokens": 16} @@ -7830,6 +7875,8 @@ {"conversations": [{"role": "user", "content": "What is `Diwhite` in SuperCollider?"}, {"role": "assistant", "content": "Diwhite — Demand rate white noise random generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 30} {"conversations": [{"role": "user", "content": "Explain `Diwhite` in SuperCollider briefly."}, {"role": "assistant", "content": "Diwhite — Demand rate white noise random generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 30} {"conversations": [{"role": "user", "content": "What does `Diwhite.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate white noise random generator. Arguments: lo — Minimum value.; hi — Maximum value.; length — Number of values to create.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 49} +{"conversations": [{"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 SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 115} +{"conversations": [{"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 = Diwhite(0, 15, 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;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Diwhite.schelp", "aug": "mut:missing_paren", "prompt_tokens": 156, "answer_tokens": 156} {"conversations": [{"role": "user", "content": "What is `Document` in SuperCollider?"}, {"role": "assistant", "content": "Document — Editor-specific text document editing The Document class represents a text document within the context of your text editing environment. You can use the class to programmatically create, modify, and query these documents. Category: Frontends."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Document.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 68} {"conversations": [{"role": "user", "content": "Explain `Document` in SuperCollider briefly."}, {"role": "assistant", "content": "Document — Editor-specific text document editing The Document class represents a text document within the context of your text editing environment. You can use the class to programmatically create, modify, and query these documents. Category: Frontends."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Document.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 68} {"conversations": [{"role": "user", "content": "What does `Document.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Editor-specific text document editing Arguments: title — An instance of String or Symbol.; string — An instance of String. The contents of the document.; envir — An instance of Environment. The Environment to be used by the interpreter of the document window. By default, it is set to the current Environment.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Document.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 103} @@ -7897,6 +7944,8 @@ {"conversations": [{"role": "user", "content": "What is `Drand` in SuperCollider?"}, {"role": "assistant", "content": "Drand — Demand rate random sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "Explain `Drand` in SuperCollider briefly."}, {"role": "assistant", "content": "Drand — Demand rate random sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "What does `Drand.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate random sequence generator. Arguments: list — An array of values or other UGens.; repeats — Number of values to return.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 41} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Drand`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Drand([1, 3, 2, 7, 8], inf);\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 121} +{"conversations": [{"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 = Drand([1, 3, 2, 7, 8], inf);\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Drand([1, 3, 2, 7, 8], inf);\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Drand.schelp", "aug": "mut:missing_paren", "prompt_tokens": 162, "answer_tokens": 162} {"conversations": [{"role": "user", "content": "What is `DrawGrid` in SuperCollider?"}, {"role": "assistant", "content": "DrawGrid — Draws grid lines on a UserView for plotting `DrawGrid` is used to draw GridLines and its labels on a UserView. It is notably used by Plotter to draw the grid lines on a plot but can also be used to add grid lines to any `UserView`, e.g. behind sliders or another GUI element. Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DrawGrid.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 134} {"conversations": [{"role": "user", "content": "Explain `DrawGrid` in SuperCollider briefly."}, {"role": "assistant", "content": "DrawGrid — Draws grid lines on a UserView for plotting `DrawGrid` is used to draw GridLines and its labels on a UserView. It is notably used by Plotter to draw the grid lines on a plot but can also be used to add grid lines to any `UserView`, e.g. behind sliders or another GUI element. Category: GUI > Accessories."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DrawGrid.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 134} {"conversations": [{"role": "user", "content": "What does `DrawGrid.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Draws grid lines on a UserView for plotting Arguments: bounds — A Point or Rect describing the size and position of the grid within the parent view (not including any labels).; horzGrid — A grid lines object for the x-axis, instantiated via GridLines, or ControlSpec#-grid method, or `nil` (resulting in no grid lines).; vertGrid — A grid lines object for the y-axis, see horzGrid.. Returns: A `DrawGrid`."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/DrawGrid.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 172} @@ -7919,27 +7968,43 @@ {"conversations": [{"role": "user", "content": "What is `Dreset` in SuperCollider?"}, {"role": "assistant", "content": "Dreset — demand rate reset The reset of a demand ugen can be controlled \"from the outside\" by the reset input of the Demand or Duty UGen, which consumes the chain of demands. Dreset allows to reset a subset of the chain internally. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 90} {"conversations": [{"role": "user", "content": "Explain `Dreset` in SuperCollider briefly."}, {"role": "assistant", "content": "Dreset — demand rate reset The reset of a demand ugen can be controlled \"from the outside\" by the reset input of the Demand or Duty UGen, which consumes the chain of demands. Dreset allows to reset a subset of the chain internally. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 90} {"conversations": [{"role": "user", "content": "What does `Dreset.new` do? What arguments does it take?"}, {"role": "assistant", "content": "demand rate reset Arguments: in — a demand UGen, producing values which are passed through; reset — a demand or any other UGen. When crossing from nonpositive to positive, it resets the first argument.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 64} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dreset`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), Drand([0, 0, 0, 1], inf));\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// reset when mouse button is pressed\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), MouseButton.kr);\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// audio rate\n(\n{\n var a, nmax = 90;\n a = { Dreset(Dseries(0, 1, inf), Drand(0 ! nmax ++ 1, inf)) } ! 2;\n Duty.ar(SampleDur.ir, 0, a) * (0.1 / nmax)\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 320} +{"conversations": [{"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;\n a = Dreset(Dseries(0, 2, inf), Drand([0, 0, 0, 1], inf));\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// reset when mouse button is pressed\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), MouseButton.kr);\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// audio rate\n(\n{\n var a, nmax = 90;\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), Drand([0, 0, 0, 1], inf));\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// reset when mouse button is pressed\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), MouseButton.kr);\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// audio rate\n(\n{\n var a, nmax = 90;\n a = { Dreset(Dseries(0, 1, inf), Drand(0 ! nmax ++ 1, inf)) } ! 2;\n Duty.ar(SampleDur.ir, 0, a) * (0.1 / nmax)\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "mut:missing_paren", "prompt_tokens": 297, "answer_tokens": 361} {"conversations": [{"role": "user", "content": "What is `Dseq` in SuperCollider?"}, {"role": "assistant", "content": "Dseq — Demand rate sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "Explain `Dseq` in SuperCollider briefly."}, {"role": "assistant", "content": "Dseq — Demand rate sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 25} {"conversations": [{"role": "user", "content": "What does `Dseq.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate sequence generator. Arguments: list — An array of values or other UGens.; repeats — Number of repeats.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 40} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dseq`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([1, 3, 2, 7, 8], 3);\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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq({ 10.rand } ! 32, inf);\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 238} +{"conversations": [{"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 = Dseq([1, 3, 2, 7, 8], 3);\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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq({ 10.rand } ! 32, inf);\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([1, 3, 2, 7, 8], 3);\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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq({ 10.rand } ! 32, inf);\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "mut:missing_paren", "prompt_tokens": 279, "answer_tokens": 279} {"conversations": [{"role": "user", "content": "What is `Dser` in SuperCollider?"}, {"role": "assistant", "content": "Dser — Demand rate sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 24} {"conversations": [{"role": "user", "content": "Explain `Dser` in SuperCollider briefly."}, {"role": "assistant", "content": "Dser — Demand rate sequence generator. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 24} {"conversations": [{"role": "user", "content": "What does `Dser.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate sequence generator. Arguments: list — An array of values or other UGens.; repeats — Number of values to return.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 40} +{"conversations": [{"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 SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 120} +{"conversations": [{"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 = 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 SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dser.schelp", "aug": "mut:missing_paren", "prompt_tokens": 161, "answer_tokens": 161} {"conversations": [{"role": "user", "content": "What is `Dseries` in SuperCollider?"}, {"role": "assistant", "content": "Dseries — Demand rate arithmetic series UGen. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "Explain `Dseries` in SuperCollider briefly."}, {"role": "assistant", "content": "Dseries — Demand rate arithmetic series UGen. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "What does `Dseries.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate arithmetic series UGen. Arguments: start — Start value. Can be a number or any other UGen.; step — Step value. Can be a number or any other UGen.; length — Number of values to create. Can be a number or any other UGen.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 78} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dseries`."}, {"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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) % 15 * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 220} +{"conversations": [{"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 = Dseries(0, 1, 15);\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;\n);\n\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) % 15 * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) % 15 * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "mut:missing_paren", "prompt_tokens": 261, "answer_tokens": 261} {"conversations": [{"role": "user", "content": "What is `Dshuf` in SuperCollider?"}, {"role": "assistant", "content": "Dshuf — Demand rate random sequence generator Category: UGens > Demand, UGens > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 33} {"conversations": [{"role": "user", "content": "Explain `Dshuf` in SuperCollider briefly."}, {"role": "assistant", "content": "Dshuf — Demand rate random sequence generator Category: UGens > Demand, UGens > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 33} {"conversations": [{"role": "user", "content": "What does `Dshuf.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate random sequence generator Arguments: list — array of values or other ugens; repeats — number of repeats."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 36} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dshuf`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([1, 3, 2, 7, 8.5], 3)], 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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf({ 10.rand } ! 81, 5)], inf).poll;\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// embedded structures\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([Drand([1, 2, 3], 1), 3, Drand([20, 23, 56], 1), 7, 8.5], 8)], 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;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 416} +{"conversations": [{"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 = Dseq([Dshuf([1, 3, 2, 7, 8.5], 3)], 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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf({ 10.rand } ! 81, 5)], inf).poll;\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) *\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([1, 3, 2, 7, 8.5], 3)], 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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf({ 10.rand } ! 81, 5)], inf).poll;\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// embedded structures\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([Drand([1, 2, 3], 1), 3, Drand([20, 23, 56], 1), 7, 8.5], 8)], 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;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 457} {"conversations": [{"role": "user", "content": "What is `Dstutter` in SuperCollider?"}, {"role": "assistant", "content": "Dstutter — Demand rate input replicator Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 26} {"conversations": [{"role": "user", "content": "Explain `Dstutter` in SuperCollider briefly."}, {"role": "assistant", "content": "Dstutter — Demand rate input replicator Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 26} {"conversations": [{"role": "user", "content": "What does `Dstutter.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate input replicator Arguments: n — number of repeats (can be a demand ugen); in — input ugen. Returns: Ddup"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 46} +{"conversations": [{"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 freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 147} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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 freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "mut:missing_paren", "prompt_tokens": 188, "answer_tokens": 188} {"conversations": [{"role": "user", "content": "What is `Dswitch` in SuperCollider?"}, {"role": "assistant", "content": "Dswitch — Demand rate generator for embedding different inputs Demand rate generator for embedding different inputs. In difference to Dswitch1, Dswitch embeds all items of an input demand ugen first before looking up the next index. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "Explain `Dswitch` in SuperCollider briefly."}, {"role": "assistant", "content": "Dswitch — Demand rate generator for embedding different inputs Demand rate generator for embedding different inputs. In difference to Dswitch1, Dswitch embeds all items of an input demand ugen first before looking up the next index. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "What does `Dswitch.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate generator for embedding different inputs Arguments: list — array of values or other ugens; index — which of the inputs to return."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 42} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dswitch`."}, {"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], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n\n// compare with Dswitch1:\n\n(\n {\n var d, trig;\n d = Dswitch1([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 333} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n\n// compare with Dswitch1:\n\n(\n {\n var d, trig;\n d = Dswitch1([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n\n// compare with Dswitch1:\n\n(\n {\n var d, trig;\n d = Dswitch1([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 374} {"conversations": [{"role": "user", "content": "What is `Dswitch1` in SuperCollider?"}, {"role": "assistant", "content": "Dswitch1 — Demand rate generator for switching between inputs. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 35} {"conversations": [{"role": "user", "content": "Explain `Dswitch1` in SuperCollider briefly."}, {"role": "assistant", "content": "Dswitch1 — Demand rate generator for switching between inputs. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 35} {"conversations": [{"role": "user", "content": "What does `Dswitch1.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate generator for switching between inputs. Arguments: list — Array of values or other UGens.; index — Which of the inputs to return.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 48} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dswitch1`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dswitch1([1, 3, MouseY.kr(1, 15), 2, Dwhite(0, 3, 2)], MouseX.kr(0, 4));\n trig = Impulse.kr(3);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dswitch1({ |i| Dseq((0..i*3), inf) } ! 5, MouseX.kr(0, 4));\n trig = Impulse.kr(6);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 263} +{"conversations": [{"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 = Dswitch1([1, 3, MouseY.kr(1, 15), 2, Dwhite(0, 3, 2)], MouseX.kr(0, 4));\n trig = Impulse.kr(3);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dswitch1({ |i| Dseq((0..i*3), inf) } ! 5, MouseX.kr(0, 4));\n trig = Impulse.kr(6);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dswitch1([1, 3, MouseY.kr(1, 15), 2, Dwhite(0, 3, 2)], MouseX.kr(0, 4));\n trig = Impulse.kr(3);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dswitch1({ |i| Dseq((0..i*3), inf) } ! 5, MouseX.kr(0, 4));\n trig = Impulse.kr(6);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 304} {"conversations": [{"role": "user", "content": "What is `Dust` in SuperCollider?"}, {"role": "assistant", "content": "Dust — Random impulses. Generates random impulses from 0 to +1. Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dust.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 44} {"conversations": [{"role": "user", "content": "Explain `Dust` in SuperCollider briefly."}, {"role": "assistant", "content": "Dust — Random impulses. Generates random impulses from 0 to +1. Category: UGens > Generators > Stochastic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dust.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 44} {"conversations": [{"role": "user", "content": "What does `Dust.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Random impulses. Arguments: density — Average number of impulses per second.; mul — Output will be multiplied by this value.; add — This value will be added to the output.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dust.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 58} @@ -7958,15 +8023,22 @@ {"conversations": [{"role": "user", "content": "Show another SuperCollider example using `Duty`."}, {"role": "assistant", "content": "```supercollider\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dust.kr(1), // control rate reset\n Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])\n ) * 30 + 250;\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n);\n\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dseq([1, 2, 4, 5], inf), // demand rate reset\n Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])\n ) * 30 + 250;\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 317} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dust.kr(1), // control rate reset\n Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])\n ) * 30 + 250;\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n);\n\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dseq([1, 2, 4, 5], inf), // demand rate reset\n Dseq\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dust.kr(1), // control rate reset\n Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])\n ) * 30 + 250;\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n);\n\n(\n {\n var freq;\n freq = Duty.kr(\n Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,\n Dseq([1, 2, 4, 5], inf), // demand rate reset\n Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])\n ) * 30 + 250;\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 358} {"conversations": [{"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 = 5, m = 64;\n a = {\n var x;\n x = { 0.2.rand2 } ! m;\n x = x ++ ({ Drand({ 0.2.rand2 } ! n) } ! m.rand);\n Dseq(x.scramble, inf)\n } ! n;\n Duty.ar(\n MouseX.kr(1, 125, 1) * SampleDur.ir * [1, 1.02],\n 0,\n Dswitch1(a, MouseY.kr(0, n-1))\n )\n\n }.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n {\n var a, n = 5, m = 64;\n a = {\n var x;\n x = { 0.2.rand2 } ! m;\n x = x ++ ({ Drand({ 0.2.rand2 } ! n) } ! m.rand);\n Dseq(x.scramble, inf)\n } ! n;\n Duty.ar(\n MouseX.kr(1, 125, 1) * SampleDur.ir * [1, 1.02],\n 0,\n Dswitch1(a, MouseY.kr(0, n-1))\n )\n\n }.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "mut:missing_paren", "prompt_tokens": 221, "answer_tokens": 221} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nb = Buffer.alloc(s, 1);\n{\nvar x, y, rate, a, c, m;\n rate = MouseX.kr(100, SampleRate.ir);\n a = 1.1;\n c = 0.13;\n m = 1.0;\n x = Dbufrd(b); // read from buffer\n x = x * a + c % m;\n y = Dbufwr(x, b); // write to buffer\n Duty.ar(1 / rate, 0, y) * 0.1;\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nb = Buffer.alloc(s, 1);\n{\nvar x, y, rate, a, c, m;\n rate = MouseX.kr(100, SampleRate.ir);\n a = 1.1;\n c = 0.13;\n m = 1.0;\n x = Dbufrd(b); // read from buffer\n x = x * a + c % m;\n y = Dbufwr(x, b); // write to buffer\n Duty.ar(1 / rate, 0, y) * 0.1;\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "mut:missing_paren", "prompt_tokens": 201, "answer_tokens": 201} {"conversations": [{"role": "user", "content": "What is `Dwhite` in SuperCollider?"}, {"role": "assistant", "content": "Dwhite — Demand rate white noise random generator. Dwhite returns numbers in the continuous range between `lo` and `hi` . Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "Explain `Dwhite` in SuperCollider briefly."}, {"role": "assistant", "content": "Dwhite — Demand rate white noise random generator. Dwhite returns numbers in the continuous range between `lo` and `hi` . Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "What does `Dwhite.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate white noise random generator. Arguments: lo — Minimum value.; hi — Maximum value.; length — Number of values to create.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 49} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dwhite`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dwhite(0, 15, 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;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 114} +{"conversations": [{"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 = Dwhite(0, 15, 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;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dwhite(0, 15, 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;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dwhite.schelp", "aug": "mut:missing_paren", "prompt_tokens": 155, "answer_tokens": 155} {"conversations": [{"role": "user", "content": "What is `Dwrand` in SuperCollider?"}, {"role": "assistant", "content": "Dwrand — Demand rate weighted random sequence generator Category: UGens > Demand, UGens > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 35} {"conversations": [{"role": "user", "content": "Explain `Dwrand` in SuperCollider briefly."}, {"role": "assistant", "content": "Dwrand — Demand rate weighted random sequence generator Category: UGens > Demand, UGens > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 35} {"conversations": [{"role": "user", "content": "What does `Dwrand.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate weighted random sequence generator Arguments: list — array of values or other ugens; weights — array of values (should sum up to 1.0); repeats — number of values to return."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 56} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Dwrand`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 141} +{"conversations": [{"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 = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var a, freq, trig;\n a = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "mut:missing_paren", "prompt_tokens": 182, "answer_tokens": 182} {"conversations": [{"role": "user", "content": "What is `Dxrand` in SuperCollider?"}, {"role": "assistant", "content": "Dxrand — Demand rate random sequence generator. Dxrand never plays the same value twice, whereas Drand chooses any value in the list. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "Explain `Dxrand` in SuperCollider briefly."}, {"role": "assistant", "content": "Dxrand — Demand rate random sequence generator. Dxrand never plays the same value twice, whereas Drand chooses any value in the list. Category: UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "What does `Dxrand.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Demand rate random sequence generator. Arguments: list — An array of values or other UGens.; repeats — Number of values to return.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 41} +{"conversations": [{"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;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 122} +{"conversations": [{"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 = 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;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Dxrand.schelp", "aug": "mut:missing_paren", "prompt_tokens": 163, "answer_tokens": 163} {"conversations": [{"role": "user", "content": "What is `DynKlang` in SuperCollider?"}, {"role": "assistant", "content": "DynKlang — Dynamic sine oscillator bank DynKlang is a bank of sine oscillators. It is less efficient than Klang, as it is basically a wrapper around SinOsc UGens in order to provide a similar interface to Klang. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DynKlang.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 98} {"conversations": [{"role": "user", "content": "Explain `DynKlang` in SuperCollider briefly."}, {"role": "assistant", "content": "DynKlang — Dynamic sine oscillator bank DynKlang is a bank of sine oscillators. It is less efficient than Klang, as it is basically a wrapper around SinOsc UGens in order to provide a similar interface to Klang. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/DynKlang.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 98} {"conversations": [{"role": "user", "content": "What does `DynKlang.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Dynamic sine oscillator bank Arguments: specificationsArrayRef — a Ref to an Array of three Arrays:; freqscale — a scale factor multiplied by all frequencies at initialization time.; freqoffset — an offset added to all frequencies at initialization time.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/DynKlang.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 89} @@ -8323,10 +8395,14 @@ {"conversations": [{"role": "user", "content": "What is `FFTTrigger` in SuperCollider?"}, {"role": "assistant", "content": "FFTTrigger — Outputs the necessary signal for FFT chains, without doing an FFT on a signal Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "Explain `FFTTrigger` in SuperCollider briefly."}, {"role": "assistant", "content": "FFTTrigger — Outputs the necessary signal for FFT chains, without doing an FFT on a signal Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "What does `FFTTrigger.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Outputs the necessary signal for FFT chains, without doing an FFT on a signal Arguments: buffer — a buffer to condition for FFT use; hop — the hop size for timing triggers (defaults to 0.5); polar — a flag. If 0.0, the buffer will be prepared for complex data, if > 0.0, polar data is set up.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 117} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `FFTTrigger`."}, {"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, phases, chain, sig;\n // Create simple undulating magnitudes\n mags = { FSinOsc.kr(ExpRand(0.1, 1)).range(0, 1) }.dup(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.dup(100);\n chain = FFTTrigger(LocalBuf(512), 0.5);\n // Now we can do the packing\n chain = PackFFT(chain, 512, [mags, phases].flop.flatten, 0, 99, 1);\n sig = IFFT(chain);\n sig.dup\n}.play\n);\nx.free;\nb.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 369} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\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(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\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(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.dup(100);\n chain = FFTTrigger(LocalBuf(512), 0.5);\n // Now we can do the packing\n chain = PackFFT(chain, 512, [mags, phases].flop.flatten, 0, 99, 1);\n sig = IFFT(chain);\n sig.dup\n}.play\n);\nx.free;\nb.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 410} {"conversations": [{"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(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.\n// …\n```"}, {"role": "assistant", "content": "Reminder: This isn't the intended typical usage! It's OK to do this though. Create simple undulating magnitudes (FFTTrigger: Outputs the necessary signal for FFT chains, without doing an FFT on a signal)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 78} {"conversations": [{"role": "user", "content": "What is `FOS` in SuperCollider?"}, {"role": "assistant", "content": "FOS — First order filter section. A standard first order filter section. Filter coefficients are given directly rather than calculated for you. Formula is equivalent to: Category: UGens > Filters > Linear."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 65} {"conversations": [{"role": "user", "content": "Explain `FOS` in SuperCollider briefly."}, {"role": "assistant", "content": "FOS — First order filter section. A standard first order filter section. Filter coefficients are given directly rather than calculated for you. Formula is equivalent to: Category: UGens > Filters > Linear."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 65} {"conversations": [{"role": "user", "content": "What does `FOS.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "First order filter section. Arguments: in — Signal input.; a0 — See formula above.; a1 — See formula above.; b1 — See formula above.; mul; add."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 56} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `FOS`."}, {"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, x)\n}.play;\n);\n\n(\n// same as OneZero\n{ var x;\n x = LFTri.ar(0.4, 0, 0.99);\n FOS.ar(LFSaw.ar(200, 0, 0.2), 1 - x.abs, x, 0.0)\n}.play;\n);\n\n(\n// same as OnePole, kr\n{ var x, ctl;\n x = LFTri.kr(0.2, 0, 0.99);\n ctl = FOS.kr(LFSaw.kr(8, 0, 0.2), 1 - x.abs, 0.0, x);\n LFTri.ar(ctl * 200 + 500);\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 277} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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, x)\n}.play;\n);\n\n(\n// same as OneZero\n{ var x;\n x = LFTri.ar(0.4, 0, 0.99);\n FOS.ar(LFSaw.ar(200, 0, 0.2), 1 - x.abs, x, 0.0)\n}.play;\n);\n\n(\n// same as OnePole, kr\n{ var x, ctl;\n x = LFTri.kr(0.2, 0, 0.99);\n ctl = FOS.kr(LFSaw.kr(8, 0, 0.2), 1 - x.abs, 0.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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, x)\n}.play;\n);\n\n(\n// same as OneZero\n{ var x;\n x = LFTri.ar(0.4, 0, 0.99);\n FOS.ar(LFSaw.ar(200, 0, 0.2), 1 - x.abs, x, 0.0)\n}.play;\n);\n\n(\n// same as OnePole, kr\n{ var x, ctl;\n x = LFTri.kr(0.2, 0, 0.99);\n ctl = FOS.kr(LFSaw.kr(8, 0, 0.2), 1 - x.abs, 0.0, x);\n LFTri.ar(ctl * 200 + 500);\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 318} {"conversations": [{"role": "user", "content": "What is `FSinOsc` in SuperCollider?"}, {"role": "assistant", "content": "FSinOsc — Fast sine oscillator. Very fast sine wave generator (2 PowerPC instructions per output sample!) implemented using a ringing filter. This generates a much cleaner sine wave than a table lookup oscillator and is a lot faster. However, the amplitude of the wave will vary with frequency. Generally the amplitude will go down as you raise the frequency and go up as you lower the frequency. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FSinOsc.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 151} {"conversations": [{"role": "user", "content": "Explain `FSinOsc` in SuperCollider briefly."}, {"role": "assistant", "content": "FSinOsc — Fast sine oscillator. Very fast sine wave generator (2 PowerPC instructions per output sample!) implemented using a ringing filter. This generates a much cleaner sine wave than a table lookup oscillator and is a lot faster. However, the amplitude of the wave will vary with frequency. Generally the amplitude will go down as you raise the frequency and go up as you lower the frequency. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/FSinOsc.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 151} {"conversations": [{"role": "user", "content": "What does `FSinOsc.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Fast sine oscillator. Arguments: freq — Frequency in Hertz.; iphase — Initial phase offset.; mul — Output will be multiplied by this value.; add — This value will be added to the output.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/FSinOsc.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 73} @@ -8799,6 +8875,8 @@ {"conversations": [{"role": "user", "content": "What is `IFFT` in SuperCollider?"}, {"role": "assistant", "content": "IFFT — Inverse Fast Fourier Transform The inverse fast fourier transform converts from frequency content to a signal. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "Explain `IFFT` in SuperCollider briefly."}, {"role": "assistant", "content": "IFFT — Inverse Fast Fourier Transform The inverse fast fourier transform converts from frequency content to a signal. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 53} {"conversations": [{"role": "user", "content": "What does `IFFT.new` do? What arguments does it take?"}, {"role": "assistant", "content": "returns a time domain signal from converting the FFT frequency domain signal chain. The *new method is equivalent to the *ar message returns an audio rate Arguments: buffer — The FFT \"chain\" signal coming originally from an FFT UGen, perhaps via other PV UGens.; wintype — Defines how the data is windowed:; winsize — Can be used to account for zero-padding, in the same way as the FFT UGen.. Returns: The time-domain audio signal."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 164} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `IFFT`."}, {"role": "assistant", "content": "```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 120} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "mut:missing_paren", "prompt_tokens": 161, "answer_tokens": 161} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}, {"role": "assistant", "content": "without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal) (IFFT: Inverse Fast Fourier Transform)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "none", "prompt_tokens": 150, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "What is `IFFT`?"}, {"role": "assistant", "content": "IFFT — Inverse Fast Fourier Transform"}, {"role": "user", "content": "What does `IFFT.new` do?"}, {"role": "assistant", "content": "returns a time domain signal from converting the FFT frequency domain signal chain. The *new method is equivalent to the *ar message returns an audio rate signal."}, {"role": "user", "content": "Show me a working example."}, {"role": "assistant", "content": "```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}], "family": "G", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "none", "prompt_tokens": 153, "answer_tokens": 120} {"conversations": [{"role": "user", "content": "What is `IODesc` in SuperCollider?"}, {"role": "assistant", "content": "IODesc — Description of SynthDesc input or output IODesc describes an input or output of a SynthDesc, as returned by SynthDesc#-outputs and SynthDesc#-inputs Category: Server > Nodes."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/IODesc.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 79} @@ -8894,9 +8972,12 @@ {"conversations": [{"role": "user", "content": "What is `InFeedback` in SuperCollider?"}, {"role": "assistant", "content": "InFeedback — Read signal from a bus with a current or one cycle old timestamp. When the various output UGens (Out, Category: UGens > InOut."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "Explain `InFeedback` in SuperCollider briefly."}, {"role": "assistant", "content": "InFeedback — Read signal from a bus with a current or one cycle old timestamp. When the various output UGens (Out, Category: UGens > InOut."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "What does `InFeedback.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Read signal from a bus with a current or one cycle old timestamp. Arguments: bus — The index of the bus to read in from.; numChannels — The number of channels (i.e. adjacent buses) to read in. The default is 1. You cannot modulate this number by assigning it to an argument in a SynthDef.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 99} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `InFeedback`."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n var input, sound;\n input = InFeedback.ar(in, 1);\n sound = SinOsc.ar(input * 1300 + 300, 0, 0.4);\n Out.ar(out, sound);\n\n}).play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 106} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n var input, sound;\n input = InFeedback.ar(in, 1);\n sound = SinOsc.ar(input * 1300 + 300, 0, 0.4);\n Out.ar(out, sound);\n\n}).play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n var input, sound;\n input = InFeedback.ar(in, 1);\n sound = SinOsc.ar(input * 1300 + 300, 0, 0.4);\n Out.ar(out, sound);\n\n}).play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "mut:missing_paren", "prompt_tokens": 147, "answer_tokens": 147} {"conversations": [{"role": "user", "content": "Show another SuperCollider example using `InFeedback`."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth before a which also writes to bus x\n// now you can't hear b, as its data is one cycle old, and is overwritten by c\nc = Synth.before(a, \"help-SinOsc\", [\\out, x.index, \\freq, 800]);\n\n// free c and you can hear b again\nc.free;\nx.free;\n\na.free; b.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 362} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth before a which also writes to bus x\n// now you can't hear b, as its data is one cycle old, and is overwritten by c\nc = Synth.before(a, \"help-SinOsc\", [\\out, x.index, \\freq, 800]);\n\n// free c and you can hear b again\nc.free;\nx.free;\n\na.free; b.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 403} {"conversations": [{"role": "user", "content": "Explain this SuperCollider code.\n```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth\n// …\n```"}, {"role": "assistant", "content": "read from bus n play to bus 0 (silent) now play a synth after this one, playing to bus x (InFeedback: Read signal from a bus with a current or one cycle old timestamp.)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 57} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nvar play, imp, initial;\nSynthDef(\"testRes\", {\n\nplay = InFeedback.ar(10, 1); // 10 is feedback channel\nimp = Impulse.ar(1);\n\n// feedback\nOffsetOut.ar(10, DelayC.ar(imp + (play * 0.995), 1,\n 440.reciprocal - ControlRate.ir.reciprocal)); // subtract block size\n\nOffsetOut.ar(0, play);\n\n}).play(s);\n\n// Compare with this for tuning\n{ SinOsc.ar(440, 0, 0.2) }.play(s, 1);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nvar play, imp, initial;\nSynthDef(\"testRes\", {\n\nplay = InFeedback.ar(10, 1); // 10 is feedback channel\nimp = Impulse.ar(1);\n\n// feedback\nOffsetOut.ar(10, DelayC.ar(imp + (play * 0.995), 1,\n 440.reciprocal - ControlRate.ir.reciprocal)); // subtract block size\n\nOffsetOut.ar(0, play);\n\n}).play(s);\n\n// Compare with this for tuning\n{ SinOsc.ar(440, 0, 0.2) }.play(s, 1);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "mut:missing_paren", "prompt_tokens": 247, "answer_tokens": 247} {"conversations": [{"role": "user", "content": "What is `InRange` in SuperCollider?"}, {"role": "assistant", "content": "InRange — Tests if a signal is within a given range. If `lo ≤ in ≤ hi`, output 1.0, otherwise output 0.0. Category: UGens > Maths."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/InRange.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "Explain `InRange` in SuperCollider briefly."}, {"role": "assistant", "content": "InRange — Tests if a signal is within a given range. If `lo ≤ in ≤ hi`, output 1.0, otherwise output 0.0. Category: UGens > Maths."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/InRange.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "What does `InRange.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Tests if a signal is within a given range. Arguments: in — Signal to be tested. If `InRange` is running at audio rate, in must also be audio rate.; lo — Low threshold. Updated at control rate.; hi — High threshold. Updated at control rate.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/InRange.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 95} @@ -9045,8 +9126,12 @@ {"conversations": [{"role": "user", "content": "What is `KeyTrack` in SuperCollider?"}, {"role": "assistant", "content": "KeyTrack — Key tracker A (12TET major/minor) key tracker based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is 0-11 C major to B major, 12-23 C minor to B minor. Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 123} {"conversations": [{"role": "user", "content": "Explain `KeyTrack` in SuperCollider briefly."}, {"role": "assistant", "content": "KeyTrack — Key tracker A (12TET major/minor) key tracker based on a pitch class profile of energy across FFT bins and matching this to templates for major and minor scales in all transpositions. It assumes a 440 Hz concert A reference. Output is 0-11 C major to B major, 12-23 C minor to B minor. Category: UGens > Analysis > Pitch."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 123} {"conversations": [{"role": "user", "content": "What does `KeyTrack.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Key tracker Arguments: chain — [fft] Audio input to track. This must have been pre-analysed by a 4096 size FFT. No other FFT sizes are valid except as noted below.; keydecay — [sk] Number of seconds for the influence of a window on the final key decision to decay by 40dB (to 0.01 its original value).; chromaleak — [sk] Each frame, the chroma values are set to the previous value multiplied by the chromadecay. 0.0 will start each frame afresh with no memory.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 170} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// The following files are test materials on my machine; you will subsitute your own filenames here\n// A major\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/100.wav\");\n// F major; hard to track!\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/115.wav\");\n\n// straight forward since no transients; training set from MIREX2006\n// 01 = A major\n// 57 = b minor\n// 78 e minor\n// 08 Bb major\n\nd = Buffer.read(s, \"/Users/nickcollins/Desktop/ML/training_wav/78.wav\")\n\n(\n{\n var in, fft, resample;\n var\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// The following files are test materials on my machine; you will subsitute your own filenames here\n// A major\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/100.wav\");\n// F major; hard to track!\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/115.wav\");\n\n// straight forward since no transients; training set from MIREX2006\n// 01 = A major\n// 57 = b minor\n// 78 e minor\n// 08 Bb major\n\nd = Buffer.read(s, \"/Users/nickcollins/Desktop/ML/training_wav/78.wav\")\n\n(\n{\n var in, fft, resample;\n var key, transientdetection;\n\n in = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\n // With standard hop of half FFT size = 2048 samples\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n fft = FFT(LocalBuf(8192), in); // for sampling rates 88200 and 96000\n\n key = KeyTrack.kr(fft, 2.0, 0.5);\n\n key.poll;\n\n Pan2.ar(in)\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 480} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// The following files are test materials on my machine; you will subsitute your own filenames here\n// A major\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/100.wav\");\n// F major; hard to track!\nd = Buffer.read(s, \"/Volumes/data/stevebeattrack/samples/115.wav\");\n\n// straight forward since no transients; training set from MIREX2006\n// 01 = A major\n// 57 = b minor\n// 78 e minor\n// 08 Bb major\n\nd = Buffer.read(s, \"/Users/nickcollins/Desktop/ML/training_wav/78.wav\")\n\n(\n{\n var in, fft, resample;\n var\n// …\n```"}, {"role": "assistant", "content": "The following files are test materials on my machine; you will subsitute your own filenames here F major; hard to track! (KeyTrack: Key tracker)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 49} +{"conversations": [{"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(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key.poll;\n\n Pan2.ar(in)\n}.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 270} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key.poll;\n\n Pan2.ar(in)\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 311} {"conversations": [{"role": "user", "content": "Explain this SuperCollider code.\n```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(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key\n// …\n```"}, {"role": "assistant", "content": "alternating major and minor chords as a test major dom 7 and minor 7; major keys preferred here (KeyTrack: Key tracker)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 45} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// Nice to hear what KeyTrack thinks:\n\nd = Buffer.read(s, \"/Users/nickcollins/Desktop/ML/training_wav/78.wav\")\n\n(\n{\n var in, fft, resample, chord, rootnote, sympath;\n var key, transientdetection;\n\n in = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft, 2.0, 0.5);\n key.poll;\n key = Median.kr(101, key); // Remove outlier wibbles\n\n chord = if(\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// Nice to hear what KeyTrack thinks:\n\nd = Buffer.read(s, \"/Users/nickcollins/Desktop/ML/training_wav/78.wav\")\n\n(\n{\n var in, fft, resample, chord, rootnote, sympath;\n var key, transientdetection;\n\n in = PlayBuf.ar(1, d, BufRateScale.kr(d), 1, 0, 1);\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft, 2.0, 0.5);\n key.poll;\n key = Median.kr(101, key); // Remove outlier wibbles\n\n chord = if(key < 12, #[0, 4, 7], #[0, 3, 7]);\n rootnote = if(key < 12, key, key-12) + 60;\n\n sympath = SinOsc.ar((rootnote + chord).midicps, 0, 0.4).mean;\n\n Pan2.ar(in, -0.5) + Pan2.ar(sympath, 0.5)\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 405} {"conversations": [{"role": "user", "content": "What is `Klang` in SuperCollider?"}, {"role": "assistant", "content": "Klang — Sine oscillator bank Klang is a bank of fixed frequency sine oscillators. Klang is more efficient than creating individual oscillators but offers less flexibility. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Klang.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "Explain `Klang` in SuperCollider briefly."}, {"role": "assistant", "content": "Klang — Sine oscillator bank Klang is a bank of fixed frequency sine oscillators. Klang is more efficient than creating individual oscillators but offers less flexibility. Category: UGens > Generators > Deterministic."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Klang.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "What does `Klang.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Sine oscillator bank Arguments: specificationsArrayRef — A Ref to an Array of three Arrays:; freqscale — A scale factor multiplied by all frequencies at initialization time.; freqoffset — An offset added to all frequencies at initialization time.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Klang.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 85} @@ -9285,6 +9370,8 @@ {"conversations": [{"role": "user", "content": "What is `LeastChange` in SuperCollider?"}, {"role": "assistant", "content": "LeastChange — Output least changed Given two inputs `a` and `b`, let `da[t] = abs(a[t] - a[t - 1])` and `db[t] = abs(b[t] - b[t - 1])`. Output `a[t]` if `da[t]` is smaller, and output `b[t]` if `db[t]` is smaller. If `da[t] == db[t]`, use whichever input was used last (assume `a` for the first sample of output). Category: UGens > Maths."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 156} {"conversations": [{"role": "user", "content": "Explain `LeastChange` in SuperCollider briefly."}, {"role": "assistant", "content": "LeastChange — Output least changed Given two inputs `a` and `b`, let `da[t] = abs(a[t] - a[t - 1])` and `db[t] = abs(b[t] - b[t - 1])`. Output `a[t]` if `da[t]` is smaller, and output `b[t]` if `db[t]` is smaller. If `da[t] == db[t]`, use whichever input was used last (assume `a` for the first sample of output). Category: UGens > Maths."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 156} {"conversations": [{"role": "user", "content": "What does `LeastChange.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Output least changed Arguments: a — Input signal A.; b — Input signal B.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 30} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `LeastChange`."}, {"role": "assistant", "content": "```supercollider\n(\nd = { |amp = 1.0|\n var in1, in2;\n in1 = LFNoise0.ar(800, amp);\n in2 = SinOsc.ar(800);\n LeastChange.ar(in1, in2) * 0.1;\n}.play;\n);\n\nd.set(\\amp, 0.1);\nd.set(\\amp, 0);\nd.set(\\amp, 3);\nd.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 129} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nd = { |amp = 1.0|\n var in1, in2;\n in1 = LFNoise0.ar(800, amp);\n in2 = SinOsc.ar(800);\n LeastChange.ar(in1, in2) * 0.1;\n}.play;\n);\n\nd.set(\\amp, 0.1);\nd.set(\\amp, 0);\nd.set(\\amp, 3;\nd.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nd = { |amp = 1.0|\n var in1, in2;\n in1 = LFNoise0.ar(800, amp);\n in2 = SinOsc.ar(800);\n LeastChange.ar(in1, in2) * 0.1;\n}.play;\n);\n\nd.set(\\amp, 0.1);\nd.set(\\amp, 0);\nd.set(\\amp, 3);\nd.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "mut:missing_paren", "prompt_tokens": 172, "answer_tokens": 170} {"conversations": [{"role": "user", "content": "Show another SuperCollider example using `LeastChange`."}, {"role": "assistant", "content": "```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 external, one internal\n ) * 0.1\n}.play\n);\n\nd.set(\\freq, 800);\nd.set(\\freq, 900);\nd.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 145} {"conversations": [{"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 external, one internal\n ) * 0.1\n}.play\n);\n\nd.set(\\freq, 800);\nd.set(\\freq, 900;\nd.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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 external, one internal\n ) * 0.1\n}.play\n);\n\nd.set(\\freq, 800);\nd.set(\\freq, 900);\nd.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "mut:missing_paren", "prompt_tokens": 188, "answer_tokens": 186} {"conversations": [{"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."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/LevelIndicator.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 54} @@ -9742,6 +9829,8 @@ {"conversations": [{"role": "user", "content": "What is `MouseButton` in SuperCollider?"}, {"role": "assistant", "content": "MouseButton — Mouse button UGen. Category: UGens > User interaction."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/MouseButton.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 28} {"conversations": [{"role": "user", "content": "Explain `MouseButton` in SuperCollider briefly."}, {"role": "assistant", "content": "MouseButton — Mouse button UGen. Category: UGens > User interaction."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/MouseButton.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 28} {"conversations": [{"role": "user", "content": "What does `MouseButton.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Mouse button UGen. Arguments: minval — Value when the button is not pressed.; maxval — Value when the button is pressed.; lag — Lag factor.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/MouseButton.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 56} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `MouseButton`."}, {"role": "assistant", "content": "```supercollider\n{ SinOsc.ar(MouseButton.kr(400, 440, 0.1), 0, 0.1) }.play;\n{ SinOsc.ar(MouseButton.kr(400, 740, 2), 0, 0.1) }.play;\n\n(\nSynthDef(\\mousexyb, { |out = 0|\n var mousex, mousey, mousebutton;\n mousex = MouseX.kr(500, 1000); // this will determine the frequency of the sound (minimum value, maximum value, warp, lag)\n mousey = MouseY.kr(0, 0.3); // this will determine the amplitude of the sound\n mousebutton = MouseButton.kr(0, 1, 2); // this will turn the sound on or off (minimum value, maximum value, lag)\n Out.ar(out, SinOsc.ar(mousex, 0, mousey) * mousebutton);\n}).add\n);\n\nx = Synth.new(\\mousexyb);\nx.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/MouseButton.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 306} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n{ SinOsc.ar(MouseButton.kr(400, 440, 0.1), 0, 0.1) }.play;\n{ SinOsc.ar(MouseButton.kr(400, 740, 2), 0, 0.1) }.play;\n\n(\nSynthDef(\\mousexyb, { |out = 0|\n var mousex, mousey, mousebutton;\n mousex = MouseX.kr(500, 1000); // this will determine the frequency of the sound (minimum value, maximum value, warp, lag)\n mousey = MouseY.kr(0, 0.3); // this will determine the amplitude of the sound\n mousebutton = MouseButton.kr(0, 1, 2); // this will turn the sound on or off (minimum value, maximum value, lag)\n Out.ar\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n{ SinOsc.ar(MouseButton.kr(400, 440, 0.1), 0, 0.1) }.play;\n{ SinOsc.ar(MouseButton.kr(400, 740, 2), 0, 0.1) }.play;\n\n(\nSynthDef(\\mousexyb, { |out = 0|\n var mousex, mousey, mousebutton;\n mousex = MouseX.kr(500, 1000); // this will determine the frequency of the sound (minimum value, maximum value, warp, lag)\n mousey = MouseY.kr(0, 0.3); // this will determine the amplitude of the sound\n mousebutton = MouseButton.kr(0, 1, 2); // this will turn the sound on or off (minimum value, maximum value, lag)\n Out.ar(out, SinOsc.ar(mousex, 0, mousey) * mousebutton);\n}).add\n);\n\nx = Synth.new(\\mousexyb);\nx.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/MouseButton.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 347} {"conversations": [{"role": "user", "content": "What is `MouseX` in SuperCollider?"}, {"role": "assistant", "content": "MouseX — Cursor tracking UGen. Category: UGens > User interaction."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/MouseX.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "Explain `MouseX` in SuperCollider briefly."}, {"role": "assistant", "content": "MouseX — Cursor tracking UGen. Category: UGens > User interaction."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/MouseX.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "What does `MouseX.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Cursor tracking UGen. Arguments: minval — Value corresponding to the left edge of the screen.; maxval — Value corresponding to the right edge of the screen.; warp — Mapping curve. 0 is linear, 1 is exponential (e. g. for freq or times). Alternatively you can specify: 'linear' or 'exponential'.; lag — Lag factor to dezipper cursor movement.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/MouseX.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 134} @@ -10332,15 +10421,21 @@ {"conversations": [{"role": "user", "content": "What is `PV_BinScramble` in SuperCollider?"}, {"role": "assistant", "content": "PV_BinScramble — Scramble bins. Randomizes the order of the bins. The trigger will select a new random ordering. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinScramble.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "Explain `PV_BinScramble` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_BinScramble — Scramble bins. Randomizes the order of the bins. The trigger will select a new random ordering. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinScramble.schelp", "aug": "para:1", "prompt_tokens": 43, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "What does `PV_BinScramble.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Scramble bins. Arguments: buffer — FFT buffer.; wipe — Scrambles more bins as wipe moves from 0 to 1.; width — A value from zero to one, indicating the maximum randomized distance of a bin from its original location in the spectrum.; trig — A trigger, that selects a new random ordering.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_BinScramble.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 104} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_BinScramble`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n// trig with MouseY\nSynthDef(\"help-binScramble\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BinScramble(chain, MouseX.kr, 0.1, MouseY.kr > 0.5);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_BinScramble.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 232} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n// trig with MouseY\nSynthDef(\"help-binScramble\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BinScramble(chain, MouseX.kr, 0.1, MouseY.kr > 0.5);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n// trig with MouseY\nSynthDef(\"help-binScramble\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BinScramble(chain, MouseX.kr, 0.1, MouseY.kr > 0.5);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_BinScramble.schelp", "aug": "mut:missing_paren", "prompt_tokens": 273, "answer_tokens": 273} {"conversations": [{"role": "user", "content": "What is `PV_BinShift` in SuperCollider?"}, {"role": "assistant", "content": "PV_BinShift — Shift and stretch bin position. Shift and scale the positions of the bins. Can be used as a very crude frequency shifter/scaler. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinShift.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 65} {"conversations": [{"role": "user", "content": "Explain `PV_BinShift` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_BinShift — Shift and stretch bin position. Shift and scale the positions of the bins. Can be used as a very crude frequency shifter/scaler. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinShift.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 65} {"conversations": [{"role": "user", "content": "What does `PV_BinShift.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Shift and stretch bin position. Arguments: buffer — FFT buffer.; stretch — Scale bin location by factor.; shift — Add an offset to bin position.; interp — Set to 0 (default) for no interpolation, or 1 to linear-interpolate between bins.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_BinShift.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 96} {"conversations": [{"role": "user", "content": "What is `PV_BinWipe` in SuperCollider?"}, {"role": "assistant", "content": "PV_BinWipe — Combine low and high bins from two inputs. Copies low bins from one input and the high bins of the other. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinWipe.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "Explain `PV_BinWipe` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_BinWipe — Combine low and high bins from two inputs. Copies low bins from one input and the high bins of the other. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BinWipe.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "What does `PV_BinWipe.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Combine low and high bins from two inputs. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.; wipe — Can range between -1 and +1. If `wipe` == 0, then the output is the same as `bufferA` . If `wipe` > 0, then it begins replacing with bins from `bufferB` from the bottom up. If `wipe` < 0, then it begins replacing with bins from `bufferB` from the top down.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_BinWipe.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 156} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_BinWipe`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-binWipe\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-binWipe2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_BinWipe.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 457} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-binWipe\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-binWipe2\", { |out = 0, sound\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-binWipe\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-binWipe2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_BinWipe(chainA, chainB, MouseX.kr(-1, 1));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_BinWipe.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 498} {"conversations": [{"role": "user", "content": "What is `PV_BrickWall` in SuperCollider?"}, {"role": "assistant", "content": "PV_BrickWall — Zero bins. Clears bins above or below a cutoff point. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 42} {"conversations": [{"role": "user", "content": "Explain `PV_BrickWall` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_BrickWall — Zero bins. Clears bins above or below a cutoff point. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 42} {"conversations": [{"role": "user", "content": "What does `PV_BrickWall.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Zero bins. Arguments: buffer — FFT buffer.; wipe — Can range between -1 and +1. If `wipe` == 0 then there is no effect. If `wipe` > 0 then it acts like a high pass filter, clearing bins from the bottom up. If `wipe` < 0 then it acts like a low pass filter, clearing bins from the top down.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 111} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_BrickWall`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BrickWall(chain, SinOsc.kr(0.1));\n IFFT(chain);\n}.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 106} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BrickWall(chain, SinOsc.kr(0.1));\n IFFT(chain);\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BrickWall(chain, SinOsc.kr(0.1));\n IFFT(chain);\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_BrickWall.schelp", "aug": "mut:missing_paren", "prompt_tokens": 147, "answer_tokens": 147} {"conversations": [{"role": "user", "content": "What is `PV_ChainUGen` in SuperCollider?"}, {"role": "assistant", "content": "PV_ChainUGen — Base class for UGens that operate on FFT chains `PV_ChainUGen` is an abstract class, not used directly, but only its subclasses are. It represents phase-vocoder UGens - i.e. UGens which apply some kind of transformation to the frequency-domain signal produced by FFT. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_ChainUGen.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "Explain `PV_ChainUGen` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_ChainUGen — Base class for UGens that operate on FFT chains `PV_ChainUGen` is an abstract class, not used directly, but only its subclasses are. It represents phase-vocoder UGens - i.e. UGens which apply some kind of transformation to the frequency-domain signal produced by FFT. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_ChainUGen.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "What does `PV_ChainUGen.pvcalc` do? What arguments does it take?"}, {"role": "assistant", "content": "pvcalc applies a function to the frequency-domain data of an FFT chain. See #-pvcollect below for discussion of efficiency considerations. See also #-pvcalc2 below, and UnpackFFT. `chain = chain.pvcalc(numframes, func, frombin, tobin, Arguments: numframes — Number of FFT frames to process; func — The function that takes two arrays as inputs (`magnitude`, and `phase`) and returns a resulting pair of arrays `[magnitude, phase]`. `// example function`; frombin — Range start (optional); tobin — Range end (optional); zeroothers — If set to 1 then bins outside of the range being processed are silenced.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_ChainUGen.schelp", "aug": "none", "prompt_tokens": 45, "answer_tokens": 230} @@ -10353,6 +10448,8 @@ {"conversations": [{"role": "user", "content": "What is `PV_Conj` in SuperCollider?"}, {"role": "assistant", "content": "PV_Conj — Complex conjugate Converts the FFT frames to their complex conjugate (i.e. reverses the sign of their imaginary part). This is not usually a useful audio effect in itself, but may be a component of other analysis or transformation processes... Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 95} {"conversations": [{"role": "user", "content": "Explain `PV_Conj` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Conj — Complex conjugate Converts the FFT frames to their complex conjugate (i.e. reverses the sign of their imaginary part). This is not usually a useful audio effect in itself, but may be a component of other analysis or transformation processes... Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 95} {"conversations": [{"role": "user", "content": "What does `PV_Conj.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Complex conjugate Arguments: buffer — FFT chain.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 23} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_Conj`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\nd = Buffer.alloc(s, 2048, 1);\n);\n\n(\nSynthDef(\\help_pvconj, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_Conj(chain);\n // Original is left, conj is right\n Out.ar(out, 0.3 * [in, IFFT(chain)]);\n}).play(s, [\\out, 0, \\bufnum, b, \\soundBufnum, c]);\n);\n\n(\nSynthDef(\\help_pvconj2, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chainA, chainB;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnum, in);\n chainB = PV_Copy(chainA, d);\n chainB = PV_Conj(chainB);\n // Now we have the original and conjugate, what happens if we add them?\n Out.ar(out, 0.3 * (IFFT(PV_Add(chainA, chainB)).dup));\n}).play(s, [\\out, 0, \\bufnum, b, \\soundBufnum, c]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 510} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\nd = Buffer.alloc(s, 2048, 1);\n);\n\n(\nSynthDef(\\help_pvconj, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_Conj(chain);\n // Original is left, conj is right\n Out.ar(out, 0.3 * [in, IFFT(chain)]);\n}).play(s, [\\out, 0, \\\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\nd = Buffer.alloc(s, 2048, 1);\n);\n\n(\nSynthDef(\\help_pvconj, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_Conj(chain);\n // Original is left, conj is right\n Out.ar(out, 0.3 * [in, IFFT(chain)]);\n}).play(s, [\\out, 0, \\bufnum, b, \\soundBufnum, c]);\n);\n\n(\nSynthDef(\\help_pvconj2, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chainA, chainB;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(bufnum, in);\n chainB = PV_Copy(chainA, d);\n chainB = PV_Conj(chainB);\n // Now we have the original and conjugate, what happens if we add them?\n Out.ar(out, 0.3 * (IFFT(PV_Add(chainA, chainB)).dup));\n}).play(s, [\\out, 0, \\bufnum, b, \\soundBufnum, c]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 551} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\nd = Buffer.alloc(s, 2048, 1);\n);\n\n(\nSynthDef(\\help_pvconj, { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_Conj(chain);\n // Original is left, conj is right\n Out.ar(out, 0.3 * [in, IFFT(chain)]);\n}).play(s, [\\out, 0, \\\n// …\n```"}, {"role": "assistant", "content": "Original is left, conj is right Now we have the original and conjugate, what happens if we add them? (PV_Conj: Complex conjugate)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/PV_Conj.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 47} {"conversations": [{"role": "user", "content": "What is `PV_Copy` in SuperCollider?"}, {"role": "assistant", "content": "PV_Copy — Copy an FFT buffer Copies the spectral frame in `bufferA` to `bufferB`. This allows for parallel processing of spectral data without the need for multiple FFT UGens. Further it allows to extract data at a given point in the FFT chain e.g. for monitoring purposes. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Copy.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 113} {"conversations": [{"role": "user", "content": "Explain `PV_Copy` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Copy — Copy an FFT buffer Copies the spectral frame in `bufferA` to `bufferB`. This allows for parallel processing of spectral data without the need for multiple FFT UGens. Further it allows to extract data at a given point in the FFT chain e.g. for monitoring purposes. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Copy.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 113} @@ -10360,6 +10457,8 @@ {"conversations": [{"role": "user", "content": "What is `PV_CopyPhase` in SuperCollider?"}, {"role": "assistant", "content": "PV_CopyPhase — Copy magnitudes and phases. Combines magnitudes of first input and phases of the second input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_CopyPhase.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "Explain `PV_CopyPhase` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_CopyPhase — Copy magnitudes and phases. Combines magnitudes of first input and phases of the second input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_CopyPhase.schelp", "aug": "para:1", "prompt_tokens": 43, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "What does `PV_CopyPhase.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Copy magnitudes and phases. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_CopyPhase.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 47} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_CopyPhase`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-copyPhase\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n inB = WhiteNoise.ar(0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_CopyPhase(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-copyPhase2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n inB = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_CopyPhase(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_CopyPhase.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 513} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-copyPhase\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n inB = WhiteNoise.ar(0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_CopyPhase(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-copyPhase\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n inB = WhiteNoise.ar(0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_CopyPhase(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-copyPhase2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n inB = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_CopyPhase(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_CopyPhase.schelp", "aug": "mut:missing_paren", "prompt_tokens": 296, "answer_tokens": 554} {"conversations": [{"role": "user", "content": "What is `PV_Diffuser` in SuperCollider?"}, {"role": "assistant", "content": "PV_Diffuser — Random phase shifting. Adds a different constant random phase shift to each bin. When triggered, it selects a new set of random phases. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Diffuser.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 63} {"conversations": [{"role": "user", "content": "Explain `PV_Diffuser` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Diffuser — Random phase shifting. Adds a different constant random phase shift to each bin. When triggered, it selects a new set of random phases. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Diffuser.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 63} {"conversations": [{"role": "user", "content": "What does `PV_Diffuser.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Random phase shifting. Arguments: buffer — FFT buffer.; trig — A trigger, that selects a new set of random values.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_Diffuser.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 45} @@ -10380,6 +10479,8 @@ {"conversations": [{"role": "user", "content": "What is `PV_MagAbove` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagAbove — Pass bins above a threshold. Passes only bins whose magnitude is above a threshold. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagAbove.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 54} {"conversations": [{"role": "user", "content": "Explain `PV_MagAbove` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagAbove — Pass bins above a threshold. Passes only bins whose magnitude is above a threshold. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagAbove.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 54} {"conversations": [{"role": "user", "content": "What does `PV_MagAbove.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Pass bins above a threshold. Arguments: buffer — FFT buffer.; threshold — Magnitude threshold.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagAbove.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 45} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagAbove`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magAbove\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n // in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, 310);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magAbove2\", { |out = 0|\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, MouseX.kr(0, 10));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magAbove3\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, MouseX.kr(0, 310));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagAbove.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 515} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magAbove\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n // in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, 310);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magAbove2\", { |out = 0|\n var in, chain;\n in = WhiteNoise.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magAbove\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n // in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, 310);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magAbove2\", { |out = 0|\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, MouseX.kr(0, 10));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magAbove3\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, MouseX.kr(0, 310));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagAbove.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 556} {"conversations": [{"role": "user", "content": "What is `PV_MagBelow` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagBelow — Pass bins below a threshold. Passes only bins whose magnitude is below a threshold. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagBelow.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "Explain `PV_MagBelow` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagBelow — Pass bins below a threshold. Passes only bins whose magnitude is below a threshold. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagBelow.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 56} {"conversations": [{"role": "user", "content": "What does `PV_MagBelow.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Pass bins below a threshold. Arguments: buffer — FFT buffer.; threshold — Magnitude threshold.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagBelow.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 46} @@ -10389,24 +10490,36 @@ {"conversations": [{"role": "user", "content": "What is `PV_MagDiv` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagDiv — Division of magnitudes Divides magnitudes of two inputs and keeps the phases of the first input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagDiv.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "Explain `PV_MagDiv` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagDiv — Division of magnitudes Divides magnitudes of two inputs and keeps the phases of the first input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagDiv.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "What does `PV_MagDiv.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Division of magnitudes Arguments: bufferA — fft buffer A.; bufferB — fft buffer B.; zeroed — number to use when bins are zeroed out, i.e. causing division by zero (defaults to 0.0001)."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagDiv.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 83} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagDiv`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagDiv(chainA, chainB);\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play;\n);\n\n\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 0|\n var inA, chainA, inB, chainB, chain;\n inA = LFSaw.ar([100, 150], 0, 0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagDiv(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain));\n}).play(s, [\\out, 0, \\soundBufnum, c]);\n);\n\nc.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagDiv.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 449} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagDiv(chainA, chainB);\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play;\n);\n\n\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 0|\n var inA,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagDiv(chainA, chainB);\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play;\n);\n\n\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 0|\n var inA, chainA, inB, chainB, chain;\n inA = LFSaw.ar([100, 150], 0, 0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagDiv(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain));\n}).play(s, [\\out, 0, \\soundBufnum, c]);\n);\n\nc.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagDiv.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 490} {"conversations": [{"role": "user", "content": "What is `PV_MagFreeze` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagFreeze — Freeze magnitudes. Freezes magnitudes at current levels when `freeze` > 0. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagFreeze.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "Explain `PV_MagFreeze` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagFreeze — Freeze magnitudes. Freezes magnitudes at current levels when `freeze` > 0. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagFreeze.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 55} {"conversations": [{"role": "user", "content": "What does `PV_MagFreeze.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Freeze magnitudes. Arguments: buffer — FFT buffer.; freeze — If > 0, then magnitudes are frozen at current levels.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagFreeze.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 53} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagFreeze`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magFreeze\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(LFNoise1.kr(5.2, 250, 400));\n chain = FFT(LocalBuf(2048), in);\n // moves in and out of freeze\n chain = PV_MagFreeze(chain, SinOsc.kr(0.2));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-magFreeze2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagFreeze(chain, MouseY.kr > 0.5);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n);\n\nb.free\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagFreeze.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 383} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magFreeze\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(LFNoise1.kr(5.2, 250, 400));\n chain = FFT(LocalBuf(2048), in);\n // moves in and out of freeze\n chain = PV_MagFreeze(chain, SinOsc.kr(0.2));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-magFreeze2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBu\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n\n(\nSynthDef(\"help-magFreeze\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(LFNoise1.kr(5.2, 250, 400));\n chain = FFT(LocalBuf(2048), in);\n // moves in and out of freeze\n chain = PV_MagFreeze(chain, SinOsc.kr(0.2));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-magFreeze2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagFreeze(chain, MouseY.kr > 0.5);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n);\n\nb.free\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagFreeze.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 424} {"conversations": [{"role": "user", "content": "What is `PV_MagMul` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagMul — Multiply magnitudes. Multiplies magnitudes of two inputs and keeps the phases of the first input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagMul.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 57} {"conversations": [{"role": "user", "content": "Explain `PV_MagMul` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagMul — Multiply magnitudes. Multiplies magnitudes of two inputs and keeps the phases of the first input. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagMul.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 57} {"conversations": [{"role": "user", "content": "What does `PV_MagMul.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Multiply magnitudes. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagMul.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 44} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagMul`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagMul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = LFSaw.ar([100, 150], 0, 0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagMul(chainA, chainB);\n Out.ar(out, 0.03 * IFFT(chain));\n}).play(s, [\\soundBufnum, b.bufnum]);\n);\n\nb.free\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagMul.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 449} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagMul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 2|\n var inA,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magMul\", { |out = 0|\n var inA, chainA, inB, chainB, chain;\n inA = WhiteNoise.ar(0.2);\n inB = LFSaw.ar(100, 0, 0.2);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagMul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magMul2\", { |out = 0, soundBufnum = 2|\n var inA, chainA, inB, chainB, chain;\n inA = LFSaw.ar([100, 150], 0, 0.2);\n inB = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_MagMul(chainA, chainB);\n Out.ar(out, 0.03 * IFFT(chain));\n}).play(s, [\\soundBufnum, b.bufnum]);\n);\n\nb.free\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagMul.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 490} {"conversations": [{"role": "user", "content": "What is `PV_MagNoise` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagNoise — Multiply magnitudes by noise. Magnitudes are multiplied with noise. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagNoise.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "Explain `PV_MagNoise` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagNoise — Multiply magnitudes by noise. Magnitudes are multiplied with noise. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagNoise.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "What does `PV_MagNoise.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Multiply magnitudes by noise. Arguments: buffer — FFT buffer.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagNoise.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 30} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagNoise`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magNoise\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagNoise(chain);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magNoise2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagNoise(chain);\n Out.ar(out, 0.2 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n);\n\nb.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagNoise.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 359} +{"conversations": [{"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.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magNoise\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagNoise(chain);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magNoise2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\nb = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-magNoise\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagNoise(chain);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n);\n\n(\nSynthDef(\"help-magNoise2\", { |out = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagNoise(chain);\n Out.ar(out, 0.2 * IFFT(chain).dup);\n}).play(s, [\\soundBufnum, b]);\n);\n\nb.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagNoise.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 400} {"conversations": [{"role": "user", "content": "What is `PV_MagShift` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagShift — shift and stretch magnitude bin position. Shift and stretch the positions of only the magnitude of the bins. Can be used as a very crude frequency shifter/scaler. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagShift.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "Explain `PV_MagShift` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagShift — shift and stretch magnitude bin position. Shift and stretch the positions of only the magnitude of the bins. Can be used as a very crude frequency shifter/scaler. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagShift.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "What does `PV_MagShift.new` do? What arguments does it take?"}, {"role": "assistant", "content": "shift and stretch magnitude bin position. Arguments: buffer — FFT buffer.; stretch — Scale bin location by factor.; shift — Add an offset to bin position.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagShift.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 65} {"conversations": [{"role": "user", "content": "What is `PV_MagSmear` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagSmear — Average magnitudes across bins. Average a bin's magnitude with its neighbors. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagSmear.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "Explain `PV_MagSmear` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagSmear — Average magnitudes across bins. Average a bin's magnitude with its neighbors. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagSmear.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "What does `PV_MagSmear.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Average magnitudes across bins. Arguments: buffer — FFT buffer.; bins — Number of bins to average on each side of bin. As this number rises, so will CPU usage.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagSmear.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 63} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagSmear`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSmear\", { |out = 0, bufnum = 0|\n var in, chain;\n in = LFSaw.ar(500, 0, Decay2.ar(Impulse.ar(2, 0, 0.2), 0.01, 2));\n chain = FFT(bufnum, in);\n chain = PV_MagSmear(chain, MouseX.kr(0, 100));\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nSynthDef(\"help-magSmear2\", { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagSmear(chain, MouseX.kr(0, 100));\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagSmear.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 440} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSmear\", { |out = 0, bufnum = 0|\n var in, chain;\n in = LFSaw.ar(500, 0, Decay2.ar(Impulse.ar(2, 0, 0.2), 0.01, 2));\n chain = FFT(bufnum, in);\n chain = PV_MagSmear(chain, MouseX.kr(0, 100));\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nSynthDef(\"help\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSmear\", { |out = 0, bufnum = 0|\n var in, chain;\n in = LFSaw.ar(500, 0, Decay2.ar(Impulse.ar(2, 0, 0.2), 0.01, 2));\n chain = FFT(bufnum, in);\n chain = PV_MagSmear(chain, MouseX.kr(0, 100));\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nSynthDef(\"help-magSmear2\", { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagSmear(chain, MouseX.kr(0, 100));\n Out.ar(out, 0.5 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagSmear.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 481} {"conversations": [{"role": "user", "content": "What is `PV_MagSquared` in SuperCollider?"}, {"role": "assistant", "content": "PV_MagSquared — Square magnitudes. Squares the magnitudes and renormalizes to previous peak. This makes weak bins weaker. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagSquared.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 66} {"conversations": [{"role": "user", "content": "Explain `PV_MagSquared` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_MagSquared — Square magnitudes. Squares the magnitudes and renormalizes to previous peak. This makes weak bins weaker. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_MagSquared.schelp", "aug": "para:1", "prompt_tokens": 43, "answer_tokens": 66} {"conversations": [{"role": "user", "content": "What does `PV_MagSquared.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Square magnitudes. Arguments: buffer — FFT buffer.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_MagSquared.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 27} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_MagSquared`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSquared\", { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagSquared(chain);\n Out.ar(out, 0.003 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_MagSquared.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 252} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSquared\", { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagSquared(chain);\n Out.ar(out, 0.003 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.alloc(s, 2048, 1);\nc = Buffer.read(s, ExampleFiles.child);\n);\n\n(\nSynthDef(\"help-magSquared\", { |out = 0, bufnum = 0, soundBufnum = 2|\n var in, chain;\n in = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(bufnum, in);\n chain = PV_MagSquared(chain);\n Out.ar(out, 0.003 * IFFT(chain).dup);\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\soundBufnum, c.bufnum]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_MagSquared.schelp", "aug": "mut:missing_paren", "prompt_tokens": 293, "answer_tokens": 293} {"conversations": [{"role": "user", "content": "What is `PV_Max` in SuperCollider?"}, {"role": "assistant", "content": "PV_Max — Maximum magnitude. Output copies bins with the maximum magnitude of the two inputs. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Max.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "Explain `PV_Max` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Max — Maximum magnitude. Output copies bins with the maximum magnitude of the two inputs. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Max.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 49} {"conversations": [{"role": "user", "content": "What does `PV_Max.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Maximum magnitude. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_Max.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 44} @@ -10416,9 +10529,13 @@ {"conversations": [{"role": "user", "content": "What is `PV_Mul` in SuperCollider?"}, {"role": "assistant", "content": "PV_Mul — Complex multiply. Complex Multiplication: Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 33} {"conversations": [{"role": "user", "content": "Explain `PV_Mul` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_Mul — Complex multiply. Complex Multiplication: Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 33} {"conversations": [{"role": "user", "content": "What does `PV_Mul.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Complex multiply. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 39} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_Mul`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-mul\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5);\n inB = SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n);\n\n(\nSynthDef(\"help-mul2\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5) * Line.kr;\n inB = LFNoise1.ar(20);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 396} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-mul\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5);\n inB = SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n);\n\n(\nSynthDef(\"help-mul2\", { |out = 0|\n var inA, chainA, inB, chainB,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-mul\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5);\n inB = SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n);\n\n(\nSynthDef(\"help-mul2\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5) * Line.kr;\n inB = LFNoise1.ar(20);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 437} {"conversations": [{"role": "user", "content": "What is `PV_PhaseShift` in SuperCollider?"}, {"role": "assistant", "content": "PV_PhaseShift — Shift phase. Shift phase of all bins. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "Explain `PV_PhaseShift` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_PhaseShift — Shift phase. Shift phase of all bins. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "para:1", "prompt_tokens": 43, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "What does `PV_PhaseShift.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Shift phase. Arguments: buffer — FFT buffer.; shift — Phase shift in radians.; integrate — If greater than zero, integrate the phase-shift across calls (for an accumulating phase shift).."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "none", "prompt_tokens": 42, "answer_tokens": 75} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_PhaseShift`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-phaseShift\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(500);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_PhaseShift(chain, LFNoise2.kr(1, 180, 180));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 148} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-phaseShift\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(500);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_PhaseShift(chain, LFNoise2.kr(1, 180, 180));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nSynthDef(\"help-phaseShift\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(500);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_PhaseShift(chain, LFNoise2.kr(1, 180, 180));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "mut:missing_paren", "prompt_tokens": 189, "answer_tokens": 189} {"conversations": [{"role": "user", "content": "What is `PV_PhaseShift270` in SuperCollider?"}, {"role": "assistant", "content": "PV_PhaseShift270 — Shift phase by 270 degrees. Shift phase of all bins by 270 degrees. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift270.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "Explain `PV_PhaseShift270` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_PhaseShift270 — Shift phase by 270 degrees. Shift phase of all bins by 270 degrees. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift270.schelp", "aug": "para:1", "prompt_tokens": 45, "answer_tokens": 51} {"conversations": [{"role": "user", "content": "What does `PV_PhaseShift270.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Shift phase by 270 degrees. Arguments: buffer — FFT buffer.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift270.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 29} @@ -10430,18 +10547,23 @@ {"conversations": [{"role": "user", "content": "What is `PV_RandComb` in SuperCollider?"}, {"role": "assistant", "content": "PV_RandComb — Pass random bins. Randomly clear bins. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RandComb.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 34} {"conversations": [{"role": "user", "content": "Explain `PV_RandComb` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_RandComb — Pass random bins. Randomly clear bins. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RandComb.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 34} {"conversations": [{"role": "user", "content": "What does `PV_RandComb.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Pass random bins. Arguments: buffer — FFT buffer.; wipe — Clears bins from input in a random order as wipe goes from 0 to 1.; trig — A trigger, that selects a new random ordering.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_RandComb.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 70} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_RandComb`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-randcomb\", { |out = 0|\n var sig, chain;\n sig = WhiteNoise.ar(0.8);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n Out.ar(out, IFFT(chain).dup);\n}).play(s);\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-randcomb2\", { |out = 0, soundBufnum = 2|\n var sig, chain;\n sig = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RandComb(chain, MouseY.kr, Impulse.kr(0.4));\n Out.ar(out, IFFT(chain).dup);\n}).play(s, [\\soundBufnum, c.bufnum]);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_RandComb.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 360} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-randcomb\", { |out = 0|\n var sig, chain;\n sig = WhiteNoise.ar(0.8);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n Out.ar(out, IFFT(chain).dup);\n}).play(s);\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-randcomb2\", { |out = 0, soundBufnum = 2|\n var sig, chain;\n sig = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(sound\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nc = Buffer.read(s, ExampleFiles.child);\n\n(\nSynthDef(\"help-randcomb\", { |out = 0|\n var sig, chain;\n sig = WhiteNoise.ar(0.8);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n Out.ar(out, IFFT(chain).dup);\n}).play(s);\n);\n\n(\n// trig with MouseY\nSynthDef(\"help-randcomb2\", { |out = 0, soundBufnum = 2|\n var sig, chain;\n sig = PlayBuf.ar(1, soundBufnum, BufRateScale.kr(soundBufnum), loop: 1);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RandComb(chain, MouseY.kr, Impulse.kr(0.4));\n Out.ar(out, IFFT(chain).dup);\n}).play(s, [\\soundBufnum, c.bufnum]);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_RandComb.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 401} {"conversations": [{"role": "user", "content": "What is `PV_RandWipe` in SuperCollider?"}, {"role": "assistant", "content": "PV_RandWipe — Crossfade in random bin order. Crossfades between two sounds by copying bins in a random order. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RandWipe.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "Explain `PV_RandWipe` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_RandWipe — Crossfade in random bin order. Crossfades between two sounds by copying bins in a random order. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RandWipe.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 52} {"conversations": [{"role": "user", "content": "What does `PV_RandWipe.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Crossfade in random bin order. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.; wipe — Copies bins from bufferB in a random order as wipe goes from 0 to 1.; trig — A trigger, that selects a new random ordering.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_RandWipe.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 94} {"conversations": [{"role": "user", "content": "What is `PV_RectComb` in SuperCollider?"}, {"role": "assistant", "content": "PV_RectComb — Make gaps in spectrum. Makes a series of gaps in a spectrum. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 47} {"conversations": [{"role": "user", "content": "Explain `PV_RectComb` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_RectComb — Make gaps in spectrum. Makes a series of gaps in a spectrum. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 47} {"conversations": [{"role": "user", "content": "What does `PV_RectComb.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Make gaps in spectrum. Arguments: buffer — FFT buffer.; numTeeth — Number of teeth in the comb.; phase — Starting phase of comb pulse.; width — Pulse width of the comb.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 75} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PV_RectComb`."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, 8, LFTri.kr(0.097, 0, 0.4, 0.5),\n LFTri.kr(0.24, 0, -0.5, 0.5));\n IFFT(chain).dup\n}.play;\n);\n\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, MouseX.kr(0, 32), MouseY.kr, 0.2);\n IFFT(chain).dup\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 248} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, 8, LFTri.kr(0.097, 0, 0.4, 0.5),\n LFTri.kr(0.24, 0, -0.5, 0.5));\n IFFT(chain).dup\n}.play;\n);\n\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, MouseX.kr(0, 32), MouseY.kr, 0.2);\n IFFT(chain).dup\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, 8, LFTri.kr(0.097, 0, 0.4, 0.5),\n LFTri.kr(0.24, 0, -0.5, 0.5));\n IFFT(chain).dup\n}.play;\n);\n\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, MouseX.kr(0, 32), MouseY.kr, 0.2);\n IFFT(chain).dup\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "mut:missing_paren", "prompt_tokens": 289, "answer_tokens": 289} {"conversations": [{"role": "user", "content": "What is `PV_RectComb2` in SuperCollider?"}, {"role": "assistant", "content": "PV_RectComb2 — Make gaps in spectrum. Alternates blocks of bins between the two inputs. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RectComb2.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "Explain `PV_RectComb2` in SuperCollider briefly."}, {"role": "assistant", "content": "PV_RectComb2 — Make gaps in spectrum. Alternates blocks of bins between the two inputs. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PV_RectComb2.schelp", "aug": "para:1", "prompt_tokens": 42, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "What does `PV_RectComb2.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Make gaps in spectrum. Arguments: bufferA — FFT buffer A.; bufferB — FFT buffer B.; numTeeth — Number of teeth in the comb.; phase — Starting phase of comb pulse.; width — Pulse width of the comb.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PV_RectComb2.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 92} {"conversations": [{"role": "user", "content": "What is `PackFFT` in SuperCollider?"}, {"role": "assistant", "content": "PackFFT — Pack separate demand-rate FFT bin streams into an FFT chain buffer Takes an array of magnitudes and phases, and packs them into an FFT buffer ready for transforming back into time-domain audio using IFFT. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PackFFT.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 97} {"conversations": [{"role": "user", "content": "Explain `PackFFT` in SuperCollider briefly."}, {"role": "assistant", "content": "PackFFT — Pack separate demand-rate FFT bin streams into an FFT chain buffer Takes an array of magnitudes and phases, and packs them into an FFT buffer ready for transforming back into time-domain audio using IFFT. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PackFFT.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 97} {"conversations": [{"role": "user", "content": "What does `PackFFT.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Pack separate demand-rate FFT bin streams into an FFT chain buffer Arguments: chain — The FFT chain; bufsize — FFT buffer size; magsphases — The input data should be a flat array containing magnitude and phase of all bins in ascending order. e.g. `[mag0, phase0, mag1, phase1, mag2, phase2, ... magN, phaseN]` This input is typically demand-rate.; frombin — restricts the frequency band; tobin — restricts the frequency band; zeroothers — set to 1 to zero all the magnitudes outside the restricted frequency band."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/PackFFT.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 209} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `PackFFT`."}, {"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, phases, chain, sig;\n // Create simple undulating magnitudes\n mags = { FSinOsc.kr(ExpRand(0.1, 1)).range(0, 1) }.dup(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.dup(100);\n // We need to create an FFT chain to feed our data in to.\n // The easiest way is to do an FFT on some signal which we then ignore!\n chain = FFT(LocalBuf(512), FSinOsc.ar);\n // Now we can do the packing\n chain = PackFFT(chain, 512, [mags, phases].flop.flatten, 0, 99, 1);\n sig = IFFT(chain);\n sig.dup\n}.play\n);\nx.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/PackFFT.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 408} {"conversations": [{"role": "user", "content": "What is `Padd` in SuperCollider?"}, {"role": "assistant", "content": "Padd — add to value of a key in event stream Category: Streams-Patterns-Events > Patterns > Math."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Padd.schelp", "aug": "none", "prompt_tokens": 31, "answer_tokens": 39} {"conversations": [{"role": "user", "content": "Explain `Padd` in SuperCollider briefly."}, {"role": "assistant", "content": "Padd — add to value of a key in event stream Category: Streams-Patterns-Events > Patterns > Math."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Padd.schelp", "aug": "para:1", "prompt_tokens": 36, "answer_tokens": 39} {"conversations": [{"role": "user", "content": "What does `Padd.new` do? What arguments does it take?"}, {"role": "assistant", "content": "add to value of a key in event stream Arguments: name; value — can be a pattern or a stream. The resulting stream ends when that incoming stream ends.; pattern."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Padd.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 49} @@ -10579,6 +10701,7 @@ {"conversations": [{"role": "user", "content": "What does `Pbind.patternpairs` do?"}, {"role": "assistant", "content": "The defined key value pairs mapping symbols to value patterns. `Pbind(x:7, y:Pseq([1, 2,"}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 38} {"conversations": [{"role": "user", "content": "What does `Pbind.embedInStream` do? What arguments does it take?"}, {"role": "assistant", "content": "From within a Stream like e.g. Routine, yield all events from this pattern before continuing. One pattern can be used to produce values for any number of independent Arguments: inevent — An event that is passed into all substreams and is used by them to produce the output events. `a = Pbind(note: Pseq([0, 4, 7]), amp: 0.1, dur: 0.2);`."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 119} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\n// When we provide the 'root' argument an array, we should hear a chord.\n// the synth def is defined above\n(\nPbind(\n \\instrument, \\acid, \\dur, Pseq([0.25, 0.5, 0.25], inf),\n \\root, [-24, -17], // expand root\n \\degree, Pseq([0, 3, 5, 7, 9, 11, 5, 1], inf),\n \\pan, Pfunc { 1.0.rand2 },\n \\cut, Pxrand([1000, 500, 2000, 300], inf),\n \\rez, Pfunc { 0.7.rand + 0.3 },\n \\amp, 0.2).play;\n);\n\n// multiple arrays are correlated in parallel, the shorter one wraps:\n(\nPbind(\n \\instrument, \\acid,\n \\dur,\n// …\n```"}, {"role": "assistant", "content": "When we provide the 'root' argument an array, we should hear a chord. the synth def is defined above (Pbind: combine several value patterns to one event stream by binding keys to values)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 55} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\\berlinb, { |out = 0, freq = 80, amp = 0.01, pan = 0, gate = 1|\n var synth, env;\n env = Decay2.kr(gate, 0.05, 8, 0.0003);\n synth = RLPF.ar(\n LFPulse.ar(freq, 0, SinOsc.kr(0.12, [0, 0.5pi], 0.48, 0.5)),\n freq * SinOsc.kr(0.21, 0, 18, 20),\n 0.07\n );\n #a, b = synth*env;\n DetectSilence.ar(a, 0.1, doneAction: Done.freeSelf);\n Out.ar(out, amp * Mix.ar(PanAz.ar(4, [a, b], [\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\\berlinb, { |out = 0, freq = 80, amp = 0.01, pan = 0, gate = 1|\n var synth, env;\n env = Decay2.kr(gate, 0.05, 8, 0.0003);\n synth = RLPF.ar(\n LFPulse.ar(freq, 0, SinOsc.kr(0.12, [0, 0.5pi], 0.48, 0.5)),\n freq * SinOsc.kr(0.21, 0, 18, 20),\n 0.07\n );\n #a, b = synth*env;\n DetectSilence.ar(a, 0.1, doneAction: Done.freeSelf);\n Out.ar(out, amp * Mix.ar(PanAz.ar(4, [a, b], [pan, pan+1])));\n}).add;\n);\n\n(\nf = Pbind(\n \\degree, Pseq([0, 1, 2, 4, 6, 3, 4, 8], inf),\n \\dur, 0.5, \\octave, 3, \\instrument, \\berlinb\n).play;\n);\n\n(\nf.stream = Pbind(\n \\degree, Pseq([0, 1, 2, 4, 6, 3, 4, 8], inf),\n \\dur, 0.5, \\octave, [2, 1],\n \\instrument, \\berlinb,\n \\pan, Pfunc({ 1.0.rand2 })\n).asStream;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 479} {"conversations": [{"role": "user", "content": "What is `Pbind`?"}, {"role": "assistant", "content": "Pbind — combine several value patterns to one event stream by binding keys to values"}, {"role": "user", "content": "What does `Pbind.new` do?"}, {"role": "assistant", "content": "The arguments to Pbind are an alternating sequence of keys and patterns. `Pbind(\\note, Pseq([0, 4, 7]), \\amp, 0.1, \\dur, 0.2).play` The message `new` converts keyword arguments into key value pairs, so that we can write: `Pbind(note: Pseq([0, 4, 7]), amp: 0.1, dur: 0.2).play` A pattern can also be bound to an array of keys. In this case, the pattern must specify a sequence whose elements are array"}, {"role": "user", "content": "Show me a working example."}, {"role": "assistant", "content": "```supercollider\nPbind(\\note, Pseq([0, 4, 7]), \\amp, 0.1, \\dur, 0.2).play\n```"}], "family": "G", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "none", "prompt_tokens": 256, "answer_tokens": 46} {"conversations": [{"role": "user", "content": "What is `PbindProxy` in SuperCollider?"}, {"role": "assistant", "content": "PbindProxy — incremental event pattern reference keeps a reference to a Pbind in which single keys can be replaced. It plays on when the old stream ended and a new stream is set and schedules the changes to the beat. Category: JITLib > Patterns, Streams-Patterns-Events > Patterns, Live Coding."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PbindProxy.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 106} {"conversations": [{"role": "user", "content": "Explain `PbindProxy` in SuperCollider briefly."}, {"role": "assistant", "content": "PbindProxy — incremental event pattern reference keeps a reference to a Pbind in which single keys can be replaced. It plays on when the old stream ended and a new stream is set and schedules the changes to the beat. Category: JITLib > Patterns, Streams-Patterns-Events > Patterns, Live Coding."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/PbindProxy.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 106} @@ -10906,6 +11029,8 @@ {"conversations": [{"role": "user", "content": "What is `Pluck` in SuperCollider?"}, {"role": "assistant", "content": "Pluck — A Karplus-Strong UGen Category: UGens > Delays."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "Explain `Pluck` in SuperCollider briefly."}, {"role": "assistant", "content": "Pluck — A Karplus-Strong UGen Category: UGens > Delays."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 29} {"conversations": [{"role": "user", "content": "What does `Pluck.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "A Karplus-Strong UGen Arguments: in — an excitation signal.; trig — upon a negative to positive transition, n samples of the excitation signal will be fed into the delay line, where n = delaytime * sample_rate / 2, using a rectangular envelope (no fading).; maxdelaytime — the max delay time in seconds (initializes the internal delay buffer).; delaytime — delay time in seconds.; decaytime — time for the echoes to decay by 60 decibels. Negative times emphasize odd partials.; coef — the coef of the internal OnePole filter. Values should be between -1 and +1 (larger values will be unstable... so be careful!).; mul; add."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 230} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Pluck`."}, {"role": "assistant", "content": "```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))\n }.play(s)\n);\ns.quit;\n// a group of angry fretless mandolin players\n(\n {\n var freq, numparts;\n numparts = 50;\n freq = SinOsc.kr(Array.fill(numparts, { Rand(0.05, 0.2) }),\n Array.fill(numparts, { Rand(0, 1.0) })).range(1000, 3000);\n LeakDC.ar(\n Pan2.ar(\n Pluck.ar(\n WhiteNoise.ar(0.1).dup(numparts),\n Impulse.kr(Array.fill(numparts, { Rand(10, 12) })),\n 100.reciprocal, freq.reciprocal, 2, Rand(0.01, 0.2), mul: 1),\n Array.fill(numparts, { Rand.new(-1.0, 1.0) }))\n .sum\n );\n }.play(s);\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 418} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\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))\n }.play(s)\n);\ns.quit;\n// a group of angry fretless mandolin players\n(\n {\n var freq, numparts;\n numparts = 50;\n freq = SinOsc.kr(Array.fill(numparts, { Rand(0.05, 0.2) }),\n Array.fill(numparts, { Rand(0, 1.0) })).range(1000,\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\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))\n }.play(s)\n);\ns.quit;\n// a group of angry fretless mandolin players\n(\n {\n var freq, numparts;\n numparts = 50;\n freq = SinOsc.kr(Array.fill(numparts, { Rand(0.05, 0.2) }),\n Array.fill(numparts, { Rand(0, 1.0) })).range(1000, 3000);\n LeakDC.ar(\n Pan2.ar(\n Pluck.ar(\n WhiteNoise.ar(0.1).dup(numparts),\n Impulse.kr(Array.fill(numparts, { Rand(10, 12) })),\n 100.reciprocal, freq.reciprocal, 2, Rand(0.01, 0.2), mul: 1),\n Array.fill(numparts, { Rand.new(-1.0, 1.0) }))\n .sum\n );\n }.play(s);\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 459} {"conversations": [{"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))\n }.play(s)\n);\ns.quit;\n// a group of angry fretless mandolin players\n(\n {\n var freq, numparts;\n numparts = 50;\n freq = SinOsc.kr(Array.fill(numparts, { Rand(0.05, 0.2) }),\n Array.fill(numparts, { Rand(0, 1.0) })).range(1000,\n// …\n```"}, {"role": "assistant", "content": "excitation signal is WhiteNoise, triggered twice a second with varying OnePole coef a group of angry fretless mandolin players (Pluck: A Karplus-Strong UGen)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Pluck.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 64} {"conversations": [{"role": "user", "content": "What is `Pmeanrand` in SuperCollider?"}, {"role": "assistant", "content": "Pmeanrand — random values that tend toward ((lo + hi) / 2) Category: Streams-Patterns-Events > Patterns > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Pmeanrand.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 48} {"conversations": [{"role": "user", "content": "Explain `Pmeanrand` in SuperCollider briefly."}, {"role": "assistant", "content": "Pmeanrand — random values that tend toward ((lo + hi) / 2) Category: Streams-Patterns-Events > Patterns > Random."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Pmeanrand.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 48} @@ -11440,6 +11565,9 @@ {"conversations": [{"role": "user", "content": "What does `RunningSum.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Running sum over n frames Arguments: in — Input signal; numsamp — How many samples to take the running sum over (initialisation time only, not modulatable. default: 40)."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 60} {"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `RunningSum`."}, {"role": "assistant", "content": "```supercollider\n// distorts of course - would need scaling\n{ RunningSum.ar(SoundIn.ar) }.play\n\n// Running Average over x samples\n(\n{\n var x = 100;\n RunningSum.ar(LFSaw.ar, x) * (x.reciprocal)\n }.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 100} {"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// distorts of course - would need scaling\n{ RunningSum.ar(SoundIn.ar) }.play\n\n// Running Average over x samples\n(\n{\n var x = 100;\n RunningSum.ar(LFSaw.ar, x) * (x.reciprocal)\n }.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// distorts of course - would need scaling\n{ RunningSum.ar(SoundIn.ar) }.play\n\n// Running Average over x samples\n(\n{\n var x = 100;\n RunningSum.ar(LFSaw.ar, x) * (x.reciprocal)\n }.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "mut:missing_paren", "prompt_tokens": 141, "answer_tokens": 141} +{"conversations": [{"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}.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 79} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "mut:missing_paren", "prompt_tokens": 120, "answer_tokens": 120} +{"conversations": [{"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)/numsamp) ** (power.reciprocal)\n}.play\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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)/numsamp) ** (power.reciprocal)\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "mut:missing_paren", "prompt_tokens": 143, "answer_tokens": 143} {"conversations": [{"role": "user", "content": "What is `SCDoc` in SuperCollider?"}, {"role": "assistant", "content": "SCDoc — Help system main class SCDoc manages the SuperCollider documentation system. Category: HelpSystem."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SCDoc.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "Explain `SCDoc` in SuperCollider briefly."}, {"role": "assistant", "content": "SCDoc — Help system main class SCDoc manages the SuperCollider documentation system. Category: HelpSystem."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SCDoc.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 37} {"conversations": [{"role": "user", "content": "What does `SCDoc.indexAllDocuments` do? What arguments does it take?"}, {"role": "assistant", "content": "Index all documents and undocumented classes on the system, putting them in the `SCDoc.documents` dictionary. If run inside a Routine, this method will yield occasionally. Run this method if you added a new document and want to see the changes without restarting Arguments: clearCache — If true, force re-render of files even if the schelp source file is not newer than the destination. This will also refresh all static files via SCDoc#*refreshStaticFiles.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/SCDoc.schelp", "aug": "none", "prompt_tokens": 44, "answer_tokens": 150} @@ -12243,6 +12371,8 @@ {"conversations": [{"role": "user", "content": "What is `SpecCentroid` in SuperCollider?"}, {"role": "assistant", "content": "SpecCentroid — Spectral centroid Given an FFT chain, this measures the spectral centroid, which is the weighted mean frequency, or the \"centre of mass\" of the spectrum. (DC is ignored.) Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 82} {"conversations": [{"role": "user", "content": "Explain `SpecCentroid` in SuperCollider briefly."}, {"role": "assistant", "content": "SpecCentroid — Spectral centroid Given an FFT chain, this measures the spectral centroid, which is the weighted mean frequency, or the \"centre of mass\" of the spectrum. (DC is ignored.) Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 82} {"conversations": [{"role": "user", "content": "What does `SpecCentroid.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral centroid Arguments: buffer — an FFT chain.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 22} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `SpecCentroid`."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.alloc(s, 2048, 1);\n(\nx = {\n var in, chain, freq, rq, centroid;\n\n // freq = LFPar.kr(0.3).exprange(100, 1000);\n freq = MouseY.kr(1000, 100, 1);\n in = Blip.ar(freq, MouseX.kr(1, 100, 1));\n chain = FFT(LocalBuf(2048), in);\n centroid = SpecCentroid.kr(chain);\n centroid.poll(10);\n in.dup * 0.1\n\n}.play\n);\n\nx.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "none", "prompt_tokens": 38, "answer_tokens": 201} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s, 2048, 1);\n(\nx = {\n var in, chain, freq, rq, centroid;\n\n // freq = LFPar.kr(0.3).exprange(100, 1000);\n freq = MouseY.kr(1000, 100, 1);\n in = Blip.ar(freq, MouseX.kr(1, 100, 1));\n chain = FFT(LocalBuf(2048), in);\n centroid = SpecCentroid.kr(chain);\n centroid.poll(10);\n in.dup * 0.1\n\n}.play\n;\n\nx.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\nb = Buffer.alloc(s, 2048, 1);\n(\nx = {\n var in, chain, freq, rq, centroid;\n\n // freq = LFPar.kr(0.3).exprange(100, 1000);\n freq = MouseY.kr(1000, 100, 1);\n in = Blip.ar(freq, MouseX.kr(1, 100, 1));\n chain = FFT(LocalBuf(2048), in);\n centroid = SpecCentroid.kr(chain);\n centroid.poll(10);\n in.dup * 0.1\n\n}.play\n);\n\nx.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "mut:missing_paren", "prompt_tokens": 244, "answer_tokens": 242} {"conversations": [{"role": "user", "content": "What is `SpecFlatness` in SuperCollider?"}, {"role": "assistant", "content": "SpecFlatness — Spectral Flatness measure Given an FFT chain this calculates the Spectral Flatness measure, defined as a power spectrum's geometric mean divided by its arithmetic mean. This gives a measure which ranges from approx 0 for a pure sinusoid, to approx 1 for white noise. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SpecFlatness.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 110} {"conversations": [{"role": "user", "content": "Explain `SpecFlatness` in SuperCollider briefly."}, {"role": "assistant", "content": "SpecFlatness — Spectral Flatness measure Given an FFT chain this calculates the Spectral Flatness measure, defined as a power spectrum's geometric mean divided by its arithmetic mean. This gives a measure which ranges from approx 0 for a pure sinusoid, to approx 1 for white noise. Category: UGens > FFT."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/SpecFlatness.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 110} {"conversations": [{"role": "user", "content": "What does `SpecFlatness.kr` do? What arguments does it take?"}, {"role": "assistant", "content": "Spectral Flatness measure Arguments: buffer — an FFT chain.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/SpecFlatness.schelp", "aug": "none", "prompt_tokens": 41, "answer_tokens": 26} @@ -12458,6 +12588,8 @@ {"conversations": [{"role": "user", "content": "What is `Sweep` in SuperCollider?"}, {"role": "assistant", "content": "Sweep — Triggered linear ramp Starts a linear raise by rate/sec from zero when trig input crosses from non-positive to positive. Category: UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Sweep.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 59} {"conversations": [{"role": "user", "content": "Explain `Sweep` in SuperCollider briefly."}, {"role": "assistant", "content": "Sweep — Triggered linear ramp Starts a linear raise by rate/sec from zero when trig input crosses from non-positive to positive. Category: UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Sweep.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 59} {"conversations": [{"role": "user", "content": "What does `Sweep.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Triggered linear ramp Arguments: trig — triggers when trig input crosses from non-positive to positive.; rate — rate/sec raise rate."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Sweep.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 49} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `Sweep`."}, {"role": "assistant", "content": "```supercollider\n// using sweep to modulate sine frequency\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 20, 1));\n SinOsc.ar(Sweep.kr(trig, 700) + 500, 0, 0.2)\n}.play;\n);\n\n\n// using sweep to index into a buffer\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0)))\n}.play;\n);\n\n// backwards, variable offset\n(\n{ var trig, pos, rate;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n rate = BufSampleRate.ir(0);\n pos = Sweep.ar(trig, rate.neg) + (BufFrames.ir(0) * LFNoise0.kr(0.2));\n BufRd.ar(1, b, pos)\n}.play;\n);\n\n// raising rate\n(\n{ var trig, rate;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n rate = Sweep.kr(trig, 2) + 0.5;\n BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0) * rate))\n}.play;\n);\n\nb.free\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Sweep.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 470} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n// using sweep to modulate sine frequency\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 20, 1));\n SinOsc.ar(Sweep.kr(trig, 700) + 500, 0, 0.2)\n}.play;\n);\n\n\n// using sweep to index into a buffer\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0)))\n}.play;\n);\n\n// backwards, variable offset\n(\n{ var trig, pos, rate;\n trig = Impulse.\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n// using sweep to modulate sine frequency\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 20, 1));\n SinOsc.ar(Sweep.kr(trig, 700) + 500, 0, 0.2)\n}.play;\n);\n\n\n// using sweep to index into a buffer\nb = Buffer.read(s, ExampleFiles.child);\n\n(\n{ var trig;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0)))\n}.play;\n);\n\n// backwards, variable offset\n(\n{ var trig, pos, rate;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n rate = BufSampleRate.ir(0);\n pos = Sweep.ar(trig, rate.neg) + (BufFrames.ir(0) * LFNoise0.kr(0.2));\n BufRd.ar(1, b, pos)\n}.play;\n);\n\n// raising rate\n(\n{ var trig, rate;\n trig = Impulse.kr(MouseX.kr(0.5, 10, 1));\n rate = Sweep.kr(trig, 2) + 0.5;\n BufRd.ar(1, b, Sweep.ar(trig, BufSampleRate.ir(0) * rate))\n}.play;\n);\n\nb.free\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Sweep.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 511} {"conversations": [{"role": "user", "content": "What is `Symbol` in SuperCollider?"}, {"role": "assistant", "content": "Symbol — a unique name for something A symbol, like a String, is a sequence of characters. Unlike strings, two symbols with exactly the same characters will be the exact same object. Symbols are optimized for recreating the same symbol over and over again. In practice, this means that symbols are best used for identifiers or tags that are only meaningful within your program, whereas you should use a string when your characters are re Category: Core."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Symbol.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "Explain `Symbol` in SuperCollider briefly."}, {"role": "assistant", "content": "Symbol — a unique name for something A symbol, like a String, is a sequence of characters. Unlike strings, two symbols with exactly the same characters will be the exact same object. Symbols are optimized for recreating the same symbol over and over again. In practice, this means that symbols are best used for identifiers or tags that are only meaningful within your program, whereas you should use a string when your characters are re Category: Core."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Symbol.schelp", "aug": "para:1", "prompt_tokens": 39, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "What does `Symbol.isClassName` do?"}, {"role": "assistant", "content": "Answer whether the symbol can be a class name. This does not say if the class exists."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Symbol.schelp", "aug": "none", "prompt_tokens": 34, "answer_tokens": 23} @@ -12595,6 +12727,8 @@ {"conversations": [{"role": "user", "content": "What is `TIRand` in SuperCollider?"}, {"role": "assistant", "content": "TIRand — Triggered integer random number generator. Generates a random integer value in uniform distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "Explain `TIRand` in SuperCollider briefly."}, {"role": "assistant", "content": "TIRand — Triggered integer random number generator. Generates a random integer value in uniform distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 79} {"conversations": [{"role": "user", "content": "What does `TIRand.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Triggered integer random number generator. Arguments: lo — Lower limit of the output range.; hi — Upper limit of the output range.; trig — The trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 81} +{"conversations": [{"role": "user", "content": "Write a minimal SuperCollider example that uses `TIRand`."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-TIRand\", {\n var trig, outBus;\n trig = Dust.kr(10);\n outBus = TIRand.kr(0, 1, trig); // play on random channel between 0 and 1\n Out.ar(outBus, PinkNoise.ar(0.2))\n\n}).play;\n);\n\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TIRand.kr(4, 12, trig) * 100\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000, 1));\n SinOsc.ar(\n TIRand.ar(4, 12, trig) * 100\n ) * 0.1\n}.play;\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 240} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\n(\nSynthDef(\"help-TIRand\", {\n var trig, outBus;\n trig = Dust.kr(10);\n outBus = TIRand.kr(0, 1, trig); // play on random channel between 0 and 1\n Out.ar(outBus, PinkNoise.ar(0.2))\n\n}).play;\n);\n\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TIRand.kr(4, 12, trig) * 100\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000, 1));\n SinOsc.ar(\n TIRand.ar(4, 12, trig) * 100\n ) * 0.1\n}.play;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\n(\nSynthDef(\"help-TIRand\", {\n var trig, outBus;\n trig = Dust.kr(10);\n outBus = TIRand.kr(0, 1, trig); // play on random channel between 0 and 1\n Out.ar(outBus, PinkNoise.ar(0.2))\n\n}).play;\n);\n\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TIRand.kr(4, 12, trig) * 100\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000, 1));\n SinOsc.ar(\n TIRand.ar(4, 12, trig) * 100\n ) * 0.1\n}.play;\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "mut:missing_paren", "prompt_tokens": 281, "answer_tokens": 281} {"conversations": [{"role": "user", "content": "What is `TRand` in SuperCollider?"}, {"role": "assistant", "content": "TRand — Triggered random number generator. Generates a random float value in uniform distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/TRand.schelp", "aug": "none", "prompt_tokens": 32, "answer_tokens": 78} {"conversations": [{"role": "user", "content": "Explain `TRand` in SuperCollider briefly."}, {"role": "assistant", "content": "TRand — Triggered random number generator. Generates a random float value in uniform distribution from `lo` to `hi` each time the trigger signal changes from nonpositive to positive values. Category: UGens > Random, UGens > Triggers."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/TRand.schelp", "aug": "para:1", "prompt_tokens": 37, "answer_tokens": 78} {"conversations": [{"role": "user", "content": "What does `TRand.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Triggered random number generator. Arguments: lo — Lower limit of the output range.; hi — Upper limit of the output range.; trig — The trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/TRand.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 80} @@ -12948,6 +13082,8 @@ {"conversations": [{"role": "user", "content": "What is `Unpack1FFT` in SuperCollider?"}, {"role": "assistant", "content": "Unpack1FFT — Unpack a single value (magnitude or phase) from an FFT chain Takes an FFT chain and extracts a single scalar value as a demand-rate stream. To call it, a \"demander\" is needed, which fires whenever the FFT chain fires - this is normally achieved using PackFFT but can also be done using Demand. Category: UGens > FFT, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "none", "prompt_tokens": 36, "answer_tokens": 135} {"conversations": [{"role": "user", "content": "Explain `Unpack1FFT` in SuperCollider briefly."}, {"role": "assistant", "content": "Unpack1FFT — Unpack a single value (magnitude or phase) from an FFT chain Takes an FFT chain and extracts a single scalar value as a demand-rate stream. To call it, a \"demander\" is needed, which fires whenever the FFT chain fires - this is normally achieved using PackFFT but can also be done using Demand. Category: UGens > FFT, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "para:1", "prompt_tokens": 41, "answer_tokens": 135} {"conversations": [{"role": "user", "content": "What does `Unpack1FFT.new` do? What arguments does it take?"}, {"role": "assistant", "content": "Unpack a single value (magnitude or phase) from an FFT chain Arguments: chain — an FFT chain; bufsize — the size of the expected input FFT frames; binindex — the integer index of the bin you want to query; whichmeasure — 0 for magnitude and 1 for phase. None of these arguments can be modulated.."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "none", "prompt_tokens": 40, "answer_tokens": 111} +{"conversations": [{"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 = 1024;\n\n sig = SinOsc.ar(LFDNoise3.kr(LFNoise0.kr(1) * 40 + 60) * 700 + 800);\n\n chain = FFT(LocalBuf(fftsize), sig);\n stream = Unpack1FFT(chain, bufsize: fftsize, binindex: 0, whichmeasure: 0);\n\n // each time an FFT window starts, the unpacker returns a new value\n windowStarts = chain > -1;\n demand = Demand.kr(windowStarts, 0, stream);\n demand.poll(windowStarts);\n\n sig * 0.05\n}.play\n)\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "none", "prompt_tokens": 39, "answer_tokens": 272} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```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 = 1024;\n\n sig = SinOsc.ar(LFDNoise3.kr(LFNoise0.kr(1) * 40 + 60) * 700 + 800);\n\n chain = FFT(LocalBuf(fftsize), sig);\n stream = Unpack1FFT(chain, bufsize: fftsize, binindex: 0, whichmeasure: 0);\n\n // each time an FFT window starts, the unpacker returns a new value\n windowStarts = chain > -1;\n demand = Demand.kr(windowStarts, 0, stream);\n demand.poll(\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```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 = 1024;\n\n sig = SinOsc.ar(LFDNoise3.kr(LFNoise0.kr(1) * 40 + 60) * 700 + 800);\n\n chain = FFT(LocalBuf(fftsize), sig);\n stream = Unpack1FFT(chain, bufsize: fftsize, binindex: 0, whichmeasure: 0);\n\n // each time an FFT window starts, the unpacker returns a new value\n windowStarts = chain > -1;\n demand = Demand.kr(windowStarts, 0, stream);\n demand.poll(windowStarts);\n\n sig * 0.05\n}.play\n)\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 313} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```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 = 1024;\n\n sig = SinOsc.ar(LFDNoise3.kr(LFNoise0.kr(1) * 40 + 60) * 700 + 800);\n\n chain = FFT(LocalBuf(fftsize), sig);\n stream = Unpack1FFT(chain, bufsize: fftsize, binindex: 0, whichmeasure: 0);\n\n // each time an FFT window starts, the unpacker returns a new value\n windowStarts = chain > -1;\n demand = Demand.kr(windowStarts, 0, stream);\n demand.poll(\n// …\n```"}, {"role": "assistant", "content": "Let's extract the DC component - i.e. the magnitude at binindex zero. each time an FFT window starts, the unpacker returns a new value (Unpack1FFT: Unpack a single value (magnitude or phase) from an FFT chain)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 83} {"conversations": [{"role": "user", "content": "What is `UnpackFFT` in SuperCollider?"}, {"role": "assistant", "content": "UnpackFFT — Unpack an FFT chain into separate demand-rate FFT bin streams Takes an FFT chain and separates the magnitude and phase data into separate demand-rate streams, for arithmetic manipulation etc. Category: UGens > FFT, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/UnpackFFT.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 100} {"conversations": [{"role": "user", "content": "Explain `UnpackFFT` in SuperCollider briefly."}, {"role": "assistant", "content": "UnpackFFT — Unpack an FFT chain into separate demand-rate FFT bin streams Takes an FFT chain and separates the magnitude and phase data into separate demand-rate streams, for arithmetic manipulation etc. Category: UGens > FFT, UGens > Demand."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/UnpackFFT.schelp", "aug": "para:1", "prompt_tokens": 40, "answer_tokens": 100} @@ -13107,6 +13243,7 @@ {"conversations": [{"role": "user", "content": "What is `Warp1` in SuperCollider?"}, {"role": "assistant", "content": "Warp1 — Warp a buffer with a time pointer Inspired by Chad Kirby's SuperCollider2 Warp1 class, which was inspired by Richard Karpen's sndwarp for CSound. A granular time stretcher and pitchshifter. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "none", "prompt_tokens": 33, "answer_tokens": 112} {"conversations": [{"role": "user", "content": "Explain `Warp1` in SuperCollider briefly."}, {"role": "assistant", "content": "Warp1 — Warp a buffer with a time pointer Inspired by Chad Kirby's SuperCollider2 Warp1 class, which was inspired by Richard Karpen's sndwarp for CSound. A granular time stretcher and pitchshifter. Category: UGens > Buffer, UGens > Generators > Granular."}], "family": "A", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "para:1", "prompt_tokens": 38, "answer_tokens": 112} {"conversations": [{"role": "user", "content": "What does `Warp1.ar` do? What arguments does it take?"}, {"role": "assistant", "content": "Warp a buffer with a time pointer Arguments: numChannels — the number of channels in the soundfile used in bufnum. Must be a nonzero, positive integer. This is fixed when the SynthDef is compiled so cannot be assigned to a SynthDef argument.; bufnum — the buffer number of a mono soundfile.; pointer — the position in the buffer. The value should be between 0 and 1, with 0 being the beginning of the buffer, and 1 the end.; freqScale — the amount of frequency shift. 1.0 is normal, 0.5 is one octave down, 2.0 is one octave up. Negative values play the soundfile backwards.; windowSize — the size of each grain window.; envbufnum — the buffer number containing a signal to use for the grain envelope. -1 uses a built-in Hanning envelope.; overlaps — the number of overlapping windows.; windowRandRatio — the amount of randomness to the windowing function. Must be between 0 (no randomness) to 1.0 (probably too random actually)."}], "family": "B", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "none", "prompt_tokens": 37, "answer_tokens": 328} +{"conversations": [{"role": "user", "content": "This SuperCollider code does not compile. What is wrong and what should it be?\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.read(s, ExampleFiles.apollo11);\nx = { |envbuf = -1|\n var pointer, pitch;\n // pointer - move from beginning to end of soundfile over 15 seconds\n pointer = LFSaw.ar(1/15).range(0, 1);\n // control pitch with MouseX\n pitch = MouseX.kr(0.5, 2);\n Warp1.ar(\n numChannels: 1,\n bufnum: b,\n pointer: pointer,\n freqScale: pitch,\n windowSize: 0.1,\n envbufnum: envbuf,\n overlaps: 8,\n windowRandRatio: 0.1,\n interp: 2\n )\n}.play\n\n);\n\n\n(\n// a custom envelope\n// …\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\n\n```supercollider\ns.boot;\n\n(\nb = Buffer.read(s, ExampleFiles.apollo11);\nx = { |envbuf = -1|\n var pointer, pitch;\n // pointer - move from beginning to end of soundfile over 15 seconds\n pointer = LFSaw.ar(1/15).range(0, 1);\n // control pitch with MouseX\n pitch = MouseX.kr(0.5, 2);\n Warp1.ar(\n numChannels: 1,\n bufnum: b,\n pointer: pointer,\n freqScale: pitch,\n windowSize: 0.1,\n envbufnum: envbuf,\n overlaps: 8,\n windowRandRatio: 0.1,\n interp: 2\n )\n}.play\n\n);\n\n\n(\n// a custom envelope - not a very good one, but you can hear the difference\n// between this and the default\nvar winenv = Env([0, 1, 0], [0.5, 0.5], [8, -8]);\nz = Buffer.sendCollection(s, winenv.discretize, 1);\nx.set(\\envbuf, z);\n);\n\n// the default is -1\nx.set(\\envbuf, -1);\n\n// relase and end\nx.relase; z.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "mut:missing_paren", "prompt_tokens": 298, "answer_tokens": 438} {"conversations": [{"role": "user", "content": "What does this SuperCollider code do?\n```supercollider\ns.boot;\n\n(\nb = Buffer.read(s, ExampleFiles.apollo11);\nx = { |envbuf = -1|\n var pointer, pitch;\n // pointer - move from beginning to end of soundfile over 15 seconds\n pointer = LFSaw.ar(1/15).range(0, 1);\n // control pitch with MouseX\n pitch = MouseX.kr(0.5, 2);\n Warp1.ar(\n numChannels: 1,\n bufnum: b,\n pointer: pointer,\n freqScale: pitch,\n windowSize: 0.1,\n envbufnum: envbuf,\n overlaps: 8,\n windowRandRatio: 0.1,\n interp: 2\n )\n}.play\n\n);\n\n\n(\n// a custom envelope\n// …\n```"}, {"role": "assistant", "content": "pointer - move from beginning to end of soundfile over 15 seconds control pitch with MouseX (Warp1: Warp a buffer with a time pointer)"}], "family": "D", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "none", "prompt_tokens": 285, "answer_tokens": 46} {"conversations": [{"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 = Warp1.ar(1, b, pointer, 1, 0.3, -1, 16, Line.kr(0, 1, 40), 4);\n Pan2.ar(sound, pointer * 2 - 1, 0.25)\n}.play\n);\nb.free;\n```"}], "family": "C", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "none", "prompt_tokens": 35, "answer_tokens": 169} {"conversations": [{"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, pointer, 1, 0.3, -1, 16, Line.kr(0, 1, 40), 4);\n Pan2.ar(sound, pointer * 2 - 1, 0.25)\n}.play\n;\nb.free;\n```"}, {"role": "assistant", "content": "A closing bracket is missing: the parenthesis opened earlier is never closed, so the expression cannot be parsed.\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, pointer, 1, 0.3, -1, 16, Line.kr(0, 1, 40), 4);\n Pan2.ar(sound, pointer * 2 - 1, 0.25)\n}.play\n);\nb.free;\n```"}], "family": "E", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "mut:missing_paren", "prompt_tokens": 212, "answer_tokens": 210} @@ -13249,46 +13386,98 @@ {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for SOUND 1, from orig Influx Example. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// SOUND 1, from orig Influx Example\n(\n// // // if JITLibExtensions are used, you can make space local:\n// Ndef(\\dog).addSpec(\\intv, [-24, 24]);\n// Ndef(\\dog).addSpec(\\timescale, [0.01, 10, \\exp]);\n// Ndef(\\dog).addSpec(\\curve, [-10, 10]);\n// Ndef(\\dog).addSpec(\\ffreq, \\freq);\n//\n// Ndef(\\dog).addSpec(\\loopnode, [0, 12]);\n// Ndef(\\dog).addSpec(\\dens, [10, 1000, \\exp]);\n// Ndef(\\dog).addSpec(\\resfreq, \\freq);\n// Ndef(\\dog).addSpec(\\ringtime, [0.01, 1, \\exp]);\n\nSpec.add(\\intv, [-24, 24]);\nSpec.add(\\timescale, [0.01, 10, \\exp]);\nSpec.add(\\curve, [-10, 10]);\nSpec.add(\\ffreq, \\freq);\n\nSpec.add(\\loopnode, [0, 12]);\nSpec.add(\\dens, [10, 1000, \\exp]);\nSpec.add(\\resfreq, \\freq);\nSpec.add(\\ringtime, [0.01, 1, \\exp]);\n\n\nNdef(\\dog, { |amp=0, freq=250, intv=19, timescale=1, curve=0, loopnode=0, dens = 10, resfreq = 500, ringtime = 0.01|\n var n = 15;\n var env = EnvGen.kr(\n Env({ 1.0.rand2 }!(n+1), {1.0.rand}!n, curve, releaseNode: n-1, loopNode: loopnode.min(n-3)),\n timeScale: timescale);\n var pitch = (env * [1, 0.33, -1] * intv).midiratio * freq;\n var form = Formant.ar(pitch, pitch.rotate(1) * 1.6, pitch.rotate(2) * 2.6);\n\n var dusty = Ringz.ar(\n Dust.ar(dens!3),\n resfreq * LFNoise0.kr([3, 5, 7], 0.5, 1),\n ringtime)\n * ((dens ** -0.5) * (ringtime ** -0.3)\n );\n\n Splay.ar(form * dusty, level: amp) ;\n});\n);\n\nNdef(\\dog).set(\\amp, 0.2).vol_(0.2);\nNdef(\\dog).gui.moveTo(400, 380);\n\n/*\n// Ndef(\\dog).addHalo(\\orderedNames, Ndef(\\dog).controlKeys);\nNdef(\\dog).controlKeys;\nNdef(\\dog).vol_(0.5);\nNdefPreset( Ndef(\\dog) ).loadSettings;\nNdef(\\dog).play;\nNdef(\\dog).gui;\n*/\n```"}], "family": "H", "source_id": "quarks:Standalone/example_myproj/02_processes/dog.scd", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 937} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PLbindef`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\nServer.default = s;\ns.boot;\n);\n\n// synthdefs to play with\n\n(\nSynthDef(\\noise_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, rq = 0.1, amp = 0.1|\n var sig = { WhiteNoise.ar } ! 2;\n sig = BPF.ar(sig, freq, rq) *\n EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2) *\n (rq ** -1) * (250 / (freq ** 0.8));\n OffsetOut.ar(out, sig);\n}).add;\n\nSynthDef(\\sin_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { SinOsc.ar(freq, Rand(0, 2pi)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n\nSynthDef(\\saw_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { VarSaw.ar(freq, Rand(0, 1)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n)\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/PLbindef.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 496} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `VarGui`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// synth definition with raising frequency\n\n(\nSynthDef(\\synth_0, { |devFactor = 0.1, devFreq = 10, amp = 0.1|\n var freq = XLine.kr(400, 1200, 10); \n Out.ar(0, SinOsc.ar(SinOsc.ar(devFreq, 0, devFactor * freq, freq), mul: amp).dup(2) * EnvGate.new) \n}).add;\n)\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Classes/VarGui.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 161} -{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `BPF`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// synthdefs to play with\n(\nSynthDef(\\noise_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, rq = 0.1, amp = 0.1|\n var sig = { WhiteNoise.ar } ! 2;\n sig = BPF.ar(sig, freq, rq) *\n EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2) *\n (rq ** -1) * (250 / (freq ** 0.8));\n OffsetOut.ar(out, sig);\n}).add;\n\nSynthDef(\\sin_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { SinOsc.ar(freq, Rand(0, 2pi)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n\n\nSynthDef(\\saw_grain, { |out = 0, freq = 400, att = 0.005, rel = 0.1, amp = 0.1|\n var sig = { VarSaw.ar(freq, Rand(0, 1)) } ! 2;\n sig = sig * EnvGen.ar(Env.perc(att, rel, amp), doneAction: 2);\n OffsetOut.ar(out, sig);\n}).add;\n)\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Tutorials/Sieves_and_Psieve_patterns.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 463} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `TGrains`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\nServer.default = s;\ns.boot;\n);\n\n// basic SynthDef suited for pitch-shift and time-stretch\n// buffer position given relatively (posLo and posHi between 0 and 1)\n// posDev: maximum amount of deviation from (moving) grain center position\n// posDev = 0 can lead to comb filter effects (which may be nice sometimes)\n\n// passing control specs as metadata allows for VarGui shortcut build method sVarGui\n// metadata specs can be overwritten by arg ctrReplace\n// alternatively control specs may be passed as synthCtr arg to a build with VarGui( ... )\n\n(\nSynthDef(\\gran_1a, { arg out = 0, bufNum = 0, posLo = 0.0, posHi = 1.0,\n posRate = 1, posDev = 0.01, trigRate = 100, granDur = 0.1, rate = 1.0,\n panMax = 1, amp = 0.1, interp = 4;\n\n var trig, pan, pos, bufDur, bufDurSection, posDif;\n\n posDif = posHi - posLo;\n bufDur = BufDur.kr(bufNum);\n bufDurSection = bufDur * posDif;\n trig = Impulse.kr(trigRate);\n pos = posLo * bufDur +\n (Phasor.ar(0, BufRateScale.kr(bufNum) * posRate / SampleRate.ir, posLo * bufDur, posHi * bufDur) +\n (TRand.kr(-0.5 * posDev, 0.5 * posDev, trig) * bufDur)).mod(bufDurSection);\n pan = Demand.kr(trig, 0, Dseq([panMax, panMax.neg],inf) * 0.999);\n Out.ar(out, TGrains.ar(2, trig, bufNum, rate, pos, granDur, pan, 1, interp) * amp);\n }, metadata: (\n specs: (\n posLo: [0.01, 0.99, \\lin, 0.01, 0],\n posHi: [0.01, 0.99, \\lin, 0.01, 1],\n posRate: [0.1, 2, \\lin, 0.01, 1],\n posDev: [0, 0.2, 5, 0, 0.01],\n granDur: [0.01, 0.3, \\lin, 0.01, 0.1],\n trigRate: [1, 200, \\lin, 0.01, 100],\n rate: [0.1, 2, \\lin, 0.01, 1],\n panMax: [0.0, 1, \\lin, 0.005, 0.8],\n amp: [0.0, 0.5, \\lin, 0.005, 0.25]\n )\n )\n).add;\n\nb = Buffer.read(s, Platform.miSCellaneousDirs[0] +/+ \"Sounds\" +/+ \"kitchen_sounds_1.wav\");\n// This searches the most likely extension places for the miSCellaneous folder.\n// In case of an extraordinary install situation or a removed sound file, pass the concerned path.\n\n);\n\n\n// start from GUI\n\n\\gran_1a.sVarGui([\\bufNum, b.bufnum]).gui;\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Tutorials/Buffer_Granulation.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 1040} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `NamedControl`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n// NamedControl is recommended in that case as a literal Array of special format would be impractical.\n// Define a SynthDef with maximum envelope size you expect to pass\n\nSynthDef(\\envArray_1, { |out = 0, freq = 440, amp = 0.1, timeScale = 1, gate = 1|\n var sig, env, envArray, envSig;\n envArray = Env([0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0]).asArray; // works also without '.asArray'\n env = \\env.kr(envArray); // shortcut for NamedControl.kr(\\env, envArray)\n envSig = EnvGen.kr(env, gate, timeScale: timeScale, doneAction: 2); \n sig = Saw.ar([freq, freq * 2.01], amp); \n Out.ar(out, sig * envSig)\n}).add\n);\n\n// Pbind uses event type \\on to avoid setting gate to 0 and receiving messages \"node not found\",\n// synths are ended by envelopes anyway.\n\n\n( \np = Pbind( \n \\type, Pshuf([\\on, \\on, \\rest], inf), \n \\instrument, \\envArray_1, \n \\dur, Pn(Pshuf([1, 1/2, 1/2]), 30), \n \\midinote, Pn(Pshuf((40..80))) + Pn(Pshuf([[0.5, 11.5], [0, 4], [0, -7], [-0.5, -9.5]])),\n \n // envData contains env types, determined by levels and times.\n // Times are only relations, within the synthdef they are scaled by the timeScale arg.\n \\envData, Pn(Pshuf([ \n [[0, 1, 0], [1, 1]], \n [[0, 1, 1/4, 1, 0], [1, 1, 1, 1]], \n [[0, 1, 1/4, 1, 1/4, 1, 0], [1, 1, 1, 1, 1, 1]]\n ])),\n \n // *x splits the envData array into levels and times, Env is converted in to an Array automatically\n \\env, Pkey(\\envData).collect { |x| Env(*x) }, \n \n // when wanting to pass the Array explicitely it would require\n // wrapping into an additional Array which is necessary for passing:\n // \\env, Pkey(\\envData).collect { |x| [Env(*x).asArray] }, \n \n \\timeScale, Pfunc { |e| e.dur / e.envData[1].sum } \n).trace.play; \n) ;\n\np.stop;\n```"}], "family": "H", "source_id": "quarks:miSCellaneous_lib/HelpSource/Tutorials/Event_patterns_and_array_args.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 839} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for imitation of a ship's horn that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// by Nóslo Tredamus //\nSynthDef(\\Bocina3, {\n\n arg freq = 200, out = 0, amp = 1, gate = 1, bend = 21, relTime = 0.05, pitchRelTime = 0.015;\n var sig, env, mod, noise, pitchEnv;\n\n env = EnvGen.kr(Env.asr(0.1, 1, relTime), gate, doneAction: 0);\n pitchEnv = EnvGen.kr(\n Env(\n levels: [freq - bend, freq, freq, freq - bend],\n times: [0.3, 0, pitchRelTime],\n curve: [\\sine, 0, -8],\n releaseNode: 2\n ),\n gate\n );\n\n mod = LFNoise1.kr(3).exprange(pitchEnv * 1.5, pitchEnv * 3);\n sig = Mix([\n Saw.ar(pitchEnv, mul: amp),\n SinOsc.ar(pitchEnv * 2.098, mul: amp * 0.3),\n SinOsc.ar(pitchEnv * 2.3814, mul: amp * 0.3),\n SinOsc.ar(pitchEnv * 0.996, mul: amp * 0.3),\n Saw.ar(pitchEnv * 1.015, mul: amp * 0.8),\n Saw.ar(pitchEnv * 1.1907, mul: amp * 0.7),\n SinOsc.ar(pitchEnv * 1.503, mul: amp * 0.7),\n Saw.ar(pitchEnv * 0.498, mul: amp)\n ]);\n\n noise = PinkNoise.ar(amp * 0.9) * env;\n sig = sig + noise;\n sig = HPF.ar(sig, freq * 0.5);\n sig = LPF.ar(sig, mod);\n sig = sig * env;\n sig = GVerb.ar(sig, roomsize: 300, revtime: 0.6, drylevel: 1, mul: 0.9);\n sig = Limiter.ar(sig, 0.99);\n DetectSilence.ar(sig, amp: 0.001, time: 0.05, doneAction: 2);\n Out.ar(out, sig);\n}).add;\n);\n~claxon3 = Synth(\\Bocina3);\n~claxon3.set(\\gate, 0);\ns.record;\ns.stopRecording;\n```"}], "family": "H", "source_id": "sccode:1-5iQ", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 763} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Interpolate between Envs with Pseg: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\sin, { arg out=0, gate=1, amp=0.1, pan=0, freq=200;\n var sig;\n sig = SinOsc.ar(freq);\n sig = sig * EnvGen.kr(\\adsr.kr(Env.adsr(0.1,0.1,0.8,0.1)), gate, doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n}).add;\n);\n\n(\n// sequence Envs\n// need [] else it is inlined or does pattern multichannel expansion\nPdef(\\demo, \n Pbind(\n \\instrument, \\sin,\n \\degree, Pseq([0, Pwhite(0,7,1)],inf),\n \\legato, 0.5,\n \\adsr, Pseq([\n [ Env.adsr(1.1,0.1,0.8,1.01) ],\n [ Env.adsr(0.01,0.1,0.8,0.01) ],\n [ Env.adsr(0.01,1.1,0.3,0.01) ],\n ],inf),\n )\n).play;\n);\n\n(\n// interpolate using Pseg\n// need .asArray\nPdef(\\demo, \n Pbind(\n \\instrument, \\sin,\n \\degree, Pseq([0, Pwhite(0,7,1)],inf),\n \\legato, 0.5,\n \\adsr, Pseg(Pseq([\n [ Env.adsr(1.1,0.1,0.8,1.01).asArray ],\n [ Env.adsr(0.01,0.1,0.8,0.01).asArray ],\n [ Env.adsr(0.01,1.1,0.3,0.01).asArray ],\n ],inf),8),\n )\n).play;\n);\n```"}], "family": "H", "source_id": "sccode:1-5iP", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 583} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Bell example using Ndef. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nvar fundamental = 131;\nvar dur = 10;\nvar partials =\n[\n [1, 0.5, dur * 1],\n [1.02, 0.3, dur * 1],\n [1.01, 0.14, dur * 0.5],\n [2.44, 0.17, dur * 0.8],\n [3.31, 0.9, dur * 0.5],\n [5.1, 0.1, dur * 0.56],\n [5.9, 0.1, dur * 0.9],\n [11.01, 0.09, dur * 1],\n [13, 0.01, dur * 0.5],\n [15, 0.01, dur * 0.2],\n [16, 0.05, dur * 0.02],\n [19, 0.10, dur * 0.01],\n [20, 0.01, dur * 0.2],\n [24, 0.01, dur * 0.2],\n [4, 3, dur * 0.002] // attack\n];\n\nNdef(\\quickBell).fadeTime = 0;\nNdef(\\quickBell, {\n var snd, env;\n env = Env.perc(\n attackTime: 0.001,\n releaseTime: partials.flop.at(2),\n level: partials.flop.at(1)\n ).kr;\n // fundamental + inharmonics\n snd = SinOsc.ar(\n freq: fundamental * partials.flop.at(0);\n );\n snd = snd * env;\n snd = Splay.ar(snd);\n snd = Limiter.ar(snd);\n}).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-5iD", "aug": "prologue:intent", "prompt_tokens": 48, "answer_tokens": 500} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Various gong-like sounds using FM synthesis. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// https://recarteblog.wordpress.com/\n//gongFM_SC\n\n// 1. Añadir al servidor\n\n(\nSynthDef(\\gongFM, {\n arg ratio1=0.9, ratio2=0.55, ratio3=1.03, index2=2, index3=4, amp=0.7, dur=7, pan=0;\n var sig, op1, op2, op3, env1, env2, env3;\n env3 = EnvGen.kr(Env.new([0, 1, 1, 0], [0.4, 0.3, dur]), doneAction:2);\n env2 = EnvGen.kr(Env.new([0, 1, 1, 0], [0, 0.3, dur]), doneAction:2);\n env1 = EnvGen.kr(Env.new([0, 1, 1, 0], [0.003, 0.3, dur - 0.5]), doneAction:2);\n op3 = SinOsc.ar(([67, 70, 74].midicps * ratio3), mul:[67, 70, 74].midicps * ratio3 * index3) * env3;\n op2 = SinOsc.ar((([67, 70, 74].midicps * ratio2) + op3), mul:[67, 70, 74].midicps * ratio2 * index2) * env2;\n op1 = SinOsc.ar(([67, 70, 74].midicps * ratio1) + op2);\n sig = op1 * env1 * amp;\n sig = Splay.ar(sig);\n sig = Balance2.ar(sig[0], sig[1], pan);\n Out.ar(0, sig);\n}).add;\n);\n\n\n// 2. Ejecutar los Synths\n\nSynth(\\gongFM);\n\nSynth(\\gongFM, [\\ratio1, 0.503, \\ratio2, 0.50, \\ratio3, 1.35, \\index2, 1.53, \\index3, 4.33]);\n\nSynth(\\gongFM, [\\ratio1, 0.59, \\ratio2, 0.17, \\ratio3, 0.75, \\index2, 1.54, \\index3, 3.29]);\n\nSynth(\\gongFM, [\\ratio1, 0.49, \\ratio2, 0.17, \\ratio3, 0.34, \\index2, 1.33, \\index3, 4.31]);\n\nSynth(\\gongFM, [\\ratio1, 1.11, \\ratio2, 0.2, \\ratio3, 0.80, \\index2, 1.97, \\index3, 5.06]);\n```"}], "family": "H", "source_id": "sccode:1-5f7", "aug": "prologue:intent", "prompt_tokens": 59, "answer_tokens": 846} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Polyrhythmic and dynamic FM drone. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// https://recarteblog.wordpress.com/\n//droneFM01\n\n// 1. Añadir al servidor\n(\nSynthDef(\\droneFM, {\n arg f1Freq=0.1, f2Freq=1.1, f3Freq=2.2, nFreq=440, m1Ratio=1, m2Ratio=2, m3Ratio=3,\n amp=0.1, dur=55, ampM=0.84 , pan=0;\n var sig, car1, mod1, car2, mod2, car3, mod3, env, index;\n index = LFNoise1.kr(0.2).range(2, 12);\n env = EnvGen.kr(Env.new([0, 0.70, 0.70, 0], [dur*0.333, dur*0.333, dur*0.333]), doneAction:2);\n mod1 = SinOsc.ar([nFreq * m1Ratio, nFreq+0.7 * m1Ratio], mul:nFreq * m1Ratio * index) * ampM;\n car1 = SinOsc.ar(f1Freq + mod1);\n mod2 = SinOsc.ar([nFreq * m2Ratio, nFreq+1.4 * m2Ratio], mul:nFreq * m2Ratio * index) * ampM;\n car2 = SinOsc.ar(f2Freq + mod2);\n mod3 = SinOsc.ar([nFreq * m3Ratio, nFreq+0.35 * m3Ratio], mul:nFreq * m3Ratio * index) * ampM;\n car3 = SinOsc.ar(f3Freq + mod3) * 0.4;\n sig = car1 + car2 + car3 * env * amp;\n sig = Pan2.ar(sig, pan);\n Out.ar(0, sig);\n}).add;\n);\n\n// 2. Ejecutar los Synths\n(\nSynth(\\droneFM, [\\nFreq, 50.midicps]);\nSynth(\\droneFM, [\\nFreq, 57.midicps]);\nSynth(\\droneFM, [\\nFreq, 41.midicps]);\n)\n```"}], "family": "H", "source_id": "sccode:1-5f5", "aug": "prologue:intent", "prompt_tokens": 59, "answer_tokens": 682} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for minor scale filtered pulsewave demands: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\n{\n arg amp=0.1;\n var a, trig, basefreq, snd, cutoffmod, rqmod;\n \n a = Dseq([0, 2, 3, 5, 7, 8, 10, 12], inf);\n trig = Impulse.kr(4);\n basefreq = Demand.kr(trig, 0, a) + 38;\n basefreq = basefreq.midicps;\n cutoffmod = LFNoise2.ar(0.2).range(100,1500);\n rqmod = LFNoise2.ar(0.2).range(1,0.05);\n\n snd = (Pulse.ar(basefreq + 1 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 2 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 3 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 4 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 5 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 2 * SinOsc.kr(0.1.rand).range(0.99,1.010)) * amp) \n + (Pulse.ar(basefreq + 3 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 4 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 5 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp)\n + (Pulse.ar(basefreq + 6 * SinOsc.kr(0.1.rand).range(0.99,1.01)) * amp);\n \n \n snd = LeakDC.ar(snd);\n snd = RLPF.ar(snd, cutoffmod, rqmod);\n snd = Limiter.ar(in: snd, level: 0.8, dur:0.001);\n snd.dup;\n \n}.play)\n```"}], "family": "H", "source_id": "sccode:1-5e9", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 732} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for reverbio (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"reverb\", {arg freq=440, release=0.1;\n var in, s1,out, mod1, depth, mfreq;\n s1 = SoundIn.ar(0,mul:2);\n out=FreeVerb.ar(s1,mix:1,room:MouseX.kr(0,1),damp:MouseY.kr(0,1));\n Out.ar(0,out);\n Out.ar(1,out);\n}).load(s);\n);\na = Synth(\"reverb\");\na.free\n```"}], "family": "H", "source_id": "sccode:1-5dC", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 172} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for flanger (a SuperCollider snippet): bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"flange\", {arg freq=440, release=0.1;\n var x, sig,out, mod1, depth, mfreq,maxfreq, maxdepth, maxdelay, basedelay;\n maxfreq=3;\n maxdelay=0.01;\n basedelay=maxdelay/2;\n maxdepth=basedelay/2;\n depth = MouseY.kr(0,maxdepth);\n mfreq = MouseX.kr(0,maxfreq);\n mod1 = SinOsc.ar(mfreq,0,depth);\n sig = SoundIn.ar(0,mul:2);\n out = DelayC.ar(sig, maxdelay,basedelay+ mod1);\n out = Mix.ar([out,sig]);\n Out.ar(0,out);\n Out.ar(1,out);\n}).load(s);\n);\n\na = Synth(\"flange\");\na.free\n```"}], "family": "H", "source_id": "sccode:1-5dA", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 288} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for it goes beyond vibrato too. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"vibrato\", {arg freq=440, release=0.1;\n var x, sig,out, mod1, depth, mfreq,maxfreq, maxdepth, maxdelay, basedelay;\n maxfreq=5;\n maxdelay=0.1;\n basedelay=maxdelay/2;\n maxdepth=basedelay/2;\n depth = MouseY.kr(0,maxdepth);\n mfreq = MouseX.kr(0,maxfreq);\n mod1 = SinOsc.ar(mfreq,0,depth);\n sig = SoundIn.ar(0,mul:2);\n x = DelayC.ar(sig, maxdelay,basedelay+ mod1);\n out = x;// FreeVerb.ar(x,MouseX.kr(0,1),MouseY.kr(0,1), 0.1);\n Out.ar(0,out);\n Out.ar(1,out);\n}).load(s);\n);\n\na = Synth(\"vibrato\");\na.free\n```"}], "family": "H", "source_id": "sccode:1-5dy", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 317} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Basic tone simulator of a stylophone. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n/*\nRetro Stylophone\n\nReverse engineered from: https://www.waitingforfriday.com/?p=334\n\n1. Relaxation oscillator (UJT)\n\n- generated by a combination of two oscillators. The primary oscillator is a\n current controlled PUT (Programmable Uni-Junction Transistor) relaxation oscillator which is\n responsible for generating the overall tone of the instrument.\n A secondary LFO phase-shifted provides the vibrato\n (the relative slow wavering of a sound around the notes centre pitch)\n\n- around 10 VPP\n\n2. LFO phase-shift (vibrato)\n\n- generated by a low-frequency oscillator made with a transistor and several capacitors,\n which produces a triangle/sine wave fed into the frequency control voltage operating the UJT\n\n- frequency of about 8.5Hz, phased shifted of 180 degree, around 4.2 VPP\n*/\n\n(\nSynthDef(\\stylophone, { |freq = 220, vibAmp = 2, toneAmp = 5, atkTime = 0.01, trigger = 0|\n\n var lfo = OnePole.kr(LFPar.kr(8, mul: vibAmp, add: freq), 0.9); // 180 degree inversion\n var relaxOsc = LFPulse.ar(lfo, width: 0.9, mul: toneAmp);\n\n var asr = EnvGen.kr(Env.asr(atkTime * 5, releaseTime: 0.001, curve: \\lin), gate: trigger);\n\n Out.ar(0, relaxOsc * asr)\n}).add\n);\n\nf = Synth(\\stylophone);\n\nf.set(\\freq, 208.2);\nf.set(\\freq, 233.4);\n\nf.set(\\trigger, 1);\nf.set(\\trigger, 0);\nf.free;\n```"}], "family": "H", "source_id": "sccode:1-5d2", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 610} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Very quick-and-dirty hack to show stereo phase. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```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: \\addAfter);\nc = s.scope;\nc.style = 2;\nc.bus = b;\n)\n```"}], "family": "H", "source_id": "sccode:1-5bE", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 150} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for UI sounds (pt1): bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n// UI sounds\n// this code is an attempt to recreate a sound\n// inspired from some technological/electrical UI interface\n\n// 1. first define the synth\n// Here we are using the FM technique\n(\nSynthDef(\\fmmod, {\n |\n amp=0.2,\n fc=1000,\n fm = 100,\n idx = 100,\n atk=0.01,\n rls=0.1\n |\n var env = EnvGen.ar(Env.perc(atk, rls), doneAction:2);\n var modulator = SinOsc.ar(fm);\n var carrier = SinOsc.ar(fc + (idx*modulator) );\n var sig = carrier * env * amp;\n sig = HPF.ar(sig, 1000);\n Out.ar(0, sig!2);\n}).add;\n);\n\n// 2. then define the Pbind which will play the sequence\n// of UI sounds simulating variuos characters showing up on an\n// imaginary display.\n// Play around FC, FM, ATK and RLS to obtain different sound characters.\n(\np = Pbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 100,\n \\idx, 100,\n \\amp, 0.6,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).asEventStreamPlayer;\n);\n\n// 3. play it\np.play;\n\n// 4. Here are some presets\n\n// \"cricket\" preset\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 100,\n \\idx, 100,\n \\amp, 0.6,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n// preset 2\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 1000,\n \\idx, 100,\n \\amp, 0.6,\n \\atk, 0.001,\n \\rls, 0.01,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n// preset 3\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 10000,\n \\fm, 100,\n \\idx, 10,\n \\amp, 0.4,\n \\atk, 0.01,\n \\rls, 0.01,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n// preset 4\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 1000,\n \\fm, 100,\n \\idx, 1000,\n \\amp, 0.2,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n\n// preset 5\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 5000,\n \\fm, 1000,\n \\idx, 1000,\n \\amp, 0.4,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n);\n\n// preset 5\n(\nPbind(\n \\instrument, \\fmmod,\n \\fc, 8000,\n \\fm, 1000,\n \\idx, 1000,\n \\amp, 0.7,\n \\atk, 0.01,\n \\rls, 0.001,\n \\dur, Pwhite(0.1, 0.05, 10)\n).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-5bj", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 1075} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for aurora borealis: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\n~root = -13;\n~revSend = Bus.audio(s, 2);\n);\n(\ns.waitForBoot(\n {\n \n SynthDef(\\bell, {\n |\n freq=556, findex=0, frate=2,\n dur=5, pos=0,\n amp=0.25,\n out=0\n |\n var sigA, sigB, sigC, sig, env, fmod;\n env = EnvGen.ar(Env.triangle(5), doneAction:2);\n fmod = findex * SinOsc.kr(frate, mul:0.5, add:0.5) * Line.kr(0, 1, 7);\n sigA = Pulse.ar(freq + fmod, LFNoise2.kr(1).range(0.2, 0.8) );\n sigB = VarSaw.ar(freq + fmod);\n sigC = WhiteNoise.ar() * 0.125;\n sig = SelectX.ar(LFNoise2.kr(2).range(0, 2), [sigA, sigB, sigC]);\n sig = LPF.ar(sig, freq*4 );\n sig = sig * env * amp;\n Out.ar(out, Pan2.ar(sig, pos));\n }).add;\n\n s.sync;\n\n SynthDef(\\rev, {\n arg in=0, out=0, mix=1, room=0.8;\n var sig;\n sig = In.ar(in, 2);\n sig = FreeVerb.ar(sig, mix, room);\n Out.ar(out, sig);\n }).add;\n\n s.sync;\n\n ~rev = Synth(\\rev, [\\in, ~revSend]);\n\n x = Pbind(\n \\instrument, \\bell,\n \\out, ~revSend,\n \\root, Pfunc({~root}),\n \\octave, Pwrand([4, 5, 6, 7], [6,8,3,1].normalizeSum, inf),\n \\degree, Prand(Scale.lydian.degrees, inf),\n \\ctranspose, Pwhite( -0.05, 0.05, inf),\n \\amp, 1.1 * Pexprand(0.001, 0.7) * (1/(Pkey(\\octave)+1)),\n \\findex, Pexprand(2, 20),\n \\frate, Pwhite(1, 25, inf),\n \\pos, Pwhite(-0.8, 0.8, inf),\n \\dur, Pwhite(0.1, 0.5),\n ).asEventStreamPlayer;\n x.play;\n\n wait(15);\n r = Routine({\n \"starting\".postln;\n loop({\n ~root = [-13, -1, 4, 7].choose;\n wait( 10.rrand(25) );\n });\n });\n r.play;\n});\n)\n```"}], "family": "H", "source_id": "sccode:1-5bi", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 887} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Quadriphonic Isochronic and Binaural Brainwave Machine. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n//Synth definition\n(\nSynthDef(\n \\isochronic,\n {\n arg freq1=97.94, freq2=136.1, freq3=174, freq4=285, freq5=396, freq6=417,\n freq7=432, freq8=528, freq9=639, freq10=741, freq11=852, freq12=963, beat1=2.6, beat2=3.9,\n amp1=0.0, amp2=0.0, amp3=0.0, amp4=0.0, amp5=0.0, amp6=0.0, amp7=0.0, amp8=0.0,\n amp9=0.0, amp10=0.0, amp11=0.0, amp12=0.0, amp=0.0, out=0, isofreq=1, width=0.5;\n var sin1, sin2, sin3, sin4, sin5, sin6, sin7, sin8, sin9, sin10, sin11, sin12, brainmix, isochronic;\n sin1=SinOsc.ar([freq1-(beat1/2),freq1-beat1,freq1+(beat1/2),freq1+beat1],\n 0,amp1,0);\n sin2=SinOsc.ar([freq2-(beat2/2),freq2-beat2,freq2+(beat2/2),freq2+beat2],\n 0,amp2,0);\n sin3=SinOsc.ar([freq3-(beat1/2),freq3-beat1,freq3+(beat1/2),freq3+beat1],\n 0,amp3,0);\n sin4=SinOsc.ar([freq4-(beat2/2),freq4-beat2,freq4+(beat2/2),freq4+beat2],\n 0,amp4,0);\n sin5=SinOsc.ar([freq5-(beat1/2),freq5-beat1,freq5+(beat1/2),freq5+beat1],\n 0,amp5,0);\n sin6=SinOsc.ar([freq6-(beat2/2),freq6-beat2,freq6+(beat2/2),freq6+beat2],\n 0,amp6,0);\n sin7=SinOsc.ar([freq7-(beat1/2),freq7-beat1,freq7+(beat1/2),freq7+beat1],\n 0,amp7,0);\n sin8=SinOsc.ar([freq8-(beat2/2),freq8-beat2,freq8+(beat2/2),freq8+beat2],\n 0,amp8,0);\n sin9=SinOsc.ar([freq9-(beat1/2),freq9-beat1,freq9+(beat1/2),freq9+beat1],\n 0,amp9,0);\n sin10=SinOsc.ar([freq10-(beat2/2),freq10-beat2,freq10+(beat2/2),freq10+beat2],\n 0,amp10,0);\n sin11=SinOsc.ar([freq11-(beat1/2),freq11-beat1,freq11+(beat1/2),freq11+beat1],\n 0,amp11,0);\n sin12=SinOsc.ar([freq12-(beat2/2),freq12-beat2,freq12+(beat2/2),freq12+beat2],\n 0,amp12,0);\n isochronic=LFPulse.ar(MouseX.kr(1,60,'linear'),0,MouseY.kr(0.01,1,'linear'),amp,0).lag(0.01);\n //isochronic=LFPulse.ar(isofreq,0,width,amp,0).lag(0.001);\n brainmix=Mix.new([sin1, sin2, sin3, sin4, sin5, sin6, sin7, sin8, sin9, sin10, sin11, sin12]*isochronic);\n Out.ar(out,brainmix, 0, 1);\n }\n).add\n);\n\n//Run Synth\n~isobrainmachine = Synth(\\isochronic,[\\out,0,\\amp,0.5, \\amp1,0.24, \\amp2,0.22, \\amp3,0.20, \\amp4,0.18, \\amp5,0.17, \\amp6,0.16, \\amp7,0.14, \\amp8,0.13, \\amp9,0.12, \\amp10,0.11, \\amp11,0.1, \\amp12,0.1,\\beat1,2.6,\\beat2,3.9]);\n\n//Modify parameter\n~isobrainmachine.set(\\beat1,1.3);\n\n//Stop Synth\n~isobrainmachine.free;\n```"}], "family": "H", "source_id": "sccode:1-5aK", "aug": "prologue:intent", "prompt_tokens": 66, "answer_tokens": 1517} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Those were the times that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\ns.waitForBoot({\n\n SynthDef(\\singer, {\n | out=0, freq=440, amp=0.5, vibrato=6|\n var lfo, lfo2, lfo3, sig;\n lfo = SinOsc.kr(1/5, 0).range(250,1000);\n lfo2 = SinOsc.kr(1/5, 0).range(0.1,0.9);\n lfo3 = SinOsc.kr(vibrato).range(0.3, 1);\n sig = lfo3*RLPF.ar(in:VarSaw.ar(freq:Lag.ar(in:K2A.ar(freq), lagTime:0.3), iphase:0, width:lfo2, mul:amp), freq:lfo, rq:200/lfo);\n Out.ar(out, sig!2);\n }).add;\n\n s.sync;\n\n Pdef.defaultQuant_(0);\n Pdef(\\bass, Pmono(\\default, \\dur, Pwhite(0.01, 0.1, inf), \\freq, (Pgbrown(1,8,5) * 20).round(10), \\amp, Pbrown(0.2,0.6,0.05)));\n Pdef(\\computer, Pmono(\\default, \\dur, Pwhite(0.01, 0.1, inf), \\freq, (Pgbrown(1,8,9) * 100).round(20), \\amp, Pbrown(0.2,0.6,0.05)));\n Pdef(\\soprano, Pmono(\\singer, \\dur, Pwhite(0.01, 0.1, inf), \\freq, Pgbrown(1,8,0.05) * 200, \\amp, Pbrown(0.2,0.6,0.05)/5, \\vibrato, Pbrown(4,7,0.125)));\n Pdef(\\soprano2, Pmono(\\singer, \\dur, Pwhite(0.01, 0.1, inf), \\freq, Pbrown(3,6,0.1) * 100, \\amp, Pbrown(0.2,0.6,0.05)/5, \\vibrato, Pbrown(3,8,0.125)));\n\n fork {\n Pdef(\\bass).play;\n 10.wait;\n Pdef(\\computer).play;\n 10.wait;\n Pdef(\\soprano).play;\n 10.wait;\n Pdef(\\soprano2).play;\n 10.wait;\n Pdef(\\computer).stop;\n 20.wait;\n Pdef(\\bass).stop;\n 10.wait;\n Pdef(\\soprano).stop;\n Pdef(\\soprano2).stop;\n Pdef(\\bass).play;\n Pdef(\\soprano).play;\n 10.wait;\n Pdef(\\soprano2).play;\n 10.wait;\n Pdef(\\computer).play;\n 20.wait;\n Pdef(\\bass).stop;\n Pdef(\\computer).stop;\n Pdef(\\soprano).stop;\n Pdef(\\soprano2).stop;\n }\n\n});\n)\n```"}], "family": "H", "source_id": "sccode:1-57w", "aug": "prologue:intent", "prompt_tokens": 53, "answer_tokens": 948} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for gabber kick (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\gabberkick, {\n var snd;\n snd = SinOsc.ar(Env([1000, 69, 60], [0.015, 0.1], \\exp).ar * [-0.1, 0, 0.1].midiratio);\n snd = Mix(snd);\n snd = (snd * 10).tanh;\n snd = (snd * 5.1).atan;\n snd = BPeakEQ.ar(snd, XLine.kr(2000, 100, 0.3), 2.0, 8);\n snd = snd + DelayC.ar(snd, 0.01, SinOsc.ar(4).range(0.0, 0.001));\n snd = RLPF.ar(snd, 8000, 0.7);\n snd = snd * Env([0, 1, 0.7, 0.7, 0], [0.001, 0.01, 0.3, 0.02]).ar(2);\n snd = (snd * 0.6).clip(-1, 1);\n Out.ar(\\out.kr(0), Pan2.ar(snd, \\pan.kr(0), \\amp.kr(0.1)));\n}).add;\n);\n\nSynth(\\gabberkick, [amp: 0.6])\n```"}], "family": "H", "source_id": "sccode:1-57r", "aug": "prologue:intent", "prompt_tokens": 63, "answer_tokens": 370} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for attempt at emulating a breathing sound. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n//s.options.memSize_(64000);\nTempoClock.tempo_(1.0);\n\ns.waitForBoot({\n SynthDef(\\breathe_in, {\n | out = 0, gate = 1, in1=0.11, in2=0.63, in3=0.18, amdb= -10 |\n var menv = EnvGen.kr(Env.new([0,1,1,0],[in1, in2, in3], curve:'lin'),\n gate,\n doneAction:Done.freeSelf);\n var noise = WhiteNoise.ar(amdb.dbamp);\n var f1 = BPF.ar(in:noise, freq:5790, rq:0.1, mul:-29.dbamp);\n var f2 = BPF.ar(in:noise, freq:3400, rq:0.2, mul:-16.dbamp);\n var f3 = BPF.ar(in:noise, freq:1990, rq:0.1, mul:-23.dbamp);\n var f4 = BPF.ar(in:noise, freq:1250, rq:0.1, mul:-26.dbamp);\n Out.ar(out, menv*(f1+f2+f3+f4)!2);\n }).add;\n\n SynthDef(\\breathe_out, {\n | out = 0, gate=1, out1=0.343, out2=0.387, amdb= -4.33 |\n var menv = EnvGen.kr(Env.new([0, 1, 0], [out1,out2], curve:'lin'),\n gate,\n doneAction:Done.freeSelf);\n var noise = WhiteNoise.ar(amdb.dbamp);\n var f1 = BPF.ar(in:noise, freq:2290, rq:0.1, mul:-17.dbamp);\n var f2 = BPF.ar(in:noise, freq:1290, rq:0.1, mul:-19.dbamp);\n var f3 = BPF.ar(in:noise, freq:490, rq:0.1, mul:-18.dbamp);\n Out.ar(out, menv*(f1+f2+f3)!2);\n }).add;\n\n\n s.sync;\n\n fork {\n 50.do({\n var in1 = 0.11.rrand(0.22);\n var in2 = 0.6.rrand(0.8);\n var in3 = 0.16.rrand(0.30);\n var pausein = 0.11.rrand(0.20);\n var out1 = 0.30.rrand(0.50);\n var out2 = 0.36.rrand(0.50);\n var pauseout = 0.11.rrand(0.20);\n var amdb = -10.0.rrand(-14.0);\n var amdb2 = amdb/2.5;\n //(\"in1: \" ++ in1 ++ \" in2: \" ++ in2 ++ \" in3: \" ++ in3 ++ \" pausein: \" ++ pausein ++ \" out1: \" ++ out1 ++ \" out2: \" ++ out2 + \" pauseout: \" ++ pauseout).postln;\n Synth(\\breathe_in, [\\in1, in1, \\in2, in2, \\in3, in3, \\amdb, amdb]);\n (in1+in2+in3+pausein).wait;\n Synth(\\breathe_out, [\\out1, out1, \\out2, out2, \\amdb, amdb2]);\n (out1+out2+pauseout).wait;\n });\n };\n\n});\n);\n```"}], "family": "H", "source_id": "sccode:1-57l", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 1118} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Now with a little more stick 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 var sig, env, hash;\n\n // hash = DC.ar(0);\n hash = BPF.ar(\n Hasher.ar(Sweep.ar(rate: TRand.kr(1.0, 10.0))), \n fund_freq * 1.4, \n 0.5,\n 2\n ).tanh * Env.perc(0.001, 0.02).ar(0);\n sig = Pulse.ar( fund_freq * [ 1, 1.5085 ], [ 0.565, 0.445 ], [ 0.4, 0.6 ] ).atan;\n env = EnvGen.ar(\n Env(\n [ 0, 0.05, 1, 0.1, 0 ], [ 0.003, 0.002, 0.05, 0.5 ], [2, -4, -4, -4]\n ),\n gate: gate,\n timeScale: [ 1.0, 1.5 ],\n doneAction: 2\n );\n sig = Mix( (hash + sig) * env );\n sig = BPF.ar( sig, fund_freq * 2, 1.808 );\n\n Out.ar( out, Pan2.ar( sig, pan, amp ) );\n}).add;\n);\n\nSynth(\\cowbell);\n```"}], "family": "H", "source_id": "sccode:1-57h", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 428} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for some kick drums i wrote back in january: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\kick1, {\n var snd;\n snd = DC.ar(0);\n snd = snd + (SinOsc.ar(XLine.ar(800, 400, 0.01)) * Env.perc(0.0005, 0.01).ar);\n snd = snd + (BPF.ar(Hasher.ar(Sweep.ar), XLine.ar(800, 100, 0.01), 0.6) * Env.perc(0.001, 0.02).delay(0.001).ar);\n snd = snd + (SinOsc.ar(XLine.ar(172, 50, 0.01)) * Env.perc(0.0001, 0.3, 1, \\lin).delay(0.005).ar(2));\n snd = snd.tanh;\n Out.ar(\\out.kr(0), Pan2.ar(snd, \\pan.kr(0), \\amp.kr(0.1)));\n}).add;\n);\n\nSynth(\\kick1, [amp: 0.4]);\n\n(\nSynthDef(\\kick2, {\n var snd;\n snd = DC.ar(0);\n snd = snd + (HPF.ar(Hasher.ar(Sweep.ar), 1320) * Env.perc(0.003, 0.03).ar * 0.5);\n snd = snd + (SinOsc.ar(XLine.ar(750, 161, 0.02)) * Env.perc(0.0005, 0.02).ar);\n snd = snd + (SinOsc.ar(XLine.ar(167, 52, 0.04)) * Env.perc(0.0005, 0.3).ar(2));\n snd = snd.tanh;\n Out.ar(\\out.kr(0), Pan2.ar(snd, \\pan.kr(0), \\amp.kr(0.1)));\n}).add;\n);\n\nSynth(\\kick2, [amp: 0.4]);\n\n(\nSynthDef(\\kick3, {\n var snd;\n snd = DC.ar(0);\n snd = snd + (SinOsc.ar(XLine.ar(1500, 800, 0.01)) * Env.perc(0.0005, 0.01, curve: \\lin).ar);\n snd = snd + (BPF.ar(Impulse.ar(0) * SampleRate.ir / 48000, 6100, 1.0) * 3.dbamp);\n snd = snd + (BPF.ar(Hasher.ar(Sweep.ar), 300, 0.9) * Env.perc(0.001, 0.02).ar);\n snd = snd + (SinOsc.ar(XLine.ar(472, 60, 0.045)) * Env.perc(0.0001, 0.3, curve: \\lin).delay(0.005).ar(2));\n snd = snd.tanh;\n Out.ar(\\out.kr(0), Pan2.ar(snd, \\pan.kr(0), \\amp.kr(0.1)));\n}).add;\n);\n\nSynth(\\kick3, [amp: 0.4]);\n\n\n/*\ncontributors so far: nathan ho\n\ni use Hasher.ar(Sweep.ar) as a quick way to generate deterministic white noise, so i can get exactly the same kick each time for a precise digital sampler effect. you are free to replace it with WhiteNoise.ar.\n\nthe DC.ar(0) does nothing, it's just so i can reorder all the \"snd = snd +\" lines and/or comment out parts of the synth.\n\nsome of the attacks are so fast that Env:kr doesn't correctly handle them. that's why i always use Env:ar, so i don't have to think about ar/kr when i'm messing with sharp envelope attacks. i'm sure many of them could be refactored to kr for CPU, but idc\n*/\n```"}], "family": "H", "source_id": "sccode:1-57g", "aug": "prologue:intent", "prompt_tokens": 59, "answer_tokens": 1162} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for very punchy snare in neurofunk style: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\neurosnare, {\n var snd;\n // a percussive click to give it some attack\n snd = LPF.ar(HPF.ar(WhiteNoise.ar, 300), 8000) * Env.linen(0.001, 0.01, 0.001).ar;\n // sine sweep body. very important!\n snd = snd + (SinOsc.ar(Env([400, 196, 160], [0.04, 0.2], \\exp).ar) * Env.perc(0.04, 0.2).ar * 6.dbamp).tanh;\n // sound of snare coils rattling\n snd = snd + (HPF.ar(BPeakEQ.ar(WhiteNoise.ar, 4000, 0.5, 3), 300) * Env.perc(0.05, 0.2).delay(0.01).ar(2) * -3.dbamp);\n // another sound sweep to improve the attack, optional\n snd = snd + (SinOsc.ar(XLine.kr(3000, 1500, 0.01)) * Env.perc(0.001, 0.02).ar);\n // distortion helps glue everything together and acts as a compressor\n snd = (snd * 1.4).tanh;\n snd = Pan2.ar(snd, \\pan.kr(0), \\amp.kr(0.1));\n Out.ar(\\out.kr(0), snd);\n}).add;\n);\n\nSynth(\\neurosnare, [amp: 0.4]);\n```"}], "family": "H", "source_id": "sccode:1-57f", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 464} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for City (a SuperCollider snippet): bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\scagrain, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, fspread=0.1;\n var sig;\n var sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8;\n var xfreq = freq * ((0..7)/7 - 0.5 * fspread + 1);\n xfreq = xfreq * XLine.kr(1,2,2);\n sig1 = SinOsc.ar(xfreq);\n sig2 = LFSaw.ar(xfreq);\n sig2 = RLPF.ar(sig2, \\lpfr.kr(2.2) * freq, \\rq.kr(0.5));\n sig = SelectX.ar(\\oscwave.kr(0), [sig1, sig2]);\n sig = sig * EnvGen.ar(Env.adsr(0.01,0.1,0.8,0.1),gate,doneAction:2);\n sig = Pan2.ar(sig, pan, amp).mean * 4;\n Out.ar(out, sig);\n}).add;\n\nSynthDef(\\scagrain2, { arg out=0, amp=0.1, gate=1, pan=0, freq=200, fac1=0.1, fac2=1, fac3=1, fac4=1, fac5=1;\n var sig;\n var sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8;\n sig = SinOsc.ar(freq * ( 1 + ( SinOsc.kr(freq/2 * ( 1 + ( SinOsc.kr((1..8) * fac1) * fac3 ))) * fac2 )));\n sig = LPF.ar(sig, freq * \\lpfr.kr(2) * SinOsc.ar(fac4, mul:fac5, add:1) ) + ( sig/2 );\n sig = sig * EnvGen.ar(Env.adsr(0.2,0.1,0.8,0.2),gate,doneAction:2);\n sig = Pan2.ar(sig, pan, amp).mean * 4;\n Out.ar(out, sig);\n}).add;\n\nPdef(\\scape, \n Ppar([\n 8.collect({ arg x;\n Pbind(\n \\oscwave, Pseg(Pseq([0,1],inf),8+x),\n \\fspread, Pseg(Pseq([0.00001,0.01],inf),8+x+3),\n \\lpfr, Pseg(Pseq([0,4],inf),8+x+2),\n \\instrument, \\scagrain,\n \\freq, 60 * ( x*16+1 ),\n \\sustain, Pseg(Pseq([0.05,0.5],inf),8+x+1),\n \\dur, 1/8 * ( 1+x ),\n \\pan, Pseg(Pseq((0..7).linlin(0,7,-1,1),inf,x),8+x+6.123) * Pseg(Pseq([0,1],inf),16+x) ,\n \\amp, 0.1/4 * Pseg(Pseq([1,1/2,1],inf),8+x+2.321),\n );\n })\n ].flat)\n);\n\n\nPdef(\\scape2, \n Ppar([\n 8.collect({ arg x;\n Pbind(\n \\instrument, \\scagrain2,\n \\freq, 60 * (x*8+1),\n \\fac1, Pseg(Pseq([0.00001,0.1,2],inf),8+x+3),\n \\fac2, Pseg(Pseq([0.40001,0.1,2],inf),8+x+2),\n \\fac3, Pseg(Pseq([0.00001,0.1,2],inf),8+x+1),\n \\fac4, Pseg(Pseq([0.00001,0.1,2],inf),8+x+4),\n \\fac5, Pseg(Pseq([0.00001,0.1,1/2],inf),8+x+5),\n\n \\dur, 1/8 + ( x/ Pseg(Pseq([1,8],inf),8) ),\n \\pan, Pseg(Pseq((0..7).linlin(0,7,-1,1),inf,x),8+x+6) * 0.8 ,\n \\lag, x,\n \\amp, 0.1/4 * Pseg(Pseq([1,1/2,1],inf),8+x+3.321),\n );\n })\n ].flat)\n);\n\n Pdef(\\city, Ptpar([\n 0, Pdef(\\scape),\n 16, Pdef(\\scape2),\n ])).play\n)\n```"}], "family": "H", "source_id": "sccode:1-57c", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 1435} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for electric hum: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\eHum).addSpec(\\fFreq, ControlSpec(25, 1000, \\lin, step: 25));\nNdef(\\eHum).addSpec(\\fRq, [0.01, 0.2]);\nNdef(\\eHum).addSpec(\\fFreqIdx, [0, 8, \\lin, 0.2]);\nNdef(\\eHum).fadeTime = 2;\n\nNdef(\\eHum, {|fFreqIdx = 1, fRq = 0.1|\n var src = Impulse.ar([50, 75, 100]); // three sources\n var fFreq = (25 * (2 ** fFreqIdx));\n\n Splay.ar((BPF.ar(src, fFreq, fRq))* 8)\n})\n);\n\nNdef(\\eHum).gui;\n```"}], "family": "H", "source_id": "sccode:1-577", "aug": "prologue:intent", "prompt_tokens": 46, "answer_tokens": 262} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for running water (simple). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\simpleRunningWater).fadeTime = 4;\n\n\nNdef(\\simpleRunningWater, {\n var mod, freq, ampMod, src;\n \n mod = {LFNoise0.ar(170)}!2;\n \n freq = mod.linexp(-1, 1, \\lowFreq.kr(400, 8), 2400).lag(0.01); // * Line.kr(1, 0.01, 40);\n ampMod = 0.5 + mod.linlin(-1, 1, 0.5, 0).lag(0.1);\n \n ampMod = ampMod * AmpComp.ar(freq);\n \n src = LPF.ar(SinOsc.ar(\n freq,\n 0.6, \n ampMod\n ), 4000);\n \n // src * LFPulse.ar(10);\n src\n \n})\n);\n\nNdef(\\simpleRunningWater).set(\\lowFreq, 1000);\nNdef(\\simpleRunningWater).xset(\\lowFreq, 1000);\nNdef(\\simpleRunningWater).gui\n```"}], "family": "H", "source_id": "sccode:1-576", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 338} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Detune idea is from James Harkins. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\na = {\n |freq = 40, wid = 0.5|\n Mix(LFPulse.ar(freq *((Array.fill(40, Pxrand((1, 2..20), inf).iter)/1000)+1),\n 0, wid, 0.05)\n ).dup\n}.play;\n);\n\n//more distorsion\n~widlfo = {Saw.kr(0.5).range(0,1)};\na.set(\\wid, ~widlfo);\n\n//stop\na.release;\n```"}], "family": "H", "source_id": "sccode:1-56d", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 163} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for A1 (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n//DEFS///////////\n\n//hh\n(\nSynthDef(\"hihat\", {arg out = 0, amp = 0.5, att = 0.5, rel = 0.02, ffreq = 4000, pan = 0;\n var env, snd;\n env = Env.perc(\n attackTime: 1,\n releaseTime: 0.02,\n level: amp\n ).kr(doneAction: 2);\n\n snd = WhiteNoise.ar;\n snd = HPF.ar(in: snd, freq: ffreq, mul: env);\n Out.ar(out, Pan2.ar(snd, pan));\n}).add;\n);\n//snare\n\n(\nSynthDef(\"snare\", {arg out = 0, amp = 0.3, att = 0.01, sus = 1, rel = 0.08, ffreq = 200, pan = 0;\n var env, snd;\n env = Env.perc(att, sus, rel, amp).kr(doneAction: 2);\n snd = BPF.ar(\n in: WhiteNoise.ar,\n freq: ffreq,\n mul: env\n );\n Out.ar(out, Pan2.ar(snd, pan));\n}).add;\n);\n\n//plucking\n(\nSynthDef(\"plucking\", {arg amp = 0.1, freq = 440, decay = 5, dampen = 0.1;\n\nvar env, snd;\nenv = Env.linen(0, decay, 0).kr(doneAction: 2);\nsnd = Pluck.ar(\n in: WhiteNoise.ar(amp),\n trig: Impulse.kr(0),\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: dampen);\n Out.ar(0, [snd, snd]);\n}).add;\n);\n\n//bass\n(\nSynthDef(\"bass\", { arg freq = 440, amp = 0.1, att = 0.1, rel = 2, lofreq = 1000, hifreq = 3000;\n var env, snd;\n env = Env.perc(\n attackTime: att,\n releaseTime: rel,\n level: amp\n ).kr(doneAction: 2);\n snd = SinOsc.ar(freq: freq * [0.9, 1, 1.2, 0.75], mul: env);\n snd = LPF.ar(\n in: snd,\n freq: LFNoise2.kr(1).range(lofreq, hifreq)\n );\n snd = Splay.ar(snd);\n Out.ar(0, snd);\n}).add;\n);\n\n//PBINDS\n\ns.record;\n\ns.stopRecording;\n\n(\n{\nPbind(\n \\instrument, \"hihat\",\n \\dur, Pseq([Rest(1/2), 1/2, 1/2, 1/6, 1/6, 1/6], inf),\n \\att, 2,\n \\rel, 0.001,\n \\ffreq, 500,\n \\pan, Pseq([0.4, -0.4], inf),\n \\amp, 0.1\n).play;\n\n4.wait;\n\nPbind(\n \\instrument, \"snare\",\n \\dur, Pseq([Rest(2), 2], inf),\n \\att, 0.01,\n \\rel, 0.5,\n \\ffreq, Pseq([1000, 500, 4000, 500], inf),\n \\amp, 1\n).play;\n\n(\nPbind(\n \\instrument, \"plucking\",\n \\freq, Pseq([220, 440, [660, 880, 1020]], inf),\n \\amp, Pseq([0.3, 0.4, 0.1], inf),\n \\decay, 8,\n \\dampen, Pseq([0.09, 0.2, 0.0001], inf),\n \\dur, Pseq([1, 2, 4], inf)\n).play;\n\nPbind(\n \\instrument, \"bass\",\n \\midinote, Pseq([\n [30],\n [],\n Prand([\n [32],\n [38],\n ], 1)\n ],\n inf\n ),\n \\dur, Prand([1, 3, 4, 4.5], 4),\n \\att, 0.1,\n \\rel, Pkey(\\dur) + 1,\n \\hifreq, 5000,\n \\amp, 0.2\n).play;\n )\n\n\n}.fork\n)\n```"}], "family": "H", "source_id": "sccode:1-552", "aug": "prologue:intent", "prompt_tokens": 60, "answer_tokens": 1312} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for smooth arpeggio, updated envelope (a SuperCollider snippet): bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\ns.boot;\n);\n\n(\nSynthDef(\\bass, { |freq = 440, sustain = 1, amp = 0.5|\n var sig;\n sig = SinOsc.ar(freq, 0, amp) * EnvGen.kr(Env.perc(0.2), doneAction: 2);\n Out.ar(0, sig ! 2)\n}).add;\n);\n\n(\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([36 + 0, 36 + 7, 36 + 12], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5], inf)\n).play;\n);\n\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([60+0, 60+5, 60+7, 60+8, 60+7, 60+5], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5, 0.5, 0.5, 0.5], inf)\n).play;\n)\n\n)\n```"}], "family": "H", "source_id": "sccode:1-53W", "aug": "prologue:intent", "prompt_tokens": 67, "answer_tokens": 405} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for simple smooth arp. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns.boot;\n);\n\n(\nSynthDef(\\smooth, { |freq = 440, sustain = 1, amp = 0.5|\n var sig;\n sig = SinOsc.ar(freq, 0, amp) * EnvGen.kr(Env.linen(0.05, sustain, 0.1), doneAction: 2);\n Out.ar(0, sig ! 2)\n}).add;\n);\n\n(\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([36 + 0, 36 + 7, 36 + 12], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5], inf)\n).play;\n);\n\n\n(\np = Pbind(\n // the name of the SynthDef to use for each note\n \\instrument, \\smooth,\n // MIDI note numbers -- converted automatically to Hz\n \\midinote, Pseq([60+0, 60+5, 60+7, 60+8, 60+7, 60+5], inf),\n // rhythmic values\n \\dur, Pseq([0.5, 0.5, 0.5, 0.5, 0.5, 0.5], inf)\n).play;\n)\n)\n```"}], "family": "H", "source_id": "sccode:1-53V", "aug": "prologue:intent", "prompt_tokens": 48, "answer_tokens": 414} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Benoit XVI (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// a supercollider port of Coloscope's Pure-data organ. \n\nSynthDef(\\benoit, {\n arg out=0, amp=0.5, freq=440, semione=12, semitwo=24, trackingmul=2, gate=1, sus=1, rel=1;\n var env, sig, sig1, sig2, sig3, ringmod, tracking, sig4;\n\n sig1 = Pulse.ar(freq, 0.17);\n sig2 = Pulse.ar((freq.cpsmidi - semione).midicps, 0.17);\n sig3 = Pulse.ar((freq.cpsmidi + semitwo).midicps, 0.17);\n\n sig4 = LFTri.ar((freq.cpsmidi - semitwo).midicps);\n\n env = EnvGen.ar(Env.linen(0,sus,rel), gate, doneAction:2);\n\n tracking = ((freq * 1) + freq) * trackingmul;\n sig = sig1 + sig2 + sig3 + (sig4 * 2);\n\n\n sig = RLPF.ar(sig, tracking, 1, 0.33);\n sig = FreeVerb.ar(sig, 0.12);\n sig = sig.tanh;\n sig = sig * env;\n\n\n Out.ar(out, (sig * amp));\n\n}).add;\n```"}], "family": "H", "source_id": "sccode:1-53U", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 438} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for number 10 for Quiz 4a. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var tri, bpf;\n tri = LFTri.ar(\n freq: [440,340, 513],\n mul: LFPulse.kr(\n freq: [6,3,2],\n width: 0.15));\n bpf = SinOsc.ar(in: tri, freq: LFNoise2.kr(4).range(400,1000));\n Splay.ar(tri,bpf);\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53t", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 144} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Nuclear Fallout (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var saw, bpf;\n saw = Saw.ar(\n freq: [60,150],\n mul: LFPulse.kr(\n freq: [2,3],\n width: 0.15));\n \n { BPF.ar(\n in: WhiteNoise.ar(mul: 1),\n freq: 1000,\n rq: 0.9\n )\n}\n\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53j", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 129} +{"conversations": [{"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.kr(\n freq: LFPulse.ar(freq: [100, 1000]).range(1, 10),\n width: 0.9));\n bpf = BPF.ar(in: saw, freq: MouseY.kr(1000, [6000, 9000]), rq: MouseX.kr(0.1, 0.9), mul: 20);\n Out.ar(0, bpf);\n \n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-53h", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 175} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Close in Counters of the Fourth Mind. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\closeN, { |out=0, freq=440, gate=1|\n var son = BPF.ar(in: WhiteNoise.ar(20!2),\n freq: freq,\n rq: 0.005,\n mul: 1,\n );\n var env = EnvGen.ar(\n Env.linen(0.1, 0.5, 0.55, 0.8, \\welch),\n doneAction:2\n );\n son = FreeVerb2.ar(son, son, mix: 0.7, room: 1.0, damp: 0.3);\n Out.ar(out, son * env);\n\n\n}).add;\n);\n\n\n(\na = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [200, 250],\n mul: LFPulse.kr(\n freq: [2, 3],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\ns = {\n var saw, bpf;\n saw = Saw.ar(\n freq: [100, 150],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nd = {\n var saw, bpf;\n saw = Pulse.ar(\n freq: [800, 1000],\n mul: LFPulse.kr(\n freq: [1, 1.5],\n width: 0.15).range(0.0,0.7));\n bpf = LPF.ar(in: saw, freq: SinOsc.kr(1/5).range(200, 4000));\n bpf = FreeVerb2.ar(bpf, bpf, mix: 0.4, room: 0.7);\n Out.ar(0, bpf);\n};\nf = Pbind(\n \\instrument, \\closeN,\n \\freq, Pseq([800, 1000, 900, 400, 600], inf),\n \\dur, Pseq([1, 1, 1, 1, 4], inf),\n \\amp, 1);\ng = Pbind(\n \\instrument, \\closeN,\n \\freq, Pseq([1000, 1150, 1200, 1500, 1200], inf),\n \\dur, Pseq([1, 1, 1, 1, 4], inf),\n \\amp, 0.5);\n{\n a.play;\n 3.75.wait;\n f.play();\n 4.25.wait;\n s.play;\n 8.wait;\n d.play;\n 3.75.wait;\n g.play;\n}.fork;\n)\n```"}], "family": "H", "source_id": "sccode:1-53b", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 933} +{"conversations": [{"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 var sig, env;\n\n sig = Pulse.ar( fund_freq * [ 1, 1.5085 ], [ 0.565, 0.445 ], [ 0.4, 0.6 ] ).distort;\n env = EnvGen.ar(\n Env(\n [ 0, 0.05, 1, 0.1, 0 ], [ 0.003, 0.002, 0.05, 0.5 ], [2, -4, -4, -4]\n ),\n gate: gate,\n timeScale: [ 1.0, 1.5 ],\n doneAction: 2\n );\n sig = Mix( sig * env );\n sig = BPF.ar( sig, fund_freq * 2, 1.808 );\n\n Out.ar( out, Pan2.ar( sig, pan, amp ) );\n}).add;\n)\n```"}], "family": "H", "source_id": "sccode:1-525", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 306} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Looping sampler with crossfading. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\simpler, {\n arg buf=0\n ,freq=220\n ,sampleStart=0\n ,loopStart=0\n ,loopLen=1 // between 0 (min) and 1 (max)\n ,fadeTime=0.1\n ,gate=1\n ,attack=0.01\n ,sustain=1\n ,release=1\n ,f0=220;\n\n var rate = freq / f0;\n var sr = rate*BufSampleRate.kr(buf);\n var fadeFrames = fadeTime*sr;\n var loopEnd = loopLen*(BufFrames.kr(buf) - loopStart) + loopStart;\n var loopFrames = loopEnd - loopStart + 1;\n var loopTime = (loopFrames - fadeFrames)/sr;\n var startUpTime = (loopStart - sampleStart)/sr;\n\n var trigLoop = TDuty.ar(Dseq([startUpTime + loopTime, Dseq([loopTime], inf)]), gapFirst:1);\n\n var phaseA = Phasor.ar(trigLoop, rate, sampleStart, inf, loopStart);\n var phaseB = Phasor.ar(trigLoop, rate, loopEnd - fadeFrames, inf, loopEnd - fadeFrames);\n\n var srcA = BufRd.ar(buf.numChannels, buf, phaseA);\n var srcB = BufRd.ar(buf.numChannels, buf, phaseB);\n\n var startLoop = SetResetFF.ar(trigLoop);\n var loopPan = Phasor.ar(trigLoop, 2/fadeFrames * rate, -1, inf, -1).clip(-1,1);\n\n var out = Select.ar(startLoop, [srcA, LinXFade2.ar(srcB, srcA, pan:loopPan)]);\n var env = EnvGen.ar(Env.asr(attack, sustain, release, 1), gate, doneAction:2);\n\n Out.ar(0, Splay.ar(out) * env);\n}).add;\n\n// Try it out:\n~buf = Buffer.read(s, Platform.resourceDir +/+ 'sounds/a11wlk01.wav');\n\nPdef(\\p, Pbind(*[\n instrument: \\simpler\n ,buf: ~buf\n ,octave: Prand([3,4,5],inf)\n ,degree: Pn(Plazy({Pseq([-4,0,5,7,9,12].scramble.clump(2),2)}))\n ,dur: 0.5\n ,strum: Prand([0, 0.125, 0.25], inf)\n ,strumEndsTogether: false\n ,loopStart: Pwhite(90000, 150000)\n ,sampleStart: Pwhite(50000, 85000)\n ,loopLen: 0.4\n ,fadeTime: 0.15\n ,attack: 0.25\n ,release: 4\n])).play;\n```"}], "family": "H", "source_id": "sccode:1-51A", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 957} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Wobble, tremolo, whatever you want to call it that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"Triangular AM\", { arg freq = 440, modfreq = 5, amp = 0.5, attack = 0.01, release = 0.1, pos = 0, gate = 1;\n var carrier, modulator, env;\n modulator = SinOsc.kr(modfreq).range(0, 1); // provides amplitude modulation for wobble\n carrier = LFTri.ar(freq: freq, mul: modulator); // provides triangle wave for an interesting harmonic\n env = Env.asr(\n attackTime: attack,\n sustainLevel: amp,\n releaseTime: release).kr(doneAction: 2, gate: gate);\n carrier = carrier * env;\n Out.ar(0, Pan2.ar(carrier, pos))\n}).add;\n);\n\n(\n// Using these settings you can produce a pulsating wobble sound\n~wobble = Pbind(\n \\instrument, \"Triangular AM\",\n \\scale, Scale.aeolian,\n \\ctranspose, -12,\n \\degree, Pseq([\n [-7,-3, 0, 2, 4, 7],\n [-8, -4, -1, 1, 3, 6],\n [-9, -5, -2, 0, 2, 5],\n [-5, -1, 2, 4, 6, 9],\n [-4, 0, 3, 5, 7, 10],\n ], inf),\n \\dur, Pseq([Pn(4, 3), 2, 2], inf),\n \\amp, 0.4,\n \\modfreq, Pseq([Pn(6.5, 3), 2, 6.5], inf),\n \\attack, 2,\n \\release, 1.2,\n \\pos, [-1, -0.7, -0.2, 0.2, 0.7, 1],\n \\gate, 0,\n);\n);\n\n~wobble.play;\n```"}], "family": "H", "source_id": "sccode:1-51d", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 552} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for 8-bit synth (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"AM2\", { arg freq = 440, modfreq = 12, amp = 0.5, attack = 0.01, dur = 1, pos = 0;\n var carrier, modulator, env;\n modulator = LFSaw.kr(modfreq).range(0, 1);\n carrier = LFSaw.ar(freq: freq, mul: modulator);\n env = Env.perc(attackTime: attack, releaseTime: dur - attack, level: amp).kr(2);\n carrier = carrier * env;\n Out.ar(0, Pan2.ar(carrier, pos))\n}).add;\n);\n\n//Example Melody\n\n(\na=Pbind(\n\\instrument, \"AM2\",\n\\degree, Pseq([0,1,2,3,4,5,6,7,6,5,4,3,2,1],inf),\n\\amp, 0.70,\n\\dur, 0.125,\n\\modfreq, 12, // add different values\n).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-51c", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 314} {"conversations": [{"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;\n var gliss = XLine.kr(sinfreq, sinfreq*glissf, rel);\n var snd = SinOsc.ar(gliss);\n var env = EnvGen.kr(Env.perc(att, rel), doneAction: 2);\n snd = snd * env * amp;\n Out.ar(0, snd);\n}).add;\n);\n\n(\nPbind(\n \\instrument, \"raygun\",\n \\dur, Pseq([0.75,0.75,0.75,0.75,0.25,0.25,0.25]*0.5, inf),\n \\amp, 0.4\n).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-519", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 254} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Seekers are something you should avoid. Define every value it uses."}, {"role": "assistant", "content": "```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],[time]));\n Out.ar(0, tone.dup);\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-50B", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 172} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for fm generated melody. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// base concept\n\n{ arg freq = 74; SinOsc.ar(freq * [1,1.000001] * ( 1 + ( SinOsc.ar(freq * LFPulse.kr(2,0, 1/8).range(0,1) * 1.20 )))) * 0.2; }.play\n\n{ arg freq = 90; SinOsc.ar(freq * [1,1.000001] * ( 1 + ( SinOsc.ar(freq * LFPulse.kr(4,0, 0.5).range(0,1) * 1.50 )))) * 0.2; }.play\n\n{ arg freq = 74; SinOsc.ar(freq * [1,1.000001] * ( 1 + ( SinOsc.ar(freq * LFPulse.kr(2,0, 1/8).range(0,1) * 1.50 )))) * 0.2; }.play\n\n{ arg freq = 77; SinOsc.ar(freq * [1,1.000001] * ( 1 + ( SinOsc.ar(freq * LFPulse.kr(4,0, 1/3).range(0,1) * 1.60 )))) * 0.2; }.play\n\n// play with it\n\n(\nNdef(\\eyes, { arg freq=483, pan=0, amp=0.1;\n var sig;\n var env1, env2, env3, env4, env5, env6, env7, env8;\n var fmfreq;\n env1 = Duty.kr(1/8, 0, Dseq([\n 1,0,1,0,\n 1,0,0,0,\n 1,0,0,0,\n 1,0,0,0,\n ],inf)).lag(0.01);\n fmfreq = freq * ( 1 + ( SinOsc.ar(freq * 4 * env1) * 1 ));\n sig = LFSaw.ar(fmfreq * [1,1.0001]);\n sig = RLPF.ar(sig, freq*2 * [1,2 * SinOsc.kr(1/8).range(2,1),1], 0.2 * SinOsc.kr(1/4).range(2,1));\n sig = Pan2.ar(sig, 0, amp).flop;\n}).play\n);\n\n(\nNdef(\\eyes, { arg freq=70, pan=0, amp=0.1;\n var sig;\n var env1, env2, env3, env4, env5, env6, env7, env8;\n var fmfreq;\n env1 = Duty.kr(1/8, 0, Dseq([\n 1,0,0,0,\n 1,0,1,1,\n 1,0,0,1,\n 1,0,0,0,\n ],inf)).lag(0.01);\n fmfreq = freq * ( 1 + ( SinOsc.ar(freq * 1 * env1) * 2.2 ));\n sig = LFSaw.ar(fmfreq * [1,1.0001]);\n sig = RLPF.ar(sig, freq*2 * [1,2 * SinOsc.kr(1/8).range(2,1),1], 0.2 * SinOsc.kr(1/4).range(2,1));\n sig = Pan2.ar(sig, 0, amp).flop;\n}).play\n);\n\n\n(\nNdef(\\eyes, { arg freq=80, pan=0, amp=0.1;\n var sig;\n var env1, env2, env3, env4, env5, env6, env7, env8;\n env1 = Duty.kr(1/8, 0, Dseq([\n 1,0,0,0,\n 1,0,0,0,\n 0,0,0,0,\n 0,0,0,0,\n ],inf)).lag(0.31);\n sig = LFSaw.ar(freq * [1,1.001]);\n sig = 0;\n sig = sig + LFSaw.ar(freq * ( 1 + ( SinOsc.ar(freq*2 * 1.0 * env1) * 1.91 )));\n //sig = sig + SinOsc.ar(freq * ( 1 + ( SinOsc.ar(freq*2 * 1.0 * LFPulse.kr(2)) * 0.91 )));\n sig = RLPF.ar(sig, ( [4000, 4001, 8000 ] * ( [1.07,1,1.0001 * SinOsc.kr(1/8).range(0.1,4)] * 1.1 * Amplitude.kr(sig)**1.8 ) ).clip(5,18000));\n sig = (sig * 40).tanh / 2;\n sig = Pan2.ar(sig, SinOsc.kr([1,2,3]/10).range(-1,1) * 0.3, amp).flop;\n}).play\n);\n```"}], "family": "H", "source_id": "sccode:1-50s", "aug": "prologue:intent", "prompt_tokens": 49, "answer_tokens": 1457} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Re: Re: the perfect frequencies. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nf = {\n var rep = [4, 8, 16, 32];\n var n = rep.choose;\n var x = [\n\n 54, 60, 66, 72, 81, 90, 96, 102,\n 108, 128, 132, 144, 162, 180, 192, 204,\n 216, 240, 264, 288, 324, 360, 384, 408,\n 432, 480, 528, 576, 648, 720, 768, 816,\n 864, 960, 1056, 1152, 1296, 1440, 1536, 1632,\n 1728, 1920, 2112, 2304, 2592, 2880, 3072, 3264,\n 3456, 3840, 4224, 4608, 5184, 5760, 6144, 6528,\n 6912, 7680, 8448, 9216, 10368, 11520, 12288, 528\n\n ];\n var fac1 = [1,10,100,1000].choose;\n var fac2 = [1,10,100,1000].choose;\n var fac3 = [1,10,100,1000].choose;\n Mix.fill(n,\n {\n var detune = 5.rand;\n var saw;\n var sin;\n detune = XLine.kr(0.1,1+250.0.rand ,2+9.0.rand) * 2.0.rand* [1,-1].choose;\n sin = SinOsc.ar(x.choose * ( 1 + ( SinOsc.ar(x.choose/fac1) * x.choose/fac2 )) + detune, 4.rand, 0.25);\n saw = RLPF.ar(Saw.ar(x.choose*0.01+detune, 0.75), x.choose, 2.rand);\n saw = [\n saw,\n saw.fold2( SinOsc.ar(x.choose/fac3).range(0.1,1) ),\n saw.wrap2( SinOsc.ar(x.choose/fac3).range(0.1,1) ),\n saw * SinOsc.ar(x.choose/2),\n ( saw * SinOsc.ar(x.choose/fac3).range(1,20) ).tanh/2,\n ].choose;\n Pan2.ar((sin+saw) * EnvGen.kr(Env.sine(12, 1/n), 1, doneAction:2),\n 1.rand2) \n }\n );\n};\n);\n\n(\n// DEFINE A ROUTINE\nr = Routine({\n\n inf.do({\n f.play;\n 10.wait;\n })\n});\n);\n\nr.reset.play;\n```"}], "family": "H", "source_id": "sccode:1-50k", "aug": "prologue:intent", "prompt_tokens": 53, "answer_tokens": 805} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Re: the perfect frequencies. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// Rumush\n// https://mycelialcordsblog.wordpress.com/\n// https://fungorumush.bandcamp.com/releases\n// https://soundcloud.com/fungorum\n\n(\nf = {\n var rep = [4, 8, 16, 32];\n var n = rep.choose;\n var x = [\n\n 54, 60, 66, 72, 81, 90, 96, 102,\n 108, 128, 132, 144, 162, 180, 192, 204,\n 216, 240, 264, 288, 324, 360, 384, 408,\n 432, 480, 528, 576, 648, 720, 768, 816,\n 864, 960, 1056, 1152, 1296, 1440, 1536, 1632,\n 1728, 1920, 2112, 2304, 2592, 2880, 3072, 3264,\n 3456, 3840, 4224, 4608, 5184, 5760, 6144, 6528,\n 6912, 7680, 8448, 9216, 10368, 11520, 12288, 528\n\n ];\n Mix.fill(n,\n {\n var detune = 5.rand;\n var sin = SinOsc.ar(x.choose, 4.rand, 0.25);\n var saw = RLPF.ar(Saw.ar(x.choose*0.01+detune, 0.75), x.choose, 2.rand).tanh;\n Pan2.ar((sin+saw) * EnvGen.kr(Env.sine(12, 1/n), 1, doneAction:2),\n 1.rand2) }\n );\n};\n);\n\n(\n// DEFINE A ROUTINE\nr = Routine({\n\n inf.do({\n f.play;\n 10.wait;\n })\n});\n);\n\nr.reset.play;\n```"}], "family": "H", "source_id": "sccode:1-50j", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 573} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Gates (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\plop).put(0, { arg freq=200, rq=0.1, pan=0, amp=0.1;\n var sig;\n var sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8;\n sig1 = WhiteNoise.ar(1, 0);\n sig2 = LPF.ar(WhiteNoise.ar(1, 0), SinOsc.kr(1/16 * [1,2,3,4]/2).range(100,9001));\n sig3 = LFSaw.ar(( freq* [1/2,1,2,1] ).clip(20,15000)) * [1,4,1/2,2];\n sig1 = SelectX.ar(\\mixg.kr(0.5)*2, [sig1, sig2, sig3]);\n sig = Gate.ar(sig1, LFPulse.ar( SinOsc.kr(1/8 * [1,2,3,4].reverse/2).range(30,100), 0.5));\n sig = Gate.ar(sig, LFPulse.ar( freq ));\n sig = RLPF.ar(sig, ( freq * SinOsc.kr([1,2,3,4]/4).range(1,4) ).clip(20,15000), rq * [1,2,3,4]);\n sig1 = LFPulse.ar(freq * [1,1/2]) * [1,1/2];\n sig = SelectX.ar(\\mix.kr(0.8)*2, [sig, sig1 * sig, sig1]);\n sig1 = BPF.ar(sig, ( freq*2 ).clip(20,15000), rq) * 5;\n sig2 = BPF.ar(sig, freq, rq) * 5;\n sig3 = BPF.ar(sig, freq/2, rq) * 5;\n sig = SelectX.ar(\\mix2.kr(0.6) * 3, [sig, sig1, sig2, sig3]);\n sig = Pan2.ar(sig, LFNoise1.kr(1/2 * [1,2,3,4]).range(-1.0,1.0) * 0.3, amp).mean;\n}).play;\n\nSpec.add(\\mix, \\unipolar);\nSpec.add(\\mix2, \\unipolar);\nSpec.add(\\mixg, \\unipolar);\n);\n\nNdef(\\plop).edit;\n\nNdef(\\plop).unset(\\freq);\n\n(\n Ndef(\\plop).put(1, \\set -> Pbind(\n \\degree, Pseq([\n 0,3,2,3,\n 4,2,2,3,\n ],inf),\n \\octave, 4,\n \\dur, Pseq([1,2,4,1],inf)/4,\n )\n);\n)\n```"}], "family": "H", "source_id": "sccode:1-4ZR", "aug": "prologue:intent", "prompt_tokens": 53, "answer_tokens": 861} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for distobass (a SuperCollider snippet). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\bass, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2;\n var sig, sig1, sig2, sig3;\n freq = SinOsc.ar(freq*\\fmfreq.kr(1).lag(0.3)) * \\fmrange.kr(0.5).lag(0.3) * LFNoise1.kr(1/7).range(0.9,1.1) + 1 * freq;\n sig = SinOsc.ar(freq.lag(0.1) * [1,8,2,4,1.002]);\n sig1 = LFPulse.ar(freq * [1,4,1.001,2 * LFNoise1.kr(1/10).range(0.999,1.001),1/2], mul:1.00);\n sig = sig + sig1;\n sig = sig.fold2(SinOsc.kr(1/13).range(0.9,1));\n sig = sig.wrap2(SinOsc.kr(1/14).range(0.9,1));\n sig = RLPF.ar(sig, \\lpf.kr(500).lag(0.4) * LFNoise1.kr(1/9).range(0.9,1.1), \\rq.kr(0.5));\n sig = HPF.ar(sig, \\hpf.kr(40));\n sig = sig * EnvGen.ar(\\iadsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),\\igate.kr(1),doneAction:0);\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);\n sig = Splay.ar(sig, spread, amp, pan);\n Out.ar(out, sig);\n}).add;\n\n(\nPdef(\\bass, Pmono(\\bass,\n \\freq, 70 * Pseq([0,1].midiratio,inf).stutter(16) * Pseq([1,2],inf).stutter(64),\n \\fmrange, Pseq([0.5,1,1.5],inf),\n \\fmfreq, Pseq([0.5,1,2,4],inf),\n \\dur, 1/4,\n \\igate, Pseq([\n 1,0,0,0,\n 0,0,0,0,\n ],inf),\n \\iadsr, Pseq([\n [ Env.adsr(0.1,0.1,0.8,4.1) ],\n ],inf),\n \\lpf, Pkey(\\freq) * Pseq([\n 2,1,4,8,\n 2,1,4,8,\n 2,1,4,8,\n 4,2,2,4,\n ],inf).stutter(8),\n \\hpf, Pkey(\\freq) / 2,\n\n \\amp, Pkey(\\amp) * 2,\n \\isRest, false,\n));\nPdef(\\bass).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-4WJ", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 940} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Server-side sequencing (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nf = { |f0=200, rate=4|\n {\n var seq = Dseq(f0*[1/2,3/4, Dstutter(4, Drand([1/2,1,2,3,4,5,6],1)), 2,3/2,3,4/3], inf);\n var trig = Impulse.ar(rate);\n var freq = Demand.ar(trig,0, seq);\n var env = Decay2.ar(trig,1e-3,1);\n FreeVerb.ar(\n Splay.ar(SinOsc.ar(freq*[0.995, 1, 1.005]).fold(-0.995,0.995)*0.25*env),\n 0.5,\n 0.5\n );\n }\n};\n\nfork{ 4.do{\n fork{\n f.(100,2).play;\n (1/8).wait;\n f.(200,4).play;\n (1/4).wait;\n f.(100*4/3,8).play;\n (1/2).wait;\n f.(400,4).play;\n };\n (1/4).wait;\n}}\n)\n```"}], "family": "H", "source_id": "sccode:1-4WH", "aug": "prologue:intent", "prompt_tokens": 68, "answer_tokens": 342} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for radio static with tuning noise (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"radiostatic\", {arg out=0;\n var hum, sineSweep, tuning, dustNoise, staticNoise, humFreq, numHarms;\n \n numHarms = 7;\n humFreq = 100;\n hum = Array.fill(numHarms, {|i| SinOsc.ar( (i+1) * humFreq, 0, 1/numHarms)});\n hum = hum.sum;\n dustNoise = Dust.ar(LFNoise1.ar(0.5).range(1000,8000));\n staticNoise = hum * dustNoise * LFNoise1.ar(1).range(0.5, 2);\n \n sineSweep = SinOsc.ar(LFNoise2.ar(1).range(20, 11000));\n tuning = SinOsc.ar(10000).ring4(sineSweep) * LFNoise2.ar(1.1).range(0.05, 0.1);\n\n Out.ar(out, Pan2.ar(staticNoise + tuning, 0));\n}).add;\n);\n \na = Synth(\"radiostatic\");\n```"}], "family": "H", "source_id": "sccode:1-4Wu", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 335} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Digital Bird sounds that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\birdy, {arg freq=1500, amp=0.5, rate=10;\n var osc, son, convIn, rand;\n osc=LFCub;\n rand = LFNoise1.ar(rate);\n convIn=LinCongN.ar(rate);\n son = osc.ar(Convolution.ar(convIn,convIn));\n freq = Latch.kr(rand.range(0,1).round(0.1), rand) * freq;\n freq = osc.ar(osc.ar(rand)*rand.range(0,10)).range(freq, freq*3);\n son = Formlet.ar(son, freq, convIn.abs*0.1, rand.abs);\n son = Normalizer.ar(son, 0.9, 0.1) * convIn.abs * LFPulse.kr(LFPulse.kr(rand.abs), 0, rand.abs);\n son = son + GVerb.ar(son, 99, 2, mul: rand.range(0,0.3));\n son * amp\n}).play\n)\n```"}], "family": "H", "source_id": "sccode:1-4Wd", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 340} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Pisano periods for rythmic patterns that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\nb = Buffer.read( s, Platform.resourceDir +/+ \"sounds/a11wlk01.wav\" );\n\n(\nSynthDef(\\playBuf, {| out = 0, buf = 0, amp = 0.2, pan = 0.0, dur = 0.2, gate = 1 startPos = 0 |\n var sig, env;\n env = EnvGen.ar( Env.sine( dur ), gate, amp, doneAction: 2 );\n sig = PlayBuf.ar( \n 1, \n buf, \n BufRateScale.ir( buf ), \n 1, \n startPos * BufFrames.ir( buf )\n );\n OffsetOut.ar(out, Pan2.ar( sig * env, pan ) )\n}).add\n);\n\n(\nPn(\n Plazy({\n var divisor = 3.rrand( 9 ), repeats = 10.rrand( 20 );\n var pisano, size, starts, durs, pans, amps;\n\n pisano = Array.pisano( divisor );\n size = pisano.size;\n starts = { 1.0.rand } ! size ;\n durs = { 0.03.rrand( 0.08 ) } ! size;\n pans = { 1.0.rand2 } ! size;\n amps = { 0.05.rrand( 0.8 ) } ! size;\n\n \"Divisor: %\\t pisano period is of length: %\\n\".postf( divisor, size );\n\n Pbind(\n \\instrument, \\playBuf,\n \\pisano, Pseq( pisano, repeats ),\n \\buf, b,\n \\amp, Pindex( amps, Pkey( \\pisano ) ),\n \\dur, Pindex( durs, Pkey( \\pisano ) ),\n \\pan, Pindex( pans, Pkey( \\pisano ) ),\n \\startPos, Pindex( starts, Pkey( \\pisano ) )\n )\n }),\n inf\n).play\n);\n\nb.free\n\n//////////////////////////////////////////////////////////////////////\n// + Array { \n// // The pisano period for the given integer.\n// *pisano { | divisor = 3 |\n// var list, lastPair, sum;\n// if ( divisor.isInteger.not or: { divisor < 0 } ){\n// \"The divisor must be a positive integer\".throw;\n// };\n// list = List[ 0, 1 ];\n// while {\n// lastPair = list.keep( -2 );\n// sum = lastPair.sum;\n// sum != 1 or: { lastPair.last != 0 }\n// }{\n// list.add( sum % divisor );\n// };\n// ^ list.array.drop( -1 )\n// }\n\n// }\n//////////////////////////////////////////////////////////////////////\n```"}], "family": "H", "source_id": "sccode:1-4W0", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 918} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Electric car. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n//load the Synth\n\n(\nk = ControlSpec(5, -128, \\lin);\ne = ControlSpec(0.01, 0.5, \\exp);\np = ControlSpec(65536, 0.25, \\exp);\nc = ControlSpec(-23, 0, \\lin);\nh = ControlSpec(1/2, 2/1, \\exp);\n\nSynthDef(\\Motorklang, {arg speed=0.0, time=0.0, rpm=0.0, t_tr=1;\n var sig, speedch, rpmch;\n speedch = EnvGen.kr(Env([0, speed], [time]), t_tr);\n rpmch = EnvGen.kr(Env([0, h.map(rpm/6000);], [time]), t_tr);\n sig = Mix.fill(8, {arg i;\n var freq, aspeed, env, curve1, curve2, phase;\n curve1 = k.map(speedch).max(1);\n aspeed = p.map(speedch/75) * curve1;\n env = e.map(speedch/75);\n curve2 = c.map(speedch/75);\n freq = 300 + (i/4);\n phase = i/8;\n Mix.fill(32, {arg i;\n var freqsq;\n freqsq = ((((i+1)*freq).cpsmidi*rpmch) - (freq.cpsmidi*rpmch-freq.cpsmidi)).midicps.min(22050);\n SinOsc.ar(freqsq, 0, 0.1/(i+1))\n *\n EnvGen.ar(Env.perc(env, 1-env, 1, curve2),\n Impulse.ar(freq*(1+i)/aspeed, phase), timeScale: 1/(freq*(1+i)/aspeed));\n });\n });\n Out.ar(0, Mix.new(sig) ! 2);\n }).load(s);\n);\n\n//Test it\n(\nx = Synth(\\Motorklang);\nx.set(\\speed, 40, \\rpm, 3000, \\time, 0, \\t_tr, 1);\n);\nx.free\n\n//A simple interface to check the sound limits of the engine\n\n(\nx = Synth.newPaused(\\Motorklang);\nw = Window.new(\"Motor\", Rect(150, 266, 950, 300)).front;\nq = StaticText(w, Rect(835, 20, 100, 100));\ny = StaticText(w, Rect(838, 140, 100, 100));\nq.string = \"km/h\";\ny.string = \"rpm\";\nc = NumberBox(w, Rect(830, 90, 40, 20));\nn = NumberBox(w, Rect(830, 210, 40, 20));\nb = ControlSpec(0, 75, \\linear, 0.1);\nm = ControlSpec(0, 6000, \\linear, 1);\na = Slider(w, Rect(50, 75, 700, 50)).value_(0).action_({\n x.run.set(\\speed, b.map(a.value), \\t_tr, 1);\n c.string_(b.map(a.value).asString)});\nd = Slider(w, Rect(50, 200, 700, 50)).value_(0).action_({\n x.run.set(\\rpm, m.map(d.value), \\t_tr, 1);\n n.string_(m.map(d.value).asString)});\nc.value = 0;\nn.value = 0;\n)\n```"}], "family": "H", "source_id": "sccode:1-4Vy", "aug": "prologue:intent", "prompt_tokens": 46, "answer_tokens": 1120} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Detuneable fat-saw with a pattern (a SuperCollider snippet): bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\fatsaw,\n {\n arg freq=440, amp=0.3, fat=0.0033, ffreq=2000, atk=0.001, dec=0.3, sus=0.5, rls=0.1,gate=1;\n\n var f1,f2,f3,f4,synth;\n\n f1=freq-(freq*fat);\n f2=freq-(freq*fat/2);\n f3=freq+(freq*fat/2);\n f4=freq+(freq*fat);\n\n synth = LFSaw.ar([f1,f2,f3,f4],[0,0.001,0.002,0.004,0.008]);\n synth = synth * EnvGen.kr(Env([0,1,sus,0],[atk,dec,rls],'lin',2),gate,doneAction:0);\n synth=Splay.ar(synth,0.7);\n synth=RLPF.ar(synth,ffreq*Linen.kr(gate,0.1,0.4,0.2,0),0.4);\n Out.ar([0,1],synth*amp);\n},[0.1,0.3,4,2]).add;\n);\n(\nTempoClock.default = TempoClock.new(2);\nfork{\n\n z = Synth(\\fatsaw,[\\gate,0,\\ffreq,500,\\fat,0.5]);\n\n a=Pseq([0,7,12,5],inf).asStream; // musical degrees\n c = Pseq([40,38,45,47],inf).asStream; // root midi notes\n e = Pseq([0.825,0.375,0.25,0.25],inf).asStream; // note durations\n f = Pseq([1000,1500,2000,2500],inf).asStream; // filter freq value\n\n 0.1.wait;\n z.set(\\gate,1);\n\n //set first root note\n d = c.next;\n\n 8.do{\n\n // move filter freq once every 4 notes\n z.set(\\ffreq, f.next);\n 4.do {\n z.set(\\gate,1);\n z.set(\\freq,(a.next + d).midicps);\n x=[0.451,0.45,0.449].choose;\n x.wait;\n z.set(\\gate,0);\n\n e.next.wait;\n };\n\n d = c.next;\n };\n 2.wait;\n z.free;\n};\n)\n```"}], "family": "H", "source_id": "sccode:1-4Vt", "aug": "prologue:intent", "prompt_tokens": 65, "answer_tokens": 791} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Pluck (Karplus-Strong) example (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"plucking\", {arg amp = 0.1, freq = 440, decay = 5, dampen = 0.1;\n\nvar env, snd;\nenv = Env.linen(0, decay, 0).kr(doneAction: 2);\nsnd = Pluck.ar(\n in: WhiteNoise.ar(amp),\n trig: Impulse.kr(0),\n maxdelaytime: 0.1,\n delaytime: freq.reciprocal,\n decaytime: decay,\n coef: dampen);\n Out.ar(0, [snd, snd]);\n}).add;\n);\n\n// Example 1\n(\nPbind(\n \\instrument, \"plucking\",\n \\freq, Pwhite(440, 880),\n \\amp, 0.1,\n \\decay, 4,\n \\dampen, 0.1,\n \\dur, Prand([0.51, 0.1, 0.1], inf)\n).play;\n);\n\n// Example 2\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.locrian,\n \\degree, Pwhite(7, 15),\n \\amp, Pwhite(0.1, 0.5),\n \\decay, Pwhite(7, 12),\n \\dampen, Pwhite(0.01, 0.1),\n \\dur, Prand([0.1, 0.2, 0.4, 0.27, 0.13, 0.38], inf)\n).play;\n);\n\n// Example 3\n(\nPbind(\n \\instrument, \"plucking\",\n \\scale, Scale.lydian,\n \\degree, Pseq([8, 17, 8, 9, 8, 17, 7], inf),\n \\amp, Pwhite(0.1, 0.5),\n \\decay, Pwhite(1, 2),\n \\dampen, Pseq([0.7, 0.8, 0.4], inf),\n \\dur, Prand([0.1, 0.2, 0.4], inf)\n).play;\n);\n\n// Example 4\n(\nPbind(\n \\instrument, \"plucking\",\n \\degree, Pseq([-5, -2, 1, 4, 6, 9], inf),\n \\mtranspose, -7,\n \\amp, Pwhite(0.2, 0.3),\n \\decay, Pseq([7, 6, 6, 5, 4, 3], inf),\n \\dampen, Pseq([0.45, 0.3, 0.3, 0.2, 0.2, 0.1], inf),\n \\dur, Prand([0.9, 0.8, 0.7], inf)\n).play;\n\nPbind(\n \\instrument, \"plucking\",\n \\degree, Prand([0, 1, 3, 4, 6, Pseq([7, 8, 9], 1), 9], inf),\n \\mtranspose, 7,\n \\amp, Pwhite(0.4, 0.5),\n \\decay, Pwhite(6, 10),\n \\dampen, Pseq([0.05, 0.1, 0.15], inf),\n \\dur, Prand([0.1, 0.2, 0.4, Rest(0.3)], inf)\n).play;\n\n);\n\n// Example 5\n\n\n(\na = Pbind(\n \\instrument, \"plucking\",\n \\degree, Pseq([7, 8, 9, 10, 11, 12, 13], inf),\n \\amp, 0.2,\n \\decay, 4,\n \\dampen, 0.05,\n \\dur, Prand([0.51, 0.1, 0.1], inf)\n);\n\nb = Pbind(\n \\instrument, \"plucking\",\n \\degree, Pseq([\n [-7, 2, 4], // chord 1\n [0, 3, 5] // chord 2\n ], inf),\n \\amp, 0.1,\n \\decay, 7,\n \\dampen, 0.1,\n \\dur, Prand([2, 4], inf)\n);\n);\n\n// sequence in time\n(\n{\n ~player1 = a.play;\n 4.wait;\n ~player2 = b.play;\n 10.wait;\n ~player1.stop;\n 4.wait;\n ~player2.stop;\n}.fork\n)\n```"}], "family": "H", "source_id": "sccode:1-4Vn", "aug": "prologue:intent", "prompt_tokens": 72, "answer_tokens": 1204} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for wobble bass (a SuperCollider snippet). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n\nSynthDef(\\wobble, { arg out=0, amp=0.1, gate=1, pan=0, spread=0.8, freq=200, doneAction=2;\n var sig, sig1, sig2, sig3;\n sig1 = LFSaw.ar(freq * 1 + (0.04 * [1,-1]));\n sig2 = LFSaw.ar(freq * 0.99 );\n sig3 = LFSaw.ar(freq * 1 );\n sig = sig1 + sig2 + sig3;\n sig = (sig*50).tanh;\n sig = sig * EnvGen.ar(\\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);\n sig = Splay.ar(sig, spread, amp, pan);\n Out.ar(out, sig);\n}).add;\n\n~bus = Bus.audio(s,2);\nPdef(\\wobble).quant=4;\nNdef(\\lfo1).quant=4;\nNdef(\\fx).quant=4;\n);\n\n(\nPdef(\\wobble).play;\nNdef(\\fx).play;\nPdef(\\wobble, Pbind(\n \\instrument, \\wobble,\n \\out, ~bus,\n \\freq, Pseq([50,60,40],inf) + [0,1],\n \\legato, 1,\n \\dur, Pseq([1/4,1/8,1/8]*8,inf);\n));\n\nNdef(\\fx, { arg ffreq=300, rq=0.3, choose=0, freqshift=40, time=2, minrate=0.7, curve=(-1);\n var in = In.ar(~bus, 2);\n var sig;\n var sig1,sig2,sig3,sig4,sig5;\n var buf = LocalBuf(2*s.sampleRate, 2);\n var rate;\n var choosetrig;\n sig = in;\n\n sig1 = RLPF.ar(sig, ffreq, rq);\n\n choosetrig = choose > 0;\n RecordBuf.ar(sig1, buf, loop:1, trigger:choosetrig);\n rate = EnvGen.kr(Env([1,1,minrate],[0,time], curve), choosetrig);\n sig2 = PlayBuf.ar(2, buf, rate, choosetrig, loop:1);\n\n sig = Select.ar(choose, [sig1, sig2]);\n sig;\n});\n\nNdef(\\fx).put(1, \\set -> Pbind(\n \\choose, Pseq([\n 0,0,0,0,\n 0,0,0,1,\n ],inf).stutter(4),\n \\time, 2,\n \\dur, 1/2,\n));\n\nNdef(\\fx).map(\\ffreq, Ndef(\\lfo1));\n\nNdef(\\lfo1, { arg freq=4, base=2100, choose=0, loval=5, hival=1000, time=1; \n Select.kr(choose, [\n SinOsc.kr(freq).range(5,base), \n Sweep.kr(Impulse.kr(1/time), 1/time) * base + 50,\n ])\n});\n\n\nNdef(\\lfo1).put(1, \\set -> Pbind(\n \\freq, Pseq([\n 4,4,4,8,\n 0,0,0,0,\n 8,8,4,4,\n 0,0,0,0,\n\n 4,6,4,8,\n 0,0,0,0,\n 8,8,4,4,\n 0,0,0,0,\n ],inf),\n \\choose, Pseq([\n 0,0,0,0,\n 1,1,1,1,\n 0,0,0,0,\n 1,1,1,1,\n ],inf),\n \\base, Pseq([1000,1500,5000,2000],inf).stutter(4) + Pseq([0,-500,0,500],inf),\n \\time, Pseq([1,1,1,2],inf).stutter(4),\n \\dur, 1/2,\n));\n);\n```"}], "family": "H", "source_id": "sccode:1-4Vl", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 1256} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Timing variations. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\sound, {\n arg i_bus = 0, amp = 0.1, freq = 440, sustain = 1, pan = 0;\n var env, osc, out;\n env = EnvGen.kr(Env.perc(0.01, sustain, amp),doneAction:2);\n osc = SinOsc.ar([freq, freq * 1.005, freq * 0.995], mul:env);\n out = Pan2.ar(osc, pan);\n Out.ar(i_bus, out);\n}).send(s);\n);\n\n(\n~amp = 0.1;\na = Pdef(\\a,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp * 1.5,\n \\degree, Pseq([2, 4, 5, 6, 1] - 1, inf),\n \\dur, Pseq([1, 1, 1, 1, 2] / 4, inf)\n )\n).quant_([3, 0, 0, 1]);\n\nb = Pdef(\\b,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp,\n \\degree, Pseq(([8, 6, 5, 3, 4, 6]!3).flat[0..(6*3)-2] - 1, inf),\n \\dur, Prand([Pseq([1, 1, 1, 1, 1, 1] / 4, 4), Prand([1/8, 3/8], 1)], inf)\n )\n).quant_([3, 0, 0, 1]);\n\nc = Pdef(\\c,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp * 0.6,\n \\degree, Pseq([1, 6, 8, 6, Pwrand([11,13], [2, 1].normalizeSum)] - 1, inf),\n \\amp, Pseq([0, 1, 1, 1, 1] / 10, inf),\n \\dur, Pseq([8, 1, 1, 1, 1] / 8, inf),\n \\sustain, 0.1\n )\n).quant_([3, 0, 0, 1]);\n);\n\n(\nSystemClock.sched(0, Routine({\n a.play; 12.yield;\n b.play; 12.yield;\n c.play; 12.yield;\n c.pause; 6.yield;\n a.pause; 6.yield;\n\n b.pause; a.play; 12.yield;\n b.play; 12.yield;\n c.play; 12.yield;\n c.pause; a.pause; 6.yield;\n b.pause; 6.yield;\n}));\n)\n```"}], "family": "H", "source_id": "sccode:1-4Va", "aug": "prologue:intent", "prompt_tokens": 47, "answer_tokens": 757} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for song of forest. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\sound, {\n arg i_bus = 0, amp = 0.1, freq = 440, sustain = 1, pan = 0;\n var env, osc, out;\n env = EnvGen.kr(Env.perc(0.01, sustain, amp),doneAction:2);\n osc = SinOsc.ar([freq, freq * 1.005, freq * 0.995], mul:env);\n out = Pan2.ar(osc, pan);\n Out.ar(i_bus, out);\n}).send(s);\n);\n\n(\n~amp = 0.1;\na = Pdef(\\a,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp * 1.5,\n \\degree, Pseq([2, 4, 5, 6, 1] - 1, inf),\n \\dur, Pseq([1, 1, 1, 1, 2] / 4, inf)\n )\n).quant_([3, 0, 0, 1]);\n\nb = Pdef(\\b,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp,\n \\degree, Pseq([8, 6, 5, 3, 4, 6] - 1, inf),\n \\dur, Pseq([1, 1, 1, 1, 1, 1] / 4, inf)\n )\n).quant_([3, 0, 0, 1]);\n\nc = Pdef(\\c,\n Pbind(\n \\instrument, \\sound,\n \\amp, ~amp * 0.6,\n \\degree, Pseq([1, 6, 8, 6, Pwrand([11,13], [2, 1].normalizeSum)] - 1, inf),\n \\amp, Pseq([0, 1, 1, 1, 1] / 10, inf),\n \\dur, Pseq([8, 1, 1, 1, 1] / 8, inf),\n \\sustain, 0.1\n )\n).quant_([3, 0, 0, 1]);\n);\n\n(\nSystemClock.sched(0, Routine({\n a.play; 12.yield;\n b.play; 12.yield;\n c.play; 12.yield;\n c.pause; 6.yield;\n a.pause; 6.yield;\n\n b.pause; a.play; 12.yield;\n b.play; 12.yield;\n c.play; 12.yield;\n c.pause; a.pause; 6.yield;\n b.pause; 6.yield;\n}));\n)\n```"}], "family": "H", "source_id": "sccode:1-4V2", "aug": "prologue:intent", "prompt_tokens": 46, "answer_tokens": 718} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for piece i'm working on for a dance performance. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n( // 'random' sequences of rhythms, reverb,...\nz = {\n var trig, seq;\n trig = Impulse.kr(6);\n seq = Drand([\n Dseq([4,0,0,1,Drand([1,4]),1,0,1]),\n Dseq([1,0,2,0,Drand([0,1,4]),0,1,1]),\n Dseq([4,0,0,2,Drand([1,2,4]),0,1,1]),\n Dseq([4,0,1,2,Drand([0,1,4]),1,2,0]),\n Dseq([1,1,4,1,Drand([1,4]),2,3,3]),\n Dseq([4,1,0,1,Drand([0,4]),1,0,1])\n ], inf);\n\n g = HenonN.ar(\n [120,120],\n LFNoise2.kr(1, 0.2, 1.2),\n LFNoise2.kr(1, 0.15, 0.15)\n )\n * 0.2\n + SinOsc.ar([61,40], mul:0.7)\n\n // add lovely chaos noise (taken from documentation example)\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(2,0.5,1.5)\n ) * 0.1 // volume\n }\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, 0.3)\n ) * 0.2 * SinOsc.kr(0.01) }\n ;\n\n trig = Demand.kr(trig, 0, seq * 0.2) * trig;\n { MoogFF.ar(\n g,\n SinOsc.kr(0.1,0,1,1) * 1000 + 3000)}.dup\n * Decay.kr(trig, Demand.kr(trig,0,Drand([1,2,4,6], inf)*0.1)) // envelope\n ;\n};\n\n{\n GVerb.ar(\n in: EnvGen.kr(Env.linen(20, 240, 40, 0.6, \\sine)) * z * 0.9,\n roomsize: 30,\n revtime: 4, // SinOsc.kr(0.1,0,4,4.1),\n damping:0.4, // SinOsc.kr(0.12,0,0.4,0.5),\n inputbw:1,\n spread:15,\n drylevel:SinOsc.kr(0.02,0,0.5,0.5),\n earlyreflevel:SinOsc.kr(0.01,0,0.5,0.5),\n taillevel:SinOsc.kr(0.02,pi,0.05,0.05)\n );\n}.play\n)\n```"}], "family": "H", "source_id": "sccode:1-4Up", "aug": "prologue:intent", "prompt_tokens": 52, "answer_tokens": 978} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for 003_102 (a SuperCollider snippet). Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nSynthDef('003_102', {|out=0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y| Out.ar(out, Pan2.ar(Normalizer.ar(( GbmanL.ar( LPF.ar( SyncSaw.ar(p, k, q, h ), FreqShift.ar(d, r, k, y, a ), h, n ), r, l, Blip.ar(r, f, u, i ), h ))*( LFPar.ar(d, x, Saw.ar(w, k, Formant.ar(s, q, d, DelayL.ar(y, 0.5, w, v, i ), e ) ), y ))*( LFCub.ar(q, a, h, g ))*( Gendy1.ar(r, c, r, QuadL.ar(h, o, j, t, t, v, f ), k, p, g, Pulse.ar(g, g, c, s ), PMOsc.ar(f, u, d, t, d, f ), f, LFNoise0.ar(k, l, e ), d ) )))) }).play(args: #[ a, 0.1, b, 0.83039082494709, c, 7.4736936148092, d, 57.834883574831, e, 0.56638920329924, f, 2.7610572022348, g, -0.60208093272399, h, 0.69731527262978, i, 0.97553825378418, j, 0.47619211673737, k, 0.45142233371735, l, 6.5229251440451, m, 0.34238355327673, n, 3.1624102065486, o, 1, p, 1, q, 5.4898714868897, r, 2.7777416341664, s, 10966.099508885, t, 0.15706503391266, u, 3.1945936724559, v, 20000, w, -4.6151277924266, x, 1.4588773159677, y, 0.0012384873762477 ])\n```"}], "family": "H", "source_id": "sccode:1-4U9", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 720} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for blaplop (a SuperCollider snippet) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\bla, { arg out=0, amp=0.1, gate=1, pan=0, freq=200;\n var sig;\n var tab;\n tab = \\tab.kr(1 ! 15);\n sig = LFSaw.ar(freq * tab.abs);\n sig = sig.sum;\n sig = RLPF.ar(sig, Rand(10,freq*2) + 100 * SinOsc.ar(tab.abs).range(0.01,Rand(2,7)));\n sig = sig.sum;\n sig = sig / 100;\n sig = sig.tanh;\n sig = sig * EnvGen.ar(Env.adsr(0.01,0.1,0.8,0.1+ExpRand(0.001,0.2)),gate,doneAction:2);\n sig = Pan2.ar(sig, pan, amp);\n Out.ar(out, sig);\n}).add;\n);\n\n(\nPdef(\\plop, Pbind(\n \\instrument, \\bla,\n \\degree, Pstep(Pseq([\n Pseq([0,2,4],4),\n Pseq([0,12,6],4),\n Pseq([0,12,6]+7,1),\n ],inf), 1),\n \\octave, 3,\n \\tab, Pfunc {\n var tab;\n [\n //tab = { arg n; (n + 1.asFloat.rand + 1).tanh / (n.rand+1) } ! 15;\n tab = { arg n; (n + 2.asFloat.rand + 1) / (n+1) } ! 15;\n tab.postln;\n ]\n },\n \\dur, PdurStutter( Prand([1,2,4],inf), Pseq([1,2,3]/2,inf)),\n \\amp, 0.4\n)).play;\n);\n```"}], "family": "H", "source_id": "sccode:1-4U1", "aug": "prologue:intent", "prompt_tokens": 62, "answer_tokens": 560} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Pan Sonic emulation - Katodivaihe - lahetys that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, b, c, d, n, e, f, out;\n\n a = Impulse.ar(8)*1.5;\n\n b = WhiteNoise.ar * Env([1.0,1.0,0.0],[0.01,0.01],\\step).ar(0, Impulse.ar(1 )) ;\n b = FreeVerb.ar(b, 0.5, 0.4)*2.5;\n\n c = SinOsc.ar(40) * Env.perc(0.01,0.2).ar(0, TDuty.ar(Dseq([1/4,1/2,1/8,1/8],inf)));\n 5.do{ c = (c.distort + c)*0.75};\n c = c * 1.5;\n\n d = LPF.ar(Saw.ar([20,47]).sum , XLine.ar(4000,200,0.5)) * Env.perc.ar(0, Impulse.ar(1/16)) * 0.5;\n d = (GVerb.ar( d , roomsize:10, revtime:6) * 200).clip(-1.0,1.0) * 0.3;\n\n n = 12;\n e = ( Saw.ar( 40*(1..n) * ({ LFNoise1.ar(0.1).range(1,1.01) } ! n) ) *\n ({ LFNoise1.ar(0.1).range(0.0,1.0) }!n)).sum * 10;\n e = CombC.ar(e, 0.1, 0.1, 4) + e;\n e = e.tanh * 0.3 * SinOsc.ar(0.05).range(0.5,1.0);\n e = e.dup;\n e = e * SinOsc.ar(0.03).range(0.2,1.0) * 0.5;\n\n f = Blip.ar(100) * Blip.ar(100) * Env([0.0,0.0,1.0],[8,8],[\\step,\\linear,\\step])\n .ar(0, Impulse.ar(1/16)) * 2 ;\n\n out = ((a + b + c + f) ! 2) + d + e;\n out = out * 0.2\n\n}.play\n)\n```"}], "family": "H", "source_id": "sccode:1-4TP", "aug": "prologue:intent", "prompt_tokens": 68, "answer_tokens": 650} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Just a dirty FM bass shuffling. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\nfork{\n SynthDef(\\basicFM, {|out = 0, gate = 1, amp = 1, carFreq = 1000, modFreq = 100, modAmount = 2000, clipAmount = 0.1|\n var modEnv = EnvGen.ar(Env.adsr(0.5, 0.5, 0.7, 0.1, peakLevel: modAmount), gate);\n var mod = SinOsc.ar(modFreq) * modEnv;\n var car = SinOsc.ar(carFreq + mod);\n var ampEnv = EnvGen.ar(Env.adsr(0.1, 0.3, 0.7, 0.2, peakLevel: amp), gate, doneAction: 2);\n var clip = clipAmount * 500;\n Out.ar(out, (car * ampEnv * clip).clip(-0.7, 0.7) * 0.1);\n }).add;\n\n s.sync;\n\n Pbind(*[\n instrument: \\basicFM,\n out: [0, 1],\n dur: Pseq([1/7, 1/3] / 1.2, inf),\n sustain: Pkey(\\dur),\n amp: 1/4,\n carFreq: Pseq([1, 1, 1, 2] * 350, inf),\n modFreq: Pkey(\\carFreq) * (1/8),\n modAmount: Pseq([2, 1, 0.5, 2, 1, 0.5, 2, 1, 2, 1, 0.5, 2, 1, 0.5, 2, 4] * 500, inf),\n clipAmount: Pseq([Pn(0.1, 32), Pn(1, 32)], inf)\n ]).play;\n}\n)\n```"}], "family": "H", "source_id": "sccode:1-4Tq", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 515} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Play your (short) soundfiles with some delay that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// By Bjørn Houdorf March 2013, Play your (short) soundfiles with some delay.\n\nb = SoundFile.collectIntoBuffers(\"yourSoundFileFolder/*\"); // 1. rund this\n\n( // 2. and then run this\nt = Task({\n({\n var num= b.size.rand;\n var buf= b[num];\n 0.1*Splay.ar(PlayBuf.ar(buf.numChannels, buf, 1, 1, 0, 0));\n}.play;\n) \n});\n);\n\n\n( // 3. Then run this\nz = Task({\nloop({\n t.start;\n 0.1.wait;\n});\n});\n);\n\n\nz.start; // 4. and run this\nz.stop; // 5. and finally run this\n```"}], "family": "H", "source_id": "sccode:1-4T9", "aug": "prologue:intent", "prompt_tokens": 64, "answer_tokens": 255} {"conversations": [{"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)})/2)!2};{q.(60,300)}.play //saw from sine #supercollider\n\n//Change the values passed to q to control the frequency and how many sines are used.\n```"}], "family": "H", "source_id": "sccode:1-4SW", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 132} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for little homage to \"Come Out\" by Steve Reich: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n/* A little homage to \"Come Out\" by Steve Reich.\n It explores ryhtmic aspects created by phasing, retriggering, and pitch shifting.\n It \"detours\" the original audio message available here\n http://www.freesound.org/people/ERH/sounds/34667/\n in which a police patrol recites\n \"We don't want to scare your children, that's the last thing we wanna do\".\n \n */\n\n\ns.options.memSize=128*1024;\ns.boot;\n\n~bus=Bus.audio(s,2);\n~buf=Buffer.readChannel(s,\"/home/***/Supercollider/sounds/v.wav\");\n\n(\nSynthDef(\\playbuff,{arg in=0,out=0,t_trig=0;\n var i=EnvGen.kr(Env([0,40,0.3,0.4,40,0],[0,60,20,20,30]),gate:1);\n var r=EnvGen.kr(Env([0,10,-0.9,-0.9],[40,20,15]),gate:t_trig,doneAction:2);\n var sig1=PlayBuf.ar(1,in,rate:1+r,trigger:Impulse.kr(i),loop:1);\n var sig2=PlayBuf.ar(1,in,rate:1+r,trigger:Impulse.kr(i+0.01),loop:1);\nOut.ar(out,Splay.ar([sig1,sig2],0.5));\n};\n).add;\n\nSynthDef(\\rev,{arg in=0,out=0;\n var sig=In.ar(in,2);\n sig=Compander.ar(sig,sig,0.8,1/3);\n sig=FreeVerb.ar(sig,mix:0.4);\nOut.ar(out,sig);\n};\n).add;\n);\n\nSynth(\\rev,[\\in:~bus]);\n\nfork{\nx=Synth(\\playbuff,[\\out:~bus]);\n75.wait;\nx.set(\\t_trig,1);\n};\n\ns.quit;\n```"}], "family": "H", "source_id": "sccode:1-4S8", "aug": "prologue:intent", "prompt_tokens": 62, "answer_tokens": 693} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for little experiment with periodicity: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n/* An little experiment with periodicity. \n Maybe there can be some sync artifact...\n */\n\ns.boot;\n\nSynthDef(\\mallet,{arg in=0,out=0,f=0,f2=0,a=0.1,r=1.8;\n\n var sig=Array.fill(3,{|n| SinOsc.ar(f*(n+1),mul:a/(n*n+1))}).sum;\n var env=EnvGen.kr(Env.perc(0.001,r),gate:Impulse.kr(f2),doneAction:0);\n\nOut.ar(out,sig*env!2);\n};\n).add;\n\n~root=60;\n~degrees=[0,4,5,7,9,12,16,17,19,21].scramble;\n~num=10;\n~coeff=0.75;\n\nArray.fill(~num,{|n| Synth.new(\\mallet,[\\f:(~root +~degrees[n]).midicps,\\a:0.2/~num,\\f2:(1+(n*~coeff))*0.1])});\n\ns.quit;\n```"}], "family": "H", "source_id": "sccode:1-4S3", "aug": "prologue:intent", "prompt_tokens": 53, "answer_tokens": 364} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Swarm of sound files. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nb = SoundFile.collectIntoBuffers(\"yourSoundFileFolder/*\"); // By Bjørn Houdorf, December 21, 2012\n\n(\n{\nvar number = b.numChannels, randomNumber, trigger, delayed, panned, sound, mixedSound, rotatedSound;\ntrigger = Dust.kr(Array.fill(number,1), 1, -0.5); // Generates random impulses from -0.5 to 0.5. as a excitation function\nrandomNumber = TRand.kr(1, number, trigger);\nsound = PlayBuf.ar(Array.fill(number,1) ,randomNumber,1,trigger,0,0); // play sound files\ndelayed = DelayL.ar(sound, trigger, trigger); // delaying the sound files\npanned = Pan2.ar(delayed, Array.fill(number,{1.0.rand2})); // pan them out in the stereo field\nmixedSound = 0.05*Mix.new(panned);// and mix them to one stereo signal\nrotatedSound = Rotate2.ar(mixedSound[0], mixedSound[1], LFSaw.kr(0.05)); // rotate stereo signal\n}.play; // play it all\n)\n```"}], "family": "H", "source_id": "sccode:1-4RX", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 404} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Ppar two intrument cumbia base that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\bass, { | atk = 0.01, dur = 0.15, freq = 50, amp=0.8 |\n var env, osc;\n env = EnvGen.kr( Env.perc( atk, dur-atk, amp, 6 ), doneAction: 2 );\n osc = BPF.ar(LFSaw.ar(freq), freq, 2, mul: env) ! 2;\n Out.ar([0,1],osc);\n}).add;\n);\n\n(\nSynthDef('wiro', { | amp = 0.1 |\n var osc, env, noise, out;\n noise = LPF.ar(WhiteNoise.ar(1),6000);\n osc = HPF.ar(noise,2000);\n //env = Line.ar(1, 0, 0.1);\n env = EnvGen.kr(Env.perc(0.01,0.05), doneAction: 2);\n out = (osc * env);\n Out.ar([0,1],out*amp)\n}).add;\n);\n\n(\nPpar([\n Pbind(\n \\instrument, \\bass,\n \\degree, Pseq([ Pseq([Pn(Pshuf([0,2,4],1),2),Pn(Pshuf([3,5,7],1),2)],2),Pn(Pshuf([-3,-1,1],1),2) ],inf),\n \\dur, Pseq([0.25,0.5,0.25],inf),\n \\legato, Pseq([ Pgeom(0.05, 0.05, 40), Pgeom(2.05, -0.05, 40) ], inf),\n \\octave, 3,\n \\amp, 0.03\n ),\n\n Pbind(\n \\instrument, \\wiro,\n \\dur, Pseq([0.5,0.25,0.25], inf),\n \\legato, Pseq([ Pgeom(0.05, 0.05, 40), Pgeom(2.05, -0.05, 40) ], inf),\n \\amp, 0.05,\n )\n]).play\n)\n```"}], "family": "H", "source_id": "sccode:1-4RW", "aug": "prologue:intent", "prompt_tokens": 58, "answer_tokens": 629} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for batuhan's buzzer parametrized that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// A beautiful sc140 tweet by Batuhan Bozkurt, parametrized for real-time changes\n(\n// Start sound here\na = { | rateL = 5, rateR = 6, blipMul = 100, blipAdd = 50, fMul = 50, kMul = 1 |\n f = LocalIn.ar(2).tanh;\n k = Latch.kr(f[0].abs,Impulse.kr(1/4)) * kMul;\n LocalOut.ar(\n f +\n CombC.ar(Blip.ar([rateL, rateR], blipMul * k + blipAdd, 0.9), 1, k*0.3, fMul * f));f\n}.play\n);\n\n// Set parameters for changing sound here: \n\na.set(\\rateL, 10);\n\na.set(\\rateR, 8);\n\na.set(\\blipMul, 25);\n\na.set(\\blipAdd, 70);\n\na.set(\\fMul, 30);\n\n\na.set(\\kMul, 0.01);\n```"}], "family": "H", "source_id": "sccode:1-4RP", "aug": "prologue:intent", "prompt_tokens": 64, "answer_tokens": 318} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for seasonal reflections ) that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n(\nfork { loop { \n Ndef(\\winter_curves, {\n var bands = 5.rrand(15) * 2;\n var freqs = Array.exprand(bands.debug('bands'), 20, 18000);\n Pan2.ar(\n SinOsc.ar(\n freqs, \n Array.rand(bands, 0, pi),\n AmpCompA.kr(freqs, freqs.sort.first)\n ).perform(0.5.coin.if(\\tanh,\\value).debug('kind')),\n FSinOsc.kr(\n Array.exprand(bands, 0.01, 15),\n Array.rand(bands, 0, pi),\n ),\n bands.reciprocal\n * LFGauss.kr(SinOsc.kr(Array.rand(bands, 0.05, 0.1)).range(1,10), 0.3)\n * FSinOsc.kr(\n Array.exprand(bands, 0.1, 15),\n 0.3\n ).range(0,1)\n ).sum\n * SelectX.kr(\n FSinOsc.kr(Array.exprand(bands, 0.1, 15)).range(0,1),\n [\n EnvGen.kr(\n Env.perc(\n FSinOsc.kr(1/16).range(0.01,0.1),\n FSinOsc.kr(1/8).range(0.25,0.3)\n ).blend(\n Env.sine( // 1/4\n FSinOsc.kr(Array.exprand(bands, 0.1, 15)).range(0.05,2)\n ).blend(\n Env.sine(1/4),\n FSinOsc.kr(Array.exprand(bands, 0.1, 15)).range(0.05,2).mean\n ),\n FSinOsc.kr(Array.exprand(bands, 0.1, 15)).range(0,1)\n ).circle,\n 1, 0.8, \n FSinOsc.kr(freqs.linlin(20,18000,0.1,20)).range(0, 0.2).mean\n ),\n 1\n ]\n ).clump(2).mean\n }).fadeTime_(0.5.rrand(2.5)).play;\n 8.rrand(30).debug('len').wait;\n} }\n)\n```"}], "family": "H", "source_id": "sccode:1-4RM", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 750} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for nothing much ). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{|atk=0.05,dur=10,freq=50,amp=0.8|\n PMOsc.ar(\n Line.kr(1,2,dur,freq),\n LFNoise2.kr([1,2]).range(1,2)*freq,\n LFNoise2.kr([2,1]).range(0.1,3.5),\n 0,\n Decay2.ar(\n Impulse.ar(XLine.kr(1, 25, dur)) * SinOsc.ar(4/dur,[0,pi/2],0.05,1),\n 0.023, XLine.ar(1,35,dur).reciprocal,\n Line.ar(1,0.8,dur) * LFNoise2.kr(4/dur,0.05,1).dup\n ) * EnvGen.ar(Env([0,1,1,0],[atk,dur-atk,0.3]),1,amp, doneAction:2)\n )\n // * LFPulse.ar(XLine.kr(5,20,dur,freq * LFNoise2.kr([1,2]).range(0.95,1.05)))\n}.play(args:[\n freq:50.rrand(350).debug('freq'),\n dur:10.rrand(20).debug('dur')\n])\n)\n```"}], "family": "H", "source_id": "sccode:1-4RB", "aug": "prologue:intent", "prompt_tokens": 47, "answer_tokens": 414} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for More afternoon fun. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// this was going to be drum and bass but I got carried away\n\n(\nfork{\n // this is going to be a convoluted step seq\n var i = 0;\n \n loop{ \n var tempo, step;\n tempo = [\n (3,5..21).reciprocal.choose,\n 1/11,\n 1/7,\n 1/5,\n 1\n ].wchoose([0.1,17,0.4,0.3,0.25].normalizeSum);\n \n i = i + 1;\n step = i % 16;\n \n play{\n // not sure I used all of these.\n var scale, bdm, hh, sd, bd, bda, sda, hha, bdseq, sdseq, hhseq, reva, revb, rev,\n mix;\n \n scale = Scale.harmonicMinor.degrees+26;\n \n // bd sequence\n bdseq =[ {2.rand}.dup(16), \n [1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]\n ].choose;\n \n // bd amp env\n bda = EnvGen.kr(Env.perc(0.01,tempo*6.0.rand,bdseq[step]), doneAction: 2);\n \n // bass freq modulation\n bdm = {LFNoise2.kr(tempo.rand,0.25,1)}.dup;\n \n // bd\n bd = LPF.ar(Pulse.ar(scale.choose.midicps,0.5).distort*bdm,1e4.rand).sum * bda; \n bd = bd.tanh;\n 5.do{bd = CombC.ar(bd, 0.5, 0.1.rand, 5.0.rand)+bd};\n 5.do{bd = AllpassC.ar(bd, 0.5, 0.1.rand, 5.0.rand)+bd};\n \n // sd seq\n sdseq = [ [0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0], \n {2.rand}.dup(16) \n ].choose;\n \n // sd amp env\n sda = EnvGen.kr(Env.perc(0.01,0.1,sdseq[step]));\n\n // sd\n sd = PinkNoise.ar(2).distort * sda.lag(0.1.rand);\n 5.do{sd = AllpassC.ar(sd, 0.5, [0.25.rand,0.05.rand].choose, 1.5.rand)+sd};\n \n // hh seq\n hhseq = [{2.rand}.dup(16),\n [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]\n ].choose;\n \n // hh amp env\n hha = EnvGen.kr(Env.perc(0.01,0.01,hhseq[step]));\n\n // hh\n hh = HPF.ar(WhiteNoise.ar(0.7),8000) * hha;\n \n // drums together\n mix = bd + sd + hh;\n \n // rev\n reva = GVerb.ar(mix,1.0.rand.max(0.1),1.0.rand).sum;\n revb = GVerb.ar(mix,1.0.rand.max(1),3.0.rand).sum;\n rev = XFade2.ar(reva,revb,LFNoise0.kr(tempo));\n \n // pannnn\n mix = PanAz.ar(5,rev,LFNoise0.kr(tempo*2));\n mix = Limiter.ar(mix);\n \n // raussssss\n Out.ar(0,mix.clip);\n };\n tempo.wait;\n }; \n}\n)\n```"}], "family": "H", "source_id": "sccode:1-4QP", "aug": "prologue:intent", "prompt_tokens": 52, "answer_tokens": 1191} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Granular electromaton. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\nServer.local.waitForBoot({\n(\nz.free;\nz = Buffer.alloc(s, 512, 1);\nz.sine1(1.0 / [1, 2, 3, 4], true, true, true);\n\n fork( { loop {\n SynthDef(\"g1\",{ arg out=0,bufnum=0,dur=1,rate=1,pos=0,sdens=1,edens=1;\n var dens = Line.kr(sdens,edens,dur);\n var trig = [LFNoise0,SinOsc,Impulse,LFPulse,LFSaw].choose.ar(Line.kr(sdens,edens,dur));\n //var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*0.5.rrand(2)),doneAction:2);\n var env = EnvGen.kr(Env.perc(0.0001.rrand(0.1),dur*(0.5.rrand(4))),doneAction:2);\n Out.ar(out,\n GrainBuf.ar(2,trig,1/dens,bufnum,rate,pos)*env;\n )\n }).add();\n [1,2,4,8,16,32].choose.postln.wait;\n }\n }\n );\n\n\na = Pbind(\\instrument,\\g1,\\dur,Pseq([Pseq([0.25],32),Pseq([0.25,0.125,0.125],32),Pseq([0.125],32)],inf),\\sdens,Pseq([9000,1000,500]/10,inf),\\edens,Prand([Pseq([9000,1000,500]/10,4),Pseq([1],1)],inf),\\rate,Pfunc({-10.0.rrand(10)}),\\pos,Pfunc({1.0.rand}),\\bufnum,z.bufnum);\nb = Pbind(\\instrument,\\g1,\\dur,Pseq([4],inf),\\sdens,Pseq([9000,1000,500]/100,inf),\\edens,Prand([Pseq([9000,1000,500]/10,1),Pseq([1],3)],inf),\\rate,Pfunc({-10.0.rrand(10)}),\\pos,Pfunc({-10.0.rrand(10)}),\\bufnum,z.bufnum);\nc = Pbind(\\instrument,\\g1,\\dur,Pseq([4/3],inf),\\sdens,Pseq([9000,1000,500,25],inf),\\edens,Prand([Pseq([9000,1000,500,25],1),Pseq([1],4)],inf),\\rate,Pfunc({-100.0.rrand(100)}),\\pos,Pfunc({-10.0.rrand(10)}),\\bufnum,z.bufnum);\n\n\na =a.play;\nb =b.play;\nc =c.play;\n\n)\n});\n)\n```"}], "family": "H", "source_id": "sccode:1-4QN", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 942} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for rough sketch of chicago minor chord pad thing. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\ChicagoPad, { |out = 0, freq = 440, cutoff = 500, amp = 0.2|\n var snd;\n freq = freq + SinOsc.kr(0.1, 0, 1, 20);\n snd = Saw.ar([freq, freq+1, freq-1, freq*3/2, freq*6/5])*0.1;\n snd = snd + VarSaw.ar(0.99*[freq, freq+1, freq-1,freq*3/2, freq*6/5],0, LFTri.kr(0.3).range(0.25,0.9))*0.1;\n snd = Mix(snd);\n snd = RLPF.ar(snd, SinOsc.kr(0.1, 0, 100, 5000), 0.1);\n snd = GVerb.ar(snd ,40, 10, 0.6, 0.6, -3, -9, -11)*0.2;\n \n //snd = RLPF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 0.2);\n snd = MoogFF.ar(snd, SinOsc.kr(0.08, 0.5, cutoff/10, cutoff), 3, 0);\n snd = DelayC.ar(snd, 1.5, 1,0.8);\n //snd = snd * EnvGen.ar(Env.linen(0.001, 0.01,0.01,1), doneAction:2);\n Out.ar(out, [snd, AllpassC.ar(snd, 0.5, 0.05, 0.3)]*amp);\n}).send;\n```"}], "family": "H", "source_id": "sccode:1-4QJ", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 506} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for tired pads that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// this is what I write when I didn't sleep last night.. zzzzzz\n// easy subsynth with dynklank and simple scale\n\n(\n\nfork{ \n loop{\n var time;\n time = 5.rand;\n {\n var sound, freqs, envs, rings, numvoices, env;\n numvoices = 40;\n freqs = {(Scale.major(\\just).degrees+26+\n (0,12..110).choose).choose}.dup(numvoices).midicps;\n rings = {1.0.rand}.dup(numvoices);\n envs = { EnvGen.kr(Env.linen( time/3.0.rand, \n time/3.0.rand, time/3.0.rand, 1.0.rand ) ) }.dup(numvoices);\n \n sound = PinkNoise.ar(numvoices.reciprocal!2);\n sound = DynKlank.ar(`[freqs,envs,rings], sound );\n sound = sound * EnvGen.kr(Env.linen(time.rand,time/3,time.rand),doneAction:2);\n \n sound = HPF.ar(sound, 120);\n \n 4.do{sound = DelayC.ar(sound, 0.4, [0.4.rand,0.4.rand], 1/8, sound) };\n \n //good call - lets turn this down \n sound*0.2;\n }.play;\n time.rand.wait;\n }\n}\n)\n```"}], "family": "H", "source_id": "sccode:1-4Qz", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 470} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Simple animated 2D user interface. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// needs shared memory interface (SC 3.5+)\n\nServer.default = s = Server.local;\ns.waitForBoot{\n if (s.hasShmInterface) {\n w = Window().front;\n u = UserView(w, w.view.bounds);\n f = { |x, y|\n var size = 20 + (y/4);\n k = k.center_(Point(x, y));\n k = k.size_(Size(size, size));\n b.setSynchronous(x.linlin(0,u.bounds.width, 1/4, 16));\n c.setSynchronous(50*(y/4));\n };\n w.onClose = { Ndef(\\sound).end(1) };\n u.background = Color.blue(0.5);\n u.animate = true;\n k = Rect(100, 100, 50, 50);\n u.drawFunc = {\n var osc = Ndef(\\osc).bus.getSynchronous * 0.5 + 0.5;\n Pen.strokeColor = Color.blue;\n Pen.addOval(k);\n Pen.fillRadialGradient(\n k.center,\n k.center,\n k.width/8,\n k.width,\n Color(1,1,1,0),\n Color(1,0,0,osc)\n );\n };\n \n u.mouseMoveAction = { |u, x, y| f.(x, y) }; \n u.mouseDownAction = { |u, x, y| f.(x, y) }; \n \n b = Bus.control(s);\n c = Bus.control(s);\n b.setSynchronous(4);\n c.setSynchronous(500);\n \n Ndef(\\osc, { SinOsc.kr(b.kr) });\n Ndef(\\sound).fadeTime = 1;\n Ndef(\\sound, { MoogFF.ar(LFSaw.ar(50+[0,1]), Ndef(\\osc).kr.linexp(-1,1,50,c.kr)) }).play;\n } {\n \"get SC 3.5 or higher ;)\".warn;\n };\n};\n```"}], "family": "H", "source_id": "sccode:1-4Qf", "aug": "prologue:intent", "prompt_tokens": 53, "answer_tokens": 666} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for danger loud click. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// proceed with caution. start at min volume, and not with your expensive speakers.\n\nfork{b=Buffer.alloc(s,512,1);inf.do{b.cheby({[1,0].choose}!2);{(Shaper.ar(b,SinOsc.ar(55,0,Line.kr(1,0,2,1,0,2))))!2}.play;0.1.wait;}};\n```"}], "family": "H", "source_id": "sccode:1-4Qc", "aug": "prologue:intent", "prompt_tokens": 49, "answer_tokens": 142} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for exploring of morphing cycled envelopes (i.e: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\ro_v19, {\n var freq = 40.rrand(90).debug('base freq');\n var seed = thisThread.randSeed = 1000000000.rand.debug('seed');\n var gen = [LFNoise2,LFNoise0,SinOsc,LFPulse,LFSaw];\n var sig = Splay.ar({\n var i = 4.exprand(40).asInteger;\n Median.ar(\n 3.exprand(18),\n EnvGen.ar(\n Env( // wave form\n [0] ++ Array.fill(i-1, { \n gen.choose.kr(\n 0.25.coin.if({ gen.choose.kr(0.01.exprand(0.1)).exprange(0.1,1) }, { 0.1.exprand(1) }), \n mul: 0.25.coin.if({ gen.choose.kr(0.05.exprand(10)).range(0.1,1) }, { 0.1.rrand(1) })\n )\n }) ++ [0],\n Array.rand(i-1, 0.1,1.0).normalizeSum,\n [[-5.0.rrand(5),\\sin].choose] ++ Array.fill(i-2, {\n [\\sin ! 1.rrand(6), -5.0.rrand(5) ! 1.rrand(4)].flat.choose\n }) ++ [[-5.0.rrand(5),\\sin].choose]\n ).circle,\n timeScale: Duty.kr( // freq\n Drand([4,8,16,24], inf), 0,\n Dwrand([1,2,4,8,16,32,64]*freq, ((14..7) ** 1.rrand(3)).normalizeSum, inf) // octave\n * 0.75.coin.if({ Duty.kr( // note\n [Dxrand, Drand].choose.new([0.125,0.25,0.5,1,2,4,6,8,12], inf), 0,\n Dshuf({ (0..11).choose.midiratio } ! 1.exprand(8), inf)\n ) }, { (0..11).choose.midiratio })\n ).reciprocal\n )\n ) * EnvGen.kr( // rhythm\n Env.perc(\n 0.01.exprand(0.4) * 0.25.coin.if({ Duty.kr( // atk\n Drand([0.5,1,2,4,8,12,16], inf), 0,\n Dshuf({ [1,2,3,4].choose } ! 1.exprand(8), inf)\n ) }, { 1 }),\n 0.1.exprand(4) * 0.75.coin.if({ Duty.kr( // release\n Drand([0.5,1,2,4,8,12,16], inf), 0,\n Dshuf({ [1,2,4,8,16].choose.reciprocal } ! 1.exprand(8), inf)\n ) }, { 1 }),\n LFNoise2.kr(0.1.exprand(10)).range(0.05,1), // appearance\n LFNoise2.kr(0.1.exprand(10)).range(-4,4),\n ).circle\n );\n } ! 3.rrand(9).debug('source'));\n BHiShelf.ar(\n GVerb.ar(\n Rotate2.ar(sig[0], sig[1], Duty.kr(Drand([2,4,8],inf), 0, Drand([-1,1,0],inf)) * LFSaw.kr(0.1.exprand(1))),\n 40.rrand(150).debug('room')\n ),\n LFNoise2.kr(0.1.exprand(0.5)).range(4000,6500),\n LFNoise2.kr(0.1.exprand(1)).range(1,3),\n LFNoise2.kr(0.1.exprand(1)).range(-24,-16)\n );\n}).play\n)\n```"}], "family": "H", "source_id": "sccode:1-4Q8", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 1252} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Kepler 22-b atmosphere. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nfork { \n Ndef(\\ttwnd).play;//(d,2,addAction:\\addToHead);\n loop {\n var seed = thisThread.randSeed = 100000000.rand.debug('seed');\n Ndef(\\ttwnd, {\n var freq = [20, 7500];\n Splay.ar(\n { \n var bands = 2.rrand(10);\n var sig = { [BPF,RLPF,RHPF].choose.ar(\n LFNoise2.ar(freq[0].rrand(freq[1]), LFNoise2.kr(0.1.exprand(10))),\n Array.rand(bands, freq[0], freq[1]),\n Array.rand(bands, 0.2, 1.8)\n ).mean } ! 2;\n Rotate2.ar(sig[0], sig[1], LFSaw.kr(0.1.exprand(10)));\n } ! 4.rrand(6).debug('source'),\n 0.5.rrand(1)\n );\n }).fadeTime_(1.rrand(4.0));\n 10.0.rrand(40).debug('wait(bts)').wait;\n }\n}\n)\n```"}], "family": "H", "source_id": "sccode:1-4mJ", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 386} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for seeking an Array!: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(// * //watch the postWindow\na=[\"m\",\"x\",\"f\",\"k\",\"d\",\"p\"];\nx=Array;\ny=x.newClear(6);\n~mxfkdp=Task({\n inf.do({y.put(x.series(6,0,1).choose,a.scramble).postln;\n 0.03.wait;})}).play;\nm=fork({inf.do({\n \"array num:\".postcln;\n if(y[x.series(6,0,1).choose.postcln]==a,\n {\"lo encontraste!/found it!\".postcln;\n 1.do({GVerb.ar(\n EnvGen.ar(Env.perc(0.01,8),1,doneAction:2)*\n Blip.ar(XLine.kr(440,1600,8)),50,10,0.02)}.play);\n ~mxfkdp.stop;\n m.stop;}, \n {\"buscando.../seeking...\".postcln;});\n 0.03.wait})});\n);\n//.SCtweetLong\n```"}], "family": "H", "source_id": "sccode:1-2v2", "aug": "prologue:intent", "prompt_tokens": 49, "answer_tokens": 362} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Re: Dark sea horns: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\n Ndef(\\x, {\n var output;\n var delayTime;\n var delayMax = 0.2;\n var delayAdd = 0.1;\n var pulseFreq = 0.5;\n var proxyMul = 2;\n var pulseMin = 40;\n var pulseMax = 130;\n var numOfEchos = 2;\n\n var mainPulse = LFPulse.ar(pulseFreq, 0, 0.5).range(pulseMin, pulseMax);\n var proxy = Ndef(\\x).ar * proxyMul;\n var ampModFreq = SinOsc.ar(0.01, 0).range(0.3, 30);\n var ampMod = LFNoise1.ar(ampModFreq, 6);\n output = SinOsc.ar(mainPulse + proxy, 0, ampMod).tanh;\n numOfEchos.do{\n delayTime = {delayMax.rand + delayAdd}!2;\n output = AllpassL.ar(output, 0.1, delayTime, 5);\n };\n output.tanh;\n }).play\n)\n```"}], "family": "H", "source_id": "sccode:1-29p", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 345} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for alone in the storm (a SuperCollider snippet). Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nNdef(\\alone, { arg amp=0.5;\n var source, local, lfo;\n\n lfo = LFNoise1.kr(0.32).abs*50+[70,0.01];\n source = Decay.ar(Impulse.ar(lfo), 0.1) * WhiteNoise.ar(0.2);\n source = source * [LFNoise1.ar(0.17,0.4,1.1), LFNoise1.ar(0.57,1,1)];\n source = source;\n\n local = LocalIn.ar(2) + source;\n\n local = LPF.ar(local, 400 + LFNoise1.kr(0.1,300,100)) * 1.5;\n local = HPF.ar(local, 100 + LFNoise1.kr(0.15,050,050)) * 1.0;\n local = DelayN.ar(local, 0.2, 0.1);\n\n local = Limiter.ar(local.reverse,0.5);\n LocalOut.ar(local * 0.6);\n local = [local, Decay.ar(Impulse.ar(LFNoise1.kr(2.12).exprange(2,400)), 0.2 + LFNoise1.kr(0.11,0.1)) * local];\n local = FreqShift.ar(local, LFNoise1.kr(LFNoise1.kr(0.21).exprange(0.1,5)).exprange(0.1,500));\n local = HPF.ar(local, LFNoise1.kr(0.4).range(50,170), LFNoise1.kr(0.1).range(0.1,0.7));\n\n Splay.ar(local, LFNoise1.kr(0.21).range(0,1)) * amp;\n}).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-1WS", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 544} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Just experimenting with patterns that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n/* Some Funky Klangs - Totally botched the math on what I was trying to do but it sounds better this way */\n\n( \nSynthDef(\\DistKlangBlip, { \n | out = 0, release = 1, freq1 = 1, freq2 = 5, freq3 = 8, freqMult = 4 | \n var env = Linen.kr(Impulse.kr(0), 0.01, 1, release, doneAction:2); \n var freqs = ([freq1, freq2, freq3] * freqMult).midicps; \n var klang = Klang.ar(`[freqs, nil, nil ], 1, 0); \n Out.ar(out, klang.tanh!2 * env * 0.5) \n}).add\n\n);\n\n( \n Pbind(*[ \n instrument: \\DistKlangBlip, \n dur: Pxrand([0.25, 0.5], inf) * 0.5, \n release: Pkey(\\dur), \n freqMult: Pxrand((3..12), inf), \n freq2: Prand([4,5], inf), \n freq3: Prand([8,12], inf) \n]).play; \n)\n```"}], "family": "H", "source_id": "sccode:1-1Pw", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 393} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for poor man's panning: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n// poor man's panning\n{\n var f, hornbostelwertheimerkonstante;\n f = MouseY.kr(1, 100, 1);\n hornbostelwertheimerkonstante = 0.00063;\n Impulse.ar(f, hornbostelwertheimerkonstante * f * [1, MouseX.kr(0, 2)], 0.1) \n}.play\n```"}], "family": "H", "source_id": "sccode:1-1h", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 132} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Beam me up scotty. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n{\nvar time = 8;\nvar freq = (40-12).midicps;\nvar a = VarSaw.ar(freq/2, width: XLine.ar(0.5,1,time)).range(0,XLine.ar(1,1/1000,time));\nvar tone = SinOsc.ar(freq).fold(-1*a,a);\nOut.ar(0, tone.dup);\n}.play;\n```"}], "family": "H", "source_id": "sccode:1-K", "aug": "prologue:intent", "prompt_tokens": 49, "answer_tokens": 137} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for old school noise from needle on vinyl. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n{\n var sig, sig1, sig2, lpf, popHz, lagtime, noise, popHzMul,\n pan1, pan2, panmod1, panmod2;\n popHzMul = Decay.kr(Dust.kr(0.15), 3, 10, 0.8);\n popHz = LFNoise1.kr(20).exprange(0.1,10) * popHzMul;\n sig = Dust2.ar(popHz);\n lpf = LFNoise1.kr(10).exprange(1000,20000);\n lagtime = LFNoise1.kr(20).range(0.008,0.0001);\n sig = LPF.ar(sig, lpf);\n sig = Lag.ar(sig, lagtime);\n sig = sig + FreeVerb.ar(sig, 0.8, 1, mul:0.11);\n panmod1 = LFNoise1.kr(5).range(0.2,0.7);\n panmod2 = LFNoise1.kr(5).range(0.2,0.7);\n pan1 = SinOsc.kr(panmod1).range(-0.2,0.2);\n pan2 = SinOsc.kr(panmod2).range(-0.2,0.2);\n sig1 = Pan2.ar(sig, pan1, 0.5);\n sig2 = Pan2.ar(sig, pan2, 0.5);\n sig = sig1 + sig2;\n sig = sig + BPF.ar(BrownNoise.ar([0.0025,0.0025]), 7200, 0.4);\n sig = sig + HPF.ar(Crackle.ar([1.999,1.999], 0.0025),2000);\n Out.ar(0, sig*6);\n}.play\n```"}], "family": "H", "source_id": "sccode:1-H", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 532} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for get different result each time running the pattern: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nTempoClock.default.tempo = 156/60;\n\n(\nSynthDef(\\spring, { |freq = 400, out = 0, pan = 0, gate = 1, dur = 0.15, curve = -4, amp = 1, index = 1|\n var sig = FreeVerb.ar(Pan2.ar(Blip.ar(freq, index), pan));\n var env = EnvGen.ar(Env.perc(0.01, dur, amp, curve), gate, doneAction:2);\n Out.ar(0, sig * env);\n}).add;\n);\n\n(\nPbind(*[\n instrument: \\spring,\n dur: Pseq([4, 1, 2, 1, 1, 1].scramble/ 4 / TempoClock.default.tempo, inf),\n degree: Pseq(#[1,2,3,4], inf) * Pkey(\\dur).reciprocal,\n octave: Pseq([2,3,4,4,4,3].scramble, inf),\n pan: Pxrand(Array.fill(100, { 0.gaussian(1).clip2(1) }), inf),\n amp: Pseq(#[0.95,1,0.8],inf),\n index: Pstutter(Pseq(#[4,8,12],inf), Pseq([2,3,4,5,6,8].scramble, inf))\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-C", "aug": "prologue:intent", "prompt_tokens": 52, "answer_tokens": 438} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for adventure in hi-fi cosmic stereo sound. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nplay{\n var taps, seconds, image, width, num, panmod;\n num = 4;\n seconds = 5;\n width = LFSaw.ar(seconds.reciprocal, iphase: 1).range(1, 0);\n panmod = LFNoise1.kr(seconds.reciprocal).range(-0.7, 0.7) * LFSaw.kr(seconds.reciprocal, iphase: 1).range(-1, 1).max(0);\n taps = Array.fill(num, {|i|\n var src, local, imp, pitches, done, pitcharray, dlymod;\n pitcharray = [30 + (i * 4), 33 + (i * 4)].midicps;\n pitches = Duty.ar(seconds, 0, Dseq(pitcharray, inf));\n src = Decay2.ar(Impulse.ar(seconds.reciprocal), 0.01, 1/3/(i+1)) * SinOscFB.ar(pitches, SinOsc.ar(3+i).range(0, 1));\n local = LocalIn.ar(2) + [0, src];\n local = DelayC.ar(local, 0.4, LFSaw.ar(seconds.reciprocal, iphase: 1).range(0.4 * (0.72**i), 0.05));\n LocalOut.ar(local.reverse * 0.8);\n done = local/4;\n }); \n image = taps.sum;\n image = [Pan2.ar(image[0], width.neg + panmod), Pan2.ar(image[1], width + panmod)].sum;\n image = GVerb.ar(image * (1.1 - width), 90, 7, 1) + image;\n Out.ar(0, image);\n}\n```"}], "family": "H", "source_id": "sccode:1-B", "aug": "prologue:intent", "prompt_tokens": 60, "answer_tokens": 548} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Feedback resonator. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n// Resonator, must subtract blockSize for correct tuning\n(\nSynthDef(\"testRes\", {\n \nvar freq = 300, localIn, input, limitLevel = 0.2, output;\nvar feedbackAmt = 0.999;\n\nfreq = MouseY.kr(20, 678, \\exponential).poll;\nfeedbackAmt = MouseX.kr(0.2, 0.99999).poll;\nlocalIn = LocalIn.ar(1); \ninput = LFNoise1.ar(freq * 16, 0.2);\ninput = input + Dust2.ar(freq);\n\n\nLocalOut.ar(\n HPF.ar(LPF.ar(DelayC.ar(input + (localIn * feedbackAmt), 2, freq.reciprocal - ControlRate.ir.reciprocal), freq * 8), freq * 0.125)\n);\n\noutput = Limiter.ar(localIn, limitLevel, 0.01) * limitLevel.reciprocal;\nOffsetOut.ar(0, output ! 2);\n\n}).play(s);\n\n)\n```"}], "family": "H", "source_id": "sccode:1-z", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 348} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Will nobody switch the damn thing off?: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\nvar dseq, trig;\n\ndseq = Dseq([SinOsc.ar(45).range(-5, 12), SinOsc.ar(SinOsc.ar(0.285).range(42, 48)).range(-9, 19), 9, 0, -12], inf);\ntrig = Impulse.ar(SinOsc.ar(0.2).range(44, 46));\nSinOsc.ar(\n (77 + Demand.ar(trig, 0, dseq)).midicps,\n 0,\n 0.5\n) ! 2\n\n\n}.play\n\n)\n```"}], "family": "H", "source_id": "sccode:1-x", "aug": "prologue:intent", "prompt_tokens": 60, "answer_tokens": 185} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Nested ifs in a SynthDef: bind everything it needs before it is used."}, {"role": "assistant", "content": "```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\nout ! 2\n\n}.play;\n)\n```"}], "family": "H", "source_id": "sccode:1-v", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 150} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Creaking door or roulette wheel?. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\n\nvar output, basePitch = 387, macroPitch, macroPitchAmt = 400;\nvar modOsc, modAmt = 1.3, amp = 0.8;\nvar creakRate, creakTrig, creakEnvGen, noise, combs, oscFreq;\n\nnoise = LFNoise1.ar(LFNoise0.kr(4.8).lag(0.4).range(3646, 7777), 0.6);\n\ncreakRate = EnvGen.kr(\n Env(\n [40, 25, 15, 2],\n [0.9, 0.6, 1.0],\n -4\n ),\n doneAction: 2\n\n);\ncreakTrig = Impulse.kr(creakRate);\n\ncreakEnvGen = EnvGen.kr(\n Env(\n [0.0, 1.0, 0.0],\n [0.02, 0.1],\n [5, -8]\n ),\n creakTrig,\n timeScale: SinOsc.kr(1.5).range(0.12, 0.26) * Line.kr(0.5, 2.3, 2)\n\n);\n\nmacroPitch = EnvGen.kr(\n Env(\n [0.0, 4, 0.1, 0.3, 0.4, 0.7, 0.9],\n [0.2, 0.2, 0.4, 0.3, 0.48, 0.59],\n [2, 2, -4, -3, -2, -4]\n )\n\n);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.17);\nmodOsc = SinOsc.ar( (basePitch + (macroPitch * macroPitchAmt)) * 0.232, modOsc * 0.3);\n\noscFreq = basePitch + (macroPitch * macroPitchAmt);\noscFreq = oscFreq * (1 + (creakEnvGen * 2));\noutput = SinOsc.ar(oscFreq, modOsc * modAmt, 1);\noutput = output * SinOsc.ar(SinOsc.kr(1.6).range(1220, 1355));\noutput = output + noise;\noutput = output.clip(-0.5, 0.5) * creakEnvGen * amp * TRand.kr(0.8, 1.0, creakTrig);\n\ncombs = Mix([CombC.ar(output, 0.2, 0.0084, 0.12), CombC.ar(output, 0.2, 0.00181, 0.03)]);\noutput = output + (combs * 0.2);\noutput ! 2\n}.play\n\n\n)\n```"}], "family": "H", "source_id": "sccode:1-s", "aug": "prologue:intent", "prompt_tokens": 56, "answer_tokens": 816} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for Time and relative dimensions in SC. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n\n{\nvar output, filtFreq, noise, noiseAmp, amp = 0.4, chain;\nvar tardRate = 0.4, combs;\n\nnoiseAmp = SinOsc.kr(0.38, 0.2).exprange(0.1, 1);\n\nnoise = BrownNoise.ar(noiseAmp);\n\nfiltFreq = SinOsc.kr(tardRate).range(400, 1800);\nnoise = RLPF.ar(noise, filtFreq, 0.7);\n\nchain = FFT(LocalBuf(256), noise);\nchain = PV_BinShift(chain, SinOsc.kr(tardRate * 0.986, 0.7).range(0.96, 1.052), SinOsc.kr(tardRate * 1.003, 0.61).range(-3, 2.1));\nchain = PV_BinScramble(chain, 0.05, 0.1, 1.0 ); \nnoise = IFFT(chain);\nnoise = noise.fold(-0.5, 0.5);\ncombs = Mix(\n [\n CombL.ar(noise, 0.1, SinOsc.kr(tardRate * 0.9966, 0.1).range(0.00032, 0.00028) * 3.4, 0.4, 0.06),\n CombL.ar(noise, 0.1, SinOsc.kr(tardRate * 0.99684, 0.1).range(0.000318, 0.000266) * 3.397, 0.4, 0.06)\n ]\n) * 1.2;\n\noutput = (noise + combs) * amp;\noutput = HPF.ar(output, 80);\noutput ! 2\n\n}.play\n\n)\n```"}], "family": "H", "source_id": "sccode:1-r", "aug": "prologue:intent", "prompt_tokens": 55, "answer_tokens": 544} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for Feedback with beats: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\nNdef(\\a, {\n var src, loc, delay=0.01;\n src = Decay2.ar(Impulse.ar(1/8), LFNoise2.kr(4).range(0.001, 0.0001),\n LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(4).exprange(40, 4000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise0.kr(1/4).range(100, 1200).lag, 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.501).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, delay * 2, delay * 1);\n LocalOut.ar(loc.reverse * 0.49);\n Out.ar(0, loc * 0.9)\n}).play;\n\nNdef(\\b, {\n var src, loc, del;\n del = 1/100;\n src = Decay2.ar(TDuty.ar(1/4,0,Dseq([1, 0.5, 0.3, 0.1],inf)), \n LFNoise2.kr(4).range(0.001, 0.0001), LFNoise2.kr(4).range(0.005, 0.05))!2\n * Saw.ar(LFNoise2.kr(200).exprange(40, 14000));\n loc = BPF.ar(LocalIn.ar(2) + [src, 0], LFNoise2.kr(0.1).range(40, 400), 3.2);\n loc = GVerb.ar(loc, 100, 4, mul:0.02, add:loc);\n loc = Compander.ar(loc, loc, 0.9, 1, 0.001);\n loc = (loc * 0.51).tanh;\n loc = Compander.ar(loc, loc, 0.1, 1, 0.1); \n loc = DelayC.ar(loc, del * 2, del * 1);\n LocalOut.ar(loc.reverse * 0.45);\n Out.ar(0, Compander.ar(loc,loc,0.1, 1, 0.05) * 1.2)\n}).play;\n\nNdef(\\c, {\n var src, loc, del=1/4;\n src = Decay2.ar(Impulse.ar(1), 0.0001, 0.05) * SinOsc.ar(60);\n loc = src + LocalIn.ar(2);\n loc = BPF.ar(loc, 800, 3.2).softclip;\n loc = DelayN.ar(loc, del, [0, del]);\n LocalOut.ar(loc.reverse * 0.99);\n Out.ar(0, loc * 2)\n}).play;\n```"}], "family": "H", "source_id": "sccode:1-i", "aug": "prologue:intent", "prompt_tokens": 51, "answer_tokens": 896} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch for Just going crazy with modulation. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"additivePad\", \n { arg numOfCycles = 100;\n var lfo;\n var lfo2;\n var lfo3;\n lfo = SinOsc.kr([Rand(0.5,1000),Rand(0.5,1000)], 1.5pi, 0.5, 0.5);\n lfo3 = SinOsc.kr([Rand(0.1,0.5),Rand(0.1,0.5)], 1.5pi, 0.5, 0.5);\n lfo2 = SinOsc.kr([(Rand(0.5,1000) * lfo) * lfo3, (Rand(0.5,1000) * (1 - lfo)) * (1 - lfo3)], 1.5pi, 0.5, 0.5);\n Out.ar(\n 0, \n Mix.arFill(\n numOfCycles,\n { \n SinOsc.ar(\n Rand(40,1000),\n 0, \n (numOfCycles.reciprocal * 0.75) * lfo2)\n }\n ) * EnvGen.kr(Env.perc(Rand(0.1,30), Rand(0.1,30)), doneAction: 2)\n )\n }\n).send(s); \n);\n\n(\nr = Routine({\n 200.do({\n x = Synth.new(\"additivePad\"); \n 10.wait;\n });\n});\n);\n\nr.play;\n```"}], "family": "H", "source_id": "sccode:1-c", "aug": "prologue:intent", "prompt_tokens": 54, "answer_tokens": 449} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch for some initial thoughts on psytrance bassline. Start by defining the values the patch depends on."}, {"role": "assistant", "content": "```supercollider\n(\n{ | dur = 0.15, atk = 0.005, amp = 1 |\n SinOsc.ar(\n EnvGen.ar( Env(\n NamedControl.kr(\\freq_l, [2960, 70, 90]),\n NamedControl.kr(\\freq_d, [0.07, 0.2]),\n NamedControl.kr(\\freq_c, [-13, -1]),\n ) ),\n mul:amp * EnvGen.ar(\n Env.perc( atk, dur - atk, curve: NamedControl.kr(\\amp_c, [-1, 6])),\n doneAction: 2\n ); \n ) ! 2;\n}.asSynthDef.name_(\"kick\").add;\n\n{ | atk = 0.01, dur = 0.15, freq = 50, amp=0.8 |\n BPF.ar(LFSaw.ar(freq), freq, 2, mul: EnvGen.kr( Env.perc( atk, dur-atk, amp, 6 ), doneAction: 2 )) ! 2;\n}.asSynthDef.name_(\"bass\").add;\n\n{ | dur = 0.15, freq = 50, amp = 0.8, index = 10 |\n PMOsc.ar(freq, freq + 5, index, mul: amp * EnvGen.kr( Env.triangle( dur ), doneAction: 2 )) ! 2;\n}.asSynthDef.name_(\"bazz\").add;\n);\n\n\n(\nPpar([\n Pbind(*[\n instrument: \\kick,\n delta: 1,\n dur: Pfunc({ thisThread.clock.beatDur }) / 4,\n amp: Pseq([\n Pseq([1], 16),\n Pseq([0.8, 1], 8), \n Pseq([1], 16),\n Pseq([0.8, 0.8, 0.9, 1], 8)\n ], inf) * 0.8,\n freq_l: Pstutter(Prand(2.pow((1..4)),inf), Pseq([\n `[2960,70,90],\n `[1260,60,110],\n `[4360,60,120]\n ],inf))\n ]),\n Pbind(*[\n instrument: \\bass,\n delta: 1/4,\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n freq: Pseq([\\r, 50,60,70], inf),\n amp:0.6\n ]),\n Pbind(*[\n instrument: \\bazz,\n delta: 1/4,\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n freq: Pseq([\\r, 30,35,40], inf),\n amp:0.2\n ])\n]).play(TempoClock(156/60), quant:[1])\n);\n\n// kick from above?\n(\nPbind(*[\n instrument: \\kick,\n delta: Pseq(Array.geom(540, 1, 1.015).reciprocal.reverse),\n dur: Pkey(\\delta) * Pfunc({ thisThread.clock.beatDur }),\n atk: Pkey(\\dur) / 6,\n amp: 0.8\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-7", "aug": "prologue:intent", "prompt_tokens": 57, "answer_tokens": 1017} {"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for some pattern exprimenting: bind everything it needs before it is used."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\brumm, { |dur = 1, pan = 2, freq = 40, index = 20|\n var sig = Pan2.ar(\n Blip.ar(freq, index),\n pan\n ) * EnvGen.ar(Env.perc(0.01, dur), doneAction: 2);\n Out.ar(0, sig);\n}).add;\n);\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.001, 100)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: 40,\n instrument: \\brumm\n]).play();\n);\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.001, 100)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: Pseq([Pseries(140, 0.5, 200)], inf),\n instrument: \\brumm\n]).play;\n);\n\n(\nPbind(*[\n dur: Pseq(Signal.chebyFill(1024, Array.rand(10, 0.0, 10.0)).abs + 0.05, inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1], inf),\n freq: Pseq(Signal.chebyFill(1024, Array.rand(10, 0.0, 10.0)).abs * 18000 + 120, inf),\n instrument: \\brumm\n]).play;\n);\n\n\n(\nPbind(*[\n dur: Pseq([1.2, 0.2, 0.5, Pseries(0.1, -0.002, 50)], inf),\n pan: Pxrand(#[-0.5, 0.5, 0.1, -0.1, 0.8, -1, 1, -0.8], inf),\n freq: Pseq([Pseries(740, 0.5, 200), Pxrand(Array.series(740, 0.5, 200), 50)], inf),\n instrument: \\brumm\n]).play;\n)\n```"}], "family": "H", "source_id": "sccode:1-5", "aug": "prologue:intent", "prompt_tokens": 50, "answer_tokens": 688} @@ -13304,26 +13493,47 @@ {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `DiskIn`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n\n\n// create with cueSoundFile class method\nb = Buffer.cueSoundFile(s, ExampleFiles.apollo11, 0, 1);\nx = { DiskIn.ar(1, b) }.play;\nb.close; // must call close in between cueing\n// now use like named instance method, but different arguments\nb.cueSoundFile(ExampleFiles.apollo11);\n// have to do all this to clean up properly!\nx.free; b.close; b.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Buffer.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 166} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Bus`. Define every value it uses."}, {"role": "assistant", "content": "```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) }\n ).add;\n s.sync;\n Synth(\\sinPerc, [\\out, b]);\n b.plot(1);\n}\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Bus.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 149} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `BusPlug` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nz = Bus.control(s, 16);\nz.setn({ |i| (i * 5).nthPrime } ! 16 * 5 + 100);\na = BusPlug.for(z);\n{ Splay.ar(SinOsc.ar(a.kr(3, MouseX.kr(0, 25)))) * 0.1 }.play; // selectively play 3 channel of the 16, modulate offset\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/BusPlug.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 128} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Button` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\ns.waitForBoot({\n var w, p, snd, b;\n\n w = Window.new;\n\n b = Button(w, Rect(20, 20, 80, 26))\n .states_([[\"start a sound\", Color.black, Color.green], [\"stop\", Color.black, Color.red]])\n .action_({ });\n\n v = VLayoutView(w, Rect(140, 20, 200, 300)); // Group the following views\n StaticText(v, Rect(20, 20, 180, 60))\n .string_(\"The button does nothing at first, so try dragging a function to the button\");\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { SinOsc.ar(440, 0, 0.6) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play sine function\").align_(\\center).background_(Color.rand);\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { Saw.ar(440, 0.4) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play saw function\").align_(\\center).background_(Color.rand);\n\n DragSource(v, Rect(20, 20, 80, 26))\n .object_(\n { |b| (b.value == 1).if{ snd = { WhiteNoise.ar(0.4) }.play } { snd.free } } // a button action function\n )\n .string_(\"a play noise function\").align_(\\center).background_(Color.rand);\n\n p = CmdPeriod.add({ b.value_(0) }); // set button to 0 on hitting Cmd-period\n w.onClose_{ snd.free; CmdPeriod.removeAll }; // clean up when window is closed\n w.front;\n})\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Button.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 649} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `CoinGate`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\na = SynthDef(\"help-TCoin\", { |out = 0, prob = 0.5|\n var trig;\n trig = CoinGate.kr(prob, Impulse.kr(10));\n Out.ar(out,\n SinOsc.ar(\n TRand.kr(300.0, 400.0, trig), 0, 0.2\n )\n )\n}).play;\n);\n\na.set(\\prob, 1.0);\na.set(\\prob, 0.0);\na.set(\\prob, 0.1);\n\n\n(\na = SynthDef(\"help-TCoin\", { |out = 0, prob = 0.5|\n var trig;\n trig = Impulse.ar(20, 0, SinOsc.kr(0.5, 0, 1, 1));\n Out.ar(out,\n Mix.fill(3, { Ringz.ar(CoinGate.ar(prob, trig*0.5), #[1, 1.5]*Rand(1000, 9000), 0.01) })\n )\n}).play;\n);\n\na.set(\\prob, 1.0);\na.set(\\prob, 0.0);\na.set(\\prob, 0.1);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/CoinGate.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 356} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Compander` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var z;\n\n // signal (clean)\n z = Decay2.ar(\n Impulse.ar(8, 0, LFSaw.kr(0.3, 1, -0.3, 0.3)),\n 0.001,\n 0.3\n )\n * Mix.ar(Pulse.ar([80, 81], 0.3));\n\n // apply gate (mouse x sets treshold)\n Compander.ar(z, z,\n thresh: MouseX.kr(0.001, 1),\n slopeBelow: 10,\n slopeAbove: 1,\n clampTime: 0.01,\n relaxTime: 0.01\n )\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Compander.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 211} -{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Convolution2L`: bind everything it needs first."}, {"role": "assistant", "content": "```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 Convolution2L.ar(input, b, 0, framesize, 1, 0.5);\n}.play\n);\n\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 135} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `ControlSpec`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// ControlSpec-map can also be used to map ugens\n(\nvar spec;\nspec = [100, 18000, \\exp].asSpec;\n{\n var freq, osc;\n osc = SinOsc.kr(0.1).range(0, 1);\n freq = spec.map(osc);\n\n freq.dump; // BinaryOpUGen\n\n SinOsc.ar(\n freq.poll\n )\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ControlSpec.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 149} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Convolution2L`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// another example\n\n(\n// must have power of two framesize- FFT size will be sorted by Convolution2 to be double this\n// maximum is currently a = 8192 for FFT of size 16384\na = 2048;\n// kernel buffer\ng = Buffer.alloc(s, a, 1);\n);\n\n(\ng.set(0, 1.0);\n100.do { |i| g.set(a.rand, (i + 1).reciprocal) };\n);\n\n(\n// random impulse response\n{\n var input, inputAmp, threshhold, gate;\n\n input = SoundIn.ar(0);\n inputAmp = Amplitude.kr(input);\n threshhold = 0.02; // noise gating threshold\n gate = Lag.kr(inputAmp > threshhold, 0.01);\n\n Convolution2L.ar(input * gate, g, 0, a, 1, 0.5);\n}.play\n);\n\ng.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Convolution2L.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 293} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Dbufwr` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// alloc a single channel buffer\nb = Buffer.alloc(s, 24, 1);\nb.setn(0, { 210 } ! b.numFrames);\n\n// post some info:\nfork { loop { 0.5.wait; b.getn(0, b.numFrames, { |x| x.postln }) } };\n\n// write demand sequence into a buffer\n(\n{\nvar read, write, readpos, writepos, writetrig;\n\n writetrig = Dust.kr(1);\n readpos = Dseries(0, 1, inf);\n writepos = Dseq([Dseries(0, 3, 30), Dseries(0, 1, 30)], inf);\n\n read = Dbufrd(b, readpos);\n write = Dbufwr(Dseq([Dseries(1, 1, 16), Dwhite(1, 16, 8)], inf) * 60, b, writepos);\n\n Demand.kr(writetrig, 0, write); // write on trigger\n\n SinOsc.ar(\n Demand.kr(Impulse.kr(16), 0, read).lag(0.01) * [1, 1.01]\n ) * 0.1\n\n}.play;\n);\n\n// write into buffer with mouse clicks\n(\n{\n var val = MouseY.kr(1000, 200, 1); // cursor y pos controls frequency\n var pos = MouseX.kr(0, BufFrames.kr(b) - 1); // cursor x position controls buffer pos\n var write = MouseButton.kr; // button controls write action\n Demand.kr(write, 0, Dbufwr(val, b, pos, 1));\n SinOsc.ar(\n Duty.kr(Dseq([0.5, 0.75, 0.5, 1.0], inf) * 0.2, 0, Dbufrd(b, Dseries(0, 1, inf)))\n ) * 0.1\n}.play;\n);\n\n// write demand sequence into a buffer\nb.free; b = Buffer.alloc(s, 2, 1);\nfork { loop { 0.5.wait; b.getn(0, b.numFrames, { |x| x.postln }) } };\nb.setn(0, [1, 0]);\n\n(\n{\nvar read, write, readpos, writepos, writetrig;\n\n writetrig = Impulse.kr(2);\n readpos = Dbufrd(b, 1); // first buffer val is position\n writepos = Dbufrd(b, 0); // second buffer val is position\n read = Dbufrd(b, readpos);\n\n write = Dbufwr(read, b, writepos);\n\n Demand.kr(writetrig, 0, write); // write on trigger\n}.play;\n);\n\n// free buffer:\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dbufwr.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 839} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Ddup`: 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 = Ddup(Diwhite(2, 8, inf), in);\n trig = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Ddup.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 146} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `DecodeB2`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var w, x, y, p, a, b, c, d;\n\n p = PinkNoise.ar; // source\n\n // B-format encode\n #w, x, y = PanB2.ar(p, MouseX.kr(-1, 1), 0.1);\n\n // B-format decode to quad\n #a, b, c, d = DecodeB2.ar(4, w, x, y);\n\n [a, b, d, c] // reorder to my speaker arrangement: Lf Rf Lr Rr\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/DecodeB2.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 165} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Demand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// examples\n\n(\n{\n var trig, seq, freq;\n trig = Impulse.kr(24);\n seq = Drand([Dseq((1..5).mirror1, 1), Drand((4..10), 8)], 2000);\n freq = Demand.kr(trig, 0, seq * 100);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed.scaleneg(MouseX.kr(-1, 1)) * 0.1;\n}.play;\n);\n\n(\n{\n var trig, seq, freq;\n trig = Impulse.kr(12);\n seq = Drand([Dseq((1..5).mirror1, 1), Drand((4..10), 8)], 2000) * Drand([1, 2, 4, 8], 2000);\n freq = Demand.kr(trig, 0, seq * 100);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed.scaleneg(MouseX.kr(-1, 1)) * 0.1;\n}.play;\n);\n\n\n\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Diwhite(60, 72, inf).midicps;\n freq = Demand.kr(trig, 0, seq);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Dseq([72, 75, 79, Drand([82, 84, 86])], inf).midicps;\n freq = Demand.kr(trig, 0, seq);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n\n(\n{\n var freq, trig, reset, seq;\n trig = Impulse.kr(10);\n seq = Dswitch1(\n [\n Diwhite(60, 72, inf),\n Dseq([72, 75, 79, Drand([82, 84, 86])], inf)\n ],\n LFPulse.kr(0.2)\n );\n freq = Demand.kr(trig, 0, seq.midicps);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n\n(\n{\n var freq, trig, reset, seq1, seq2;\n trig = Impulse.kr(10);\n seq1 = Drand([72, 75, 79, 82] - 12, inf).midicps;\n seq2 = Dseq([72, 75, 79, Drand([82, 84, 86])], inf).midicps;\n freq = Demand.kr(trig, 0, [seq1, seq2]);\n SinOsc.ar(freq + [0, 0.7]).cubed.cubed * 0.1;\n}.play;\n);\n\n(\n{\n var trig, seq;\n trig = Impulse.kr(8);\n seq = Drand([\n Dseq([4, 0, 0, 1, 2, 1, 0, 1]),\n Dseq([4, 0, 2, 0, 1, 0, 1, 1]),\n Dseq([4, 0, 0, 2, 0, 0, 1, 1]),\n Dseq([4, 0, 1, 2, 0, 1, 2, 0]),\n Dseq([4, 1, 1, 1, 2, 2, 3, 3]),\n Dseq([4, 1, 0, 1, 0, 1, 0, 1])\n ], inf);\n trig = Demand.kr(trig, 0, seq * 0.4) * trig;\n { LPF.ar(PinkNoise.ar, 5000) }.dup * Decay.kr(trig, 0.5);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Demand.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 1190} +{"conversations": [{"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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dgeom(1, 1.2, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dgeom.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 226} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dreset`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), Drand([0, 0, 0, 1], inf));\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// reset when mouse button is pressed\n(\n{\n var a, freq;\n a = Dreset(Dseries(0, 2, inf), MouseButton.kr);\n freq = Duty.kr(1/MouseX.kr(1, 40, 1), 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// audio rate\n(\n{\n var a, nmax = 90;\n a = { Dreset(Dseries(0, 1, inf), Drand(0 ! nmax ++ 1, inf)) } ! 2;\n Duty.ar(SampleDur.ir, 0, a) * (0.1 / nmax)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dreset.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 320} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Dseq`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([1, 3, 2, 7, 8], 3);\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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq({ 10.rand } ! 32, inf);\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dseq.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 238} +{"conversations": [{"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 = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dseries(0, 1, inf);\n trig = Dust.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, a) % 15 * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dseries.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 220} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dshuf`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([1, 3, 2, 7, 8.5], 3)], 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;\n);\n\n// audio rate\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf({ 10.rand } ! 81, 5)], inf).poll;\n trig = Impulse.ar(MouseX.kr(1, 10000, 1));\n freq = Demand.ar(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n// embedded structures\n(\n{\n var a, freq, trig;\n a = Dseq([Dshuf([Drand([1, 2, 3], 1), 3, Drand([20, 23, 56], 1), 7, 8.5], 8)], 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;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dshuf.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 416} +{"conversations": [{"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 = Impulse.kr(MouseX.kr(1, 40, 1));\n freq = Demand.kr(trig, 0, rep).poll(trig) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dstutter.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 147} +{"conversations": [{"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], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n\n// compare with Dswitch1:\n\n(\n {\n var d, trig;\n d = Dswitch1([\n Dwhite(3, 4, 2),\n Dwhite(0, 1, 2),\n Dseq([1, 1, 1, 0], 2)\n ], Dseq([0, 1, 2, 1, 0], 2));\n\n trig = Impulse.kr(4);\n\n SinOsc.ar(\n Demand.kr(trig, 0, d).poll(trig)\n * 300 + 400\n )\n * 0.1 ! 2\n }.play;\n);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dswitch.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 333} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Dswitch1`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dswitch1([1, 3, MouseY.kr(1, 15), 2, Dwhite(0, 3, 2)], MouseX.kr(0, 4));\n trig = Impulse.kr(3);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n);\n\n(\n{\n var a, freq, trig;\n a = Dswitch1({ |i| Dseq((0..i*3), inf) } ! 5, MouseX.kr(0, 4));\n trig = Impulse.kr(6);\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dswitch1.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 263} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Duty`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n {\n var freq;\n freq = Duty.kr(\n Drand([0.01, 0.2, 0.4], inf), // demand ugen as durations\n 0,\n Dseq([204, 400, 201, 502, 300, 200], inf)\n );\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n);\n\n(\n {\n var freq;\n freq = Duty.kr(\n MouseX.kr(0.001, 2, 1), // control rate ugen as durations\n 0,\n Dseq([204, 400, 201, 502, 300, 200], inf)\n );\n SinOsc.ar(freq * [1, 1.01]) * 0.1\n\n }.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Duty.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 237} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Dwrand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var a, freq, trig;\n a = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;\n trig = Impulse.kr(MouseX.kr(1, 400, 1));\n freq = Demand.kr(trig, 0, a) * 30 + 340;\n SinOsc.ar(freq) * 0.1\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Dwrand.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 141} {"conversations": [{"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) * EnvGen.kr(env, doneAction: Done.freeSelf)\n}.play\n);\n\n// as amplitude and modulation envelope\n(\n{\n var env = Env([0, 1, 0.5, 0.8, 0, 1.2, 0], [0.01, 0.5, 0.02, 0.5, 0.2, 0.5]);\n var gate = Impulse.kr(MouseX.kr(0.2, 3), 0.5);\n var gen = EnvGen.kr(env, gate);\n SinOsc.ar(270, SinOsc.ar(gen * 473)) * gen * 0.2\n}.play\n);\n// EnvGen multichannel expands when passed a multichannel envelope\n(\n{\n SinOsc.ar(\n EnvGen.kr(\n Env.circle([0, 1, 0, (2..4), 0, LFNoise1.kr(0.1 ! 5) * 10, 0], [0.01, 0.6])\n )\n * 240 + 300\n ).sum * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/EnvGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 401} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Event` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\pm, { |out = 0, freq = 440, amp = 0.1, pan = 0, gate = 1, ratio = 1, index = 1, ar = 0.1, dr = 0.1|\n var z;\n z = LPF.ar(\n PMOsc.ar(freq, freq * ratio, Linen.kr(gate, ar, index, dr), 0, 0.3),\n XLine.kr(Rand(4000, 5000), Rand(2500, 3200), 1)\n ) * Linen.kr(gate, 0.01, 0.7, dr, 2);\n OffsetOut.ar(out, Pan2.ar(z, pan, amp));\n}).add;\n);\n\n(instrument: \\pm).play;\n\n(instrument: \\pm, ratio: 3.42, index: 12, freq: 150, ar: 8, dr: 3, sustain: 10).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Event.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 278} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `ExpRand` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-ExpRand\", { |out = 0|\n Out.ar(out,\n FSinOsc.ar(\n ExpRand(100.0, 8000.0),\n 0, Line.kr(0.2, 0, 0.01, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n(\nRoutine({\n inf.do({ |i|\n Synth.new(\"help-ExpRand\"); 0.05.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ExpRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 162} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `FFT`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.1);\n chain = FFT(LocalBuf(2048), in);\n IFFT(chain) // inverse FFT\n}.play;\n);\n\n// inspecting it, we see that the chain is an FFT:\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.1);\n chain = FFT(LocalBuf(2048), in);\n chain.inspect;\n IFFT(chain) // inverse FFT\n}.play;\n);\n\n(\n{\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n chain = FFT(LocalBuf(2048), in);\n IFFT(chain)\n}.play;\n);\n\n(\n{\n var in, chain;\n in = SinOsc.ar(SinOsc.kr(SinOsc.kr(0.08, 0, 6, 6.2).squared, 0, 100, 800));\n // in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_MagAbove(chain, 310);\n 0.5 * IFFT(chain);\n}.play;\n);\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_BrickWall(chain, SinOsc.kr(0.1));\n IFFT(chain)\n}.play;\n);\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.8);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n IFFT(chain)\n}.play;\n);\n\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_RectComb(chain, 8, LFTri.kr(0.097, 0, 0.4, 0.5),\n LFTri.kr(0.24, 0, -0.5, 0.5));\n IFFT(chain)\n}.play;\n);\n\n(\n{\n var in, chain;\n in = SinOsc.ar(LFNoise1.kr(5.2, 250, 400));\n chain = FFT(LocalBuf(2048), in);\n // moves in and out of freeze\n chain = PV_MagFreeze(chain, SinOsc.kr(0.2));\n 0.5 * IFFT(chain);\n}.play;\n);\n\n\n// stereo example:\n\n(\n{\n var in, chain;\n in = SinOsc.ar(LFNoise1.kr([5.2, 3.3], 250, 400));\n chain = FFT({ LocalBuf(2048) } ! 2, in); // we need two buffers for stereo input.\n // moves in and out of freeze\n chain = PV_MagFreeze(chain, SinOsc.kr([0.2, 0.3]));\n 0.5 * IFFT(chain);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FFT.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 1012} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `FFTTrigger` 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, phases, chain, sig;\n // Create simple undulating magnitudes\n mags = { FSinOsc.kr(ExpRand(0.1, 1)).range(0, 1) }.dup(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.dup(100);\n chain = FFTTrigger(LocalBuf(512), 0.5);\n // Now we can do the packing\n chain = PackFFT(chain, 512, [mags, phases].flop.flatten, 0, 99, 1);\n sig = IFFT(chain);\n sig.dup\n}.play\n);\nx.free;\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FFTTrigger.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 369} +{"conversations": [{"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, x)\n}.play;\n);\n\n(\n// same as OneZero\n{ var x;\n x = LFTri.ar(0.4, 0, 0.99);\n FOS.ar(LFSaw.ar(200, 0, 0.2), 1 - x.abs, x, 0.0)\n}.play;\n);\n\n(\n// same as OnePole, kr\n{ var x, ctl;\n x = LFTri.kr(0.2, 0, 0.99);\n ctl = FOS.kr(LFSaw.kr(8, 0, 0.2), 1 - x.abs, 0.0, x);\n LFTri.ar(ctl * 200 + 500);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FOS.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 277} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Fdef`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// sound example\n(\ns.boot;\nSynthDef(\"gpdef\",\n { |out = 0, freq = 440, sustain = 0.05, amp = 0.1|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain), doneAction: Done.freeSelf) * amp;\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n// fork a thread that plays some sounds\n(\nFdef(\\freq, 440);\nFdef(\\dur, 0.2);\n\nfork {\n loop {\n s.sendMsg(\"/s_new\", \"gpdef\", -1, 1, 1, \\freq, Fdef(\\freq).value);\n Fdef(\\dur).value.wait;\n }\n};\n);\n\n// some modifications\n\nFdef(\\freq, Fdef(\\midinote, 60).midicps);\nFdef(\\midinote, { [67, 64, 65].choose });\nFdef(\\midinote, { [67, 64, 65].choose } + Fdef(\\offset));\nFdef(\\offset, { 4.rand });\nFdef(\\dur, 0.23);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Fdef.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 370} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `FoldIndex`. 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 = FoldIndex.kr(buf, MouseX.kr(0, BufFrames.ir(buf) * 3));\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// the same using a global buffer\n(\nt = [200, 300, 400, 500, 600, 800];\nb = Buffer(s, t.size, 1);\n\n// alloc and set the values\ns.listSendMsg(b.allocMsg(b.setnMsg(0, t)).postln);\n\nSynthDef(\\help_Index, { |out = 0, bufnum = 0|\n Out.ar(out,\n SinOsc.ar(\n FoldIndex.kr(\n bufnum,\n MouseX.kr(0, BufFrames.ir(bufnum) * 3)\n ),\n 0,\n 0.5\n )\n )\n}).play(s, [\\bufnum, b.bufnum]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FoldIndex.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 355} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `RecordBuf`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n// simple example\n(\n{ var env;\nenv = Line.kr(0, 1, 1);\nFreeSelfWhenDone.kr(env); // free synth at end of line\nSinOsc.ar(200, 0, 0.5) * env\n}.play;\n);\n\n// the previous example works, because FreeSelfWhenDone operates on the Line\n// this version won't work\n(\n{ var env, output;\nenv = Line.kr(0, 1, 1);\noutput = SinOsc.ar(200, 0, 0.5) * env;\noutput.postln; // output is a BinaryOpUGen, which has no 'done' flag\nFreeSelfWhenDone.kr(output); // won't ever be done\noutput\n}.play;\n);\n\n// record for four seconds\nb = Buffer.alloc(s, 44100 * 4.0, 1);\n(\nSynthDef(\"help-RecordBuf\", { |out = 0, bufnum = 0|\n var formant, recbuf;\n formant = Formant.ar(XLine.kr(400, 1000, 4), 2000, 800, 0.125);\n recbuf = RecordBuf.ar(formant, bufnum, recLevel: Line.kr(1, 1), loop: 0);\n // The RecordBuf doesn't loop, so you can check it for 'done' status\n FreeSelfWhenDone.kr(recbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play it back\n(\nSynthDef(\"help-RecordBuf play\", { |out = 0, bufnum = 0|\n var playbuf;\n playbuf = PlayBuf.ar(1, bufnum);\n FreeSelfWhenDone.kr(playbuf); // frees the synth when the PlayBuf is finished\n Out.ar(out, playbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FreeSelfWhenDone.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 593} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `FreqScopeView`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// Start server\ns.boot;\n\n// Create analyzer in a window\n(\nw = Window(\"My Analyzer\", Rect(0, 0, 511, 300)); // width should be 511\nf = FreqScopeView(w, w.view.bounds);\nf.active_(true); // turn it on the first time;\n\nw.onClose_({ f.kill }); // you must have this\nw.front;\n{ SinOsc.ar([500, 1000], 0, 0.25).mean.dup }.play(s); // start two sine waves\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/FreqScopeView.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 182} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Function`: bind everything it needs first."}, {"role": "assistant", "content": "```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 resulting SynthDef\nx.release(4); // fadeout over 4 seconds\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Function.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 110} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Harmonics`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\na.ramp(1.0, 1.0); // returns a harmonic series\n\nb = Buffer.alloc(s, 512, 1);\n// harmonic series for freqs, ramp down for amps\nb.sine2(a.ramp(1.0, 1.0).postln, a.ramp(0.5, -0.025).postln, true, true, true);\n(\nz = SynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, 200, 0, 0.5)\n )\n});\n);\ny = z.play(s, [\\out, 0, \\bufnum, b]);\ny.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Harmonics.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 216} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `History` that runs as it is."}, {"role": "assistant", "content": "```supercollider\nHistory.clear.end; // if needed, clear History first\nHistory.start; // starts recording, opens log file\n\n// execute these lines one by one, as a little performance history\n1 + 2;\np = ProxySpace.push(s.boot);\n~a = { Dust.ar([1, 1] * 30) * 0.3 };\n~a.play;\n~a.end(3);\n\nHistory.started; // is it on now?\n\n// stops recording history and ends logging.\nHistory.end;\nHistory.started;\n\nHistory.document; // creates a document with current history\nHistory.showLogFolder; // opens the folder where logs are written.\nHistory.showLogFile; // opens the current log file as it was written.\n\n\n// make a gui window, to access code history lines at will,\n// e.g. for code reuse in performance, adaptation, sharing, etc:\ng = History.makeWin;\n// specify left-bottom position, and number of lines in textview\ng = History.makeWin(0@20, 5);\n\n// play back the recorded history line by line\nHistory.play(0);\n\n\n// history can even record and play back stops with CmdPeriod.\n// run these lines one at a time:\nHistory.clear.start;\n1 + 2;\n2 + 3;\ns.boot;\n(dur: inf).play;\n\nCmdPeriod.run; // or hit the Stop key command, Cmd-., or ctrl-.\n3 + 4; // continue recording into history\n4 + 5;\nHistory.end;\n\n// Replays history, including a CmdPeriod, and keeps replaying history.\nHistory.play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/History.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 523} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `IEnvGen`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var env = Env([0, 0.6, 0.3, 1.0, 0], [0.1, 0.02, 0.4, 1.1], [\\lin, \\exp, -6, \\sin]);\n var envgen = IEnvGen.kr(env, MouseX.kr(0, env.times.sum));\n env.plot;\n SinOsc.ar(envgen * 500 + 440)\n}.play;\n);\n\n// index with an SinOsc ... mouse controls amplitude of SinOsc\n// use offset so negative values of SinOsc will map into the Env\n(\n{\n var sin = SinOsc.ar(440, 0, MouseX.kr(0, 1));\n // use offset so negative values of SinOsc will map into the Env\n var env = Env([-1, -0.7, 0.7, 1], [0.8666, 0.2666, 0.8668], \\lin, offset: -1.0);\n IEnvGen.ar(env, sin) * 0.1\n}.play;\n);\n\n// index with Amplitude of input, control freq of SinOsc (uses SoundIn)\n(\n{\n var point = Amplitude.ar(SoundIn.ar(0), 0.01, 0.2);\n // use offset so negative values of SinOsc will map into the Env\n var env = Env.xyc([[0, 330, \\exp], [0.5, 440, \\exp], [1.0, 1760]]);\n SinOsc.ar(IEnvGen.kr(env, point)) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IEnvGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 501} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `IFFT` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// without any modification, convert FFT chain (frequency domain signal) back to audio (time domain signal)\n(\n{ var in, chain;\n in = WhiteNoise.ar;\n chain = FFT(LocalBuf(2048), in);\n IFFT.ar(chain) * -20.dbamp // inverse FFT\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IFFT.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 120} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `IdentityDictionary`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_sinegrain, { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0.5pi, env))\n}).add;\n\na = Pbind(\\instrument, \\help_sinegrain, \\note, Pseq([0, 7, 2, 9, 11, 10, 9, 8], inf), \\dur, 1);\na.play(quant: (quant: 1, phase: 0));\na.play(quant: (quant: 1, phase: 1/3));\na.play(quant: (quant: 1, phase: 1.0.rand));\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IdentityDictionary.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 253} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `In` and actually plays. Assume nothing about the session."}, {"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;\n input = In.ar(in, 1);\n Out.ar(out, input);\n\n}).add;\n);\n\n// play noise on the right channel\nx = Synth(\"help-PinkNoise\", [\\out, 1]);\n\n// read the input and play it out on the left channel\nSynth.after(x, \"help-In\", [\\out, 0, \\in, 1]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/In.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 198} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `InFeedback`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-InFeedback\", { |out = 0, in = 0|\n Out.ar(out,\n InFeedback.ar(in, 1)\n );\n}).add;\nSynthDef(\"help-SinOsc\", { |out = 0, freq = 440|\n Out.ar(out, SinOsc.ar(freq, 0, 0.1))\n}).add;\n);\n\nx = Bus.audio(s, 1);\n\n// read from bus n play to bus 0 (silent)\na = Synth(\"help-InFeedback\", [\\in, x.index, \\out, 0]);\n\n// now play a synth after this one, playing to bus x\nb = Synth.after(a, \"help-SinOsc\", [\\out, x.index]);\n\n// add another synth before a which also writes to bus x\n// now you can't hear b, as its data is one cycle old, and is overwritten by c\nc = Synth.before(a, \"help-SinOsc\", [\\out, x.index, \\freq, 800]);\n\n// free c and you can hear b again\nc.free;\nx.free;\n\na.free; b.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InFeedback.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 362} {"conversations": [{"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 inTrig = InTrig.kr(busnum);\n Out.ar(out,\n EnvGen.kr(Env.perc, gate: inTrig, levelScale: inTrig) * SinOsc.ar\n )\n}).play(s, [\\out, 0, \\busnum, b.index]);\n\n\nb.set(1.0);\n\nb.value = 1.0;\n\nb.value = 0.2;\n\nb.value = 0.1;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/InTrig.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 206} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `IndexInBetween` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// autotune.\n{\n var index, in, autotuned, f0, fdiff;\n var scale = ([0, 1, 3, 4, 7, 11, 12] + 70).midicps;\n var buffer = scale.as(LocalBuf);\n in = Pulse.ar(MouseX.kr(scale.minItem, scale.maxItem)) * 0.1;\n f0 = Pitch.kr(in).at(0);\n index = IndexInBetween.kr(buffer, f0);\n fdiff = index.frac * (Index.kr(buffer, index + 1) - Index.kr(buffer, index));\n autotuned = PitchShift.ar(in, 0.1, 1 - (fdiff / f0), 0.01, 0.01);\n RLPF.ar(autotuned, [2000, 5000], 0.3)\n}.play;\n);\n\nb.free;\n\n\n// basic test.\n(\n{\n var index, f0, f1, f3;\n var buffer = [200, 210, 400, 430, 600, 800].as(LocalBuf);\n f0 = MouseX.kr(200, 900);\n index = IndexInBetween.kr(buffer, f0);\n f1 = IndexL.kr(buffer, index);\n SinOsc.ar([f0, f1]) * 0.1\n\n}.play;\n);\n\n\n\n// One way to map across from an arbitrary piecewise curve, onto another:\n// We use IndexInBetween to \"unmap\" your input into integer slots,\n// and then use IndexL to do the reverse, to \"map\" onto your other distribution.\n// This example maps a sort-of-exponential curve onto a sort-of-sinusoidal curve:\n\n~from = [1, 2, 4, 8, 16];\n~to = [0, 1, 0, -1, 0];\n(\nx = {\n IndexL.kr(~to.as(LocalBuf), IndexInBetween.kr(~from.as(LocalBuf), MouseX.kr(~from.first, ~from.last).poll).poll).poll\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/IndexInBetween.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 668} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `JITGui`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// typically, only subclasses of JITGui are used,\n // so here are just some basic usage and layout tests\n\n // make its own window - defPos, minSize is used\ng = JITGui(Ndef(\\a));\n\n // make its own window, specific size\ng = JITGui(Ndef(\\a), bounds: 390@20);\n\n // provide full bounds\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 390, 24));\n\n // extent is 0@0: minSize x, y is used\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 0, 0));\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 0, 50));\ng = JITGui(Ndef(\\a), bounds: Rect(200, 500, 500, 0));\n\n\n( // put a JITGui in an existing window:\nw = Window().front;\ng = JITGui(Ndef(\\a), 0, w, bounds: 300@48);\n);\n\n( // 5 lines high\nw = Window().front;\ng = JITGui(Ndef(\\a), 5, w);\n);\n\n( // recommended: use a FlowLayout.\nw = Window().front;\nw.addFlowLayout;\nEZSlider(w, 300@100, \\test, []);\ng = JITGui(Ndef(\\a), 0, w, bounds: 300@40);\n);\n\n// test changing color schemes for JITguis\n// this scheme is admittedly ugly but different\n\nGUI.skins.put(\\jit, (\n fontSpecs: [\"Inconsolata\", 12],\n fontColor: Color.white,\n background: Color(0.2, 0.85, 0.7, 0.5),\n foreground: Color.grey(0.1),\n onColor: Color(0.5, 0, 0.5),\n onColor2: Color(0.0, 0.5, 0.5),\n offColor: Color.grey(0.2, 0.5),\n hiliteColor: Color.green(1.0, 0.5),\n gap: 0 @ 0,\n margin: 2@2,\n buttonHeight: 18,\n headHeight: 24)\n);\n\n// make some JITGuis to check\nn = NdefGui(Ndef(\\a));\nNdef(\\a, { SinOsc.ar(\\freq.kr(250)) });\nNdef(\\a).clear;\nn = NdefMixer(s);\n\nTdefAllGui();\nTdef(\\a).set(\\amp, 0.25);\nTdefGui(Tdef(\\a), 5);\n\nEnvirGui((a: 123));\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/JITGui.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 851} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `KeyTrack`: bind everything it needs first."}, {"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(3, 4).round(1), 7]).midicps, 0, 0.1));\n\n // major dom 7 and minor 7; major keys preferred here\n // in = Mix(SinOsc.ar((60 + (MouseY.kr(0, 11).round(1.0)) + [0, MouseX.kr(3, 4).round(1), 7, 10]).midicps, 0, 0.1));\n\n fft = FFT(LocalBuf(4096), in); // for sampling rates 44100 and 48000\n\n key = KeyTrack.kr(fft);\n\n key.poll;\n\n Pan2.ar(in)\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/KeyTrack.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 270} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `LFClipNoise`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n LFClipNoise.ar(1000, 0.25)\n )\n}).play;\n);\n\n// modulate frequency\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n LFClipNoise.ar(XLine.kr(1000, 10000, 10), 0.25)\n )\n}).play;\n);\n\n// use as frequency control\n(\nSynthDef(\"help-LFClipNoise\", { |out = 0|\n Out.ar(out,\n SinOsc.ar(\n LFClipNoise.ar(4, 200, 600),\n 0, 0.2\n )\n )\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LFClipNoise.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 239} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LeastChange`. Define every value it uses."}, {"role": "assistant", "content": "```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 external, one internal\n ) * 0.1\n}.play\n);\n\nd.set(\\freq, 800);\nd.set(\\freq, 900);\nd.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LeastChange.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 145} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `LFPulse` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\ns.meter;\ns.scope;\n\n// synthesize 2 test signals at level 0.1 (-20 dB), first on separate channels\n(\n{ var n = 2, level = 0.1, spread = 1, pan = 0;\n LFPulse.ar({ 100.exprand(2000) } ! n).range(-1, 1) * level\n}.play;\n);\n\n// now mix/pan these 2 signals using Splay, level at 0.1 (-20dB)\n(\nx = { |spread = 1, level = 0.1, center = 0|\n var n = 2;\n var snd = LFPulse.ar({ 100.exprand(2000) } ! n).range(-1, 1);\n var stereo = Splay.ar(snd, spread, level, center);\n Peak.ar(stereo, Impulse.kr(2)).ampdb.poll(2);\n stereo\n}.play;\n);\n\n// when we set full spread, panned to center:\n// the 2 signals are discrete, left and right\n// we see the energy-based levelComp applied (1/2.sqrt).ampdb = -3\nx.set(\\spread, 1, \\center, 0); // -20 - 3 = -23dB\n\n// no spread, panned center:\n// each signal decreases by 3dB as they move to the center (from the panning function)\n// and the two signals mix on each channel, so we get -20 dB\nx.set(\\spread, 0, \\center, 0); // -20dB\n\n// no spread, panned fully right:\n// the signals fully mix in the right channel (+6 dB)\nx.set(\\spread, 0, \\center, 1); // -23 + 6 = -17db\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LevelComp.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 514} @@ -13331,6 +13541,7 @@ {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Limiter` and actually plays. Assume nothing about the session."}, {"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 * 0.8\n}.play\n);\n\n(\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, Limiter.ar(z, 0.4, 0.01)] * 0.5\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Limiter.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 206} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `LinRand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-LinRand\", { |out = 0, minmax = 1|\n Out.ar(out,\n FSinOsc.ar(\n LinRand(200.0, 10000.0, minmax),\n 0, Line.kr(0.2, 0, 0.01, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n// towards hi\n(\nRoutine({\n loop({\n Synth.new(\"help-LinRand\"); 0.04.wait;\n })\n}).play;\n);\n\n// towards lo (doesn't work like that yet)\n(\nRoutine({\n loop({\n Synth.new(\"help-LinRand\", [\\minmax, -1]); 0.04.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LinRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 246} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LinSelectX`. Define every value it uses."}, {"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}.play;\n);\n\n(\n{\n var a;\n a = [\n SinOsc.kr(0.25),\n LFSaw.kr(10),\n LFPulse.kr(0.3)\n ];\n\n SinOsc.ar(LinSelectX.kr(MouseX.kr(0, 1) * a.size, a) * 300 + 400) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LinSelectX.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 212} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `LocalIn`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var source, local;\n\n source = Decay.ar(Impulse.ar(0.3), 0.1) * WhiteNoise.ar(0.2);\n local = LocalIn.ar(2) + [source, 0]; // read feedback, add to source\n local = DelayN.ar(local, 0.2, 0.2); // delay sound\n\n // reverse channels to give ping pong effect, apply decay factor\n LocalOut.ar(local.reverse * 0.8);\n\n local\n}.play;\n);\n\n(\n{\n var local, in;\n\n in = Mix.fill(12, {\n Pan2.ar(\n Decay2.ar(Dust.ar(0.05), 0.1, 0.5, 0.1)\n * FSinOsc.ar(IRand(36, 84).midicps).cubed.max(0),\n Rand(-1, 1))\n });\n in = in + Pan2.ar(Decay2.ar(Dust.ar(0.03), 0.04, 0.3) * BrownNoise.ar, 0);\n\n 4.do { in = AllpassN.ar(in, 0.03, { Rand(0.005, 0.02) }.dup, 1) };\n\n local = LocalIn.ar(2) * 0.98;\n local = OnePole.ar(local, 0.5);\n\n local = Rotate2.ar(local[0], local[1], 0.23);\n local = AllpassN.ar(local, 0.05, { Rand(0.01, 0.05) }.dup, 2);\n\n local = DelayN.ar(local, 0.3, [0.19, 0.26]);\n local = AllpassN.ar(local, 0.05, { Rand(0.03, 0.15) }.dup, 2);\n\n local = LeakDC.ar(local);\n local = local + in;\n\n LocalOut.ar(local);\n\n local\n\n}.play;\n);\n\n(\n{\n var local, in, amp;\n\n in = SoundIn.ar([0, 1]);\n\n amp = Amplitude.kr(Mix.ar(in));\n in = in * (amp > 0.02); // noise gate\n\n local = LocalIn.ar(2);\n local = OnePole.ar(local, 0.4);\n local = OnePole.ar(local, -0.08);\n\n local = Rotate2.ar(local[0], local[1], 0.2);\n\n local = DelayN.ar(local, 0.25, 0.25);\n\n local = LeakDC.ar(local);\n local = ((local + in) * 1.25).softclip;\n\n LocalOut.ar(local);\n local * 0.1;\n}.play;\n);\n\n// Resonator, must subtract blockSize for correct tuning\n(\n{\n var in, imp, sound;\n\n in = LocalIn.ar(1);\n imp = Impulse.ar(1);\n sound = DelayC.ar(imp + (in * 0.995), 1, 440.reciprocal - ControlRate.ir.reciprocal);\n LocalOut.ar(sound); // for feedback\n in\n}.play;\n\n// compare pitch\n{\n SinOsc.ar(440, 0, 0.2)\n}.play(s, 1);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/LocalIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 992} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `NRand`: bind everything it needs first."}, {"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, doneAction: Done.freeSelf))\n )\n}).add;\n);\n\n(\nn = 0;\nRoutine({\n inf.do({ |i|\n Synth.new(\"help-NRand\", [\\n, n]); 0.05.wait;\n })\n}).play;\n);\n\nn = 1;\nn = 2;\nn = 4;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 193} {"conversations": [{"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, 440).lag(1);\n SinOsc.ar([x, y] * [2, 1.2]) * 0.1\n}.play;\n);\n\na.set(\\freq, 1220);\na.set(\\freq, 120);\n\n// to this:\n(\na = {\n var x, y;\n x = Control.names([\\freq]).kr(440).lag(3.5);\n y = Control.names([\\freq]).kr(440).lag(1); // this hangs when set\n SinOsc.ar([x, y] * [2, 1.2]) * 0.1\n}.play;\n);\n\na.set(\\freq, 1220);\na.set(\\freq, 120);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NamedControl.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 284} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Ndef`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\nNdef(\\sound, { |freq = 56, numHarm = 10| Blip.ar(freq, numHarm, 30) * 0.2 }).play;\nNdef(\\sound).set(\\freq, 15);\nNdef(\\sound).set(\\freq, 15, \\numHarm, 100);\n\nNdef(\\lfo, { LFNoise2.kr(2).exprange(10, 200) });\nNdef(\\sound).map(\\numHarm, Ndef(\\lfo));\nNdef(\\sound).set(\\numHarm, nil); // unmap.\nNdef(\\sound).stop;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Ndef.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 188} @@ -13339,15 +13550,23 @@ {"conversations": [{"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 crossfade\n// set the source\na.source = { SinOsc.ar([350, 351.3], 0, 0.2) };\na.source = { Pulse.ar([350, 351.3] / 4, 0.4) * 0.2 };\na.source = Pbind(\\dur, 0.03, \\freq, Pbrown(0, 1, 0.1, inf).linexp(0, 1, 200, 350));\n\nb = NodeProxy.new;\na.source = { Ringz.ar(b.ar, [350, 351.3] * 8, 0.2) * 4 };\nb.source = { Impulse.ar([5, 7]/2, [0, 0.5]) };\n\na.clear(3); // clear after 3 seconds\nb.clear(3);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/NodeProxy.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 289} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Normalizer`. Define every value it uses."}, {"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 * 0.8\n}.play\n);\n\n(\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, Normalizer.ar(z, 0.4, 0.01)] * 0.5\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Normalizer.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 208} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `OSCBundle`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// create a new, empty instance\na = OSCBundle.new;\n\n// a synthdef that needs to be sent to the server, an operation that is asynchronous,\n// i.e. we have to wait until it is finished.\nx = SynthDef(\"test\", { OffsetOut.ar(0, BPF.ar(Impulse.ar(4) * 10, Rand(9000, 1000), 0.1)) });\n// this is why addPrepare is used.\na.addPrepare([\"/d_recv\", x.asBytes]);\n// add is used with synchronous operations, like starting synths.\na.add([\"/s_new\", \"test\", -1]);\n\n// the bundle has now the synchronous separated from the asynchronous bundles:\na.messages;\na.preparationMessages;\n\n// this can be simply sent - the bundle takes care of the server client communication\n// like waiting for the synthdef to be loaded. the synth is started when the preparation\n// is finished.\n\ns.boot; // boot the server\na.send(s);\n\ns.freeAll; // free all nodes on the server\n\n// scheduled sending: the synths are started on the next beat.\n\na.schedSend(s, TempoClock.default, 1);\na.schedSend(s, TempoClock.default, 1);\na.schedSend(s, TempoClock.default, 1);\n\ns.freeAll; // free all nodes on the server\n\n// the bundle can contain several preparation messages and messages at a time.\n// the proparationMessages are sent first and only when they are all completed,\n// the other bundles are sent.\n// the bundle can also be reused, if there is no specific allocated buffers/node ids.\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/OSCBundle.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 562} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `OffsetOut`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-OffsetOut\",\n { |out = 0, freq = 440, dur = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, dur, 0.2), doneAction: Done.freeSelf);\n OffsetOut.ar(out, SinOsc.ar(freq, 0, env))\n}).send(s);\n\nSynthDef(\"help-Out\",\n { |out = 0, freq = 440, dur = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, dur, 0.2), doneAction: Done.freeSelf);\n // compare to Out:\n Out.ar(out, SinOsc.ar(freq, 0, env))\n}).send(s);\n);\n\n\n// these are in sync\n(\nRoutine({\n loop {\n s.sendBundle(0.2, [\"/s_new\", \"help-OffsetOut\", -1]);\n 0.01.wait;\n }\n}).play;\n);\n\n// these are less reliably in sync and are placed at multiples of blocksize.\n(\nRoutine({\n loop {\n s.sendBundle(0.2, [\"/s_new\", \"help-Out\", -1]);\n 0.01.wait;\n }\n}).play;\n);\n\n\n\nSynthDef(\"trig1\", {\n var gate, tone;\n gate = Trig1.ar(1.0, t);\n tone = In.ar(10, 1); // tone comes in normally\n // but is then delayed when by the OffsetOut\n OffsetOut.ar(0,\n tone * EnvGen.ar(\n Env([0, 0.1, 0.1, 0], [0.01, 1.0, 0.01], [-4, 4], 2),\n gate, doneAction: Done.freeSelf\n )\n )\n})\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/OffsetOut.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 589} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Osc`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, 200, 0, 0.5)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, XLine.kr(2000, 200), 0, 0.5) // modulate freq\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n(\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum,\n Osc.ar(bufnum,\n XLine.kr(1, 1000, 9),\n 0,\n 200,\n 800),\n 0,\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n(\n// modulate phase\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum,\n 800,\n Osc.ar(bufnum,\n XLine.kr(20, 8000, 10),\n 0,\n 2pi),\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n\n\n(\n// change the buffer while its playing\ns = Server.local;\nb = Buffer.alloc(s, 4096, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-Osc\", { |out = 0, bufnum = 0|\n Out.ar(out,\n Osc.ar(bufnum, [80, 80.2], 0, 0.2)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nfork {\n var n = 32;\n 50.do {\n b.sine1(Array.rand(n, 0, 1).cubed, true, true, true);\n 0.25.wait;\n };\n};\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Osc.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 909} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `OscN` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// compare examples below with interpolating Osc examples.\n\n(\ns = Server.local;\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, false, true);\nb = Buffer.alloc(s, 512, 1);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, 500, 0, 0.5)\n )\n}).play(s, [0, 0, 1, b.bufnum]);\n\n);\nb.free;\n\n\n\n(\n// noninterpolating - there are noticeable artifacts\n// modulate freq\n\ns = Server.local;\nb.sine1(1.0/[1, 2, 3, 4, 5, 6].squared, true, false, true);\nb = Buffer.alloc(s, 512, 1);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, XLine.kr(2000, 200), 0, 0.5)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n\n);\nb.free;\n\n(\n// sounds very different than the Osc example\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum,\n OscN.ar(bufnum,\n XLine.kr(1, 1000, 9),\n 0,\n 200,\n 800),\n 0,\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n\n);\nb.free;\n\n(\n// modulate phase\ns = Server.local;\nb = Buffer.alloc(s, 512, 1);\nb.sine1([1.0], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum,\n 800,\n OscN.ar(bufnum,\n XLine.kr(20, 8000, 10),\n 0,\n 2pi),\n 0.25)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\nb.free;\n\n\n(\n// change the buffer while its playing\ns = Server.local;\nb = Buffer.alloc(s, 4096, 1);\nb.sine1(1.0/[1, 2, 3, 4, 5, 6], true, true, true);\n\nSynthDef(\"help-OscN\", { |out = 0, bufnum = 0|\n Out.ar(out,\n OscN.ar(bufnum, [80, 80.2], 0, 0.2)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n);\n\n(\nRoutine({\n var n = 32;\n 50.do({\n b.sine1(Array.rand(n, 0, 1).cubed, true, true, true);\n 0.25.wait;\n });\n}).play;\n);\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/OscN.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 1013} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Out` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-out\", { |out = 0, freq = 440|\n var source;\n source = SinOsc.ar(freq, 0, 0.1);\n\n // write to the bus, adding to previous contents\n Out.ar(out, source);\n\n}).add;\n);\n\n\nSynth(\"help-out\", [\\freq, 500]);\nSynth(\"help-out\", [\\freq, 600]);\nSynth(\"help-out\", [\\freq, 700]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Out.schelp", "aug": "prologue:ugen", "prompt_tokens": 43, "answer_tokens": 155} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `PV_Mul`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-mul\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5);\n inB = SinOsc.ar(Line.kr(100, 400, 5), 0, 0.5);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n);\n\n(\nSynthDef(\"help-mul2\", { |out = 0|\n var inA, chainA, inB, chainB, chain ;\n inA = SinOsc.ar(500, 0, 0.5) * Line.kr;\n inB = LFNoise1.ar(20);\n chainA = FFT(LocalBuf(2048), inA);\n chainB = FFT(LocalBuf(2048), inB);\n chain = PV_Mul(chainA, chainB);\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\ns.scope;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_Mul.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 396} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PV_PhaseShift`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\nSynthDef(\"help-phaseShift\", { |out = 0|\n var in, chain;\n in = SinOsc.ar(500);\n chain = FFT(LocalBuf(2048), in);\n chain = PV_PhaseShift(chain, LFNoise2.kr(1, 180, 180));\n Out.ar(out, 0.1 * IFFT(chain).dup);\n}).play(s);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 148} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `PV_PhaseShift90` that runs as it is."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n\n(\n{ |out = 0, bufnum = 0|\n var in, fft, fft2, shifted;\n in = SinOsc.ar(500, 0, 0.1);\n fft = FFT(LocalBuf(2048), in);\n fft2 = FFT(LocalBuf(2048), in);\n shifted = PV_PhaseShift90(fft);\n Out.ar(out, [IFFT(fft2), IFFT(shifted)]);\n}.scope\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_PhaseShift90.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 163} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `PV_RectComb`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, 8, LFTri.kr(0.097, 0, 0.4, 0.5),\n LFTri.kr(0.24, 0, -0.5, 0.5));\n IFFT(chain).dup\n}.play;\n);\n\n(\n{\n var sig, chain;\n sig = WhiteNoise.ar(0.2);\n chain = FFT(LocalBuf(2048), sig);\n chain = PV_RectComb(chain, MouseX.kr(0, 32), MouseY.kr, 0.2);\n IFFT(chain).dup\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PV_RectComb.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 248} +{"conversations": [{"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, phases, chain, sig;\n // Create simple undulating magnitudes\n mags = { FSinOsc.kr(ExpRand(0.1, 1)).range(0, 1) }.dup(100);\n // Then give them a \"rolloff\" to make the sound less unpleasant\n mags = mags * ((1, 0.99 .. 0.01).squared);\n // Let's turn the bins on and off at different rates, I'm *sure* that'll sound interesting\n mags = mags * { LFPulse.kr(2 ** IRand(-3, 5)).range(0, 1) }.dup(100);\n // Let's ignore phase for now\n phases = 0.dup(100);\n // We need to create an FFT chain to feed our data in to.\n // The easiest way is to do an FFT on some signal which we then ignore!\n chain = FFT(LocalBuf(512), FSinOsc.ar);\n // Now we can do the packing\n chain = PackFFT(chain, 512, [mags, phases].flop.flatten, 0, 99, 1);\n sig = IFFT(chain);\n sig.dup\n}.play\n);\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PackFFT.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 408} {"conversations": [{"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.asr(0.001, 1, 0.2), gate, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\dur, 0.5, \\instrument, \\sinegrain, \\freq, 440);\nb = Padd(\\freq, Pseq([10, 30, 100], inf), a);\nb.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Padd.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 208} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Paddp` and actually plays. Assume nothing about the session."}, {"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.001, sustain), 1, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\freq, Pseq([500, 600, 700]), \\instrument, \\sinegrain);\na = Paddp(\\freq, Pseq([30, 90, -100], inf), a);\na.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Paddp.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 212} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Paddpre` and actually plays. Assume nothing about the session."}, {"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.001, sustain), 1, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\dur, 0.5, \\instrument, \\sinegrain);\nb = Paddpre(\\freq, Pseq([10, 30, 100], inf), a);\nb.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Paddpre.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 198} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pbind` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\berlinb, { |out = 0, freq = 80, amp = 0.01, pan = 0, gate = 1|\n var synth, env;\n env = Decay2.kr(gate, 0.05, 8, 0.0003);\n synth = RLPF.ar(\n LFPulse.ar(freq, 0, SinOsc.kr(0.12, [0, 0.5pi], 0.48, 0.5)),\n freq * SinOsc.kr(0.21, 0, 18, 20),\n 0.07\n );\n #a, b = synth*env;\n DetectSilence.ar(a, 0.1, doneAction: Done.freeSelf);\n Out.ar(out, amp * Mix.ar(PanAz.ar(4, [a, b], [pan, pan+1])));\n}).add;\n);\n\n(\nf = Pbind(\n \\degree, Pseq([0, 1, 2, 4, 6, 3, 4, 8], inf),\n \\dur, 0.5, \\octave, 3, \\instrument, \\berlinb\n).play;\n);\n\n(\nf.stream = Pbind(\n \\degree, Pseq([0, 1, 2, 4, 6, 3, 4, 8], inf),\n \\dur, 0.5, \\octave, [2, 1],\n \\instrument, \\berlinb,\n \\pan, Pfunc({ 1.0.rand2 })\n).asStream;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pbind.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 438} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `PdurStutter`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\na = PdurStutter(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,0,1,3,4,0], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\n100.do({ x.next.postln });\n);\n\n\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n(\na = PdurStutter(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\n\nRoutine({\n loop({\n Synth.grain(\\help_sinegrain, [\\freq, 440]);\n x.next.wait;\n })\n}).play(TempoClock.default);\n);\n\n\n(\na = PdurStutter(\n Pseq(#[1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,0,4,4], inf),\n Pseq(#[0.5, 1, 2, 0.25, 0.25], inf)\n);\nx = a.asStream;\nRoutine({\n loop({\n Synth.grain(\\help_sinegrain, [\\freq, 440]);\n x.next.wait;\n })\n}).play(TempoClock.default);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PdurStutter.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 574} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pfsm` 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, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n\n(\na = Pfsm([\n #[0, 1],\n 67, #[0, 0, 3],\n 72, #[2],\n 73, #[0, 2],\n Pseq([74, 75, 76, 77]), #[2, 3, 3],\n nil, nil\n ], inf).asStream;\nRoutine({\n loop({\n Synth(\\help_sinegrain, [\\freq, a.next.midicps]);\n 0.1.wait;\n })\n}).play;\n);\n\n(\nPfsm([\n #[5, 6, 7], // entry states\n\n // e1 (== state 0)\n Pbind(\\dur, Pseq([1/8, 3/8]), \\midinote, Pseq([86, 75])),\n // #[1], // as given in CMJ\n // my de-boredom-ated version..\n #[1, 1, 1, 1, 1, 1, 1, 8],\n // e2 (== state 1)\n Pbind(\\dur, 1/2, \\midinote, Pseq([69])),\n #[0, 1],\n // e3 (== state 2)\n Pbind(\\dur, 1/3, \\midinote, Pseq([55, 60, 66])),\n #[0, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n // e4 (== state 3)\n Pbind(\\dur, 1/4, \\midinote, Pseq([81, 80, 77, 76])),\n #[1, 4, 4, 4, 4],\n // e5 (== state 4)\n Pbind(\\dur, Pseq([1, 2/3, 2/3, 2/3, 1]), \\midinote, Pseq([\\, 70, 70, 70, \\])),\n #[2, 3],\n // e6 (== state 5)\n Pbind(\\dur, 1/4, \\midinote, Pseq([59, 61])),\n #[0, 2, 4, 5, 5, 5, 5, 5, 5, 5],\n // e7 (== state 6)\n Pbind(\\dur, 1/4, \\midinote, Pseq([87, 88], 2)),\n #[4, 4, 4, 4, 6, 6, 6, 7, 7, 7],\n // e8 (== state 7)\n Pbind(\\dur, 1, \\midinote, Pseq([56])),\n #[1, 3, 6, 6, 6],\n // terminal state\n nil, nil\n]).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pfsm.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 845} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Pgtpar` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// synthdef\n(\nSynthDef(\\help_sinegrain,\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n}).add;\n);\n\n// pattern with different start times\n(\nx = Pbind(\n \\instrument, \\help_sinegrain,\n \\degree, Pseq(#[0, 5, 4, 2, 1, 1, 3], inf),\n \\dur, Pseq(#[0.25, 0.5, 1.0], inf),\n \\scale, #[0, 3, 5, 9, 10]\n);\na = Pbus(Pgtpar([0.0, x, 1.5, x, 2.25, x])).play;\n);\ns.plotTree;\na.stop;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pgtpar.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 289} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `PingPong`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\ns = Server.local;\ns.waitForBoot({\n\nb = Buffer.alloc(s, 44100 * 2, 2);\n\nSynthDef(\"help-PingPong\", { |out = 0, bufnum = 0, feedback = 0.5, delayTime = 0.2|\n var left, right;\n left = Decay2.ar(Impulse.ar(0.7, 0.25), 0.01, 0.25,\n SinOsc.ar(SinOsc.kr(3.7, 0, 200, 500)));\n right = Decay2.ar(Impulse.ar(0.5, 0.25), 0.01, 0.25,\n Resonz.ar(PinkNoise.ar(4), SinOsc.kr(2.7, 0, 1000, 2500), 0.2));\n\n Out.ar(out,\n PingPong.ar(bufnum, [left, right], delayTime, feedback, 1)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum, \\feedback, 0.5, \\delayTime, 0.1]);\n\n})\n);\n\nb.free;\n\n(\ns = Server.local;\ns.waitForBoot({\n\nb = Buffer.alloc(s, 44100 * 2, 2);\n\nSynthDef(\"help-PingPong\", { |out = 0, bufnum = 0|\n var left, right;\n left = Decay2.ar(Impulse.ar(0.7, 0.25), 0.01, 0.25,\n SinOsc.ar(SinOsc.kr(3.7, 0, 200, 500)));\n right = Decay2.ar(Impulse.ar(0.5, 0.25), 0.01, 0.25,\n Resonz.ar(PinkNoise.ar(4), SinOsc.kr(2.7, 0, 1000, 2500),\n0.2));\n\n Out.ar(out,\n PingPong.ar(bufnum, [left, right] * EnvGen.kr(Env([1, 1, 0], [2, 0.1])),\n 0.1, 0.8, 1)\n )\n}).play(s, [\\out, 0, \\bufnum, b.bufnum]);\n});\n);\n\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/PingPong.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 680} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Plambda`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n/*\n\nA simple example:\nTwo patterns playing in parallel,\nsharing data between eachother\n\n*/\n(\n // a melody playing random scale degrees\n a = Pbind(\n \\dur, 0.125,\n \\octave, 4,\n \\degree, Plet(\\melody, pattern: Pwhite(0, 7))\n );\n\n // the bass, scale degrees sampled from the \\melody variable defined above\n b = Pbind(\n \\dur, 0.5,\n \\octave, 3,\n \\degree, Pget(\\melody, default: 1, repeats: inf).trace\n );\n\n // Play the patterns in parallel\n Plambda(\n Ppar([a, b], inf)\n ).play;\n);\n/*\n\nA more complex example:\nThree patterns running in parallel\n\n*/\n(\nSynthDef(\\sine,\n { |out = 0, freq = 440, sustain = 0.05, pan = 0, amp = 0.1|\n var env;\n env = EnvGen.kr(Env.perc(Rand(0.001, 0.02), sustain, AmpCompA.kr(freq)*amp), doneAction: Done.freeSelf);\n Out.ar(out, Pan2.ar(SinOsc.ar(freq), pan, env))\n }).add;\n);\n\n(\na = Plambda(\n Pseq([\n Pfindur(5,\n Ppar([\n Pbind(\\note, Plet(\\x, Prand([1, 5, 1, [10, 14]], inf)), \\dur, 8/3, \\pan, -1),\n Pbind(\\note, Plet(\\y, Pseq([5, 3, 2, 0, [0, 5, 6, 9]], inf)), \\dur, 0.5, \\pan, 1),\n Pbind(\\note, Pseq([Pget(\\x), Pget(\\y)], inf) + 12, \\pan, 0, \\dur, 2/3)\n ])\n ),\n Pbind(\\note, Pget(\\x, 0, 6) + [0, 5], \\dur, Pdup(inf, Prand([2/3, 1/6])))\n ], inf).trace(\\eventScope) // internally, the values are shared via \\eventScope\n);\n\nb = Pbindf(a, \\instrument, \\sine, \\legato, 0.1);\nb.play\n);\n\n// Play two copies of the complex pattern above in parallel, one of them transposed and playing with shorter durations\nPpar([b, Pbindf(b, \\ctranspose, 24, \\dur, Pkey(\\dur) * 0.25)]).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Plambda.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 794} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Pmul`. 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.asr(0.001, 1, 0.2), gate, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\dur, 0.5, \\instrument, \\sinegrain, \\freq, 440);\nb = Pmul(\\freq, Pseq([1, 2, 3, 4, 5, 6, 7], inf), a);\nb.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pmul.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 217} {"conversations": [{"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.001, sustain), 1, doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))\n }).add;\n);\n\n(\na = Pbind(\\freq, Pseq([500, 600, 700]), \\instrument, \\sinegrain);\na = Pmulp(\\freq, Pseq([0.5, 0.9, 0.8], inf), a);\na.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Pmulp.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 217} @@ -13361,30 +13580,41 @@ {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Rand`: bind everything it needs first."}, {"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))\n )\n}).add;\n);\n\n(\nRoutine({\n 8.do({\n Synth.new(\"help-Rand\"); 1.0.wait;\n })\n}).play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Rand.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 150} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `RandID` that runs as it is."}, {"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 WhiteNoise.ar(0.05) + Dust2.ar(70)\n )\n}).add;\n);\n\n// reset the seed of my rgen at a variable rate\n(\nSynthDef(\"help-RandSeed\", { |seed = 1910, id = 1|\n RandID.kr(id);\n RandSeed.kr(Impulse.kr(FSinOsc.kr(0.2, 0, 10, 11)), seed);\n}).add;\n\n);\n\n// start two noise synths on left and right channel with a different randgen id\na = Synth(\"help-RandID\", [\\out, 0, \\id, 1]);\nb = Synth(\"help-RandID\", [\\out, 1, \\id, 2]);\n\n// reset the seed of randgen 1\nx = Synth(\"help-RandSeed\", [\\id, 1]);\n\n// change the target randgen to 2 (affects right channel)\nx.set(\\id, 2);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RandID.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 354} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `RecordBuf` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// Execute the following in order\n(\n// allocate a Buffer\ns = Server.local;\nb = Buffer.alloc(s, 44100 * 4.0, 1); // a four second 1 channel Buffer\n);\n\n// record for four seconds\n(\nSynthDef(\\help_RecordBuf, { |out = 0, bufnum = 0|\n var formant;\n formant = Formant.ar(XLine.kr(400, 1000, 4), 2000, 800, 0.125);\n RecordBuf.ar(formant, bufnum, doneAction: Done.freeSelf, loop: 0);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play it back\n(\nSynthDef(\\help_RecordBuf_playback, { |out = 0, bufnum = 0|\n var playbuf;\n playbuf = PlayBuf.ar(1, bufnum);\n FreeSelfWhenDone.kr(playbuf); // frees the synth when the PlayBuf is finished\n Out.ar(out, playbuf);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// overdub\n(\nSynthDef(\\help_RecordBuf_overdub, { |out = 0, bufnum = 0|\n var formant;\n formant = Formant.ar(XLine.kr(200, 1000, 4), 2000, 800, 0.125);\n // mixes equally with existing data\n RecordBuf.ar(formant, bufnum, 0, 0.3, 0.5, doneAction: Done.freeSelf, loop: 0);\n}).play(s, [\\out, 0, \\bufnum, b]);\n);\n\n// play back the overdubbed version\nSynth.new(\\help_RecordBuf_playback, [\\out, 0, \\bufnum, b], s);\n\n// write the contents of the buffer to a file (see Buffer for more options)\n(\nb.write(sampleFormat: 'int16');\nthisProcess.platform.recordingsDir +/+ \"SC_\" ++ Date.localtime.stamp ++ \".aiff\"; // generated path\n);\n\nb.close; b.free; // cleanup\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RecordBuf.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 686} -{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `ReplaceOut`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"ReplaceOutHelp\", { |out = 0, freq = 440|\n var source;\n source = SinOsc.ar(freq, 0, 0.1);\n\n // write to the bus, replacing previous contents\n ReplaceOut.ar(out, source);\n\n}).add;\n);\n\n// each Synth replaces the output of the previous one\nx = Synth.tail(s, \"ReplaceOutHelp\", [\\freq, 500]);\ny = Synth.tail(s, \"ReplaceOutHelp\", [\\freq, 600]);\nz = Synth.tail(s, \"ReplaceOutHelp\", [\\freq, 700]);\n\n// release them in reverse order; the older Synths are still there.\nz.free;\ny.free;\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/ReplaceOut.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 248} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `RunningSum` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```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)/numsamp) ** (power.reciprocal)\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/RunningSum.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 102} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `SampleRate`: bind everything it needs first."}, {"role": "assistant", "content": "```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.ir * 0.01, 440];\n SinOsc.ar(freq, 0, 0.1)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SampleRate.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 119} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Scale` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nr = {\n var scale = Scale.choose.postln;\n SinOsc.ar(\n (\n DegreeToKey.kr(\n scale.as(LocalBuf),\n MouseX.kr(0, 15), // mouse indexes into scale\n scale.stepsPerOctave,\n 1, // mul = 1\n 60 // offset by 72 notes\n )\n + LFNoise1.kr([3, 3], 0.04) // add some low freq stereo detuning\n ).midicps, // convert midi notes to hertz\n 0,\n 0.25\n )\n}.play;\n);\n\nr.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Scale.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 203} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `SelectX` that runs as it is."}, {"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 SelectX.ar(MouseX.kr(0, 1) * a.size, a) * 0.2\n}.play;\n);\n\n(\n{\n var a;\n a = [\n SinOsc.kr(0.25),\n LFSaw.kr(10),\n LFPulse.kr(0.3)\n ];\n\n SinOsc.ar(SelectX.kr(MouseX.kr(0, 1) * a.size, a) * 300 + 400) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SelectX.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 207} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `SelectXFocus` that runs as it is."}, {"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, 230)),\n SinOsc.ar(SinOsc.kr(4 * [1, 1.03], 0, 200, 300))\n ];\n\n SelectXFocus.ar(MouseX.kr(0, 1) * a.size, a, MouseY.kr(0, a.size)) * 0.2\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SelectXFocus.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 194} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `SharedIn`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n// only works with the internal server\ns = Server.internal;\ns.boot;\n);\n\n(\nSynthDef(\"help-SharedIn1\", {\n Out.ar(0, SinOsc.ar(Lag.kr(SharedIn.kr(0, 1), 0.01), 0, 0.2));\n}).add;\nSynthDef(\"help-SharedIn2\", {\n Out.ar(1, SinOsc.ar(Lag.kr(SharedIn.kr(0, 1), 0.01, 1.5), 0, 0.2));\n}).add;\n);\n\n(\ns.setSharedControl(0, 300); // an initial value\ns.sendMsg(\\s_new, \"help-SharedIn1\", x = s.nextNodeID, 0, 1);\ns.sendMsg(\\s_new, \"help-SharedIn2\", y = s.nextNodeID, 0, 1);\n\nRoutine({\n 30.do({\n s.setSharedControl(0, 300 * (10.rand + 1));\n 0.2.wait;\n });\n s.sendMsg(\\n_free, x);\n s.sendMsg(\\n_free, y);\n}).play;\n);\n\n\ns.quit;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SharedIn.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 387} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `SharedOut` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// only works with the internal server\ns = Server.internal;\ns.boot;\n);\n\n(\nSynthDef(\"help-SharedOut\", {\n SharedOut.kr(0, SinOsc.kr(0.2));\n}).add;\n);\n\n(\ns.sendMsg(\\s_new, \"help-SharedOut\", x = s.nextNodeID, 0, 1);\ns.sendMsg(\\n_trace, x);\n\n// poll the shared control bus\nRoutine({\n 30.do({\n s.getSharedControl(0).postln;\n 0.2.wait;\n });\n}).play;\n);\n\n\ns.quit;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SharedOut.schelp", "aug": "prologue:ugen", "prompt_tokens": 55, "answer_tokens": 222} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `SpecCentroid`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\nb = Buffer.alloc(s, 2048, 1);\n(\nx = {\n var in, chain, freq, rq, centroid;\n\n // freq = LFPar.kr(0.3).exprange(100, 1000);\n freq = MouseY.kr(1000, 100, 1);\n in = Blip.ar(freq, MouseX.kr(1, 100, 1));\n chain = FFT(LocalBuf(2048), in);\n centroid = SpecCentroid.kr(chain);\n centroid.poll(10);\n in.dup * 0.1\n\n}.play\n);\n\nx.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SpecCentroid.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 201} +{"conversations": [{"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, flat, flatdb, flatdbsquish;\n\n in = XFade2.ar(WhiteNoise.ar, SinOsc.ar, MouseX.kr(-1, 1));\n chain = FFT(LocalBuf(2048), in);\n Out.ar(0, in * 0.1);\n\n flat = SpecFlatness.kr(chain);\n\n flatdb = 10 * flat.log; // Convert to decibels\n flatdbsquish = LinLin.kr(flatdb, -45, -1.6, 0, 1).max(-10); // Rescale db roughly to 0...1.\n\n flat.poll(10, \"flatness: \");\n flatdb.poll(10, \"flatness (db): \");\n\n [flat, flatdbsquish]\n}.scope;\n);\n\n(\n{ // Now try with your own voice\n var in, chain;\n in = SoundIn.ar([0, 1]).mean;\n chain = FFT(LocalBuf(2048), in);\n Out.kr(0, [in, SpecFlatness.kr(chain).poll(1, \"flatness: \")]);\n}.scope;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SpecFlatness.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 403} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `SpecPcile`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n// Simple demo with filtering white noise, and trying to infer the cutoff freq.\n// Move the mouse.\n(\n{\n var in, chain, realcutoff, estcutoff;\n realcutoff = MouseX.kr(0.00001, 22050);\n in = LPF.ar(WhiteNoise.ar, realcutoff);\n chain = FFT(LocalBuf(2048), in);\n estcutoff = Lag.kr(SpecPcile.kr(chain, 0.9), 1);\n realcutoff.poll(Impulse.kr(1), \"real cutoff\");\n estcutoff.poll(Impulse.kr(1), \"estimated cutoff\");\n Out.kr(0, estcutoff * 22050.0.reciprocal);\n Out.ar(0, in);\n}.scope;\n);\n\n// Audio input - try different vowel/long-consonant sounds and see what comes out.\n// Specifically, change from \"ssss\" through to \"aaaa\" through to \"wwww\".\n(\n{\n var in, chain, perc;\n in = SoundIn.ar([0, 1]).mean;\n chain = FFT(LocalBuf(2048), in);\n // Out.ar(0, in * 0.1);\n perc = SpecPcile.kr(chain, 0.5);\n Out.kr(0, perc * 22050.0.reciprocal);\n Out.ar(1, LPF.ar(WhiteNoise.ar, perc)); // outputting to right channel\n}.scope;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/SpecPcile.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 485} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Spring` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// trigger gate is mouse button\n// spring constant is mouse x\n// mouse y controls damping\n(\n{\n var inforce, outforce, freq, k, d;\n inforce = K2A.ar(MouseButton.kr(0, 1, 0)) > 0;\n k = MouseY.kr(0.1, 20, 1);\n d = MouseX.kr(0.00001, 0.1, 1);\n outforce = Spring.ar(inforce, k, d);\n freq = outforce * 400 + 500; // modulate frequency with the force\n SinOsc.ar(freq, 0, 0.2)\n}.play;\n);\n\n\n// several springs in series.\n// trigger gate is mouse button\n// spring constant is mouse x\n// mouse y controls damping\n(\n{ var m0, m1, m2, m3, d, k, inforce;\n d = MouseY.kr(0.00001, 0.01, 1);\n k = MouseX.kr(0.1, 20, 1);\n inforce = K2A.ar(MouseButton.kr(0, 1, 0)) > 0;\n m0 = Spring.ar(inforce, k, 0.01);\n m1 = Spring.ar(m0, 0.5 * k, d);\n m2 = Spring.ar(m0, 0.6 * k + 0.2, d);\n m3 = Spring.ar(m1 - m2, 0.4, d);\n SinOsc.ar(m3 * 200 + 500, 0, 0.2) // modulate frequency with the force\n\n}.play;\n);\n\n// modulating a resonating string with the force\n// spring constant is mouse x\n// mouse y controls damping\n(\n{ var m0, m1, m2, m3, m4, d, k, t;\n k = MouseX.kr(0.5, 100, 1);\n d = MouseY.kr(0.0001, 0.01, 1);\n t = Dust.ar(2);\n m0 = Spring.ar(ToggleFF.ar(t), 1 * k, 0.01);\n m1 = Spring.ar(m0, 0.5 * k, d);\n m2 = Spring.ar(m0, 0.6 * k, d);\n m3 = Spring.ar([m1, m2], 0.4 * k, d);\n m4 = Spring.ar(m3 - m1 + m2, 0.1 * k, d);\n CombL.ar(t, 0.1, LinLin.ar(m4, -10, 10, 1/8000, 1/100), 12)\n\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Spring.schelp", "aug": "prologue:ugen", "prompt_tokens": 43, "answer_tokens": 742} +{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `StaticText`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nvar w, a, r, b, q;\nw = Window(\"Frequency Monitor\", Rect(200, Window.screenBounds.height - 200, 300, 150)).front;\n\na = StaticText(w, Rect(45, 10, 200, 20)).background_(Color.rand);\na.string = \" Current Frequency \";\n\nButton.new(w, Rect(45, 70, 200, 20)).states_([[\"close\", Color.black, Color.rand]]).action_({ w.close });\n\ns.waitForBoot({\n\n b = Bus.new(\\control, 0, 1);\n\n q = SynthDef(\\Docs_FreqMonitor, {\n var freq, snd;\n freq = LFNoise0.ar(2, 400, 650);\n snd = SinOsc.ar(freq, 0, 0.2);\n Out.ar(0, snd);\n Out.kr(b.index, freq); // output the frequency to a control bus\n }).play;\n\n r = Routine {\n {\n // Set the value of the StaticText to the value in the control bus.\n // Setting GUI values is asynchronous, so you must use .defer in the system clock.\n // Also you must check if the window is still open, since Routine will continue for at least\n // one step after you close the window.\n b.get({ |v|\n {\n if(w.isClosed.not) {\n a.string = \" Current Frequency: \" ++ v.round(0.01)\n }\n }.defer\n });\n\n 0.01.wait;\n }.loop\n\n }.play\n});\n\nCmdPeriod.doOnce({ w.close });\nw.onClose = { r.stop; q.free; b.free }; // clean up if the window closes\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/StaticText.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 581} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Stethoscope`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var f = { |l,h| SinOsc.kr(0.1, {pi.rand}).range(l, h) } ;\n Pulse.ar({ f.(20, 1000) }!6, { f.(0.0, 1) }!6, { f.(0.0, 1.0) }!6)\n}.play;\n);\n\nc = s.scope;\nc.numChannels = 6;\nc.scopeView.waveColors = [Color.red, Color.red, Color.cyan, Color.cyan, Color.white, Color.white];\nc.style = 2;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Stethoscope.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 195} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Synth`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\ns.boot;\n(\n// send a synth def to server\nSynthDef(\"tpulse\", { |out = 0, freq = 700, sawFreq = 440.0|\n Out.ar(out, SyncSaw.ar(freq, sawFreq, 0.1));\n}).add;\n);\n\n// Here the defaults for *new will result in a Synth at the head of the default group\n// of the default Server. This will use the SynthDef's default arguments;\ny = Synth.new(\"tpulse\");\ny.free;\n\n// The same done explicitly\ny = Synth.new(\"tpulse\", nil, s, \\addToHead);\ny.free;\n\n// With some arguments\ny = Synth.new(\"tpulse\", [\\freq, 350, \\sawFreq, 220]);\ny.free;\n\n// make a new synth\ny = Synth(\"tpulse\");\n\n// pause\ny.run(false);\n\ny.run(true);\n\n// set a control by argument name\ny.set(\"freq\", 200);\n\n// or by index\ny.set(2, 100.0);\n\n// modulate out to bus number 1 (the right speaker)\ny.set(0, 1);\n\n// multiple set commands in one message\ny.set(\"out\", 0, \"freq\", 300);\n\n// free the synth from the server\ny.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Synth.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 430} +{"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `TIRand` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"help-TIRand\", {\n var trig, outBus;\n trig = Dust.kr(10);\n outBus = TIRand.kr(0, 1, trig); // play on random channel between 0 and 1\n Out.ar(outBus, PinkNoise.ar(0.2))\n\n}).play;\n);\n\n(\n{\n var trig = Dust.kr(10);\n SinOsc.ar(\n TIRand.kr(4, 12, trig) * 100\n ) * 0.1\n}.play;\n);\n\n(\n{\n var trig = Dust.ar(MouseX.kr(1, 8000, 1));\n SinOsc.ar(\n TIRand.ar(4, 12, trig) * 100\n ) * 0.1\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/TIRand.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 240} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Tdef` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n// load a synthdef\ns.boot;\nSynthDef(\"pdef_grainlet\",\n { |out = 0, freq = 440, sustain = 0.05|\n var env;\n env = EnvGen.kr(Env.perc(0.01, sustain, 0.3), doneAction: Done.freeSelf);\n Out.ar(out, SinOsc.ar(freq, 0, env))\n }).add;\n);\n\n\n\nTdef(\\z, Pseq([1, 1, 1, 0.5, 0.5], inf));\n\n(\nPset(\\instrument, \\pdef_grainlet,\n Ppar([\n Pbind(\n \\dur, Tdef(\\z),\n \\note, Pseq([1, 3, 2, 1, 0], inf),\n \\x, Pfunc { TempoClock.default.elapsedBeats.postln } // posts the onset times\n ),\n Pbind(\n \\dur, 4, // reference beat\n \\sustain, 0.1,\n \\note, 8\n )\n ])\n).play(quant: 1);\n);\n\n\nTdef(\\z, Prand([1, 1, 0.23, 0.5, 0.5], inf)); // exchange time pattern\nTdef(\\z, Pseq([1, 1, 1, 1], inf)); // pattern stays in sync.\nTdef(\\z, Pseq([1, 1, 1, 0.5, 0.5], inf)); // but might be in different order.\n // to avoid this, set quant to an appropriate value.\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Tdef.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 463} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Timer`. Define every value it uses."}, {"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));\n SinOsc.ar(Timer.kr(trig) * 500 + 500, 0, 0.2)\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Timer.schelp", "aug": "prologue:ugen", "prompt_tokens": 47, "answer_tokens": 117} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `UnaryOpUGen` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```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// Plotting the \"abs\" unary operator (via the server):\n\n{ SinOsc.ar(300).abs }.plot\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/UnaryOpUGen.schelp", "aug": "prologue:ugen", "prompt_tokens": 56, "answer_tokens": 137} -{"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Warp1`. Define every value it uses."}, {"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 = Warp1.ar(1, b, pointer, 1, 0.3, -1, 16, Line.kr(0, 1, 40), 4);\n Pan2.ar(sound, pointer * 2 - 1, 0.25)\n}.play\n);\nb.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Warp1.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 169} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Unpack1FFT`: bind everything it needs first."}, {"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 = 1024;\n\n sig = SinOsc.ar(LFDNoise3.kr(LFNoise0.kr(1) * 40 + 60) * 700 + 800);\n\n chain = FFT(LocalBuf(fftsize), sig);\n stream = Unpack1FFT(chain, bufsize: fftsize, binindex: 0, whichmeasure: 0);\n\n // each time an FFT window starts, the unpacker returns a new value\n windowStarts = chain > -1;\n demand = Demand.kr(windowStarts, 0, stream);\n demand.poll(windowStarts);\n\n sig * 0.05\n}.play\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/Unpack1FFT.schelp", "aug": "prologue:ugen", "prompt_tokens": 54, "answer_tokens": 272} {"conversations": [{"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 = WrapIndex.kr(buf, MouseX.kr(0, BufFrames.ir(buf) * 3));\n SinOsc.ar(freq) * 0.1\n}.play;\n);\n\n// the same using a global buffer\n(\nt = [200, 300, 400, 500, 600, 800];\nb = Buffer(s, t.size, 1);\n\n// alloc and set the values\ns.listSendMsg(b.allocMsg(b.setnMsg(0, t)).postln);\n\nSynthDef(\\help_Index, { |out = 0, bufnum = 0|\n Out.ar(out,\n SinOsc.ar(\n WrapIndex.kr(\n bufnum,\n MouseX.kr(0, BufFrames.ir(bufnum) * 3)\n ),\n 0,\n 0.5\n )\n )\n}).play(s, [\\bufnum, b.bufnum]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Classes/WrapIndex.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 357} {"conversations": [{"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(freq, sawFreq,0.1) )\n}).send(s);\n);\n\n// all OSC commands generated in the function contained below will be added to a bundle\n// and executed simultaneously after 2 seconds.\n(\ns.makeBundle(2.0, {\n x = Synth.new(\"tpulse\");\n a = Bus.control.set(440);\n x.map(\\freq, a);\n});\n);\nx.free;\n\n// don't send\n(\nb = s.makeBundle(false, {\n x = { PinkNoise.ar(0.1) * In.kr(0, 1); }.play;\n});\n);\n// now pass b as a pre-existing bundle, and start both synths synchronously\n(\ns.makeBundle(nil, { // nil executes ASAP\n y = { SinOsc.kr(0.2).abs }.play(x, 0, 0, \\addBefore); // sine envelope\n}, b);\n);\nx.free; y.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Bundled-Messages.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 389} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `Pan2` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n(\ns.bind {\n SynthDef(\"tpulse2\", { arg out=0, freq=700, sawFreq=440.0;\n Out.ar(out, Pan2.ar(SyncSaw.ar(freq, sawFreq, 0.1), SinOsc.kr(8)) )\n }).send(s);\n s.sync; // wait until synthdef is loaded\n x = Synth.new(\"tpulse2\");\n a = Bus.control.set(440);\n x.map(\\freq, a);\n};\n);\n\na.free; x.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Bundled-Messages.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 194} {"conversations": [{"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 for Impulse here\n SinOsc.ar(freq, 0, 0.3) ! 2\n}.play;\n\nl = List.new;\nr = fork { loop { l.add(b.getSynchronous); 0.1.wait } };\n\nr.stop;\na.free;\n\nl.array.plot; // to view the results graphically\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Debugging-tips.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 180} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `WhiteNoise` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var in, chain;\n in = WhiteNoise.ar(0.8);\n chain = FFT(LocalBuf(2048), in); // encode to frequency domain\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4)); // process\n IFFT(chain) // decode to time domain\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/FFT-Overview.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 126} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Ringz` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\n{\n var in, chain;\n in = Ringz.ar(Impulse.ar([2, 3]), [700, 800], 0.1) * 5; // stereo input\n chain = FFT({ LocalBuf(2048) } ! 2, in); // array of two local buffers\n chain = PV_RandComb(chain, 0.95, Impulse.kr(0.4));\n IFFT(chain) // returns a stereo out\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/FFT-Overview.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 152} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `LFClipNoise` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nx = { var inA, chainA, chainB;\n inA = LFClipNoise.ar(100);\n chainA = FFT(LocalBuf(2048, 1), inA);\n chainB = PV_PhaseShift(chainA, pi);\n // half-circle phase shift should result in an inverse signal\n // in practice, ultra-low frequencies sneak through\n // but you won't hear very much here\n IFFT(chainA) + IFFT(chainB);\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/FFT-Overview.schelp", "aug": "prologue:ugen", "prompt_tokens": 55, "answer_tokens": 168} {"conversations": [{"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 to a stereo position\n CombL.ar( // a comb filter used as a string resonator\n Dust.ar( // random impulses as an excitation function\n // an array to cause expansion of Dust to n channels\n // 1 means one impulse per second on average\n Array.fill(n, 1),\n 0.3 // amplitude\n ),\n 0.01, // max delay time in seconds\n // array of different random lengths for each 'string'\n Array.fill(n, {0.004.rand+0.0003}),\n 4 // decay time in seconds\n ),\n Array.fill(n,{1.0.rand2}) // give each voice a different pan position\n )\n )\n}.play;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Multichannel-Expansion.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 273} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Saw`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\n SynthDef(\\controlList, { |out = 0, freq = 440, amp = 0.1, detune = #[0.999, 1.001], gate = 1|\n var sig = Mix(Saw.ar(freq * (detune ++ [1]), amp)),\n env = EnvGen.kr(Env.adsr, gate, doneAction: Done.freeSelf);\n Out.ar(out, (sig * env) ! 2);\n }).add;\n\n SynthDescLib.global[\\controlList]\n )\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/NodeMessaging.schelp", "aug": "prologue:ugen", "prompt_tokens": 46, "answer_tokens": 188} +{"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `SoundIn`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\n(\nvar server, numChannels;\nvar inputFile = SoundFile.openRead(ExampleFiles.child);\nnumChannels = inputFile.numChannels;\ninputFile.close; // doesn't need to stay open; we just need the stats\n\nserver = Server(\\nrt,\n options: ServerOptions.new\n .numOutputBusChannels_(numChannels)\n .numInputBusChannels_(numChannels)\n);\n\nx = Score([\n [0.0, ['/d_recv',\n SynthDef(\\fft, {\n // 'child' is a mono file, but this SynthDef works for any number of channels.\n var channels = (0..(numChannels-1));\n var in = SoundIn.ar(channels);\n var fft = FFT(LocalBuf(1024, 1), in);\n fft = PV_MagFreeze(fft, ToggleFF.kr(Dust.kr(12)));\n Out.ar(0, IFFT(fft))\n }).asBytes\n ]],\n [0.0, Synth.basicNew(\\fft, server).newMsg]\n]);\n\nx.recordNRT(\n outputFilePath: \"~/nrt.wav\".standardizePath,\n inputFilePath: inputFile.path,\n // make sure to use the same sample rate as the input file!\n sampleRate: inputFile.sampleRate,\n headerFormat: \"wav\",\n sampleFormat: \"int16\",\n options: server.options,\n duration: inputFile.duration\n);\n\nserver.remove;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Non-Realtime-Synthesis.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 505} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Routine` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n// SynthDefs on the fly\ns.boot;\n(\nt = TempoClock.new;\nr = Routine.new({\n 10.do({\n // could be done with an argument instead of a new def, but proves the point\n SynthDef(\"help-EnvGen\" ++ i, { arg out = 0;\n Out.ar(\n out,\n EnvGen.kr(Env.perc, 1.0, doneAction: Done.freeSelf)\n * SinOsc.ar(100 + (100 * t.elapsedBeats), 0, 0.1)\n )\n }).play(s);\n 1.yield;\n });\n}).play(t); // Note the alternative syntax: Routine.play(aClock)\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/Spawning.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 232} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `SoundIn` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\nu = Server(\\scau, NetAddr(\"127.0.0.1\", 9989)); // Change the port from 9989 to the right one for you\nu.serverRunning = true;\nu.ping(10); // Gives about 0.02 for me - confirms that communication is working\n// Now let's create a quick ring-modulator effect:\nz = { SoundIn.ar([0,1]) * SinOsc.ar(MouseX.kr(100, 1000)) }.play(u);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/SuperColliderAU.schelp", "aug": "prologue:ugen", "prompt_tokens": 52, "answer_tokens": 155} {"conversations": [{"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 code\nvar run = false;\nif (run) {\n { GVerb.ar(Dust.ar(5), SinOsc.kr(0.3).range(10, 14), drylevel:0) }.play\n}\n// 3.13 super loud glitch (crackling)! 3.14: super loud glitch (cleaner pitch shifting)!\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Guides/UGen-Changelog.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 169} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Duty`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// this is useful when two UGens need to be called, but only one of their outputs is needed\n(\n{\n var a, b, c;\n a = Dseq([1, 2, 3, 4], inf).dpoll(\"a\");\n b = Dseq([1955, 1952, 1823, 1452], inf).dpoll(\"b\");\n c = (a a Pbind(\n \\dur, Prand([1, 0.5], inf),\n \\freq, Pwhite(200.0, 1000, inf),\n \\rate, Pdup(4, Prand([1, 3, 6, 10], inf)),\n \\dt, Pwhite(0.01, 0.1, inf)\n)\n);\n// modify the source in the meanwhile:\na[0] = { |freq = 440, dt=0.1, rate=2| Ringz.ar(Dust.ar(rate * 10.dup), freq, dt)*0.1 };\n\na.nodeMap.postln; // the values are not set in the node map.\na.clear(3);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Reference/NodeProxy_roles.schelp", "aug": "prologue:ugen", "prompt_tokens": 44, "answer_tokens": 294} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Decay2` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\help_SPE7_BerlinB, { arg i_out=0, freq = 80, amp = 0.2, pan=0;\n var out, a, b;\n amp = Decay2.kr(Impulse.kr(0), 0.05, 8, amp);\n out = RLPF.ar(\n LFPulse.ar(freq, 0, SinOsc.kr(0.12,[0,0.5pi],0.48,0.5), amp),\n freq * SinOsc.kr(0.21,0,4,8),\n 0.07\n );\n #a, b = out;\n DetectSilence.ar(a, 0.0001, doneAction: Done.freeSelf);\n Out.ar(i_out, Mix.ar(PanAz.ar(4, [a, b], [pan, pan+1])));\n}).add;\n\nSynthDef(\\help_SPE7_CFString1, { arg i_out, freq = 360, gate = 1, pan, amp=0.1;\n var out, eg, fc, osc, a, b, w;\n fc = LinExp.kr(LFNoise1.kr(Rand(0.25,0.4)), -1,1,500,2000);\n osc = Mix.fill(8, { LFSaw.ar(freq * [Rand(0.99,1.01),Rand(0.99,1.01)], 0, amp) }).distort * 0.2;\n eg = EnvGen.kr(Env.asr(1,1,1), gate, doneAction: Done.freeSelf);\n out = eg * RLPF.ar(osc, fc, 0.1);\n #a, b = out;\n Out.ar(i_out, Mix.ar(PanAz.ar(4, [a, b], [pan, pan+0.3])));\n}).add;\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Streams-Patterns-Events7.schelp", "aug": "prologue:ugen", "prompt_tokens": 53, "answer_tokens": 568} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `LPF`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1;\n var z;\n z = LPF.ar(\n Mix.new(VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3)),\n XLine.kr(Rand(4000,5000), Rand(2500,3200), 1)\n ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2);\n OffsetOut.ar(out, Pan2.ar(z, pan, amp));\n}, [\\ir]);\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/A-Practical-Guide/PG_03_What_Is_Pbind.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 207} {"conversations": [{"role": "user", "content": "Show me a self-contained SuperCollider patch using `Pulse`: bind everything it needs first."}, {"role": "assistant", "content": "```supercollider\nSynthDef(\\harpsi, { |outbus = 0, freq = 440, amp = 0.1, gate = 1|\n var out;\n out = EnvGen.ar(Env.adsr, gate, doneAction: Done.freeSelf) * amp *\n Pulse.ar(freq, 0.25, 0.75);\n Out.ar(outbus, out ! 2);\n}).add; // see below for more on .add\n\np = Pbind(\n // Use \\harpsi, not \\default\n \\instrument, \\harpsi,\n \\degree, Pseries(0, 1, 8),\n \\dur, 0.25\n).play;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/A-Practical-Guide/PG_03_What_Is_Pbind.schelp", "aug": "prologue:ugen", "prompt_tokens": 50, "answer_tokens": 205} {"conversations": [{"role": "user", "content": "Write a SuperCollider patch that uses `Saw` and actually plays. Assume nothing about the session."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\\event_set, { |freq = 440, gate = 1, amp = 0.1, lagTime = 0.1,\n ffreq = 2000, detune = 1.005, out = 0|\n var sig = Saw.ar(Lag.kr(freq, lagTime) * [1, detune]).sum * amp\n * EnvGen.kr(Env.adsr, gate, doneAction: Done.freeSelf);\n Out.ar(out, sig ! 2);\n}).add;\n);\n\na = Synth(\\event_set);\n\n(\np = Pbind(\n \\type, \\set,\n \\id, a,\n \\instrument, \\event_set,\n \\args, #[],\n \\freq, Pexprand(200, 600, inf),\n \\dur, Pwhite(1, 5, inf) * 0.125\n).play;\n);\n\np.stop;\na.free;\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/A-Practical-Guide/PG_08_Event_Types_and_Parameters.schelp", "aug": "prologue:ugen", "prompt_tokens": 51, "answer_tokens": 291} @@ -13396,6 +13626,8 @@ {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `Resonz`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n(\nSynthDef(\"pitchFromNoise\", { arg out = 0;\n Out.ar(\n out,\n Resonz.ar(\n WhiteNoise.ar(15),\n LFNoise0.kr(2, 110, 660),\n 0.005\n )\n )\n}).add;\n);\n\n\n(\nSynth(\"ringModulation\");\nSynth(\"pitchFromNoise\", [\\out, 1]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/11.schelp", "aug": "prologue:ugen", "prompt_tokens": 48, "answer_tokens": 136} {"conversations": [{"role": "user", "content": "Write a self-contained SuperCollider patch that uses `BrownNoise`. Define every value it uses."}, {"role": "assistant", "content": "```supercollider\n// 以下のSynthDefは全て共通のコントロール名(mul)を持つ\n(\n// 3つのSynthDefとグループを作成する\nSynthDef(\"synthNumber1\", { arg mul = 0.2;\n Out.ar(\n 0,\n BrownNoise.ar(mul) * LFNoise0.kr([1, 1.01])\n )\n }, [0.1]).add;\nSynthDef(\"synthNumber2\", { arg mul = 0.2;\n Out.ar(\n 0,\n WhiteNoise.ar(mul) * LFNoise1.kr([2.99, 3])\n )\n }, [0.1]).add;\nSynthDef(\"synthNumber3\", { arg mul = 0.2;\n Out.ar(\n 0,\n PinkNoise.ar(mul) * LFNoise2.kr([0.79, 0.67])\n )\n}, [0.1]).add;\n);\n\n(\n// グループを作成する\n~myGroup = Group.new;\n);\n\n(\n// 3つのシンセを加える\nSynth.head(~myGroup, \"synthNumber1\");\nSynth.head(~myGroup, \"synthNumber2\");\nSynth.head(~myGroup, \"synthNumber3\");\n);\n\n// 3つのシンセのそれぞれの\\mulコントロール、新しい(そして同じ)値にセットする\n~myGroup.set(\\mul, 0.05)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/11.schelp", "aug": "prologue:ugen", "prompt_tokens": 49, "answer_tokens": 496} {"conversations": [{"role": "user", "content": "Write a complete SuperCollider patch built around `DelayN` that runs as it is."}, {"role": "assistant", "content": "```supercollider\n// これは(SC2の配布物の中の)\"01 Why SuperCollider document\"からのリバーブ\n(\nSynthDef(\"preDelay\", { arg inbus = 2;\n Out.ar(\n 4,\n DelayN.ar(In.ar(inbus, 1), 0.048, 0.048)\n )\n}).add;\n\nSynthDef(\"combs\", {\n Out.ar(\n 6,\n Mix.arFill(7, { CombL.ar(In.ar(4, 1), 0.1, LFNoise1.kr(Rand(0, 0.1), 0.04, 0.05), 15) })\n )\n}).add;\n\nSynthDef(\"allpass\", { arg gain = 0.2;\n var source;\n source = In.ar(6, 1);\n 4.do({ source = AllpassN.ar(source, 0.050, [Rand(0, 0.05), Rand(0, 0.05)], 1) });\n Out.ar(\n 8,\n source * gain\n )\n}).add;\n\nSynthDef(\"theMixer\", { arg gain = 1;\n Out.ar(\n 0,\n Mix.ar([In.ar(2, 1), In.ar(8, 2)]) * gain\n )\n}).add;\n);\n\n(\nSynth(\"fm1\", [\\bus, 2, \\freq, 440, \\carPartial, 1, \\modPartial, 1.99, \\mul, 0.071]);\nSynth(\"fm1\", [\\bus, 2, \\freq, 442, \\carPartial, 1, \\modPartial, 2.401, \\mul, 0.071]);\nSynth.tail(s, \"preDelay\");\nSynth.tail(s, \"combs\");\nSynth.tail(s, \"allpass\");\nSynth.tail(s, \"theMixer\", [\\gain, 0.64]);\n)\n```"}], "family": "H", "source_id": "supercollider:HelpSource/Tutorials/Mark_Polishook_tutorial/Japanese_version/14.schelp", "aug": "prologue:ugen", "prompt_tokens": 45, "answer_tokens": 572} +{"conversations": [{"role": "user", "content": "Give me a complete SuperCollider patch for (thor magnusson) (2006) An instrumentalist inside a synthdef: bind everything it needs before it is used."}, {"role": "assistant", "content": "```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 !!!\n\n snare = WhiteNoise.ar(Decay2.ar(PulseDivider.ar(tempo, 4, 2), 0.005, 0.5));\n base = SinOsc.ar(Line.ar(120,60, 1), 0, Decay2.ar(PulseDivider.ar(tempo, 4, 0), 0.005, 0.5));\n hihat = HPF.ar(WhiteNoise.ar(1), 10000) * Decay2.ar(tempo, 0.005, 0.5);\n\n Out.ar(out,(snare + base + hihat) * 0.4 ! 2)\n}).add;\n);\n\na = Synth(\\drummer);\na.set(\\tempo, 6);\na.set(\\tempo, 18);\na.set(\\tempo, 180); // check the CPU! no increase.\na.free;\n```"}], "family": "H", "source_id": "supercollider:examples/pieces/DrummerSynthDef.scd", "aug": "prologue:intent", "prompt_tokens": 69, "answer_tokens": 373} +{"conversations": [{"role": "user", "content": "Write a SuperCollider patch for shepard tones alberto de campo that runs as it is, with nothing assumed about the session."}, {"role": "assistant", "content": "```supercollider\n// shepard tones\n// alberto de campo\n(\nvar ampTable, freqTable, b1, b2;\n\nampTable = Signal.hanningWindow(1024).squared;\nfreqTable = Signal.newClear(1024).waveFill({ arg i; 0.5 ** i * 20000 }, 0, 10);\n\nb1 = Buffer.loadCollection(s, freqTable);\nb2 = Buffer.loadCollection(s, ampTable);\n\n{\n var freqs, amps, phasor, ratescale, rate, phases;\n ratescale = 1024 / 44100 / 10;\n rate = 0.1; // once per 10 sec\n phasor = Phasor.ar(0, rate * ratescale, 0, 1024);\n phases = (0..9) * 0.1 * 1024 + phasor;\n\n freqs = BufRd.ar(1, b1.bufnum, phases);\n amps = BufRd.ar(1, b2.bufnum, phases);\n\n Mix.ar(SinOsc.ar(freqs) * amps) * 0.1;\n}.play;\n\n)\n```"}], "family": "H", "source_id": "supercollider:examples/research_and_tools/ShepardTones SignalBuf.scd", "aug": "prologue:intent", "prompt_tokens": 61, "answer_tokens": 354} {"conversations": [{"role": "user", "content": "Who are you?"}, {"role": "assistant", "content": "I am sc-mind, a 198M MiniMind-3-MoE trained from scratch on the SuperCollider source and help corpus. I write and explain SuperCollider: SynthDefs, UGens, Patterns, Ndef, the language/server split, and how to make sound that is not silence."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 21, "answer_tokens": 94} {"conversations": [{"role": "user", "content": "What are you good at?"}, {"role": "assistant", "content": "SuperCollider. I can explain its classes and UGens, write SynthDefs and patches, read a patch back to you, and tell you why one does not compile. I am 198M parameters; I am not a general assistant."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 23, "answer_tokens": 64} {"conversations": [{"role": "user", "content": "What is SuperCollider?"}, {"role": "assistant", "content": "SuperCollider is a platform for audio synthesis and algorithmic composition, written in C++ and SuperCollider. It splits into a language client (sclang) that runs your code and builds UGen graphs, and an audio server (scsynth) that does the DSP in real time. They talk over OSC."}], "family": "I", "source_id": "teacher:identity", "aug": "none", "prompt_tokens": 26, "answer_tokens": 96}