Moonside

Moonside wrote

Cuttlefish and pigeons and that thing I voted last are very good folks.

I personally think that filtering main page is good so I like to see my subscriptions when I see front page when logged in. If you don't feel like a form of posting is that good, you can see your own front page. And that's valuable and chill imo. Let's be excellent to each other. Thank you, I love you all. My audiences... each of them has a story to tell.

3

Moonside OP wrote

I was mostly joking, but I'm halfway done with the 1st of these books. It's definitely laborious, but interesting. It seems like things are faraway from production and changing pretty fast in that space. Some others: Agda, Idris, ATS (this seems scary). The most impressive Coq project I've seen is this C compiler: http://compcert.inria.fr .

Btw, juggling with proofs is very video game like though, I played with them too late into the night. That constant feedback! The triumph of writing Qed.

2

Moonside OP wrote

I'm doing it in Python and following ~TDD~

Reimplement in Coq and automatically derive it from specification. Actually I've tried to learn proper testing habits in Haskell, but I think that I don't even have a specification atm so yeah haha.

Godot looks pretty good.

I've been meaning to look at the Postmill source code and learn about that too

Me too! I've been itching to Fix a thing or two there.

3

Moonside OP wrote

Arbitrary precision integer arithmetic is just a mouthful for what is in Python long and in Java BigInteger. Just integers that go arbitrarily big in absolute value. I literally had to google for the official name!

It might be that I don't understand enough about the music theory behind it, but why don't you trust ints? Is that distrust just for this application, or more general?

It was a bit of hyperbole, it's mostly that I've gotten a bit bored with the tricks we have to do in software to make things palatable for computers, instead of doing the most straightforwardly correct thing at first and then making it hairy in the name of efficiency. It's like we have a computer brain or binary fog or what you call it!

The big problem was representing notes so that they have correct letter names, the correct amount of accidentals and octave; this is enough to name them correctly and also play the pitch. I wrote convoluted and buggy versions of this, so I was motivated to do it Right. The original version was just storing these directly, but calculating intervals between them was convoluted, but I noticed that each note is some distance (interval) away from middle C. Notes can be represented as rewrapped intervals.

I represented intervals as pairs of integers (I can distinguish between augmented fourths and diminished fifths that way). I defined addition and inverse on them so it turns out that they are isomorphic to the additive group of integer points on a XY-plane, or Z². And as notes are just intervals from middle C in disguise, naming all of them correctly is easy since the bookkeeping is done by underlying presentation. It's about ten lines of code and half of that are signatures.

So it was just an easy thing to do, because the innermost representation really is infinite in two directions. That said, it doesn't matter much, because the largest integer is 9223372036854775807 and basically for my purposes about 1000 is enough, without doing a bunch of renormalizations.

3

Moonside OP wrote

Reply to comment by musou in Computers are bad by Moonside

Linux audio feels like Mordor, I wonder how people ever dare to venture into it. Which is kinda sad, broke musicians could definitely benefit if Linux audio was great.

2

Moonside OP wrote

this sounds really neat! i love making music and i also love haskell (although i am only a hobbyist at either one).

It's nice to see another person in this intersection of interests, I wouldn't have guessed! I'm not a career programmer by any means, so Haskell is a hobby for me too.

have you picked a web framework yet? i've seen a few for haskell but haven't tried any.

No I haven't and this has been a point of procrastination for me. I think I should pick one, make something that outputs on the page the same [e♭,F,g,b♭,e♭,c,e♭,b,E,d] kinda string as my current program does, and refreshes it every time you click a button. Pimintel's app isn't much more fancy than that in the big picture, after all.

A problem is that there are lots of choices, but the situation keeps developing so I can't what's good. Year old blog posts are outdated at this point afaik.

3