Live data from Hacker News

Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

p01.org

121–130 of 131 posts

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#121

OK, this is really weird, but I closed the browser tab with the demo ca. 1 minute ago and can still hear the music. I'm on FF/Big Sur.

I imagine that accidental unfair scheduling is to blame here: that the audio processor is keeping things busy in such a way that Firefox isn’t getting its “hey, this tab is closed” message through to kill the event loop. This is definitely a bug in Firefox, and it appears to be consistent across platforms (I’m on Windows, you’re on macOS, someone else is mentioning Android). The patch to fix this is likely to be quit…

I do notice, that PulseAudio shows me that the audio stream from Firefox is labelled "AudioCallbackDriver", which is unusual: most Firefox audio streams are labelled "AudioStream". I think this is a little-tested feature in Firefox at this point. Somehow it also manages to activate the speech (espeak) dispatcher too.

Not cool.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#123
post #114

Earlier quoted context omitted.

No, please don't add derision to HN threads. When someone else is wrong, it's enough to supply correct information. That enhances the thread without damaging the commons. https://news.ycombinator.com/newsguidelines.html

Are you saying everything everyone says is above critique, or that derision specifically is not welcome?

The latter. It's never needed and does more harm than good.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#124
post #111

Because the rest of the commentors in this thread seem to not be reading the article, there's a performance issue in Firefox due to the following unresolved bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1190398

5 years old and not a peep. That sounds about right.

5 years? That's nice. https://bugzilla.mozilla.org/show_bug.cgi?id=70315 took 18 years to get solved.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#125
post #76

Earlier quoted context omitted.

Hi there. I do not use any minifier. I minify the code by hand, and typically prototype ideas and performance tests in normal non-minified code. Once the main idea and approach are settled, I minify the code by hand and keep an eye on the heatmap of the DEFLATE stream to match the 1024 bytes limit. MONOSPACE took ~4months on an off to create, tallying ~60h of work. You know 2020 + trying to balance work & family, and…

Hi P01, thank for your great work. Can you explain what this means? > keep an eye on the heatmap of the DEFLATE stream How is the heatmap generated?

I use gzThermal by Caveman - https://encode.su/threads/1889-gzthermal-pseudo-thermal-view...

He is very talented and was nice enough to implement a couple of features to help with this kind of productions when I was working on BLCK4777 - https://www.p01.org/BLCK4777

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#126
post #76

Earlier quoted context omitted.

Hi there. I do not use any minifier. I minify the code by hand, and typically prototype ideas and performance tests in normal non-minified code. Once the main idea and approach are settled, I minify the code by hand and keep an eye on the heatmap of the DEFLATE stream to match the 1024 bytes limit. MONOSPACE took ~4months on an off to create, tallying ~60h of work. You know 2020 + trying to balance work & family, and…

> tallying ~60h of work This is far less than I expected, which usually means I am hopelessly out of my league in the topic. Great job :)

That is 60h for this project alone.

I made 100s of creative projects and failed experiences before getting there. Don't get scared by that number. All it means, is that it is possible to do in 60h. Some would take 600, others 20.

I threw that number away to put it in context with the 4 months since the first prototype. I could only work from time to time. Some times not touching the code at all for weeks.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#127
post #96
post #77

Glad you like it :) -- p01, author of MONOSPACE

What is the source for the music?

Do you mean the source code or the inspiration ?

The main part of the source code is the last `for(...)` loop that updates the sound buffer, and draws the text.

There was not much inspiration :p I needed something simple enough to be fairly compact and sound melodic.

So I used a chord of 4 notes, played them at different speed and octaves. The lead using a sinus oscillator to get nice pure tones, a deeper sound 4x slower with a pulse oscillator to get more edgy sound, the deepest sound 16x slower with a sawtooth to get a gritty bass. Layered with the perspective scaling of the dots to get something bleeps in synch with the visuals.

Hope that answers your question

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#128
post #26

I'm getting the same issues as all of the other Firefox users. Guess I'll never watch it, because I have a hard policy of never, ever installing Chrome malware on my personal computer. Maybe the title should be changed to "Chrome demo"?

Jesus, no one cares what your "policy" is. Not to mention, it's a Firefox bug, so probably should be changed to "Firefox bug demo". I fucking hate how snarky sometimes HN can be.

> Jesus, no one cares what your "policy" is.

I care.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#129
post #123

Earlier quoted context omitted.

Are you saying everything everyone says is above critique, or that derision specifically is not welcome?

The latter. It's never needed and does more harm than good.

Ok. Thanks for answering.
Post reply on HN