News for hackers. Stuff that matters.

sudara

Love the chorales, thanks for sharing that one.

Show HN: I made an additive synth with 10k oscillators

https://melatonin.dev/

It's called Sine Machine and it has 20 voices of 511 (don't ask) time-domain oscillators.By "time-domain," I mean actual oscillators. A lot of additive synths are essentially iFFT engines and offer "partials" whereas Sine Machine literally provides 10,000 free running oscillators (and 20k lfos to control pitch/vol of each).Having this kind of full control over these offers a lot of fun ability...

( Read More... | no comments | on HN )
This is amazing, I will def be playing with it (lossy is also my jam) and hi! I made pamplejuce, hope it worked ok for you, lemme know if anything was rough (its been growing up a bit lately)
I'm interested in this idea. I think I got confused at some point and mistakenly thought box blur was a 2D kernel and so it wouldn't perform great. vImage does contain a box blur but I haven't checked its performance (I did check the tent blur and it was so-so...) https://developer.apple.com/documentation/accelerate/blurrin...
Thanks for this!
OMG would have loved to do that instead.
Cache locality and specifically the vertical pass was top of my mind when trying to come up with good ways to vectorize. In the end (at least in my vector implementations) the difference between the passes weren't too large. But most of the them ended up having to do things like first convert the incoming row/col to its own float vector.

One main issue I never resolved is in the middle of the main loop, data has to be converted and written back to the source image and the incoming pixels have to be converted and loaded in. Even when doing all rows or cols in bulk (which was always faster somehow than doing batches of 32/64), that seemed pretty brutal.

I also wondered whether it might be more efficient to rotate the entire image before and after the vertical pass, but in my implementations at least, there wasn't a huge difference in the pass timings.

> If you take a look at the video in my README, you'll see how bad it is.

Ahh, the video threw me off originally, I think because of the FPS glitches on the full width — but I see it now! Big bands of blue on the left and right edges. I'll have to cook up some examples to reproduce. Also curious what it means (if anything) in the drop shadow context.

> I can say there is a huge performance tradeoff in using real division

Makes sense. It would also throw a wrench in my vector implementations, where the expectation is to perform the same operation efficiently across groups of pixels.

> and that my library was therefore the best :)

Haha, well it was for me! I don't know Rust, but it helped me figure out my first C++ implementations!

Fixed! Sorry about that. The rustrepo stuff confused me!

My question is — was solving the edge bleed worth the (assumed) performance tradeoff? There were a couple vendor APIs that seemed to have smarter edge bleed options, but they performed worse. I never got around to actually visually comparing the images, though...

Thanks for all the great comments in your repo, they were quite helpful when trying to figure out how Stack Blur worked!

Thanks for the proofread! I had so much text juggling between this and the README that it was guaranteed some things would fall through the cracks! I updated the things you mentioned about `stackSum` and thanks for the catch on the `sumIn` definition.

> It couldn't provide this if it was moving every value in the queue.

I actually don't remember anymore what std::deque does under the hood, I did look into it, but the only thing I remember is that it was quite slow!

> You'd have to template the code on `radius` instead of passing it in as a runtime parameter so that the compiler could lower the divisions to bitshifts.

Yes, I really like this idea. Especially because radii only really vary between 1-48px for most drop shadow needs. It would be nice to have a handful of the common radii be ripping fast.

Probably! The dequeue implementation was just for fun, as I miss working in higher level languages :) Home cooked circular buffers is usually how one usually sees real-time audio code written... I haven't had much hands on experience with std::span, but seeing as it's a non-owning view, maybe it would be perfect?
Thanks! It's Figma, which I have some rudimentary proficiency in, really easy to make boxes and move em around.
Re:Pure Data as a plugin, with a new GUI on Saturday October 22, 2022 @09:26PM (#33303707)
Good q! I’m an audio dev who thought the general community might appreciate the project. It’s a cool effort (my primary beef with pd was always the UI)
Re:The enduring allure of Choose Your Own Adventure books on Wednesday September 14, 2022 @12:09PM (#32839182)
Jason Shiga's Meanwhile and Leviathan are the ultimate choose your own adventure graphic novels. The latter is also getting a steam release:

https://store.steampowered.com/app/2128390/Leviathan_An_Inte...

Re:How JUCE Components Work on Tuesday May 24, 2022 @06:25PM (#31498250)
Thank you! Good point.

Older »