dinosaurs eat everybody

for all your Dave Schwantes related needs

Thing A Week 14 - Drawing Class

This week I started something new. I'm taking a Drawing 101 class at Root Division art studio in the Mission. I've been drawing comics for a few years now, it seems like I should start learning how to draw.

The class seems like it's going to cover the basics and have us work mainly with graphite and charcoal. I think it will be really good for me to take a step back and really learn some of these fundamentals. I haven't had any formal art training since Jr. High, so I'm about due. I really feel like my comic art has started to hit a wall and I'm having a hard time getting some ideas down on to paper.

The drawing above is the first thing our instructor had us do: first draw an apple from memory, then he put an apple on the table for us to draw. Apples are kind of hard to draw.

Hopefully I'll have some more impressive work from this class to post in the future.

bonus thing!

Eileen got me a copy of Logic Pro X for my birthday and so the first thing I did with it was play with all the amp models and pile a bunch of guitar parts on top of each other. The resulting 30 second piece ended up sounding like some kind of epic video game music:

Thing A Week 13 - RecLab and Rocktopus

This week was another mainly RecLab week. Actually I didn't get much done on the RecLab Rails site outside of updating the look and feel with the new logo we've settled on (shown here...). I spent most of my time on our audio processing API, Rocktopus.

The Rocktopus work has been going well. It's nice to get back into writing some Python again and I've been enjoying working with Flask. One of my favorite recent additions is the require_auth decorator. Python decorators are pretty awesome and make it really simple to roll some common functionality into several methods.

This allows me to write Flask endpoints like this:

@app.route('/path_name', methods=['POST'])
@require_auth
def path_method():
  # do a bunch of stuff for this endpoint
  # but make sure the POST body contains the proper authentication

The decorator itself is pretty simple and works something like this:

def require_auth(f):
    @wraps(f)
    def wrapped(*args, **kwargs):
        data = request.get_json(force=True)
        if not validate_auth(data):
            return response_arm.auth_fail() # return 401

        return f(*args, **kwargs)
    return wrapped

Rocktopus is really coming along nicely and I'm really close to getting it hooked up to the Rails site soon.

This week I start my drawing classes. I haven't had any formal art training since grade school and it seemed time to learn a bit more about drawing, given my interest in comics, so I signed up for a Drawing 101 course at a local art studio. Hopefully I'll have some cool work from the class over the next few weeks to show off in these posts.

Thing A Week 12 - FilterFilter

So this week I actually made a thing. Back in week's 4 and 5 I was working on a project to listen to Twitter for pictures with a certain #hastag so I could display them at our wedding. I also wanted to build something similar for Instagram and have it feed into the same database. This became FilterFilter.

The Instagram API works differently than Twitter's. In order to get real-time information you have to register a callback endpoint with Instagram. This endpoint has to respont to a GET call with a validation code sent by Instgram and then respond to POST with whatever you want. Instagram only notifies you of an event (such as a photo being posted with a certain #hashtag), they don't actually provide the media info, so you have to find that yourself, which is a bit annoying and kind of clunky.

Here is the Sinatra code you might used to create the GET and POST endpoints to register and use the Instagram API:

get '/instagram_stuff' do
  params['hub.challenge'] # for when you register your callback endpoint
end

post '/instagram_stuff' do
  # do stuff when Instagram tells you something 
  #    new has been posted
end

I was able to use a lot of the code I wrote for BirdWatcher (the Twitter listener) to store this info, so that was nice. I still need to write a front end to display all of these photos but that will be done some other week. It would be nice to bundle all of this together and create some sort of product for people where they provide a hashtag or keyword and I provide a nice display of photos from various services with those keywords. Maybe someday, when I have time to clean up this code a bit.

Of course I spent time this week working on RecLab, too. I got some S3 stuff set up and built out a few site forms. We were able to get a rough prototype of the basic track uploading and song creation functionality, which was fun to see. I also spent a bit of time working on our audio processing API. It's starting to come together and it's been very interesting designing something like this from the ground up.

To help us learn more about the types of people who might use RecLab I've put together a quick 10 question survey. If you are a musician, please take a minute and fill this out, it would be a big help! RecLab Musician Survey

Thing A Week 11 - More RecLab

Once again this week's work was devoted more to a long term project than to anything that could be finished in 7 days. I put more work into the site and the audio processing tools for RecLab and we've been doing some good planning, too.

The site is pretty straight forward Rails, so far. Nothing too out of the ordinary there. I'm starting to get deeper into the music objects and business logic of the site, which is fun. I've also been working a bit with Flask as a wrapper around some of the audio processing stuff. After Week 7 I had been looking for a good Flask project and now I've found one! I've found some great resources on building good APIs in Flask, such as this one which have been really helpful for designing non-trivial stuff. I have a bit of experience building APIs with a micro web framework from building the Unofficial Fitocracy Runs API in Sinatra, but this will be a bit more complex than that.

