# @supercollider/dryads

> Dryadic components for SuperCollider

Latest version **1.0.1** (published 2020-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @supercollider/dryads
pnpm add @supercollider/dryads
yarn add @supercollider/dryads
bun add @supercollider/dryads
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-01-30 |
| First published | 2019-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 162.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 506 |
| Author | Chris Sattinger |
| Maintainers | crucialfelix |
| Keywords | supercollider, dryadic |

## Links

- npm: https://www.npmjs.com/package/@supercollider/dryads
- Repository: https://github.com/crucialfelix/supercolliderjs
- Homepage: https://crucialfelix.github.io/supercolliderjs/
- Issues: https://github.com/crucialfelix/supercolliderjs/issues
- npm.io page: https://npm.io/package/@supercollider/dryads

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [baconjs](https://npm.io/package/baconjs.md) ^0.7.93
- [dryadic](https://npm.io/package/dryadic.md) ^1.0.0
- [@supercollider/lang](https://npm.io/package/@supercollider/lang.md) ^1.0.1
- [@supercollider/logger](https://npm.io/package/@supercollider/logger.md) ^1.0.0
- [@supercollider/server](https://npm.io/package/@supercollider/server.md) ^1.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-01-30
- 1.0.0 — 2020-01-09
- 1.0.0-beta.1 — 2019-11-27
- 1.0.0-beta.0 — 2019-11-24
- 1.0.0-alpha.2 — 2019-11-15
- 1.0.0-alpha.1 — 2019-11-05
- 1.0.0-alpha.0 — 2019-10-20

## README

# @supercollider/dryads
[![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url]

<i>Dryadic components for SuperCollider</i>

> A dryad (/ˈdraɪ.æd/; Greek: Δρυάδες, sing.: Δρυάς) is a tree nymph, or female tree spirit, in Greek mythology

Dryadic is a framework for writing components that encapsulate all the complexities of loading, state management, dependencies and execution order.

https://github.com/crucialfelix/dryadic

Just as SuperCollider synths have a call graph or UGens, Dryadic has a call graph of higher level components. In Dryadic this is referred to as a tree.

Dryadic is declarative: you specify the resources you want and how they are connected. The framework does the rest.
Because it is declarative, you can update your tree while performing and the resources (servers, sounds, synth defs, settings) update live.

## Examples

More extensive examples will come with dryadic 1.0

```js
/**
 * This example generates a random sequence and plays the first
 * 4 seconds in a loop.
 *
 * SynthEventList has other tricks not yet shown here yet.
 * You can reschedule or alter the event list while playing.
 *
 * The scheduler can be given different scheduling functions,
 * one of which is this sequential event list.
 *
 * Other versions could use tempo, mathematical formula,
 * non-deterministic, event-by-event scheduling.
 */
const { play, SCSynthDef, SynthEventList, SCServer } = require("supercolliderjs").dryads;

function randomEvent(totalDuration) {
  return {
    time: Math.random() * totalDuration,
    defName: "saw",
    args: {
      freq: Math.random() * 500 + 100,
    },
  };
}

function randomEvents(totalDuration = 60, density = 2) {
  const n = Math.floor(totalDuration * density);
  const events = [];
  for (let index = 0; index < n; index++) {
    events.push(randomEvent(totalDuration));
  }
  return events;
}

// Currently this has to be expressed as a tree of nested dependencies.
// dryadic 2 will make it much cleaner and simpler.
const out = new SCServer({ numInputBusChannels: 0 }, [
  new SCSynthDef(
    {
      source: `
    SynthDef("saw", { arg freq;
      Out.ar(0, EnvGen.kr(Env.perc, doneAction: 2) * Saw.ar(freq))
    });
  `,
    },
    [
      new SynthEventList({
        events: randomEvents(60, 4),
        loopTime: 65,
      }),
    ],
  ),
]);

play(out);

```
<small class="source-link"><a href=https://github.com/crucialfelix/supercolliderjs/blob/develop/examples/dryads-synth-event-list.js>source</a></small>


Documentation
-------------

[Documentation](https://crucialfelix.github.io/supercolliderjs/#/packages/dryads/api)

Compatibility
-------------

Works on Node 10+

Source code is written in TypeScript and is usable in JavaScript [es2018](https://2ality.com/2017/02/ecmascript-2018.html) or [TypeScript](https://www.typescriptlang.org/docs/home.html) projects.

Contribute
----------

- Issue Tracker: https://github.com/crucialfelix/supercolliderjs/issues
- Source Code: https://github.com/crucialfelix/supercolliderjs

License
-------

MIT license

[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE

[npm-url]: https://npmjs.org/package/@supercollider/dryads
[npm-version-image]: http://img.shields.io/npm/v/@supercollider/dryads.svg?style=flat
[npm-downloads-image]: http://img.shields.io/npm/dm/@supercollider/dryads.svg?style=flat

[travis-url]: http://travis-ci.org/crucialfelix/supercolliderjs
[travis-image]: https://travis-ci.org/crucialfelix/supercolliderjs.svg?branch=master

---
_Source: https://npm.io/package/@supercollider/dryads · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
