Saturday, September 08, 2012

7Digital API wrapper in Python

I've been looking at the developer API from 7Digital, the digital media delivery company, and realized that I needed a lightweight, python-friendly wrapper for the API requests and responses.

And so I wrote one. It's called py7D, and it's here: https://github.com/jasonrubenstein/python-7Digital
and the README is here: https://github.com/jasonrubenstein/python-7Digital#readme


Why
I wanted a very thin layer of code that wasn't dependent on ORM-like structures. I don't believe that abstracting out each and every API method/function call to a method on an object makes it "easier for the programmer". If anything, it makes it a pain in the ass to maintain the library every time 7Digital comes out with a new API method/function. I also wanted to keep the separation between function and data cleaner, more obvious, and clearly intended.

Ok, enough with the negative comments. Lets get positive. What I wanted to do: create a library of small, clean modules that do the absolute minimum to get the data from the API; provide the responses in a python-friendly form like a dictionary or a list (rather than in XML, which is what the API returns); make no assumptions about how the data is to be consumed, and therefore just pass it on in as much of an unmodified form as possible; separate data from function and separate disparate functions from each other (for example, relocating API calls from the OAuth module to the API module).  I also wanted to do away with the use of classes where I think it's not necessary. There really wasn't any state being kept here, and the settings that could imply state weren't enough of a deciding factor to go with a class.  Also, if the requirements of a project require the maintenance of state, the modules are written such that wrapping them with a class would be trivial.

I also wanted to update the oauth library used in the existing, legacy library. I upgraded my version to use oauth2 and implemented its convenient Client class for making oauth signed requests.


What
My plan for this thing is to create a service around it. The service would handle an incoming request for information, call the API, and then convert the response from the API into some consumable form (probably a JSON string or an edited dict or list of dicts). It would also handle routing certain responses to a cache in redis.


Notes
The page for 7Digital's API is here,  and a direct link to the docs is here.

Tuesday, July 17, 2012

Process kills developer passion

I'd say "Too much or too little process..."
Now, I’m certainly not advocating some kind of Wild-West approach where nothing is tested, developers code what they want regardless of schedule, etc. But the blind application of process best practices across all development is turning what should be a creative process into chartered accountancy with a side of prison.
Either extreme will kill an engineering team's passion and productivity. Good article by James Turner.

Saturday, May 05, 2012

Twitter for Musicians, Writers, Filmmakers, And Other Malcontents

There is a great way to use Twitter and a terrible way to use Twitter. If you're a writer, musician, filmmaker or in some other arts-related business and you're using Twitter to reach your fans, gain new fans, keep your fans, and "market" your work and it just isn't happening,  this post is for you.

Why me?
I'm a software engineer and a musician. I've produced and published several music projects, and I worked in San Francisco at a social media/games company called "Slide" (which was, alas, acquired by Google and then subsumed into the great, primary-colored googley googleness of a googleplex on the peninsula), most significantly on a Facebook app called "Top Friends", which was a very successful social-network-in-a-social-network. It was also the largest app on Facebook for a long time.  I'm talking, literally, millions of users.

Great. So you probably know what you're talking about. Get on with it, I'm on a deadline.
One of the biggest lessons learned from building successful social products was this:  Fostering personal, meaningful relationships between people was one of the keys to growth, retention, and scale.  

"Well, duh,", I hear you cry, "Isn't this obvious?"  Yeah, I know, I'm stating the simple and obvious. But it isn't always easy, at least not for some people, even though it's simple.1

Well, look. Here's the simplest way I can explain it: speak to people on Twitter like you're speaking to someone in person. Write about you, what you're doing, what interests you, things that happened and are happening right now. Be personal in your conversation, and re-tweet things that personally interest you. Your fans want to connect with you.  What your fans do not want is a spew of advertising copy.

Speak to them as people, and not as targets of online marketing.  

When I follow my favorite writers or musicians, or when I discover new ones, I want to read what they have to say and read about what they're doing or thinking that may or may not be directly related to their projects or products. The speak with me, not to me.  Most of the time I don't reply. I nod in interest or agreement at the screen (figuratively or literally), but the opportunity to reply is implicit in the original tweet.

Think of tweets that could elicit a response from your followers (And by response, I do not mean "OMFG STFU already").

Do not fill their twitter feeds with marketing noise, advertising crap, or other non-personal stuff that's the equivalent of junk-mail. 

There's a lot of horrible advice out there about using twitter as a medium for marketing copy. Don't follow it.  

