{"id":19323105,"url":"https://github.com/ojack/hydra-osc","last_synced_at":"2025-04-22T19:32:12.127Z","repository":{"id":70843036,"uuid":"459621235","full_name":"ojack/hydra-osc","owner":"ojack","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-16T10:08:42.000Z","size":32,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-11T20:56:51.656Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ojack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-15T14:47:42.000Z","updated_at":"2024-02-02T15:54:17.000Z","dependencies_parsed_at":"2023-03-21T03:48:17.868Z","dependency_job_id":null,"html_url":"https://github.com/ojack/hydra-osc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojack%2Fhydra-osc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojack%2Fhydra-osc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojack%2Fhydra-osc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojack%2Fhydra-osc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ojack","download_url":"https://codeload.github.com/ojack/hydra-osc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903637,"owners_count":17222550,"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":[],"created_at":"2024-11-10T01:45:06.142Z","updated_at":"2024-11-10T01:45:06.733Z","avatar_url":"https://github.com/ojack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydra-osc [WIP]\n\nMinimum example sending osc messages to and from hydra in the browser. \n\nCurrent version uses (osc-js)[https://github.com/adzialocha/osc-js], would like to switch to browserglue. \n\nTo use:\n1. install node.js on your operating system\n2. run `npm install` to install dependencies\n3. run the local websocket server `node server.js` \n4. paste the following code in hydra editor:\n\n```javascript\nawait loadScript(\"https://cdn.jsdelivr.net/gh/ojack/hydra-osc/lib/osc.min.js\")\n\n_osc = new OSC()\n_osc.open()\n\n_osc.on(\"*\", (m) =\u003e { console.log(m.address, m.args)})\n\n```\nOpen the browser console to see osc messages logged from your local system. The local osc messages should be sent to the ports specified in `server.js`\n\nMore complete example (live at https://hydra.ojack.xyz/?sketch_id=8XySbQWWCzK4AaDF)\n```javascript\n/* \nExample using osc-js to bridge local udp / osc messages to the browser via websockets. For more information, see: https://github.com/ojack/hydra-osc\nand follow instructions to run a local websocket server.\n*/\nawait loadScript(\"https://cdn.jsdelivr.net/gh/ojack/hydra-osc/lib/osc.min.js\")\n\n_osc = new OSC()\n_osc.open()\n\n/* example to receive osc */\n\n_osc.on(\"*\", (m) =\u003e { console.log(m.address, m.args)})\n\nhue = 0\n_osc.on(\"/hue\", (m) =\u003e {\n  console.log(m)\n  hue = m.args[0]/255\n})\n\nshape(4).color(-1, 1).hue(() =\u003e hue).out()\n\n/* example to send osc */\n\nsend = (address = \"\", args) =\u003e {\n  var message = new OSC.Message(address, args)\n  _osc.send(message);\n}\n\n// execute this line to send an osc message\nsend('/hi', \"hello\")\n```\n\nThis is only meant as an example. For easier use while livecoding, the implementation should allow overwriting old event handlers with new ones, and follow an api similar to the atom-hydra implementation of osc: https://github.com/hydra-synth/atom-hydra/blob/master/lib/osc-loader.js\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojack%2Fhydra-osc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fojack%2Fhydra-osc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojack%2Fhydra-osc/lists"}