Code

Seven Languages in Seven Weeks

Introduction Think about the way you think. Think about that thought, and this one. Did you think using words? Did you see the words? Sound them out mentally? If someone asked you describe yourself, you would probably think of a series of adjectives (at least if you’re an English speaker). We think via language, spoken or written. It’s the source of our intelligence and in some ways the root of our consciousness.…

Be Careful With your Redis BitSets and Java

A while back a popular article hit Hacker News. Written by the guys over at Spool, it contained a slick methodology for storing metrics such as user logins per day, song plays by user, etc using using Redis BitSets. How about a basic example. When a user logs in, set a bit in a bitset at the location of that user’s ID number. If you have a bitset allocated for each day, you can tell for any given day how many users logged in by looking at the cardinality of the bitset.…

Programming, Languages, and Hacking the Way We Think

Last night I read a wonderful article about programming languages. It opened with a quote: A language that doesn’t affect the way you think about programming is not worth knowing. -Alan Perlis After a few minutes of thinking about it, I changed the quote to read: A language that doesn’t change the way you think is not worth knowing. I don’t think in Ruby. Or Perl. Or Python.…

Todo-CL 2.0.0

A while back I created a simple command line tool that allowed me to create tasks from Launchy and send them directly to Toodledo. My process was simple. I’d create a bunch of tasks throughout the day while doing other stuff, then sometime that night (or the next morning) I’d go through all those tasks and put them in the right container, assign due dates, and make projects out of them if necessary.…

A Launchy Todo Client and the GitHub Paradigm

I use Launchy hundreds of times in a day. The Alt and Spacebar keys are usually the first to show significant wear and tear on any new computer I work with. It’s the first thing I install, and it’s how I keep my hands on the keyboard and off the mouse. I also use a web service called Toodledo for task, todo, and personal project management. Toodledo sounds like a lame children’s toy, but it is extremely good at what it does: being an ugly but efficient task management system.…

GOLSequencer, HarmonicTable, and MidiReference on GitHub

With just a little trepidation I have checked in the code for all of my free software goodies into GitHub. I was getting several requests to provide access to the source for several of my old projects, so rather than emailing code around on a case by case basis, I have simply checked everything in to GitHub for posterity. Who knows, maybe someone will jump in there and fix all the bugs.…

RWMidi and Pitch Bend: Another Adventure in Social Coding

In my previous post, I discovered that the RWMidi library was available via GitHub, leaving it open to the possibility of forking and making my sync and pulse resolution changes public. Proving that Jung and Sting were on to something, while making these changes I received an e-mail from a user struggling with RWMidi: I’m trying to send a simple Pitch Bend message and it’s proving impossible! I was already in the code, so I poked around.…

RWMidi, GMS, and GOL Sequencer: Adventures in Social Coding

Many moons ago, I created a little tool called the [GOL Sequencer Bank][1]. You can read more about it [here][2], and [here][3]. In order to create the tool, I used [RWMidi][4], a Java/Processing library created by Manuel Odendahl of [Ruin&Wesen][5]. While creating the sequencer bank, I discovered that the RWMidi library had no support for MIDI Sync messages, preventing me from syncing the sequencer with a master, like Ableton Live. This simply would not do.…

Converting 24PPQ Midi Sync in Java/Processing

I would be the first person to say that for the most part, MIDI is perfectly acceptable as an interface between musical devices, and has survived for as long as it has because of how dead simple it is. MIDI is still plenty fast, and in terms of interoperability, has yet to be bested. However MIDI does have its shortcomings, and while helping John Keston over at AudioCookbook with his Gestural Music Sequencer, I ran in to a big one.…

Java MidiReference 1.0

Several months ago I started working on a series of classes to make my life easier when programming for music. I’d started several projects and realized that trying to refer back and forth between MIDI Numbers and Notation by hand was tedious, so I created a library of functions to do it all for me. I finally got around to formalizing this into one library, and released it here. I’ve put this into action already with the Game Of Life Sequencer Bank and HarmonicTable projects, and its really made it easy to pull scales, chords, drum maps, you name it quickly from a preset library…

Drawing a Hexagon in Processing / Java

As part of my little HarmonicTable project I spent a lot of time figuring out how to draw a proper hexagon. It seems I wasn’t alone in this endeavor, as I’ve received a few comments and e-mails about how exactly to do this. At the request of others I’ve moved the Hexagon class back into Processing, and written a dead simple PDE sketch to show you how to use it.…

Processing Harmonic Table 02

Mac users pointed out some problems with 01, so I fixed the following: When dragging notes, the note would only sound once until the mouse was released. The software would not start up automatically on many Macs unless the java version was set to 6 Unreported: Notes would only sustain as long as the mouse button was held. May be seen as a feature, see below for fix. I fixed the dragging problem, and recompiled the software in Java 5 so that it will work in either 5 or 6, so Mac users should be able to start up without issue.…

Processing Harmonic Table: Part 2

Since the last post I’ve had to make far more changes than I expected. If you looked at the previous examples, there was using a loop to create the hex buttons, making translations to relative to other translations on the screen. In the process I completely lost track of the absolute position of the button, which basically made it impossible to detect the location of the mouse on the screen in order to tell which button I was pressing.…

Processing Harmonic Table: Part 1

Earlier this year while reading Harmonic Experience by W. A. Mathieu, I was introduced to the concept of lattices to represent tones, chords and keys. These lattices can be used to represent the basics of music composition in a visual way that makes more sense than standard scales on staffs. Here is an example: The lattice is effectively several staffs of music stacked on top of each other, so that the note can be displayed horizontally and vertically.…

Java Midi Reference Class

Lately I have been doing some work with Processing to create visuals from music. One of the concepts I’m working with is live visuals based on video feeds from cameras that are tracking the show, or band, or whatever. This alone would be enormously boring, so to heighten the experience, I thought of using the audio output of the show to control features of the video feeds, like playback speed, positions, color and hue, etc.…