-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from crucialfelix/feature/dryads-static-methods
feat: dryads static methods
- Loading branch information
Showing
4 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
const d = require("supercolliderjs").dryads; | ||
const { SCLang, SCServer, Synth, dryadic } = require("supercolliderjs").dryads; | ||
|
||
/** | ||
* This is the full tree required just to play a Sin wave. | ||
* Dryadic 2 will | ||
* Minimal Sin wave example. | ||
* | ||
* To compile the SuperCollider language synth def it requires a | ||
* SCLang. To play the Synth it requires a SCServer. | ||
*/ | ||
const out = new d.SCLang({}, [ | ||
new d.SCServer({ numInputBusChannels: 0 }, [ | ||
new d.Synth({ | ||
def: new d.SCSynthDef({ | ||
source: ` | ||
{ arg freq; | ||
Out.ar(0, SinOsc.ar(freq)) | ||
}`, | ||
}), | ||
args: { | ||
freq: 440, | ||
}, | ||
const out = new SCLang({}, [ | ||
new SCServer({}, [ | ||
Synth.fromSource(`|freq| SinOsc.ar(freq)`, { | ||
freq: 440, | ||
}), | ||
]), | ||
]); | ||
|
||
d.dryadic(out).play(); | ||
dryadic(out).play(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters