Using clerk with overtone (signal in time and frequency domain with a FFT using the jdsp lib) \o/ One qq, what's the quickest built-in way to send data from the JVM to cljs in Clerk? I guess I could create a websocket, but maybe there is a way for "real-time" data in Clerk
https://github.com/leonoel/missionary support for missionary streams and signals in Clerk would make it incredible for DSP-type stuff
Clerk Sync https://book.clerk.vision/#clerk-sync Recently got some performance improvements so be sure to use latest main and let me know how it goes!
Nice, yeah, at least for offline processing, seems cool. For real-time, I will see if compiling a C string on-demand from clj (using gcc or whatever) and then using dlopen in the SC plugin works fine. If so, we can create a small clj to C transpiler ahahahah let’s make the world interactive one piece at a time
Nice, thanks, Martin!
@afoltzm can you say a bit more how you’d envision that? I haven’t used missionary, only know that electric uses it
Clerk sync is using editscript diffs over websocket
Yeah, I will check later as I don’t have an atom, but a pointer that’s being modified by c++ code ahahaha maybe putting the data into an sync’ed atom using a timer (every, let’s say, 10 ms) will work fine
I’m using https://github.com/pfeodrippe/vybe/blob/develop/src/vybe/clerk/audio.clj#L48 right now (the future triggering recompute every n milliseconds)
@mkvlr The counter increment at https://book.clerk.vision/#clerk-sync doesn't seem to be working
I’ve clicked on increment many times, and still not working. I will see soon if I have something in the console. Thanks for checking it o/
@pfeodrippe oh, it doesn’t work in the book, it’s a dead static html there. Should clarify this with a note.
Oh lol ok, thanks, yeah, makes sense, I was thinking that it would work with a client only page somehow, but ofc it doesn’t work ahahaha sorry, thanks
huh, I’ll take a look in a bit
just getting to this now but it’s working fine here:
(ns sync
(:require [nextjournal.clerk :as clerk]))
^::clerk/sync
(defonce !counter
(atom 0))
(clerk/with-viewer {:render-fn '(fn []
[:button.bg-sky-500.hover:bg-sky-700.text-white.rounded-xl.px-2.py-1
{:on-click #(swap! !counter inc)}
"Increment counter"])}
{})@pfeodrippe are you getting an error?