Build fans and customers, or shoot yourself in one of your toes.
Twitter (and Facebook, among others)  is a great product with which to build and maintain meaningful, valuable relationships between you and your fans & customers. It's also a great product with which to shoot yourself in one of your toes and end up with diminishing fans and decreasing followers. 

Here are some examples of both. 

Bad
"4 out of 5 moviegoers loved what they saw at the screening! You will too! http://..."
(Try something like "Great screening last night at X. Lots of compliments, I'm still grinning like an idiot" instead)

"Big sale today only in our gallery come on down http://"
(Advertising. You're not speaking with me, you're speaking to me.)

"Have you read my new book? http://... "
"Have you read my previous books? http://..."
"Customers love this book I wrote in 2009 http://..."
"Review of X: http://..."
"Review of Y: http://..."
"Review of X: http://..."
(and so on. My twitter feed was filled, FILLED I tell you, with these from a self-published author. I unfollowed in a hurry.)

A good rule of thumb: if you'd hate to see it in your feed, or it's pure advertising copy, or it isn't some form of personal communication, don't tweet it. 

Another good rule of thumb is don't spam your followers. A steady stream of tweets from you in sudden succession looks like spam. And, uh, that's because it is spam.

Good
"Wow. Cool thing on my walk to my office: http:///"
"Dogs barking at a terrifying, aggressive maple leaf on the patio, stopped me at 2200 words. Got my quota for the day."
"Off to Free Jazz CD day. Won't forget to buy something while I'm there"
"Woke up to awesome reviews this morning! Feeling vindicated! http://..."
"Listened to new XYZ music while I painted this morning. Inspiring! New art soon."
"The amazing Fred sketched this from my novel X. Very cool http://..."
"So-and-so's article on free digital music downloads. Agree completely http://..."
"This asparagus is huge. Monsterous. I expect it to start chasing me around the kitchen."
"RT: @someone My book is out today! excited and hopeful"
(re-tweets are personal; they're still a tweet from you, and so are personal communication. 

And so on.  In general, be yourself. Consider tweets about what you're doing, what you're thinking, what inspires you, wild sudden thoughts, what you agree with, what you disagree with, what you hate, what you think deserves attention, sudden flashes of inspiration, what you're doing to procrastinate... all within the scope of what you're comfortable talking about, of course. Look, just be you. And you ain't ad-copy. 

Homework: Ask yourself, "Why do I follow the people I love to follow?"
And, conversely, ask yourself "Why did I just unfollow that person?". 

What is it about your favorite artists, your idols, your mentors, that you enjoy when you read their tweets? What connection do you feel with them?   One author I follow tweeted that the wolf-howls in Skyrim are so realistic that they drive his dogs nuts. Hey, now I know that one of my favorite authors plays Skyrim. I play Skyrim! We're connected!  The meaningful connection between customer and artist  has been reinforced ever-so-slightly-but-significantly. And the image of his dogs freaking out at the sound from the game is pretty amusing.2 Will I be inclined to pay attention to his next release? Yup. The meaningful signal coming from him is greater than the background noise of the interwebs-social-webverse-thingy, so without much effort from me I'm inclined to pay attention to it.3

More Homework
Ok, so what about tweets about upcoming books, performances, and so on? How do you get around just spamming marketing copy in these cases?

Here are some ideas. I'm sure there are more ways out there besides these, but the basic tenet is be personal.

Got a show coming up? How are you feeling about it? When is the last time you were there? Playing new songs that they haven't heard yet? Pick one and add it to your tweet. It has to be real, though - if you're feeling nothing about playing this gig, uh, you may have other problems than gaining Twitter followers. 

Open a word processor and write some tweets about professional events. Make 'em personal.

Here are some (somewhat generic) examples.
(Note: don't spam a bunch of these.. pick one or two and go with it. Maybe two over two days or so. Use your judgement. If it feels like spam, it's probably spam)
"Playing J's Pub on the 16th. Can't wait, haven't been there since '09"
"Playing J's Pub on the 16th. Hope the chandelier doesn't fall this time!"
"Playing J's Pub on the 16th then jumping into the van to Cleveland for next gig. All night drive"
"New book out tomorrow. Can't sleep, critics hiding under bed will eat me".
"Book signing alert: J's Bookstore. See http://... for more info. Come by, it'll be fun"
"I normally hate flying at 3am, but I love the venue for this reading. Beautiful place, can't wait to get there"
"Talking to a distributor today. Fingers crossed. They saw film at the festival, loved it"
"Great time at the awards last night but head now hates me. I drank how much?"
"Film at the festival today at 4. Please come, I'll be hanging out afterwards, come up and say hi" 

That's it
Alright. That's enough lecturing for today. Bottom line: be real. I want to hear from you, not from your marketing copy. 


1. The inspiration for this post came from a new-to-me author whose tweets filled my feed with ad copy. Nothing personal from them, just a rapid-fire spew of reviews, links to books, "buy me now" type stuff that drove me nuts. The post was further inspired by some companies out in the midwest whose approach to twitter was "all-spam-all-the-time" who followed me, expecting a follow-back.  It turns out that their "social media expert" recommended they use twitter as an ad platform. As we say in web engineering circles: FAIL.

2. Back when I owned dogs, I used to record their barks in my music studio and later play it back at random times. The two of them would freak the hell out. They're run around the house, barking, trying to locate the sound of their own voices. "WTF? That sounds familiar! Holy cats, it is familiar! Like, what the crap, where the hell am I? I have got to find me!  Quick, I'll flush me out by running around all of the furniture, barking at me!" Eventually they'd make their way to my studio, tails wagging, and barking at nothing. "Whoa, dude, you sounded just like me! I was like all freaked and shit because I was down there looking for me and I was up here and now I'm not down there looking for me, I'm up here, which is exactly where I was barking when I was downstairs barking at me barking from up here where I am now but I wasn't and, wait... what? Aroo? Oh, fuhgeddit, if you're not gonna gimme a pig's ear, I'm going back to sleep. My head hurts."

3. Another artist I follow posts "found art", which are cel-phone pics of odd shadows, interesting juxtapositions, and so on, and they're usually wildly cool. It gives some insight into how he thinks about art in general. Very interesting.  And there's the writer with an incredible penchant for tweeting puns; I bought a couple of his books based on his sense of humor. Through these two and others I've discovered other writers and musicians as well as podcasts, blogs, articles, and more books and music.  The social-proof that's gained from trusting the tweets of one person can (and usually will) be beneficial to them and to the other artists in your network.  Social-proof itself is a topic for a different blog post.

Monday, April 16, 2012

On Micro-frameworks

Says my friend and former colleague james-m:
I like the idea of micro frameworks, or very compact, loosely coupled library of components that you pick and choose from to create your overall architectures. A micro framework approach has the following benefits: a) because they’re so loosely coupled, you have more choose (sic) for any given component. b) smaller, bite-sized pieces of code are easier to digest, and the more you digest of what a framework is doing under the covers, the better able you’ll be to diagnose problems.
James says succinctly what I've been thinking and saying (much, much less succinctly) about micro frameworks. I've been putting this into practice on my recent projects.

