What I like right now

I’ve been working a lot with Scala over the last few months, both at work and personally.  If you get a chance, check out DenverDesignStudio.com.  It is the new site for my girlfriend’s company.  She does custom calligraphy for weddings and events.  Her work is amazing.  It’s almost the exact opposite of what I do.  While I sit around beating my head against machines, she fashions these beautiful organic handmade creations.  It’s awesome.  We collaborated on the site.  I’m not much of a web developer, so she did all the design in illustrator, and then I coded it to get it working.  It turns out that the two of us make one half-decent web designer.  In any case, check it out.

The reason I mention it here is because the entire site is done in Scala against a PostgreSQL database using the Play Framework.  It’s running behind nginx on Ubuntu which is running on a Linode VM.    I guess that makes it a LNPS stack, which just rolls off of the tongue.  It’s been a lovely experience.

First off, Linode is awesome.  They totally get out of your way.  I feel bad for not having more to say about them; however, they are so good that I hardly notice that they are there.  I mean that in the best way possible.

Second, nginx is awesome.  It’s small, it’s fast, it’s wicked easy to configure.  I have it serving a bunch of blogs (including this one) which are WordPress sites, DenverDesignStudio.com, etc. and it just works.

Third, Ubuntu Server is awesome.  It’s small, it’s fast, it’s wicked easy to configure.  I tried using Ubuntu as my main OS on my Dell laptop for work for the last 3 weeks and it’s not my favorite.  I’ll write about that some other time, but I like Server quite a bit.

Fourth, Play/Scala is awesome.  It’s as simple as it can be, and no simpler.  It’s a joy to work with.  It integrates with intellij (which is also an awesome piece of software).  It doesn’t use an ORM!  That might be my favorite part.  I write SQL, and it blazes.  It doesn’t get on board the java abstraction boner wagon.  The main reason I almost never write Java is because it feels heavy and slow.  It abstracts away things that people should probably understand if they are writing code.  I like a certain level of abstraction though, which is why I don’t program in C or C++ much.  I don’t need everything abstracted away though.  Play is a good balance and so far I really enjoy it.  Scala is mostly what makes it awesome.  There is part of me that still things the erlang vm is the way to go, but I’ll have to wait until I have more time to play around with it.  In the meantime, I’m getting things done with Scala, which is nice.

More with Max/MSP, Ableton, and now Python!

It’s pretty neat that so much of what I’ve been interested in, as far as technology and music go, are all kind of congealing into one big mess.  This weekend I started exploring the capabilities of this software call Kapture.  It basically does exactly what my MIDI mapper does, only it captures all configurable parameters of the Live set instead of just the parameters I had the foresight to write code to capture.  It also saves them to the set instead of a separate xml file.  It’s pretty badass.  It basically lets me snapshot my entire setup, save those snapshots, and then recall them whenever I want.  The only part I was missing was a way to get it working with my FBV controller in a way I liked.   Bring on the python!

I wrote a python script last night for the FBV Shortboard MKII that lets me control live with my FBV.  It is based very heavily on the work of Hanz Petrov who has done so much work documenting the LiveAPI that the code is pretty trivial to write now.  My code draws a red box around the tracks I am working with exactly like the APC40 does, and basically makes the FBV a physical extension of what is going on in Ableton Live.  This basically gives me the ability to create snapshots of all of my virtual instruments, mixer settings, etc. with Kapture, and then I can stomp on a pedal to switch between them.  My hands are free to play instruments, and my feet control Ableton.  Pro tools may be the industry standard, but this flexibility and stability makes it feel like a dinosaur.  I can do almost anything I can think of with this software.  It’s incredible.  Python is kind of a glue language, and that is exactly how I used it.  I glued some hardware to a neat Max/MSP app and have something better than what I was trying to write earlier.  I learned a lot writing my old setup though so it isn’t a total wash.

This functionality has obvious live music implications, but it turns out that it is so efficient that I can probably use it when recording and mixing too.  I barely have to touch my laptop which is awesome.  I am now working on getting my Maschine integrated with everything and I should have a really flexible setup with a pretty minimal effort.

I am cleaning up the code now and I am going to try it out over the next few weeks.  I’ll post the code if anyone wants it, but for now I am going to play with it a bit first to make sure it all works as expected.

More Ableton and MAX

I sat down to write this post awhile ago and life kind of happened so I am finishing it now.  A few months ago I sat down to finally write a MIDI mapper for my line6 FBV Shortboard Mk II so that I could control Ableton Live with a foot pedal and not have to worry about using my APC40 for live performance.  I wanted to do it because I’m not a DJ and rarely have my hands free when I am performing.  I’m usually playing bass or keys, and I need both hands.  Trying to work a device with my hands while I am using them to play a different instrument is a wicked pain in the ass. Ari also pointed out that my setup was kind of byzantine and simplifying it might be a good move.  I agree.  My solution was to take the FBV and write a tool in Max For Live that would take the CC messages that the FBV sends and turn them into midi note messages.  I initially wanted the bank buttons to set banks and then based on that number send different midi notes so that instead of being limited to 13 midi buttons I would have x banks of 9 buttons.

My initial implementation worked exactly as designed, but when I tried setting up all of my band’s songs in a single live set (so I could switch between songs seamlessly), I quickly realized that midi was not going to be the solution.  I had not way to track what state the tracks were in from the song before which meant that I had to put every song in the order that I intended to perform them beforehand.  That sucks because it doesn’t allow me to change the set list on a whim.  I also ran into a limitation of live where I can only assign one midi value to a parameter.  This meant that if button a was controlling parameter a of a plugin or whatever, button b could not control that parameter at all.  This meant that instead of being able to hit a button and have it do a few things, and then hit another button and have it do a few different things and undo one of the previous things was not going to work.  The whole thing felt very fragile.  I decided it was time to use Max For Live and it’s Ableton API to set parameters and just take as much midi out of it as I could.

