RSSAmplifier

Blog

graeme. hello

Recent content on graeme. hello

graemephi.github.ioRSS feed ↗13 posts

Latest posts

Spectrogram Phases

There was a tweet recently pointing out the apparent structurelessness of the phase data that is usually discarded when you compute audio spectrograms. People familiar with audio will know phase is important so this is pretty weird. So here’s quick post about what makes the phases so bad and some tricks to show there is structure to be found in them, but no promises any of it will be useful.…

Twelve tones are inescapable

Speculations. Nothing new just held up at a different angle than what you’ve seen before. I want to write about something interesting you can do with a single pentatonic scale. I’m just going to begin with what I noticed that got me thinking about this. Take C \text C C major pentatonic, C D E G A \text{C D E G A} C D E G A And transpose it onto G \text{G} G . G A B ‾ D E \text{G A }…

Generating Unique Random Numbers

This post has two things: Two somewhat obscure non-linear invertible operations that work on only part of a register, and A fast stateless random permutation generator that uses them, and passes some statistical tests for RNGs you may have seen before The ideas are pretty simple so the hope is you can also get an intuition for how to think about the problem, which is the best thing you can get out…

WTF Are Modular Forms

This post is part of the HMN Learning Jam . One weekend to fill your head with stuff and one weekend to dump it back out. I’ve spent a few more days here and there (that convinced me I could learn the rest of what I needed to know in a weekend) but otherwise that’s about how much time I’ve got in knowing about modular forms. This is a bit out of step from the rest of the…

Some low discrepancy noise functions

This post is about an attempt to generate blue noise at a point: no state, no offline training, just arithmetic on an index. Honestly I don’t have a good reason for wanting this but it’s probably been at the back of my mind for like 2 years–it just seemed like it ought to be possible. It turns out to be doable in 1D and with a little lookup table we can push it to 2D. The kind of…

Difference Decay

Here’s a variation on the damper I keep coming up with uses for. I find my code that uses it a bit subtle and annoying to figure out, hence this post. That theorangeduck post is about springs, which could be an interesting extension to this, but this post is setting our sights lower. My first use for this was to clean up a noisy/unreliable clock by using a high resolution clock, taking the…

stb_ds: string interning

stb_ds is a generic container library for C. It was probably from seeing the same technique in bitwise , but I’ve had it at the back of my mind for a while now that one of the good use cases for stb_ds was easy string interning. But it’s not mentioned anywhere, not even in the gentle introduction ! Well, the pieces are there, but how to put them together is a little subtle. By the way,…

deep sky object

A couple months ago I set @tiny_dso running. It’s a twitter art bot, which I guess is less of an exciting thing nowadays, but it’s an idea I’ve wanted to do for at least a few years now: turn @tiny_star_field 's tweets into computer generated imitations of astrophotography. tiny_star_field is getting a bit intermittent nowadays, so I set the bot to work it’s way backwards…

Server-side KaTeX With Hugo: Part 2

So, despite saying I didn’t want to do this in my last post on this, I went and forked Hugo . Now rendering with KaTeX is way faster, and basically free when using hugo server . This was more driven by curiosity than a desire to make things fast. At some point a couple weeks ago I was reminded of QuickJS , and from there it was a short series of small steps to my downfall. QuickJS really…

Calculating LOD

Angelo Pesce (@kenpex) recently tweeted: This is a calibration poll. Please don't spoil the answer, RT appreciated - Do you know how a GPU knows which mips to fetch when a regular tex2D(tex,uv) is called with trilinear filtering? — c0de517e/AngeloPesce (@kenpex) December 3, 2019 I would have counted myself as ‘not sure’, but I had a pretty good idea what it would involve and I was also…

Server-side KaTeX With Hugo

Update (2020-01-19): I lasted some 3 weeks before gettng rid of this . Also, I’ve changed the title from ‘static’ to ‘server-side’ which is more accurate. Hugo is a static website generator written in Go. Katex is a math typesetting library written in Javascript. This site uses them both. I keep javascript turned off on websites unless white-listed. I notice when…

The Discrete Fourier Transform, But With Triangles

Here’s something I’ve been wondering about lately: what happens if you replace all the sine waves in the fourier transform with triangle waves? If you are like me and would like to play around with such a thing, this post has a method to get a representation of a signal as scaled-and-shifted band-limited triangle waves in O ( n log ⁡ n ) O(n\log n) O ( n lo g n ) time. This is fast…

Dumb Tricks With Phase Inversion

Phase inversion takes a signal and flips it upside down . Most people are introduced to it as a button you push in a DAW while troubleshooting phase problems, but with some thinking it’s capable of a lot more than that. Some digging in the audio DSP literature will uncover a stray sentence or two that acknowledges this, but I get the impression that it strikes the people who already know it…