Friday, March 30, 2012

Life Hacks for "A"-players Living in SV and SF

Over the last few years, I've observed how some local "Entrepreneurial A-players" execute so-called "life hacks" to make their lives easier, more efficient, and quicker.

I've outlined some of them below, as if they were written as a guide for "A-Players".  And I'm wearing my Hat of Disdainful Sarcasm while I write this.


Starbucks hack
A-players don't wait for coffee - they're too busy working to change the world. Here's a great hack at Starbuck's, or any other coffee place, so you can keep changing the world and keep ahead of the competition without having to waste time.

Grab a seat with your laptop, and start working. Since you're an A-player who can focus on several things at once, keep listening for the coffee you'd like to drink. This shouldn't be a problem - you already have several windows open on your desktop: a spreadsheet, your email, your browser with several tabs open, and either Spotify or YouTube. or both. Go the extra mile and listen for "double cafe mocha with extra whip" or whatever else floats your marshmallow.  Casually stand up, make sure you look like you're thinking about something extremely important and entrepreneurial, grab the coffee and return to your chair. Score!

It doesn't matter who ordered that drink, only that they're too slow to get it when called. They're probably not paying attention and are gabbing on their phone or playing "Sudoku with Friends", unable to focus on more than one thing at a time (hey, they're B or C players). A-players don't wait, they seize the moment.  Or, in this case, they seize the caffeinated water-of-life.

Extra credit: If you're in a place that's actually calling orders by a person's name, just wait until you hear a name that could be you. But pay attention - don't go for a "Linda" when you look like a "Sergei".

Extra extra credit: This also works at the grilled-cheese or hipster curry restaurants. Wait for some order that sounds good, walk up like you're late for a meeting, and take the food. Leave a dollar in the tip jar, though, because it's not nice not to tip.  Go have your lunch while you're working on your deck. A-players eat A-lunches. B players starve.


