dinosaurs eat everybody

for all your Dave Schwantes related needs

Thing A Week 34 - Instrumental Indie Music

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.

Enjoy!

Thing A Week 33 - Watercolor Painting

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.

Thing A Week 32 - In Browser Audio Recording

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!

Thing A Week 31 - RecLaboratory Instrument Icons

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!

Thing A Week 30 - RecLaboratory Servers

So as of last week I have the RecLab Rails site up and running on Heroku and the audio processing API, Roctopus, up and running on my own server. Amazingly they are able to talk to each other and work pretty much as expected.

There are still quite a few things to fix up, particularly with Rocktopus, but it’s nice to see the full application working together on remote servers. While the Rails/Heroku setup was pretty straight forward, Rocktopus was uncharted territory for me.

I had never “launched” a Flask application before so this was all a bit new. As a (temporary, I swear!) measure I moved the files to my server over SFTP and started up a Gunicorn server to run the application. I still need to put Nginx in front of all of this but for now it works as expected (though I can’t imagine it would handle much traffic). I’d also like to learn more about Fabric for Python deployments. I’ve never been much of a sysadmin, so this was all a bit new to me.

The only really new thing I did for the Rails/Heroku app was add Unicorn as a server. Heroku has a great article that held my hand through this setup.

Also, as part of this setup I’ve been playing around with Slack and it’s wonderful integrations for monitoring the app. So far I have it working with Heroku, PaperTrail, and Pingdom. Nothing’s gone wrong yet, but I suppose that is to be expected when there are no users…

As I mentioned, there are still quite a few rough edges to be worked out, a bunch of minor features, and at least one major feature that still needs to be built but this feels like a big step in getting RecLaboratory launched and letting people try it out. We have some people in mind for VERY early alpha testers, but please let me know if you’re interested in trying it out when it’s ready!

Thing A Week 29 - Wedding Ring Box

So, you may have noticed that I’ve missed the past few Thing a Week weeks. In my defense I did just get married last Saturday, so I’ve been pretty busy with wedding related travel and planning so I haven’t had much time for extra projects. The wedding was amazing and I now have a wife, which is fun. In the spirit of the wedding I wanted to share a project that I worked on a while ago but didn’t want to show until now.

For the wedding I wanted to build a ring bearer box out of an old book. After looking around some used bookstores I picked an old Tarzan book because 1) it seemed common enough that I didn’t feel bad using it as materials and 2) it had a cool elephant on the cover. I wanted to hollow out part the inside pages and create inlays to hold the rings (like a secret flask holder but for wedding stuff).

I started by covering the covers in plastic (to avoid getting glue on them) painting the sides of the pages with puzzle glue in order to stick all the pages together. I did about 5 coats of this. Once that glue was dried I measured out the inlay and started carving pieces out using an Excato knife. This took a lot longer than expected and when I was down about half an inch, I coded the new inner wall with glue to give it a nice solid feel.

After I had my basic inlay I needed to dig out the slots for the actual rings. This was even more tricky. I thought I would be able to make clean cuts, like I did with the inlay but I ended up basically using the knife to turn the paper into pulp and then just digging the pulp out of the the slots. After removing top page from the inlay, which had been pretty well torn up by all the digging I was left with a nice ring box.

The pages held the rings perfectly and I could even hold the box open and upside down without the rings falling out. The box was put to use by our ring bearer, Sui Chi, on Saturday and it looked great! This was a cool little project and it was fun to build something non-digital again. It really took a lot longer than I expected but the result was worth it.

Thing A Week 28 - Not Much

So most of this week I was traveling so I wasn’t able to get very much work done on any projects. I did, however, attend an Indian wedding in Long Island which was really cool so the week was not a total loss.

The work I did get done earlier this week was mainly with the RecLaboratory interface to Rocktopus, our audio processing API. I built the interface to the bounce_song functionality, which will take all the individual tracks of a song and combine them into a single (probably .mp3) file.

I also set up a sort of hacky but effective, for now, “loading screen” to let users know that their audio is being uploaded/processes. It seems like a little thing but letting the page just hangs after clicking submit is really bad UI. This is a very early version of the product and we haven’t given UI the full focus it needs but this was one thing that would be too awkward to not address early. It was a bit of an awkward fix because we’re not actually doing the audio processing or uploading as a background process. Eventually I’ll build a queuing/callback system in Rocktopus that will work much nicer, but this gets us going now.

This next week is another busy week. It is the last week in SF before we fly back to Chicago for the wedding (which is less than 2 weeks away now…). If I get anything Thing A Week thing done this week it will probably be something wedding related.

Thing A Week 27 - Even More Sauropod

Once again, another busy week divided between wedding stuff and side projects.

I spent this week adding more features to the RecLaboratory audio player and I feel like it’s in a pretty good spot for now. Obviously, there’s more I’d like it to do but it’s certainly at a point where it will work for basic track and song playback.

