Blogs

Does swapping 3rds and 7ths preserve harmonic feel?

The ii-V-I chord changes are arguably the most basic stable of jazz harmony, and exploring what’s so compelling about this chord is always a good way to diving into what’s harmony in jazz is all about. Recently the youtuber Charles Cornell published a nice video in his channel exploring how ii-V-I changes in major have a very nice pattern of leading tones involving thirds and sevenths, and how this drives the harmony forward in such a compelling way, by stacking compelling resolutions that continuously release the tension built by moving the chords around.

March 13, 2022

Could Neural Nets be used for Symbolic Optimization? Maybe.

What’s Symbolic Optimization A while ago I was entertaining problems in the intersection of symbolic manipulation of expressions and Deep Learning. In particular I was interested in finding “optimal” expressions in some way. So, imagine you have some grammar $G$ that describe a set of expressions, let’s call it $\mathrm{Exp}_G$, and suppose we have a real-valued function that takes an expression and maps into a number $f: \mathrm{Exp}_G \to \mathbb{R}$. The problem I want to discuss is finding expressions that minimize that function:

July 2, 2021

Negative Harmony inverts brightness of modes

Intro Recently I’ve been listening to a 12tone video on YouTube about negative harmony, a concept recently popularized by musician Jacob Collier. On the related links I found a bunch of videos from this channel with “negative harmony” versions of many popular songs. The change in sonority of those songs clearly indicated for me a change in the mode of the song, which kind of go against the grain of what I’ve been told about the action of those transformations.

February 20, 2021

A few frustrations with Python's type annotation system

I have on and off again tried to use mypy to type check my python code, but some shortcomings of Python’s type annotation system really get in the way. This came now because I needed to write code involving trees that had to change the types of values stored on the nodes. This highlighted a few serious shortcomings for anyone that is accostumed to use stronger type systems. The ugly syntax for function types is annoying but there are worse problems Yes, writing Callable[[Callable[[A], B], F[A]], F[B]] instead of (a -> b) -> f a -> f b as in Haskell or (A => B, F[A]) => F[B] (or maybe the uncurried (A => B) => (F[A] => F[B]) version) as in Scala is really annoying.

January 20, 2019

Type safe records as an excuse to learn type level programming in Haskell

I’ve been recently trying to learn more advanced type-level constructs in Haskell and was very happy to find this amazing talk by Prof. Stephanie Weirich about Dependent Types in haskell. This talk helped me to understand deeper a few more recent concepts introduced by some of GHC’s extensions and how to use them. In this post I want to focus a little bit in a simplified version of one of the data structures Prof.

February 12, 2018

Operational Semantics for Monads

Disclaimer: this is an old blog post from a very old wordpress blog and may contain inacuracies. I reproduced it as is for sentimental reasons. I may revisit this theme later. While randomly browsing around on Planet Haskell I’ve found a post on Heinrich Apfelmus' blog about something called “operational semantics” for monads. Found it very iluminating. Basically it’s a form to implement monads focusing not on defining the bind and return operators, but on what the monad is really supposed to do.

August 25, 2010

Stochastic Processes as Monad Transformers

Disclaimer: this is an old blog post from a very old wordpress blog and may contain inacuracies. I reproduced it as is for sentimental reasons. I may revisit this theme later. I have a difficulty to understand functional programming concepts that I can’t put to some very simple and natural use (natural for me, of course). I need to find the perfect simple example to implement to finally understand something. And I’m not a computer scientist, so things like parsers and compilers have very little appeal to me (probably because I don’t understand them…).

August 3, 2010