1 2 3 4 5 6 7 play synth ( 'midi.mid' ) { | midi | midi . env * midi . tone . ramp . filter ( :lowpass , cutoff : midi . frequency + midi . env ( range : 300 .. 1200 ), quality : midi . cc ( 1 , range : 2 .. 10 ) ) } The mb-sound synthesizer DSL Hey everyone! In this post I want to talk about a long-standing idea in software engineering for making development easier, called domain-specific…
Ruby bug #21220 TLDR: Click here if you just want the highlights Ruby's range syntax has lower precedence than method invocation, so 1..16.size returns the Range 1..8 (probably 1..4 on 32-bit systems), while (1..16).size returns the Integer 16 . Because of this, we need to wrap a range in parentheses or store it in a variable when we want to call a method on the range. I missed the parentheses…
This video is about reverb. This post is about Ruby. Yet they are also part of a lifelong quest to find and redefine the edges of what people consider possible. A change of perspective can reveal the inherent simplicity within the apparently complex. This quest is incomplete and I don’t yet have the neat, packaged answer that ties everything together, but keep this idea in mind while you…
Example SIGQUIT stack trace from mb-util rubygem Hey there, everyone! This is just a quick post to share a debugging technique I’ve found useful and that I recently added to mb-util . Today I’m talking about using SIGQUIT to trigger some kind of debugging action in an application, such as opening a REPL or logging a stack trace. The reason SIGQUIT is useful is that most terminals will…
Over the years of my engineering career I’ve been involved in a number of monitoring, observability, and visualization projects. I’ve found that many of my system-oriented techniques learned from across industries aren’t always intuitively obvious to newer engineers, so I’ve wanted to write about the subject for some time. Here you’ll find my thoughts on…
Once again it’s time for another episode of my video series, Code, Sound & Surround ! This series is all about using 2D and 3D visualizations, code, and sound to explore the relationships between math, sound, visuals, and problem solving from a unique angle. My goal is not necessarily to be a one-stop source to learn these concepts, but rather to both provide an overview of things you might…
My latest video is live on YouTube! In this beautifully animated tour of Voronoi diagrams , Delaunay triangulation , and natural neighbor interpolation , I explain the algorithms used in my mb-geometry rubygem for generating Delaunay triangulations and Voronoi partitions. Then interpolation is given as a practical application of these algorithms. This video is part of my ongoing video series,…
I’ve been writing a lot of code for my next video in Code, Sound & Surround . One small part of that has turned out to be interesting enough to show off on its own. I built some tools for plotting and animating Voronoi diagrams in Ruby , and now I’ve published them on GitHub. Update: I’ve also made a YouTube video showing these geometric algorithms . A Voronoi diagram (Voronoi…
Ruby is one of those programming languages that seems to get slotted into a specific use-case in people’s minds. You use Ruby for web development, C or C++ for high-performance code, Java for banks and insurance companies, Python for machine learning, Rust for trendily secure code, Typescript for web frontends. Everyone just “knows” these things. But why? For a long time I had…
I’ve been working hard on a YouTube project lately, which I’ll blog about later. For now, I’m pleased to announce that I’ve opened up the source code for Nitrogen Logic’s Depth Camera Controller browser-based UI, called knc . knc is a Ruby- and EventMachine-based service that serves a dynamic browser-based UI (HTML, CSS, JS) for controlling Nitrogen Logic automation…
Hi, it’s been a while. So I actually uploaded this next component from Nitrogen Logic, knd , quite a while ago (October 2018). But things got busy and I never wrote the blog post. So now that we’re all on quarantine lockdowns and have extra time, here’s a very late announcement that knd is now open source! knd provides the core Kinect backend interface for all Nitrogen Logic…
If you’ve read my previous post, you know that I’m opening up some of the source code from my old startup, Nitrogen Logic . Here’s the first major piece of the Nitrogen Logic source code to go open source. It’s a core utility library used by all of Nitrogen Logic’s C projects, called nlutils . Because of C’s very limited standard library compared to more modern…
It’s been quite some time since my last post. I’ve been meaning to write more about my old startup, Nitrogen Logic , but as they say life gets busy. But now seems like a good time to start opening up more of the source code that powered Nitrogen Logic. It’ll be slow going, but the first big C release, nlutils , is already on GitHub . Since Nitrogen Logic was always a one-person…
Lately I’ve been reading about the Rust programming language , just for fun. One of the ways I (and others) enjoy learning a new language or framework is porting an old project into the new language, while trying to take advantage of the language’s features. So to learn Rust, I’ll be reimplementing my old cliserver example for libevent using Rust’s Tokio crate. At the risk…
The web interfaces for the Nitrogen Logic depth and automation controllers are written in Ruby. To talk to the Philips Hue lighting system and some other DIY home automation systems, I created two Ruby libraries, nlhue and xap_ruby . I recently converted these libraries to Ruby Gems available from RubyGems.org. Both of them depend on EventMachine for fast network event handling, but that also…
My last post contained some code snippets useful for working with an Oracle database from Ruby . I’ve also had to interface with Microsoft’s SQL Server database (to add data to a data warehouse) using Ruby and Sequel . Here’s a snippet for using the MERGE statement with the Sequel gem , useful unless/until Sequel gets official MERGE support. This snippet only supports basic…
My last couple of blog posts have been about the backend and middleware work I did at my previous employer. I wrote about two Ruby gems, ClassyHash and HashFormer , that help with data validation and transformation in backend APIs and in middleware. Today we’ll look briefly at some code snippets to help Ruby developers interface with older systems that were written in Oracle PL/SQL, possibly…
Let me tell you about Hashformer , another open source Ruby Gem I wrote for my previous employer. Like ClassyHash , Hashformer was written as part of the “middleware” interface between a Solidus ecommerce site and an Oracle E-business Suite backend. Hashformer defines a Ruby DSL for basic data transformations, like renaming keys, merging values, etc. Hashformer is a bit more niche than…
In this post I will briefly demonstrate the ClassyHash gem, which is a fast data validation gem written in pure Ruby. I recently released version 0.2.0 of ClassyHash , with some cool PRs integrated and quite a few new features. Here’s a quick example: 1 2 3 4 5 6 7 8 9 schema = { query : Set . new ( 'repo' , 'user' ), # Match either 'repo' or 'user' values : [[ String ]] , # Match an array…
Several years ago I came across a number of obsolete Pocket PC handhelds and accessories at a surplus sale. While the PocketPCs themselves weren’t worth keeping due to the dead batteries and slow processors, I held onto a compact portable keyboard with a 9-pin serial connector made by a company called iBIZ. I’m finally getting around to hooking the keyboard up and seeing if I can get…