Queue barger (or: queues are for sheep)
A-players don't wait in line. You know who waits in line? Sheep. Sheep wait in line. You know who else waits in line? Hogs on their way to getting turned into bacon. Don't be waiting for bacon. Queues are for sheep. And bacon-providing hogs.

A-players are much too busy working on changing the world, so don't wait in line. Look for a gap large enough to shoulder-in, look like you're late for a very important meeting, and barge the line. Better yet, time it so that you jump the line entirely - get to the head of the line, right to the service-person, just as the previous servicee is leaving. Ignore anyone who barks at you, you're too busy. The probability is high that the service-person won't want a confrontation and will get you in and out of there as fast as possible. Let the unwashed masses grumble about you as you're leaving - while the door is closing behind you, you've gotten what you needed to get done done. The rest of the sheep-hog-waiting-for-bacon people are still back there. Standing in the line.

Extra credit: if your company has a cafeteria, look up and down the line and find some neckbearded engineer-looking type and shoulder in front of him to get at the "green-means-healthy" labeled almond-encrusted sea bream. It's more probable than not that he's some Asberger's afflicted socially-inept asshole who's already pissed-off all of his co-workers, so no one will care that you've barged the line in front of him. And even if he's not an Asberger's PhD-degree-in-CS poster-child, he's still a neckbearded engineering asshole who couldn't deliver product on time if you tied an exploding, loudly-ticking alarm clock to his ass, so who cares? What's the worst he's going to do? Probably call you a "noob level three troll" and some other equally incomprehensible names. Yeah right. Whatever, 'bro, sticks and stones. You're way ahead of him - you're going to go eat lunch while he's still standing in line.


Red lights are for other people
You know that A-players don't wait, right? You don't succeed if you're not aggressive.

When walking, keep walking. Get to a corner and hit a red light? Keep walking. This is a pedestrian-friendly state, therefore cars have to stop for you. We know that the rule says "red light means STOP", but A-types break the rules.  A's are rule-breakers, not rule-followers.  A-types don't ask permission, they apologize later (but only when absolutely necessary. They should be too busy to apologize).   While all of those people are stopped at the corner, waiting for the light to turn green and for the green-walky-guy to light up, you're already way ahead of them.

You can't beat the competition by stopping at the red light.

This also applies when riding a bike. Don't stop for reds, and remember: you can ride on either side of the road and in either direction. Rules are for B and C players.


Get that referral bonus you know you deserve.
Does your company give referral bonuses for referring new employees? If so, here's a great hack. A-players don't wait around for someone to claim the goods. When a new employee is hired, march straight to HR and claim the referral. In most cases, HR is too busy to notice who referred whom, and won't bother to look for an actual email from you or anyone else. Look earnest, sell it to Ms.or Mr. HR with a humble brag about the amazing depth of your professional network (hell, everyone loves you anyway, so it shouldn't be a tough sell), and get that extra money next pay cycle. Score! The lesson: snooze and lose - if the referring party isn't fast enough to get their ass out of the Aeron chair and haul to HR to make their claim, lulz too bads.

Note that this will not always work. Sometimes, HR will have an email from an actual referring employee, so you're out of luck. Look innocent, quickly excuse yourself, and try again next time.


Closing commentary
This kind of behavior really irritates the hell out of me. Over the last few years I've experienced or observed this behavior from aggressive "A-player" startup people, and my love for humanity decreased a few centimeters each time. Stealing coffee? Really? Intercepting referral bonuses? Really??

The bottom line is that this is selfish, rude, anti-social behavior, and these people aren't "A-types". They're just jerks.  I'm all for "don't ask permission, ask forgiveness" in the creative context for which it was intended, not in the social context where you end up "pwning" the people around you.

This behavior sucks. In fact, these "hacks" should be included in a collection that could be called  "How To Be An Asshole", because the people who've done this crap are.. well, you know.

Are these experiences anecdotal examples of individual jerks, or are they examples of symptoms of a deeper problem in our society where rude, selfish behavior is increasingly becoming the accepted standard?

Monday, February 20, 2012

Music review

I finally put in my order for new music software (and a few bits of hardware) from my local music gear shop. It's been a long time coming - my last music project dates back to around 2004 or so.

This is exciting! Music software & hardware have come a long way since then, and my last composing & recording rig dated back to mid-90s synthesizers and software.  Some of the new stuff I'm getting is way, way cool.

