package import scserver from "./middleware/scserver" ; import SCServer from "./SCServer" ; import SCLang from "./SCLang" ; import Group from "./Group" ; import Synth from "./Synth" ; import AudioBus from "./AudioBus" ; import SCSynthDef from "./SCSynthDef" ; import SynthControl from "./SynthControl" ; import SynthStream from "./SynthStream" ; import SynthEventList from "./SynthEventList" ; import { Dryad , DryadPlayer , Middleware , dryadic as makeDryadPlayer , Layer } from "dryadic" ; export { SCServer , SCLang , Group , Synth , AudioBus , SCSynthDef , SynthControl , SynthStream , SynthEventList } ; const middleware = [ scserver ] ; const classes = [ SCServer , SCLang , Group , Synth , AudioBus , SCSynthDef , SynthControl , SynthStream , SynthEventList ] ; /**
 * A layer adds Dryad classes and middleware for an external library. eg. for Supercolliderjs
 */ export const layer = { middleware , classes , } ; export interface Context { [ name ] : any ; } /**
 * Create a DryadPlayer from a Dryad or hyperscript definition.
 *
 * Automatically includes the supercollider.js layer
 *
 * usage:
 * ```js
 *   var sc = require('supercolliderjs');
 *   var player = sc.dryadic([
 *     'scserver', [
 *       ['group', [
 *         ['synth', {
 *           defName: 'sinosc',
 *           args: {
 *             freq: 440
 *           }
 *         }]
 *       ]
 *   ]);
 *   player.play();
 *   // ...
 *   player.stop();
 * ```
 */ export function dryadic ( rootDryad ? , moreLayers = [ ] , rootContext = { } ) { return makeDryadPlayer ( rootDryad || new Dryad ( ) , [ layer , ... moreLayers ] , rootContext ) ; } param { Dryad | Array } rootDryad returns { DryadPlayer } export function play ( rootDryad ) { return dryadic ( rootDryad ) . play ( ) ; } /**
 * Convert hyperscript object to a tree of Dryads.
 *
 * This lookups each class by lower class 'classname'
 * and creates an instance with properties and children.
 */ export function h ( hgraph ) { const player = dryadic ( ) ; return player . h ( hgraph ) ; }