206 karma · joined January 4, 2021
At first I tried to send the whole dom from one user to another, so users would see the exact same thing (no personalization like some sites do) -- and that didn't work out. It was easy to stream the html from one user to another via webrtc but the styles and javascript seemed non trivial.
So I landed at this more simple version. I haven't experimented much with browser extensions but for that approach, I would just create the peer connection between users in the extension. And simulate a click whenever a leader changes urls. (that may actually be better than this current Chromium browser version)
(forgive the spaghetti code -- I treated this more like a hackathon to get a proof of concept working)
Also you can sync YouTube videos, so you get better quality than you would via screen share.
Users send each other urls in a peer to peer way, just like audio data (so no urls are sent to the server). The browser then navigates to the url received.
The browser itself is a Chromium Browser (the Electron BrowserView).
The website is built with Notion + Super.so.
Let me know if you have any questions :)
So for repeating commands you can use this syntax:
play somenotelist for 1b loop for 5
Here is your code using the new feature: https://pastebin.com/bNwUHNaM
To make this more robust, I'll be looking to add looping constructs to allow more customized looping in the future.
Running two chunks in sequence is currently not supported, but I've been considering a separate block (or a customization of a run of a chunk) that could allow that behavior.
Adding looping functionality to play would also be a nice addition.
Future plans wise, in the short term I'm looking to address some bugs and proposed features. But generally want to get the interpreter to a stable state
For now there are a couple examples in the examples folder here: https://github.com/ddj231/Handel/tree/master/Examples
that demo the current core language features.
The Handel interpreter uses Tone.js for scheduling and playing notes. But because there is only one Tone.Transport per page, changing the bpm of the Transport would change it for all tracks.
So instead of using Tone.js for setting bpms, the note lengths are calculated based on the bpm and amount of beats, and scheduled in seconds. Which could lead to greater imprecision over time
I agree, it is still in its early stages.
Looking at your code it seems it would be useful to have a way to repeat a play command without a chunk.
I think something like: " play E4 for 1b rep 5 "
As a way to repeat something 5 times for example (and reduce duplicates) could be a future solution.
Your question does bring up an interesting idea, which would be to have a 'play somechunk' command that is blocking. But that does not exist at the moment
And nice catch on the scroll bars, will fix, thanks!
So by procedural what is meant is that the there are chunks (which are Handel's procedures/functions).
Currently your code snippet can't be replicated in Handel. Looping is accomplished by telling a chunk to loop (giving it a number of times to loop). ex. run somechunk with loop for 100
But there is no arithmetic in the language. Adding arithmetic to playables like you mentioned could be a nice feature
start
chunk lefthand
play C3, Eb3, G3 for 2b
rest for 2b
endchunk
chunk righthand
play C3 for 1b
play Gb3 for 1b
play Eb3 for 1b
play Db3 for 1b
endchunk
run lefthand with loop for 100
run righthand with loop for 100
finish
1. Readability:
Ex.
start
play E3, Ab3 for 1b
rest 5b
play E3, Ab3 for 1b
finish
It is somewhat intuitive to read the above without experience with the language (or with programming in general).
2. Procedures: You can create chunks (procedures), which are reusable. For example you can create a chunk which takes 3 chord playables as parameters and run that chunk with any arguments. And also stack those runs on top of each other (because all run chunks play at the same time).
The editor is pretty barebones at the moment
One notable aspect of Handel is the behavior of its procedures, which are called chunks. Each chunk is conceptually a song track and all run chunks (from procedure calls) play at the same time. A run of a chunk can be customized by passing in arguments (ex. chords to use). The bpm, instrument, and loop amount of a run of a chunk can also be optionally set to further customize that run.
Open to questions and feedback!