But the specifics of gear is not what I want to talk about right now.

This whole gear-purchasing spasm really came about as I've been thinking about music ideas for the last two years or so, especially applying my recent experiences in engineering & product to music composition.  In effect, I've had music rattling around my head for a while now, and it's becoming impossible not to compose and record (as a hobby, and not with aspirations of quitting my day-job. I like my day-job, thanks very much).

I've also been listening to my previous catalog of work & critiquing it, asking myself "What works? What doesn't? What keeps my interest? What moves me to abject ennui? What's too long? What's too short? What takes forEVer to get to the point? Have I engaged the listener? Have I kept their interest? Do I surprise them or delight them or challenge them?"

Specifically, I've been listening to my 2000 effort "Tonecluster" this week, since that was a project in which I was experimenting with space, a limited number of textures, and trying for specific moods. I wanted to hear what worked from a technical perspective, and what my efforts at "slimming down the sound" were like 12 years later.

Some pieces really work for what I intended; some don't, and some are great little experiments that I might never try again, but at the time were real reaches (for me).

Anyway, after listening to this album a few times over the last couple of weeks, I've decided I'm confidently in the "less is more" camp, and will be purchasing the minimum number of virtual instruments necessary to create another album of music that I have boinging (and fizzing and banging and thumping) around my noggin'. And, since 2004, I've sold or given away a crapton of music gear, so I'm left with four different real synthesizers ranging from vintage to modern.

You can hear this old music for yourself, at this link. (You can also download the music, for free, which I encourage if you find you like it enough to add it to your collection).

What will the new music sound like? Heck if I know. I'm all over the place, with ideas for loud rock tumbling around with separate ideas for textures & beats you'd find in a Chillout session.  I will probably end up with a non-genre-specific project (and since genres are arbitrary rubrics anyway why the hell not?),  which is frankly more fun for me anyway. I get to be rust-never-sleeps loud when it suits me, and Tosca-like chilled when it suits me otherwise.

Friday, January 27, 2012

Music on vinyl making a comeback

Old turntable and LP.
(jazzology.blogspot.com)
I've known about the increase of music-industry vinyl sales for few months now, and when I heard about it I was pleasantly surprised.

Not long after I'd heard that sales of music on vinyl were up over the previous year, I was in a conversation about music with some folks at our local bar.

So the kid says to me, "Hey, there's this new thing, it's music on vinyl, like a big disc. You need a special device to hear it, kind of like a DJ turntable. You should check it out, you like music".

Now, either he thinks I'm really young (oh, bless him the little scoundrel), or he's unaware that vinyl pre-dates the recent LP release by Vampire Weekend. I suspect it's the latter, though I'd be happy with the former.

Yes, Virginia, I know what vinyl is.

Tubes.
My first amplifier was my father's hand-me-down Fisher tube amplifier (which started with a primer button - you kept it pressed until the tubes were properly lit). The turntable was some used thing I picked up at the local used-stereo-equipment store (we had those back then), and I'd buy records from the stacks at our local used-record-store (we had those back then).   There was nothing like lying on the floor, album sleeve in hand, reading the back cover. Back then we listened to music. We'd just be there, and listen.

Even when the Walkman cassette players were ubiquitous, we'd still find time to listen to great music. As we were able to buy better gear, the old used stereo rigs were replaced with better-quality amps, speakers, receivers, and so on.  Quality music and listening for the enjoyment of listening hadn't yet been replaced by the convenience of portable, lower-quality music and the use of music simply as a background, a soundtrack, to our (increasingly frenetic) lives.

I'm glad to see vinyl making a comeback. The quality of the LPs are better now then they were at the end of the LP-era; they're thicker, heavier, with deeper grooves.  The quality of music from the big black disc should be high, provided you're using an analog signal chain (whether tube or solid-state) or a digital signal chain containing an excellent DAC (digital-analog-converter).  The LP master (for manufacturing) is probably cut from a 24-bit, 96k sample-rate studio master (or better, if you're artist's producer had the foresight to record at 24/192). In some cases the original may be 16/48k (16 bit, 48k sample rate), but that's still better quality on analog vinyl than you'll get from an mp3.  These days, 24/96 in the music studio is common, so what you're hearing via vinyl is much better than you'll get either on CD (16/44.1) or mp3 (a conveniently small file at the cost of degraded audio quality).

Now, what I really want is a convenient, portable high-quality music I can listen to as the soundtrack for my increasingly frenetic life and an analog system at home with LPs for recreational listening.