Tag: audio

Jan

2024

Nonograms

(A puzzle CodePen)

Nonograms are a simple but sometimes fiendishly difficult puzzle that my partner and I have become slightly addicted to. She is much better at them than me so in a desperate attempt to even the odds I thought it might help give me the edge to make them myself.

Conceptually a lot of the algorithms for a nonogram are quite simple. It actually makes for a nice little interview question because the key lies in breaking down the problem into smaller easy to reason parts. However, I hit a stumbling block when I realised there was an edge case where a random generation might not have just one unique solution. This was a problem because when it was generated it would store the "correct" answer it had in mind. This meant you could correctly solve the puzzle but not be awarded for the win; Disaster!!

After staring down the rabbit hole of having to potentially wrestle with holistic ways of approaching a "P vs NP", I came to a much more sensible solution.

Instead of solving for the difficult case of guaranteeing a unique solution, I could just change how the game checked whether it was in the "won" state. This problem seems difficult at first, especially when you consider the original implementation just compared the user's proposed solution with a stored one... but it actually turned out simple in a really pleasing way!

Each horizontal and vertical line of the puzzle has a list of numbers that represent the number of consecutive blocks of colour in that line, these are like "clues" to help you solve the puzzle. If you want to check any arbitrary proposed solution you can simply generate what the clues would be if the solution was a puzzle itself and then use those as your comparison.

I think there something really pleasing about this solution, and it's a great reminder that sometimes you need to stop and just take a minute to consider problems from a completely different angle.

Jan

2024

Good Morning AI

(The radio station run by robots)

Good Morning AI is a radio station where the scripts, voices, music, and schedule are completely controlled by AI. It's an idea I've wanted to create for years, but with the huge advancements in AI in the last few years, it finally felt like the right time to make it happen.

It became immediately obvious that working directly in the console to tweak prompts, iterate on outcomes, and stitch together different APIs was tedious at best. To try and make the build process smoother, I created a dashboard powered by Express, React, and Tailwind to quickly build the tools I needed to help me realize my vision.

This project came with a lot of technical hurdles despite the fact that the AI heavy lifting was done for me. I think the most interesting lesson for me was in adapting to a new paradigm of interacting with software. Both in terms of prompt engineering and also the API itself. For instance, being able to present the AI with a TS object and request for its response to fit that definition streamlined the process. Although this would be risky in a production client-facing application, when it came to making quick MVP tools, it allowed me to quickly and easily iterate. If a type needed to change, then the response from the API would automatically update to match it.

Mar

2019

Secret Melody Generator

(A Zelda-style puzzle complete audio generator CodePen)

Dynamic audio always excited me, but I felt overwhelmed about where to start. This CodePen was my simple, fun attempt to explore audio generation.

Focusing on a familiar sound effect - the 'puzzle solved' or 'secret found' from games like Zelda, I broke it down into two simple rules for creating a 'curious' sound: the notes should climb and resolve higher than the first note.

This basic setup yielded surprisingly effective results. It demystified dynamic audio for me, leading to more exploration in the field.

Nov

2018

Retro Ringtones

(A Nokia composer ringtone player Codepen)

Exploring the web audio API and making my first bleeps and bloops on an oscillator immediately brought me back to my childhood playing with the ringtone composer on my Nokia 3310. I figured that memory would make a great way to explore this API and so I set about making a ringtone composer of my own.

Using the same Ring Tone Text Transfer Language (RTTTL) I had memories of scouring the internet for, I created a simple interface to play them.

Even years later with HD ringtones and the ability to play any song you want, there is something so satisfying about the old school bleeps and bloops of a classic ringtone.

and for extra nostalgia points (bpm 60):

8e2 8e2 8d2 8d2 2c2 8d2 4e2 2a1 8a1 4b1 4g1 4e2 8d2 4c2 8d2 2e2 4- 8e2 8e2 8d2 8d2 2c2 8d2 4f2 2a1 8a1 4b1 4g1 4e2 8d2 2c2