npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hydra-superdirt

v0.1.2

Published

A Hydra extension for handling SuperDirt RMS events

Downloads

7

Readme

hydra-superdirt

A Hydra extension for handling SuperDirt RMS events (envelope follower)

This repository contains the source code of a Hydra extension that handles RMS messages sent by SuperDirt, and an OSC-WebSocket bridge application that forwards OSC messages to the browser.

Watch demo:

demo

Install

Bridge binaries

You will need to download and run a program that bridges between SuperCollider and the browser, forwarding OSC messages through WebSockets. This is necessary because browsers don't currently support the OSC protocol.

Download the latest bridge binary file at Releases corresponding to your operating system (Linux, MacOs and Windows supported) and put it somewhere accesible.

Alternatively, if you have Node installed, you can run from a terminal:

npx hydra-superdirt

Usage

Start Supercollider and SuperDirt.

On SC, execute this:

(
// Run this to start sending the RMS OSC messages to SC.
~dirt.startSendRMS;

// The bridge will be listening to OSC messages on port UDP 9130.
b = NetAddr.new("127.0.0.1", 9130);

// This is the RMS OSC handler, here we'll forward these messages to our bridge
OSCFunc({ |msg|
	// Forward OSC message
	b.sendMsg("/rms", *msg);
}, "/rms");
)

By default, the RMS reply rate (frequency of messages) and peak lag (how long it takes for the peak values to drop to zero) are 20 and 3, but you can adjust them with startSendRMS:

~dirt.startSendRMS(60, 0.4);

You can stop sending RMS events with:

~dirt.stopSendRMS;

Then, start the bridge by executing the binary, which will create a WebSockets server at 8080 and open a UDP port on 9130 by default.

On Hydra, execute first:

// Load osc-js script
loadScript("https://unpkg.com/hydra-superdirt")

Then, to connect:

rmsConnect()

Now, go to tidal and test with

d1 $ s "bd sd"

Then on Hydra, try this:

solid(() => rms(0)).out()

You should see a red tint that fades to black every time the samples are played.

Using more than one event.

On tidal test something like this:

d1 $ s $ "bd*8"
d2 $ s $ "arpy*2"

Then on Hydra:

shape(30,() => rms(0)).scrollX(()=>rms(1)).out()

You will see a circle scaling with the d1 pattern and then shifting to the left with d2.

Functions

  • rmsConnect(port): Connect to the WS-OSC bridge. By default it will connect to port 8080, but can be changed. If it's different than 8080, make sure to set --port with the correct port number when running the bridge.

  • rmsDisconnect(): Disconnect from the WS-OSC bridge.

  • rms(orbit): Returns the latest RMS value received on orbit. When orbit is not specified, it will default to orbit 0. If no message has been received yet on that orbit, it will return 0.

  • rmsOn(orbit, callback): Assigns a callback function whenever a new RMS value is received on orbit.

  • rmsReset(orbit): Resets the callback function of an orbit. If orbit is not specified, it will reset all callback functions.

Development

You need to install Node and Yarn. Then, clone the repository, and from within the cloned directory run yarn to install all dependencies.

You can start the bridge by running yarn start or bin/hydra-sc-bridge.js. index.js contains the source code of the Hydra extension.

Contributing

Bug reports and pull requests are welcome on GitHub at the issues page. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

This project is licensed under GPL 3+. Refer to LICENSE.txt