-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion and development of web/wasm version #287
Comments
Leaving a note to myself, https://github.com/Dreamtonics/juce_emscripten/blob/master/modules/juce_audio_devices/native/emscripten/RtMidi.cpp has rough but working code for webmidi. |
The ping pong delay from MSC makes a ton of noise if you load it, this basic patch which should play a single plucked note every second into a short and feedback heavy delay. NOISE WARNING the output is connected and it immediately clips. |
Insanity. Wowzers. Would be cool to load patch from url encoded parameter, |
I thought about this, and while I typically dislike such approaches, but I think it makes sense here.
there are 2 things though that need to be done before we can tackle this:
will add to the todo, thanks for the idea! |
drag doesn't work to scroll boundaries of view area. click on output "socket", drag upward to reach module that is currently "off-screen" .. drag will break. |
if scroll is used to zoom, easy to get to a point where cardinal does not occupy entire browser screen, at which point the coordinate determination seems to be messed up. drags will affect things not under the mouse. |
mentioned on the 1st post as
and
known issue, I fixed it already locally but didnt deploy a build for it yet |
Small update: fixed up the ildaeil audiofile and midifile plugins, adjusted for more high-dpi screens, and updated view menu to follow official Rack 2.1.2 changes. With the ildaeil fixes it is now possible to get some MIDI going.
Right-click the expander module for polyphony options. |
Good news, the issue with loading compressed project files is fixed. (or better said, a workaround is in place) Also, you can now pass it a patchstorage "slug" to the URL as a way to load that patch on start. |
Another update, this is fun 😆 Thanks to previous work done in https://github.com/DISTRHO/PawPaw I could just repurpose it to build generic opensource libs for wasm. For now that is libogg, libvorbis, flac, opus, sndfile, liblo, fftw and lv2 related libs. I did a few more tweaks and made Cardinal able to load audio plugins from the "filesystem" (JSFX dont really count, they are not binaries). |
ok a couple more things now:
|
Going out of full screen returns to the wrong size render (x/y mouse coordinates are still correct, but don't align with the view). |
I have some ideas for this, the fullscreen mode typically changes the viewport to render in "pixel perfect" mode by default, while typically contents are scaled instead. When entering fullscreen, we can request how to deal with the viewport and keep things as-is. Will try later |
And more news for the web side, Web MIDI is implemented! The web audio stuff was rewritten from scratch too, I was using SDL before but it was doing some weird stuff behind the scenes, specially for audio input. Oh yeah, I got audio input to work too, but did not enable yet as the permission request for it would make the page look too suspicious. ("Why does this random page want mic access?") For the curious ones, relevant code for this web audio + midi is at https://github.com/DISTRHO/DPF/blob/develop/distrho/src/jackbridge/WebBridge.hpp I will try to have the html/js/wasm files built as part of 22.07 release on CI. |
Audio input is now enabled. You can enable audio input and MIDI under the engine menu. Audio input quality is really subpar here.. and forces itself as mono even if we request 2 channels. But, well, feature is enabled now. |
A bit more news on the input and processing.. Chrome cannot do stereo input though, only Firefox does. Also "fixed" the choppy audio in chrome after the latest updates, turns out it is just tweaking buffer size. |
There is a mini version now at https://minicardinal.kx.studio/ The mini version assets have a combined 15Mb size. Feel free to use and share! |
A few more things: touch events are now enabled, sorta..
moving around the canvas is still an issue. I am considering mapping 2 finger movements to mouse wheel, will need to run some tests.. the hosted files are now gzip compressed, which makes them smaller and thus faster to load. I will push the setup for this later. A final thing added was detection of required browser features before trying to load the web assembly program. And speaking of unsupported browsers, with this we now know why it does not work on Safari - lack of wasm simd support. |
Oh, and another small change I forgot to mention: when browser tab/window is not visible, cardinal wont spend time rendering the webgl gui anymore. which makes it use less cpu when running in the background. |
Good news, with more optimizations and compression, the wasm binary and data downloads are now below <50Mb. This is great because, at least in Firefox, downloads with less than 50Mb are allowed to be cached. Additionally I did some tests for clipboard support. so starting today we have a sorta fake clipboard in the webapp, with it having internal data for dealing with copy&paste and allowing to copy out of the webapp as an extra. |
We have URL parameters handling now! Both passing full patch, or a link to some file online. Use Use The embed patch in the URL is kinda disappointing, even with zst compressed data we easily get into the limits of how long we can make the URL. It works, but it is very limited.. The remote file seems the best approach here. you can host a file on a pastebin like service, and pass the raw contents url as parameter to cardinal web app. Can be quite useful to quickly show some patch to someone. Have fun! |
Hi Could I please have some simple instructions on locally hosting the wasm version of Cardinal? |
Download the artifacts and serve them under a web server. There is no magic needed, these are just static files. |
In a word, amazing 🥳 I'm looking at incorporating this into a tutorial website/book I'm working on.
|
Cardinal does not do midi-like input via keyboard, never did. |
Small update: The main https://cardinal.kx.studio/ has been updated to the latest code. |
Thanks - going back in the build history, it looks like wasm builds were commented out in build 1188. The last successful build before that was build 1182. FWIW I currently have build 1153 deployed for testing/evaluation. |
wasm builds are enabled already. they were failing due to new modules having a lot more code which made the build machine go out of RAM. I have reverted voxglitch to the same version as used in 22.07 (with minor fixes), but we are at the limit of what the free github CI VMs can do.. |
Hello,
I come back to you for my feedback. I cannot run the WASM version. As soon
as the html link is pasted, there is an error message: Exception
thrown:Script error.
In Browser Inspector: Browser does not accept CORS origin from local c:/.
After research no NO-CORS plugin could work to circumvent it. Only one
server will apparently be able to function. I can't try on this workstation.
Disabling browser add-ons did not allow me to run the classic web version.
On the other hand, I can access the mini web version as before. So it
shouldn't be a domain issue.
It even started on my modest android mobile. It's great, she makes the
sound. I guess it's in development.
Thanks again for your work, I follow you.
Le jeu. 8 déc. 2022 à 14:23, Davy Voiturier ***@***.***> a
écrit :
… Thank you, I will try.
Le mer. 7 déc. 2022 à 18:27, Andrew M Olney ***@***.***> a
écrit :
> @davybjj <https://github.com/davybjj> in your log file, the last line is
> this:
>
> Échec du chargement de la carte source par les Outils de développement :
> Impossible de charger le contenu de
> chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/browser-polyfill.js.map :
> Erreur système: net::ERR_FILE_NOT_FOUND
>
> This makes me wonder if the problem is an extension you've installed. I
> googled this message, and it seems to be associated with Adblock Plus.
> However it could also be caused by other extensions.
>
> —
> Reply to this email directly, view it on GitHub
> <#287 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A3R42ZOZZK4OD43BBV3YUZ3WMDCJTANCNFSM522BT5BQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Some small bit of news. I investigated the pointer lock issue on chrome, seems to be bug in emscripten as reported in emscripten-core/emscripten#9681 Some input keys were not being accepted before, like - = ^ ~ ? characters, should now be corrected. Updated the web app again just now, not sure I mentioned it in previous posts, but we got stoermelder-packone, MindMeld PatchMaster, Sapphire and SurgeXT modules now. Not from Cardinal/DISTRHO side, but related to the discussion, the just released Firefox 108 now supports WebMIDI 🚀 |
Merci!
Le mar. 13 déc. 2022 à 12:44, Filipe Coelho ***@***.***> a
écrit :
… Some small bit of news.
I investigated the pointer lock issue on chrome, seems to be bug in
emscripten as reported in emscripten-core/emscripten#9681
<emscripten-core/emscripten#9681>
I added a workaround for now, so default knob behaviour works under
chrome-based browsers now.
Some input keys were not being accepted before, like - = ^ ~ ? characters,
should now be corrected.
Updated the web app again just now, not sure I mentioned it in previous
posts, but we got stoermelder-packone, MindMeldPatchMaster, Sapphire and
SurgeXT modules now.
[image: image]
<https://user-images.githubusercontent.com/1334853/207308819-14964383-d0b6-45e5-a7dc-2773f427637f.png>
[image: image]
<https://user-images.githubusercontent.com/1334853/207309094-ca2cf222-2626-405f-93e8-317465c143ae.png>
Not from Cardinal/DISTRHO side, but related to the discussion, the just
released Firefox 108 now supports WebMIDI 🚀
You get this weird scary popup warning, but afterwards it appears to work.
[image: image]
<https://user-images.githubusercontent.com/1334853/207308512-5b161bd5-d1c1-48b5-bdc1-c35b89782c74.png>
—
Reply to this email directly, view it on GitHub
<#287 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3R42ZN6VTFA3CKSNXDLSXLWNBOQNANCNFSM522BT5BQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
A few more news, caching on chrome-based browsers is now possible. I thought IndexedDB was deprecated, but MDN has removed the deprecation notice... so I went to investigate to see if we could make use of it. There is an under-undocumented emscripten flag to activate pushing the data file into IndexedDB, which will fetch its contents on next page load. This allows us to go beyond the 50Mb data limit on Firefox, and whatever one was on Chrome. The wasm binary is not pushed to IndexedDB, but so far it does not seem needed. Currently we are at 17Mb brotli compressed binary, both are cached by Firefox and Chrome. So as far as I can see and test, the caching issue is resolved. |
Good evening,
Thank you, I just updated my compiled linux versions with the new modules.
I will try right away. The web version works like a charm on chrome and
firefox linux. I will try firefox midi soon. When I got your message I left
work, I will try it at the end of the week.
Thank you for your patience and good work.
Le mar. 13 déc. 2022 à 17:42, Filipe Coelho ***@***.***> a
écrit :
… A few more news, caching on chrome-based browsers is now possible.
I thought IndexedDB was deprecated, but MDN has removed the deprecation
notice... so I went to investigate to see if we could make use of it. There
is an under-undocumented emscripten flag to activate pushing the data file
into IndexedDB, which will fetch its contents on next page load. This
allows us to go beyond the 50Mb data limit on Firefox, and whatever one was
on Chrome.
The wasm binary is not pushed to IndexedDB, but so far it does not seem
needed. Currently we are at 17Mb brotli compressed binary, both are cached
by Firefox and Chrome.
So as far as I can see and test, the caching issue is resolved.
At least for now until Web standards and browsers change again.
—
Reply to this email directly, view it on GitHub
<#287 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3R42ZMN3T3UMILFEG7XABDWNCRRBANCNFSM522BT5BQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Good news, sorta.. Supposedly this means it would work on iOS too, meaning iPhone and iPad. |
https://minicardinal.kx.studio/ has been updated to NOT have SIMD optimizations, thus it works under Safari/WebKit now. |
I confirm it works on a basic ipad (9th generation) 😄 Is it possible to put logic in the page that decides which SIMD version to load (e.g. using the agent string)? |
Seeing an interesting bug related to the 22.12 wasm full version. In my book, I launch cardinal as a modal iframe. With 22.12, if I add a module from the modal iframe, a few key presses in the search bar causes a crash with this error:
However, this error does not occur when using cardinal directly (outside the book). Has there been any change since version 1208 that would cause this error? Looking at the diff between the respective CardinalNative.htmls does not show any meaningful difference. |
A bit of news on the mini version. Instead of being the core and fundamental, I updated it to match the real mini version coming for next release. There is a wasm-noopt build now, which allows to run the entire thing on webkit browsers (and not just the mini variant). |
Finally found out a regression with emscripten, they changed the default stack size from 5Mb to 64Kb during an update, that breaks everything... Rack uses 64k stack buffers for decoding vcv files, which easily triggered a stack overflow and everything went to shit after loading a compressed file. With that out of the way I have pushed the latest changes to both https://cardinal.kx.studio/ and https://minicardinal.kx.studio/ Assuming you are running the latest version (shows 23.05 on the top-right corner of the page) we should now have files saved into browser cache, which are made available on subsquent page reloads. If you can please launch the web versions, do some little patching, save it and try to resume that work after restarting the browser. ![]() Let me know if that works for you! |
Just tried this with minicardinal and I could see the |
Silly question - are there still builds in the nightlies? I don't see them where they used to be, so perhaps GitHub has changed the interface or they no longer exist? |
Thx, it was the scroll that was getting me; I was looking at the left pane instead of the main pane as well. Here are my test results for Using
the local storage seems to not be working completely. If I
then I can recall a patch using At no time does If I repeat the above with Firefox 115.0 (64-bit), I get the same results except I can recall the patch if I restart the browser. Again |
I found out about this yesterday, I'm just blown away! Did a full sketch of a song in there and sent a link to all the related communities I know. It could also a powerful, powerful demonstration utility for online or in-person discussions. Instantly accessible powerful sketchpad. I'm so happy this exists! Opened up on my phone browser, too, but can't use it with a touch screen. Mouse even kind of works, but... :) you maybe need a keyboard, I couldn't get much further. Would love love to see the day! My subway time would be enhanced instantly. So let me instead list the issues I saw while playing in a browser (Firefox Nightly, mainly).
Minicardinal suggestions! Last one, silly suggestion for the full online version. It's online anyways, can we get Bidoo Antn? :) I'm in love with the idea. I'm back to toying with the thing and experimenting. Love the work. Thank you so much! |
Another little thing I found. Happens in the live version, didn't happen on Windows. Alea module interferes with plugins' positions. 2024-02-08.15-09-17.mp4 |
@Vospi this behavior with Alea does happen with the standalone and in Rack2Free for me. Better to report this to the original developer instead I think. Or it's a "feature" and not a "bug". Anyway not at all specific to the web/wasm build of Cardinal. |
https://cardinal.kx.studio/live is updated to latest 24.04 release I fixed the MindMeld modules that caused issues, they wanted to do multi-threaded things which are not allowed in our wasm setup, fixed by using web timers with emscripten APIs That now allows to load the salamonis-mono-regen example patch, though without a fake/internal transport mechanism the patch is not so useful as-is. But no crashes is always good, and we have a fully functional EQMaster module on the web now |
Love this! Saw this commit recently. Thank you very much! Using wasm all the time. |
Big problem: Surge XT Filter in wasm seems to be bugged out. |
VCV Scope seems to have an issue with triggers - when EXT is disconnected and Trigger is toggled on, the screen freezes. |
The Bogaudio ANALYZER seems to have an issue as well - it throws an exception when a signal is tied to it? |
Selecting the stoermelder STRIP module:
|
Yeah I've reported that in February right above: |
For those unaware, https://cardinal.kx.studio/ is totally a thing now for some reason.
Also https://minicardinal.kx.studio/ for a mini/stripped-down version that loads faster.
There are some issues and things still to do.
Because this is for playground and testing and fun, and not all that serious, let's not open more than 1 ticket for web related things.
Everything web/wasm related should be on this ticket.
Stuff to do or implement:
Known issues:
(so they are updated automatically when reopening the page as needed)
Stuff to fix or workaround:
Undecided:
The text was updated successfully, but these errors were encountered: