{"id":18118648,"url":"https://github.com/munshkr/hydra-superdirt","last_synced_at":"2025-09-09T23:48:09.899Z","repository":{"id":44368320,"uuid":"512284417","full_name":"munshkr/hydra-superdirt","owner":"munshkr","description":"A Hydra extension for handling SuperDirt RMS events (envelope follower)","archived":false,"fork":false,"pushed_at":"2025-04-11T21:50:38.000Z","size":73,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T17:11:31.777Z","etag":null,"topics":["hydra","osc","osc-js","supercollider","superdirt"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/munshkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T20:58:22.000Z","updated_at":"2025-04-11T21:50:42.000Z","dependencies_parsed_at":"2025-04-05T13:28:57.679Z","dependency_job_id":"0b9ef94c-9b13-4a6a-b1cf-8a693905dbd9","html_url":"https://github.com/munshkr/hydra-superdirt","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munshkr%2Fhydra-superdirt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munshkr%2Fhydra-superdirt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munshkr%2Fhydra-superdirt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munshkr%2Fhydra-superdirt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/munshkr","download_url":"https://codeload.github.com/munshkr/hydra-superdirt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248923765,"owners_count":21183953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hydra","osc","osc-js","supercollider","superdirt"],"created_at":"2024-11-01T05:13:04.197Z","updated_at":"2025-04-14T17:11:35.298Z","avatar_url":"https://github.com/munshkr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydra-superdirt\n\nA Hydra extension for handling SuperDirt RMS events (envelope follower)\n\nThis repository contains the source code of a [Hydra](https://hydra.ojack.xyz/)\nextension that handles RMS messages sent by\n[SuperDirt](https://github.com/musikinformatik/SuperDirt), and an OSC-WebSocket\nbridge application that forwards OSC messages to the browser.\n\nWatch demo:\n\n[![demo](https://user-images.githubusercontent.com/4862/190862964-ca9eaa34-5782-4cb4-b3f7-87d461b0e685.gif)](https://www.youtube.com/watch?v=i5JoCTLqGSw)\n\n## Install\n\n### Bridge binaries\n\nYou will need to download and run a program that bridges between SuperCollider and\nthe browser, forwarding OSC messages through WebSockets. This is necessary because\nbrowsers don't currently support the OSC protocol.\n\nDownload the latest bridge binary file at\n[Releases](https://github.com/munshkr/hydra-superdirt/releases) corresponding to\nyour operating system (Linux, MacOs and Windows supported) and put it somewhere accesible.\n\nAlternatively, if you have Node installed, you can run from a terminal:\n\n```\nnpx hydra-superdirt\n```\n\n## Usage\n\nStart Supercollider and SuperDirt.\n\nOn SC, execute this:\n\n```c\n(\n// Run this to start sending the RMS OSC messages to SC.\n~dirt.startSendRMS;\n\n// The bridge will be listening to OSC messages on port UDP 9130.\nb = NetAddr.new(\"127.0.0.1\", 9130);\n\n// This is the RMS OSC handler, here we'll forward these messages to our bridge\nOSCFunc({ |msg|\n\t// Forward OSC message\n\tb.sendMsg(\"/rms\", *msg);\n}, \"/rms\");\n)\n```\n\nBy default, the RMS reply rate (frequency of messages) and peak lag (how long it \ntakes for the peak values to drop to zero) are 20 and 3, but you can adjust them\nwith `startSendRMS`:\n\n```c\n~dirt.startSendRMS(60, 0.4);\n```\n\nYou can stop sending RMS events with:\n\n```c\n~dirt.stopSendRMS;\n```\n\nThen, start the bridge by executing the binary, which will create a WebSockets\nserver at 8080 and open a UDP port on 9130 by default.\n\nOn Hydra, execute first:\n\n```js\n// Load osc-js script\nloadScript(\"https://unpkg.com/hydra-superdirt\")\n```\n\nThen, to connect:\n\n```js\nrmsConnect()\n```\nNow, go to tidal and test with \n\n`d1 $ s \"bd sd\"`\n\nThen on Hydra, try this:\n\n```js\nsolid(() =\u003e rms(0)).out()\n```\n\nYou should see a red tint that fades to black every time the samples are played.\n\n### Using more than one event.\n\nOn tidal test something like this:\n\n```js\nd1 $ s $ \"bd*8\"\nd2 $ s $ \"arpy*2\"\n```\nThen on Hydra:\n```js\nshape(30,() =\u003e rms(0)).scrollX(()=\u003erms(1)).out()\n```\nYou will see a circle scaling with the d1 pattern and then shifting to the left with d2.\n\n\n\n### Functions\n\n* `rmsConnect(port)`: Connect to the WS-OSC bridge. By default it will connect\n  to port 8080, but can be changed. If it's different than 8080, make sure to\n  set `--port` with the correct port number when running the bridge.\n\n* `rmsDisconnect()`: Disconnect from the WS-OSC bridge.\n\n* `rms(orbit)`: Returns the latest RMS value received on `orbit`. When `orbit`\n  is not specified, it will default to orbit 0. If no message has been received\n  yet on that orbit, it will return 0.\n\n* `rmsOn(orbit, callback)`: Assigns a callback function whenever a new RMS\n  value is received on `orbit`.\n\n* `rmsReset(orbit)`: Resets the callback function of an orbit. If `orbit` is not\n  specified, it will reset all callback functions.\n\n## Development\n\nYou need to install [Node](https://nodejs.org/en/) and\n[Yarn](https://yarnpkg.com/).  Then, clone the repository, and from within the\ncloned directory run `yarn` to install all dependencies.\n\nYou can start the bridge by running `yarn start` or `bin/hydra-sc-bridge.js`.\n`index.js` contains the source code of the Hydra extension.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at the [issues\npage](https://github.com/munshkr/hydra-superdirt). This project is intended to\nbe a safe, welcoming space for collaboration, and contributors are expected to\nadhere to the [Contributor Covenant](http://contributor-covenant.org) code of\nconduct.\n\n## License\n\nThis project is licensed under GPL 3+. Refer to [LICENSE.txt](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunshkr%2Fhydra-superdirt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmunshkr%2Fhydra-superdirt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunshkr%2Fhydra-superdirt/lists"}