My second implementation used a bunch of set commands to just force set parameters.  I used the param save function to save the settings for each button press into xml.  That worked really well but I later found out that the looper built into live basically requires midi to be used.  It doesn’t expose anything I need to the live API.  I also found out that if you use the set command to set a parameter, it does it as if you clicked the button yourself and there is a 10ms delay or so.  It also has the side effect of creating an undo event for every single thing the pedal does.  That probably isn’t a big deal but I found out that it isn’t really that hard to use the remote~ function to send messages to live and anything sent over a remote is realtime and and doesn’t create an undo event.  Basically the goal at the point was to use remote~ for everything I could and use regular set commands for everything else.  Below are some examples of some of the things I’ve written that are part of the entire tool that lets me basically DJ my own music with my feet while I play.

Here is an example of setting a return track volume with remote and with a set command.









Here is an example of setting tempo that takes 3 seconds (if you’re using a 44100 sample rate ) to get from where it is to where you want it (for smoother tempo transitions if you want to link songs together and have a drummer playing to the click track… which I do).






Here’s a little event timing manager that lets me make my pedal presses take effect on the 1 via quantization:


With all of this working I am able to control Ableton with my feet while playing piano or bass or whatever.  I never have to touch the computer which kicks ass.  So far I’ve not found anything I can’t do with this software.  It really is a pretty brilliant piece of kit.  The sad thing is that I think I like writing software more than I like writing music.  I’m certainly better at it.  Anyway…


DDRUM4 Hi-Hat Controller “Fix”

Disclaimer: I’m not sure why anyone other than me and a handful of other dorks would care about this; however, it seems like a shame to not share it if there is someone out there that could use it.

I built a MAX/MSP patch for MAX for Live that will allow you to use the ddrum4 hi-hat controller with basically any drum sample library you can find.  This may not sound like a big deal, but this controller came out in ’94 and has been discontinued for years despite it kicking the shit out of every controller before or since it was created.  The patch does what it does by taking the CC:4 messages that the ddrum4 uses to determine hi-hat position to control which note actually gets sent to the drum sample library you are using.

You tell it the closed note for the hi-hat, the open-hat note, set the threshold you want to use, and it does the rest.  You can see your pedal position on the Hi-Hat Current Value slider and you can see what note it is sending to your drum sampler in the Output After Processing keyboard.

What this means is that you can use the ddrum4 hi-hat (which is my favorite hi-hat controller ever made, suck it Roland) to control whatever sample library you use without having to do all kind of insane configuration of your drum library.  I got sick of using BFD2 and jumping through hoops to get it to work and then having it all be for nothing if I wanted to use kontakt or some other library that had standard keyboard mappings.  You use this, set up your ddrum4 brain to send regular keyboard mappings, and rock out with your cock out (as much as you can playing midi drums in your bedroom).

At some point I plan to had another feature so you can get the tones of playing the hat with just the pedal with no stick.  It kind of works right now, but it could be better.  I was going to program it to do a splash as well so that if you stomp it and release it real quick it will make a sound.  I’ve found though that it already does that like a real hi-hat with the existing code because it’s using a real hi-hat stand and the abrupt stop of the pedal is what causes the splash… yet another perk of the ddrum hardware.  It just works.

Here is a screenshot of the actual “code” and here is the actual code if you are one of the 10 people on the planet who still use this hardware and want to use it with Max for Live.  Good luck and let me know if you have any suggestions or questions.

Microsoft stole my idea!

Okay, so have any of you seen the new ad campaign for Vista? It shows a bunch of people using Vista only Microsoft tells the people using it that it is a new OS called Mojave. Sure enough, everyone likes it. It’s faster, it has cool features, gadgets are cool, blah blah blah. Then Microsoft tells them it is Vista and no one can believe it. I was going to write a blog about that very thing but then Microsoft beat me to it.

I’ll come out and say that I am not a big fan of Microsoft on a lot of things; however, Vista does kick ass. The people whining about how it is slow and doesn’t run on their ancient computer need to suck it up. It wasn’t built for old computers. If you have an old computer then stick with XP. XP is solid. Run Ubuntu if you want, it’s cool too (if you don’t need exchange and don’t mind spending time getting it set up to do what you need to do). If you have the means though, Vista kicks ass. It runs fast as hell on my laptop. It’s snappy. It looks good. Gadgets are way cooler than I thought they would be. It’s just good.

I do a lot of development in Python using PyQt for Gui design and Eclipse as an IDE and I have not had a single problem with any of it. It all runs great, it looks good (a testament to Qt as well). I don’t know what else to say. I am pretty critical of software and gadgets that make big promises and then punk out on them and so far Vista hasn’t pissed me off. People complain about it always asking permission to do things; however, that only happens when an app is doing something it probably shouldn’t be. Well written apps behave. If I could talk Microsoft into changing anything it would be the way the networking configuration is set up. Opening 5 windows to change my IP is a drag; however, how often do I really need to do that?

Anyway, since Microsoft is building an entire ad campaign on this idea I am not going to go into tons of detail as to why I am happy with Vista. I suppose I have been so busy getting things done that I haven’t had time to write up anything on Vista. That is a good sign. Microsoft seems to be on track and lately they are coming around to the open source community (ironpython actually works, they are throwing money at apache, etc). Microsoft out from under Bill Gates might be a company that people get can excited about without feeling dirty.