Here’s a list of new features that got added this week:

  • Visual indicators on the in page play buttons to show what is playing in the global player
  • Some basic layout polish and player styling
  • Jump forward or back in the audio by clicking on the progress bar
  • Play/pause using the space bar
  • Some basic (if clunky) error checking to make sure files loaded

One really interesting thing I found this week that I didn’t expect is that audio playback is not interrupted by navigating around the site. If I reload the page the sauropod.audio object is empty and playback stops, but not if I’m just clicking links on the site. I haven’t had time to explore it completely yet but I suspect it has something to do with either the way Rails caches JavaScript or with TurboLinks.

I’m really happy that is “just works” that way, I was worried that I would have to go back and turn this whole project into a single page app eventually to get uninterrupted playback, so this is a nice win. I do need to spend some time testing things to make sure I understand WHY it works. It seems dangerous to accidentally get a nice feature like this.

Like I said, while Sauropod is still a little rough around the edges, it’s good enough to use for the site. I’m now moving on to fixing up the interface to Rocktopus for audio compression and song bouncing.

This week I’ll be traveling to New York for a friend’s wedding, so my Thing A Week time may be limited. Also I need to eventually finish writing the ceremony script for my wedding or else some people are going to be mad at me…

Thing A Week 26 - More Sauropod

Another 7 days, another busy week. With the wedding growing ever closer I’ve been squeezing in time for other projects wherever I can. This week I managed to make some good progress on Sauropod by putting in some work before I go to work and on the plane while traveling to Chicago for the 4th.

I got Sauropod hooked up into the asset pipeline of the RecLab Rails site and started attaching it to the various audio controls on the site. While Howler.js handles loading the audio file and playing the sound in browser, I still needed to build all the hooks to control and monitor the audio.

At this point I am able to click a “play” button next to a track and have Sauropod load the song and update global play/pause button, display the name and owner of the track (with links), and display a progress bar and time progress. I also have a global mute/unmute working and started on global volume controls. Most of the controls and UI updates were just simple hooks into Howler and some jQuery for display manipulation, but the progress bar and timer were a little tricky. While a regular HTML5 audio player sends an onprogress event that you can listen for to control the progress display I had to write my own listener that starts an stops with the audio. It wasn’t very hard, I just used a setInterval() function around my own sauropod.updateProgress() function:

sauropod.play = function() {
  if (sauropod.audio.status != "playing") {
    _.each(sauropod.audio.tracks, function(s) {s.play()});
    sauropod.audio.status = "playing";
    sauropod.updatePlayer();
    sauropod.tid = setInterval(sauropod.updateProgress, 100);
  }
}

I still need to build all the hooks into playing a mutitrack song (though it should work based on how I’ve built the system) and then work on the track editing features (muting/level adjustments at a per-track level). I also need a bit more robust error handling and a cleaner UI, but all in all the audio player is coming along nicely.

Thing A Week Progress Update

So this week marks half a year of this “Thing A Week” project. It hasn’t been exactly what I planned, one discrete project finished every week, but it has really keep me focused on building things and I’ve really enjoyed writing about my progress on all the things I’ve been working on.

Thing A Week 25 - Sauropod and Wedding Stuff

As seems to be the trend lately, last week was very busy. Between work stuff, wedding stuff, seeing a musical, and going to a show it was hard to find time to get extra things done.

Almost all of the weekend was devoted to knocking off extra wedding things, like designing take-home gifts for guests and buying a bunch of ties. There is a big list of things that we apparently need to do, but we’re making good progress on it.

We had a really productive RecLab meeting on Tuesday where we worked out some good layout stuff and got the feed stuff into a good place. With the basic feed working, I am now able to move on to the audio player component: Sauropod.

Why is called Sauropod? Well a while ago I had to build an HTML5 based mp3 player for a job interview and I decided to call it 5auropod because ‘sauropod’ kind of sounded like ‘iPod” and the ‘5’ because of HTML5. Also sauropods are cool, enormous dinosaurs. When I started working on a player for RecLab I wanted to use the same name, but I was worried about starting JavaScript variables with a number so I just used “Sauropod”. Convoluted, I know, but it makes sense to me.

Right now Sauropod is in it’s VERY early stages, mainly just building out method names to architect the system. The basic idea is to build a library to work with songs and tracks that contain metadata and possibly multiple audio tracks that need to be played simultaneously or adjusted individually. I’m using Howler.js to handle most of the audio heavy lifting. It’s been pretty awesome so far. I’m also trying out Underscore.js to give me a bit of functional programming in JavaScript. This is mainly to make working with arrays nicer, which I will have to do quite a bit with the arrays of Howler.js Sounds that make up songs.

Sauropod is still in it’s very early stages, but I have a pretty good architecture planned out and I’m excited to see it develop.