April 20, 2015
I spend the vast majority of programming time working with Ruby these days. I've gotten to know it pretty well and it is honestly a joy to use, but I want to make sure that I don't just limit myself to a single language or even a single type of language (the occasional Python project doesn't quite count as adventurous). Out of curiosity and a desire to work with a more low level language I've started playing around with Rust.
Rust is a systems level language created by Mozilla that might be used in similar situations as C++. I haven't done anything this low level since I had to use C++ for a data structures class my sophmore year of college, which was a surprisingly long time ago.
I needed a small project to build if I was going to learn anything about the language so I decided to build a Bloom filter. A Bloom filter is a probabilistic data structure that is designed to be really space efficient and allows you to determine if something is "probably in the set" or "definitely not in the set". For example, web browsers use Bloom filters to store lists of dangerous websites, which is why you sometime get a warning for an obviously safe site.
The end result of this little project was Bloomfilter-RS, a small Rust library that implements a Bloom filter. It can be used like this to create a Bloom filter with 100 buckets and 5 hash functions:
let mut bf = BloomFilter::new(100, 5);
// (probably) true
It was pretty interesting working with a lower level language coming from Ruby. I had to think about passing pointers and dealing with a much more robust type system. Fortunately working with Scala in the past prepared me a bit for dealing with generics and default immutability, but it really felt MUCH slower than working with a high level language like Ruby (which I suppose should be obvious).
I don't really have a major project in mind that needs a language like Rust right now, but I'd like to keep tinkering around with it just to expose myself to other types of langues. It's also just fun to follow a language as it's being built (as of this post Rust is still a few weeks away from it's official 1.0 release and some of the API still isn't quite stable).
Feel free to dig through my Bloomfilter-RS code and give me any feedback about style or a better way to use language features. It was certainly built as a learning experience.
February 7, 2015
January 11, 2015
So I posted my first Thing A Week post almost exactly 1 year ago today. The idea behind Thing A Week was to get myself to do more small projects with short deadlines and also get myself to work on a bunch of different things so I was producing something interesting each week.
While some weeks I did manage to work with in those bounds and produce a standalone project in one week (for example; the bass pedal, my cover of In The Garage, and the Therimino) I actually ended up spending a lot of my Thing A Week time on pieces of larger projects like RecLaboratory and the photo listener. While this wasn't the original intention of the exercise I was still able to use the model to break up chunks of work and produce stuff worth talking about almost every week.
In the end I did 36 Thing A Week posts last year. Not as good as the 52 I would have liked, but it still represents a lot of productive weeks. I also found it really valuable to write about what I was working on each week. I think I just really enjoy sharing both the finished product and the process for the projects I work on.
Here are some things I made last year:
While I really enjoyed doing the Thing A Week posts last year, this year I'm not going to have the same weekly goal. I may do some more Thing A Week style posts when I finish a project but I'm trying to focus more on just doing stuff rather than only on getting stuff done. For example, when I was writing music last year I focused a lot on writing things that I knew I could finish quickly so I ended up with a lot of short musical ideas, but not very many complete songs. I want to spend more time doing things like art, music, and coding (and whatever else sparks my attention) and doing it well. Maybe this means spending more time drawing in sketchbooks and less time making finished comics. Maybe this means starting a couple of songs and working on them until I'm REALLY happy with one.
I have a few project ideas (some big, some small) that I'm already starting to plan out, so I'll try to keep up with regular Thing A Week style postings discussing my progress on those things, even if it's just for my own enjoyment.
October 20, 2014
This last week I built something cool that was actually in the spirit of the Thing a Week project!
Last Christmas my mom got me a distance sensor that could be easily used with an Arduio (which is a totally normal gift) and I finally got around to playing with it. I had originally wanted to start working on some sort of robot but first I wanted to just play around with it and see what I could do.
After running through a few tutorials I decided it would be fun to make some sort of crude musical instrument using the distance sensor. I learned a bit about how to hook up a tiny speaker and then used the value of the distance sensor specify which tones to generate.
This created something that just constantly made steady sine wave sounding noise. I wanted to add the ability to do start and stop notes so I attached a small pressure sensor to the project. Then the tone would only play if you were pressing down on that sensor.
I also added a small LED light that turns on when a note is being played because lights are neat.
Because you control the instrument by moving one hand around, like you would on a theremin I decided to call my new creation a theremino (like theremin + Arduino... get it?). Unlike a theremin, the theremino plays discrete notes from a regular chromatic scale, changing notes every 4cm you move your hand from the sensor. It has a range from B2 to C6.
As you can see from the video below this instrument is actually kind of hard to play. It's tough to be accurate with your notes when moving around in mid air.
It had been a while since I had tinkered around with an Arduino, so this what a really fun little project. For those interested, I have the the Arduino code for this project available here and a wiring diagram for the Ardunio and breadboard here.
October 14, 2014
Unfortunately I've broken my "Thing a Week" streak due to some busy weeks where I just didn't have time to make much of anything. I did, however, have time to clean up some of the last few things for the RecLaboratory early tester launch. Bobby and I spent last Tuesday fixing bugs and cleaning up the UI to get RecLab to a place where we were happy enough to let other people check it out.
This doesn't mean it is complete or bug-free by any means. I'm sure there a lots of little rough spots and the UI, while not terrible, is still pretty bare-bones. But our goal for this "release" was to get the site to a point where we could show some friends and let them try things out. We really just want to see if we're headed in the right direction with what we have so far before we devote a lot of time to polishing the UI and the code base.
It's pretty exciting to finally start showing off something we've been working on for a long time (on and off for about 6 months now). While it's kind of nerve-wracking to worry about something breaking now that people other than Bobby and I are on the site it'll be fun to see how people start to use what we've built. We're rolling out invites very slowly as we become more confident about the feature set and stability of the system.
I also started a RecLab Blog (my first Tumblr account!) to act as a sort of company blog now that we're trying to involve other people in the site. As always you should follow/friend/read/whatever our Facebook, Twitter, Instagram, and blog.
Please go to www.reclaboratory.com and sign up to become an early tester and we'll probably send you and invite soon!
September 22, 2014
Last week was a pretty busy week so I didn't get too many "projects" done outside of some RecLaboratory work and even most of that was done in between sessions at the Golden Gate Ruby Conference. The major piece of work I finished up, apart from some UI cleanup, was a modal to create (and record!) a new track from a song's page. I think this will be a very common use case, so I wanted it working before we did the friendly release.
After getting the in-browser track recording to a working place the previous week, I wanted to reuse most of that functionality in this new modal. Building this new feature on top of that existing code caused me to refactor a few things, which was great. I also had to add the ability to use multiple tracks as a "backing track" for the recording because I imagine that users won't want to bounce the song after every recorded track. This takes advantage of the track pre-loading I had already built into the song page and a little bit of html5 audio object abuse.
This is one of the last functional pieces of the site that needed to be built before we start soliciting alpha testers. Originally we had wanted to open RecLaboratory to early users on September 8th (almost exactly 6 months after Bobby and I first started talking about the idea) but we really wanted to get the last features in so that we could offer users a compelling reason to interact with the service. I think we're getting REALLY close now!
September 15, 2014
Hey look! Another non-code related Thing a Week! On Saturday night, Eileen was at hockey so I grabbed my (much neglected) guitar and popped open Logic Pro for some quick recording. The end product was a nice, kind of dark sounding instrumental track.
I had been messing around with a little arpeggiated riff and I wanted to build something pretty repetitive, getting away from a verse-chorus-bridge structure. After I had the riff, I started building the drum part. The real breakthrough there was throwing in the handclaps, which start off sounding so happy but then sound more ominous under the bass and main guitar riff. Despite being pretty core to the whole song, the bass part didn't come in until much later in the writing process. I also ended up using amp models with a lot more reverb than I typically use. I have a tendency to seek out drier guitar tones, but the more spacious sounds really worked for this piece.
I resisted the urge to just keep stacking more and more tracks on top of each other in this song and let some parts be pretty sparse. I think I could put some lyrics over this but it was getting late and nothing was really jumping out to me, so I'm pretty happy with it being instrumental for now.
September 8, 2014
This week I'll take a break from talking about RecLaboratory stuff and talk about art. This week I started playing around with watercolors.
One of my favorite cartoonists, Mitch Clem, has been working with his wife(?), Amanda to use watercolors in his comics for a while. They've done some really cool stuff in both color and black and white. I've seen other comic artists do it too and I've always loved the effect.
After a trip to the Walt Disney Museum, particularly the Mary Blair exhibit, with Eileen I was really inspired to try painting something so we went to the art store later that weekend and picked up some supplies. As a first project I wrote a short (questionably funny/comprehensible) comic and tried to paint that. The result was pretty cool, for my first time, and a lot of fun to do. It was a bit tricky working with watercolors in such a small size (the panels were maybe 2" x 3") but I learned a bit and really enjoyed the medium.
Then over the weekend I wanted to do a single scene and had the idea of just doing a simple girl playing guitar on stage. After watching a whole season of Inkmaster I decided to throw a few tattoos on her, as well. I am particularly proud of the hands in this piece. Usually I just give up and let the hands sort of fall apart, especially on guitars but I thought these turned out well. I'm really happy with how this turned out and I plan to keep working with watercolors in the future.
September 2, 2014
This week my major work was around building an in-browser audio recording system. I've been reading about using new HTML5 APIs to get access to the user's mic (and camera) for a while and I was finally able to sit down and start building something out. Because I feel the need to name everything I build, I had to name this as well. None of the bands I was in ever really practiced or recorded in a garage, they mostly worked out of basements. As a bit of a nod to (and departure from) Garageband, I decided to just call my recording stuff Basement.
The core technology for this whole process is getUserMedia(). This is what prompts the user to allow the page to access the mic (or camera or whatever) and then handle a
LocalMediaStream object. From there you can work with whatever is being picked up by the mic.
Outputing the audio in real time was very easy (hey I built a monitor!) and after doing a bit of research I found a fantastic library to help with the recording aspect of this project: Recorderjs. It provides a nice
Recorder object to work with and, best of all, it's a VERY small, easy to understand library so I can go through every line of code and understand exactly what is being done. This is very important because all of this in-browser media work is very new and deep tutorials are rare. Plus I'm going to need to do a few things that haven't been done perfectly yet.
Right now I'm working on taking the recorded audio, which exists as a Blob tied to the page it was created on, and sending it back to the server to be uploaded in a way that works nicely with our existing Paperclip system. I'm really digging into some of the new HTML5 APIs for all this work and it's been really interesting.
The in-browser recording is the last new major feature we need to build before polishing up the RecLaboratory site (which I updated this week, too!) for a very early, very small beta. I'm really excited to get people using this tool soon!
August 24, 2014
Along with some other RecLab stuff (which is coming along nicely), this week I finally tackled a little project that I've been thinking about for a while. Unlike most of the RecLab work this was much more artistic than technical. I built the first first hand drawn icons for the site.
I knew that I wanted custom instrument, track, and song icons so I started out with a small set of 8 (with plans to make more as we need them). I did these icons the same way I do my comics: first drawing in pencil, then inking, then scanning into Photoshop, then cleaning up the lines and adding color in Illustrator. They had to look good at a wide range of sizes: 400px to 30px so I didn't add too much detail.
To handle what I think will be the most commonly used instruments I started with (electric) guitar, (electric) bass, drums, keys, vocals, sax (perhaps my own bias), percussion, and general track.
So here they are!
Guitars are still hard to draw.
I used a small pallet of colors for all the icons in the hopes of creating an overall cohesive effect when they all get seen together on the site. Bobby doesn't like the percussion one very much and he's probably right. It's my least favorite too, but this seems like a good start and really adds some nice visual variety to the site. Plus it's always fun to draw things!