hydrafriend
v0.0.4
Published
create stateful handlers for responding to samples in hydra
Downloads
2
Readme
HydraFriend
Your friendly hydra library. A wrapper around hydra to allow for quicker, enhanded visual coding by way of stateful handlers and generators.
Are There Docs?
Yes, but they are a work in progress - I will work on these once the library itself is more complete (I promise 🙏).
How Can I Use This?
Ok, so you've cloned this repo, or found it on npm. Congrats!! Then you had some serious issues trying to get it to work... my bad! These are the early days, things will only get better.
That being said, it is possible to use this right now. To do so, follow these steps:
- install atom
- install tidalcycles and hydra on atom
- navigate to the hydra-atom package on your machine (Linux:
~/.atom/packages/atom-hydra
) - remove this package and clone my fork
- my fork adds 2 things:
- ability to eval whole file
ctrl-alt-enter
, necessary for importing packages - installs the latest version of HydraFriend
- ability to eval whole file
- my fork adds 2 things:
npm install
in the forked repo- open atom and go at it!
Example
Let's create a super trivial setup that will do invert the colors of an octagon every 5 times bd
is heard. This example assumes you have a SuperCollider session that relays messages to some given port (we are using port 3333). For an example file to use at startup, see here.
visual.js
// import library (now on npm yeah!)
const { Handler, HydraFriend, initialize, Shape } = require("hydrafriend");
// Only call initialize once
// see https://github.com/tado/ofxTidalCycles/blob/master/startup.scd
initialize(3333);
// define a new octagon shape
const octagon = new Shape()sides(8);
// handle bd by inverting every 5
const handle_bd = new Handler("bd", () => octagon.invert());
handle_bd.every(5);
// register all our handlers
const hf = new HydraFriend();
hf.register(handle_bd);
music.tidal
d1 $ s "bd sn"