Skip to content

Commit

Permalink
fix(examples)
Browse files Browse the repository at this point in the history
  • Loading branch information
crucialfelix committed Nov 24, 2019
1 parent 3e19568 commit 1ecb978
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions examples/klang.scd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SynthDef("klang", {
var nPartials = 12, nChans = 5;
var n = nPartials * nChans;
Splay.ar(Klang.ar(`[ { { rrand(200.0, 2000.0) } ! nPartials } ! nChans, nil, nil ], 1, 0))
* EnvGen.kr(Env.sine(4), 1, 0.02, doneAction: Done.freeSelf);
});
4 changes: 2 additions & 2 deletions examples/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { server } from "supercolliderjs";
const sc = require("supercolliderjs");

server.run(async sc => {
sc.server.boot().then(async sc => {
// Allocate an 8 second stereo audio buffer
const b = await sc.buffer(44 * 1024 * 8, 2);
});
22 changes: 11 additions & 11 deletions examples/sine-wave.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const d = require("supercolliderjs").dryads;
// const d = require("supercolliderjs").dryads;

const s = d.Synth(
`
arg freq;
Out.ar(0, SinOsc.ar(freq))
`,
{
freq: 40,
},
);
// const s = new d.Synth(
// `
// arg freq;
// Out.ar(0, SinOsc.ar(freq))
// `,
// {
// freq: 40,
// },
// );

s.play();
// d.dryadic(s).play();
2 changes: 1 addition & 1 deletion examples/synthdef-and-synth.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ sc.server.boot().then(async server => {
await server.callAndResponse(defLoadMsg);

// Load an entire directory of pre-compiled synth defs
await server.callAndResponse(sc.server.msg.defLoadDir("./synthdefs/"));
// await server.callAndResponse(sc.server.msg.defLoadDir("./synthdefs/"));
});

0 comments on commit 1ecb978

Please sign in to comment.