Hopefully we'll have something that I can actually show off soon. We'll certainly need early testers. I do still hope to have work on a few small projects that I can show off from week to week.

Thing A Week 10 - RecLab Site

Once again I feel like I'm stretching the rules of A Thing a Week (which is ok because I sort of just made them up). This week I focused on starting the website for a new larger project I've started working on with a friend. We're trying to build a good way for musicians to collaborate online. There are a few things out there trying to address something similar to this, but none of them seem to have serious traction and it looks like there's a lot of room for refinement.

This week we did a lot of planning and architecture for the project and I started building the Rails application for the site. This is my first non-trivial Rails 4 project and it's been interesting to see some of the little differences. The biggest one I've come across so far is the removal of attr_accessible and moving that functionality into the controller. I need to learn a bit more about how that totally works but so far I've been able to use a lot of what I learned building Rails 3.2 stuff.

I've been really impressed with the Rails 4 gem compatibility, as well. Major stuff I like to use such as Devise, Active Admin, and Paperclip are all working just fine. Python could learn a lot here!

This week I was able to get the basic site together, make it look nice enough to work in for a while, build basic user/user profile and login functionality, and start building out some of the core business logic for working with recorded tracks. I also started putting together some survey questions so, musician friends, expect to be bugged to be asked questions soon. It might be a little while before we have an actual site for people to try but I'm always interested in talking with people about the idea.

Now I need to balance working on this with doing a couple other single-week projects, especially the stuff that is needed for the wedding.

Thing A Week 9 - No Thing

So this week was not a good Thing a Week week. I had planned to build the Instragram listener to go along with the Bird Watcher project I was working on a few weeks ago, but I ended up sort of bouncing around between a few ideas instead. This is a bit against the "Thing a Week" idea where I complete something every week rather than randomly playing around with stuff to no clear end.

That said I did git a bit of work done in a few areas.

I started the Instagram work and learned a bit more about how their streaming API works. It looks like I'll need to build a callback endpoint to take in post info and store things in a database and then Instagram will handle most of the hard work. I'll probably just end up building the callback endpoint as part of the exiting daveandeileen.com Sinatra application.

I also spent some time doing a bit of research on audio processing libraries for another project I'm planning. As of now I'm leaning towards PyDub. Hopefully I'll have some work from that project to post soon.

Finally, I'm planning to build a ring box for our wedding out of an old book (kind of like this, but with wedding rings). I was able to find a book I like at a used bookstore this weekend, so I consider that a small win.

This wasn't a great Thing a Week week, but at least I got a few productive things done.

Thing A Week 8 - In The Garage Cover

I had a little bit of trouble picking my project this week. Originally I had planned to continue working with Flask, but I was just at a loss for a small web app project idea. I had been playing around with some Weezer songs while playing guitar one morning so I decided to record a cover of In The Garage for this week's thing. If you don't feel like reading this to get all the way down to the Soundcloud player here's a link.

I was pretty faithful to the original, mainly just taking some liberties with instrumentation in a few parts. I really like the dirty guitar and bass in song so I found some amp models that kept with that style. I did swap out the harmonica riff for a thin, high piano part over a crunchy bass. I really liked the hollow sound it created and it felt in line with my tendency to add keys to things. In that same vein, I used some synth in a few parts as well, replacing the little guitar riff in the verse and working with the guitar in the solo.

I actually had a lot of fun with the solo, again staying pretty true to the original but taking some liberties here and there. The synth was a fun addition and really beefed things up. I ended up falling back on some blues riffing during the end of the solo because I'm just not as metal as Rivers.

Again I used Garageband's Drummer feature for the drums. I spent a bit of time dialing them in and I was pleased with how they turned out. While laying out the song I did discover that Garageband doesn't let you change time signatures in the middle of a song. There is a single measure of 2/4 time in the verse so I had to just offset thing. I was worried that the automated drumming would sound weird around this change, but it ended up being fine.

The vocals... This is always tough for me. The verses turned out ok. They're pretty straight forward and in my range but the chorus was tough. Some of the high notes were a big of a strain for me and in general the choruses felt a bit lack luster. I just don't know how to get more character out of my voice. The last chorus with the high harmonies was especially difficult. I was really straining my voice there. As always, doing stuff like this is great practice and helps me improve so I just need to keep that perspective.

I wasn't especially pleased with the mixing and production on this song. I felt a bit rushed because I started working on this a little later in the week. I had recorded some of the guitar parts in a chopped up way and I can hear some lack of fluidity. None of the parts were difficult enough to get right to justify this type of recording but I was just in a rush to get something down. In general I think things just feel a bit choppy, but I suppose that's the price of doing things on a time crunch.

All in all, it was a fun project and it's alway nice to spend time recording. Enjoy:

bonus thing!

I also posted a comic to Mount Saint Awesome this week (the first in quite a while). It didn't feel like a big enough art project to be a full Thing a Week thing, but it's still worth checking out.

