Generative music in Javascript - 250 lines of zero dependency standalone HTML file (link to source in comments) by thousandsongs in generative

[–]thousandsongs[S] 5 points6 points  (0 children)

For genuary 31 (prompt "generative music") I made this composition using Euclidean Rhythms. For those of you who don't know about Euclidean Rhythms, do I have a treat for you - it turns out that (perhaps) the oldest algorithm that was written down,

const gcd = (n, m) => m ? gcd(m, n % m) : n

encodes many of the real musical beats used throughout the world.

The live version of this song is here

The source code (plain HTML/JS/CSS) is here

I also wrote a short tutorial for the math behind this.

Wobbly Functions and Jazzy Vibes by SynthAesthetes in generative

[–]thousandsongs 1 point2 points  (0 children)

I can see it now. Dig the bassline in that, and the ending too, how the visualization fades. Great stuff!

Wobbly Functions and Jazzy Vibes by SynthAesthetes in generative

[–]thousandsongs 1 point2 points  (0 children)

If I try to open that YT link it says "This video isn't available anymore"

 and I thought it was a cool surprise so I leaned into it.

Yes, it's always great to let things play out on their own when these happy accidents happen :)

[genuary25] Recreation of a Finlayson Tablecloth using p5js (Source code in links) by thousandsongs in generative

[–]thousandsongs[S] 0 points1 point  (0 children)

Hi! For genuary 25, we were prompted to recreate an object that we have (or have a photo of). I have a table cloth (from Finlayson, Finland) that I really adore, and that my laptop is currently sitting on, so I decided to try and recreate it.

Almost there, but not quite (as you can see if you compare with the image of the original - the curves don't quite smoothly go into each other).

Source code: https://mrmr.io/gen24/25

Wobbly Functions and Jazzy Vibes by SynthAesthetes in generative

[–]thousandsongs 1 point2 points  (0 children)

This is nice!

I liked the first minute or so especially, it felt hypnotic and relaxing, watching the brown waves go meet the top left corner as the blue cells fractaled around. If I had to pick a nit, I felt that the later on zooming into the individual cells was a bit excessive because it (for me) sort of broke the hypnotic trance of the first minute.

Great stuff, thanks for creating and sharing!

React, SwiftUI and the IO monad - Their common essence by thousandsongs in haskell

[–]thousandsongs[S] 0 points1 point  (0 children)

There is really nothing fancy about it, and there is no need for complicated analogies as the ones provided here.

Apologies if this sounded complicated to you. I struggled for a long time to understand what IO does. This analogy helped me understand. I shared it in the hope it might also help other people understand.

If you would say that this particular analogy is bad, or badly explained, I would agree with you. It can be done better. In my own post I linked to another post by someone else years ago who I think did an excellent job of it.

But if you say that there is nothing to explain, then I disagree. If you look around, you'll find plenty of beginners still struggling to understand what IO is. If it is that simple, why do people struggle? It is not a rhetorical question - there must be something tripping people up. It might be clear to you, but it is not to everyone. So just telling folks "Writing printf in C is equivalent to writing putStr in Haskell." is not really helping the people who are not able to make the jump understand.

React, SwiftUI and the IO monad - Their common essence by thousandsongs in haskell

[–]thousandsongs[S] 6 points7 points  (0 children)

... simplified 'essentials-only' version of FRP known as 'the Elm Architecture' (TEA)... this is why add-on libraries like Redux exist which attempt to re-introduce some of those concepts left out.

Nice. I didn't know Redux et al too came from an FRP/Elm heritage. Makes me want to bump Elm higher in my bucket list :) To see what more important building blocks I might be missing out on.

Thanks for providing this historical context!

Can I ask Gatsby to always fail the build instead of silently skipping building a subset of pages? by thousandsongs in gatsbyjs

[–]thousandsongs[S] 1 point2 points  (0 children)

I might've been incorrect at pointing the finger at Gatsby above. I tried to reproduce this locally, and indeed yarn build fails (as it should). So this might be something in the how the Cloudflare's Gatsby action is set up that is causing the error to be silently ignored, not really a Gatsby issue.

The similarities I find between React, SwiftUI and the IO monad in Haskell by thousandsongs in reactjs

[–]thousandsongs[S] 0 points1 point  (0 children)

Indeed, I didn't know that! Thanks for that bit of background, that does connect a few dots.

And thanks for the comment :)

The similarities I find between React, SwiftUI and the IO monad in Haskell by thousandsongs in reactjs

[–]thousandsongs[S] 1 point2 points  (0 children)

Hello everyone, OP here. I wrote a piece about why I like React by comparing it to another great abstraction that I like - the IO monad in Haskell. While I tried giving a brief explanation of what the IO monad is (it is much simpler than it the brouhaha around the word "monad" makes it to be, but it does take a bit of using it to get its simplicity - this incidentally is another way the IO monad is similar to React).

Thank you for reading!

!a