micahscopes / musical-flows-from-peer-2-peer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🎢🌊 p2p musical flows experiment 🎢🌊

what is it?

This is an experiment in sending musical data directly from browser to browser using the excellent p2p APIs available in Agregore Browser

I made this as a demo to show at the 2022 Wizard Amigos Code Camp... video coming soon!

how does it work?

  • data gets broadcast to peers by POSTing it via the fetch interface to a given pubsub:// URL
  • listening happens via an EventSource set up for the same URL
  • events from the EventSource interface get turned into @most/core streams
  • @most/core streams and stram transformations are used to glue the application together and modify/select/filter musical data in various ways
  • webmidi.js is used to simplify WebMIDI setup
  • the all-around-keyboard web component is used for feedback and as a musical interface ​

development notes

starting a development server at http://localhost:4321:

> npm install
> npm run dev

automatically building and publishing changes to hyperdrive

First ensure that you've set up the hyp CLI and have created a hyperdrive:

> hyp daemon start
> hyp create hyperdrive

This will give you a hyper:// URL for the new hyperdrive. Modify the script in package.json to use your new hyperdrive URL.

In one terminal start the build in watch mode:

> npm start build:watch

In another terminal start syncing in watch mode:

> npm start hyp:sync

Now whenever you make changes, vite will build to ./dist and hyp will sync the changes to your hyperdrive.


image ​

notes and links

misc links

who are you and where can I find you?

About


Languages

Language:JavaScript 93.3%Language:HTML 6.3%Language:CSS 0.4%