Thing A Week 7 - Flask

Now, in my defense I was pretty sick for most of last week so I ended up not getting much done outside of work besides a lot of napping. I started with a vague plan to do something with Flask, the Python micro-webframework and to that end I succeeded in what I set out to do. It had been a while since I had done anything serious with Python and I've been feeling the urge to get back into it.

I ended up spending a lot of time just getting my Python development environment set up. Apparently it's been so long since I've done anything non-trivial in the language that I didn't even have basic tools set up well on this computer. I wanted to do things right and that took a bit of installing and uninstalling through various channels to get things just so. This meant Python installed threw Homebrew and then using that version of pip to install virtualenv. This way I didn't have to use sudo to install virtualenv. While this ended up being more frustrating than it should have been (and at one point led to me asking a Stack Overflow question that I later answered for myself) I did get things set up nicely, which is a major win.

Once I got down to setting up Flask thing were pretty smooth. For the basic stuff I was doing it felt very similar to Sinatra, which I've worked with quite a bit. I finally got to use Python's method decorators in practice which was neat (they drive the routing around the functions related to the routes).

The end result was a pretty basic first test site. Nothing really worth putting up anywhere. I'd like to keep playing with Flask and get a bit more reacquainted with Python so unless I have another burning project come up, I might just stick with it this week too.

Thing A Week 6 - Piano and Bass Song

I think that it's fair to call this Thing A Week a failure and I don't really have a great excuse. I set out to write a song that revolved around the piano and bass and I ended up with a nice riff that didn't go anywhere.

This tends to happen to me a lot. My Garageband folder is full of 30 second long riffs and fleshed out song chunks, but I often hit a wall and I'm not sure where to go from there. Last week I sat down and tried writing some stuff influenced by a couple songs that either did piano and bass or just bass licks well. The main ones I referred to were Erase Me by Ben Folds Five and Sic Transit Gloria...Glory Fades by Brand New. They are both awesome songs and I especially love the way the piano and bass work together in the Ben Folds song but my ideas just weren't working. I ended up with some weird meandering minor bass parts thrown over some really weak piano parts.

I came back the next day and switched to a major key and started with the piano part first. From there I came up with something that I liked and wrote a simple bass part that just harmonized the piano roots in a few parts.

And that's where I got stuck. I spent a bit of time playing around with some sparse guitar parts and a few of the new amp models in the new version of Garageband. I also played around with the new Drummer feature of Garageband. It was pretty cool and maybe the most redeeming quality of Garageband X (the removal of the old keyboard shortcuts and export to mp3 are driving me nuts and might send my back to version 6!). The drum sounds are great and it's a big step up from the midi drum parts I had been working with in the old version of Garageband, but I did feel a bit uncomfortable with the loss of control over every single hit. I suppose it's a decent compromise.

So here's what I came up with. I ended up just doing some random guitar riffing and bigger chords at some point, but it really just felt forced and didn't take the song anywhere. Take a listen, though, because the piano/bass part turned out pretty nice:

I'd like to keep working with this song. It's different than most of the stuff I've written lately. I think that throwing lyrics over it will be a bit of a challenge just because I don't quite trust my voice for something this mellow, but it's a fun part and I think it could turn into something cool.

This week I'm leaning towards either a project with Python (I've been meaning to brush up on my Python for a while) or something artistic. I'm still not quite sure.

Thing A Week 5 - Bird Watcher (Part 2)

So I took this week to wrap up last week's project. I was having trouble getting the Twitter listener for my wedding photo project up and running on my server but I'm pleased to report that I managed to get things up and running.

I ended up changing the format of the project a bit. Instead of a full Sinatra application I put everything into a single Ruby file that I can just leave running whenever I want to fire up the listener. I didn't need this project to serve any content, only run Tweet Stream and write to a database, so Sinatra was probably overkill to begin with.

I had some trouble with Sequel, the Gem I was using to interface with the Postgres database but eventually got things worked out. The weirdest issue was with trying to store the url of the photo. For some reason this didn't work:

def store_image(tweet_photo_url, tweet_user, tweet_text)
  ...
  @db[:photos].insert( :photo_url => tweet_photo_url, :service => "twitter", :username => screen_name, :name => name, :photo_text => tweet_text)
end

but this did:

def store_image(tweet_photo_url, tweet_user, tweet_text)
  ...
  the_url = "#{tweet_photo_url}"
  
  @db[:photos].insert( :photo_url => the_url, :service => "twitter", :username => screen_name, :name => name, :photo_text => tweet_text)
end

It must have something to do with the way Ruby handles certain strings or how Sequel or Postgres handle certain strings in INSERTs.

You can see the final file I'm using bird_watcher.rb in the Github repo for the project.

Next I'll need to write an Instragram listener. Hopefully that will be pretty quick as most of the mechanics will be identical to this listener. I might hold off on working on that for a bit, though. I'm thinking about tackling a musical project next week.