mechanicalSPIRIT

Brandon Franklin's blog

Inventive Repurposing: Swimming Pool becomes Greenhouse

The grass in Dennis and Danielle McClung's front yard won't grow, and the peach tree they planted withered away.

But in the backyard, hidden beneath a tent-like structure is a thriving garden that produces enough food to feed the McClungs and their two children, Caden, 4, and Vedah, 2.

via azcentral.com (click to read full story)

I really like to see this kind of inventive repurposing of things rather than simply leaving them derelict. I've posted before about this kind of thing, specifically my idea for converting an old motel into an office park. I think this is along the same lines, or at least the same general spirit. It's ridiculous to always tear things down and start from scratch, when often there is existing value in place.

Filed under  //   greenhouse   repurposing   self-sufficiency  

Java Programming Tip: Using Actions in Swing

One poorly-understood area of Swing seems to be the Action class. I don't know how many times I've seen big blocks of code stuffed to the brim setting various attributes of JButtons or JMenuItems and attaching listeners left and right. Wow! What if I told you all that stuff could be done in a single line, like this:

JButton activatorButton = new JButton( new ActivationAction() );

It's true! JButton has (and most of the other interactive Swing components have) a constructor that takes nothing but a single Action. From this Action, Swing is able to configure nearly everything else of importance about the component.

Actions are interesting little classes. In general, you create one by extending AbstractAction to represent a single specific user action, not in terms of the component being triggered, but rather in terms of the user's desired result, such as "Save File". In the Action's constructor, you build up a set of attributes stored by the Action, which are then retrieved by the component (such as the JButton) when the Action is attached. Moreover, the Action serves as a listener to the component, so when the JButton is pressed, the Action is the class that hears the call.

This design enables your application to be written in terms of a set of actions rather than a set of buttons. It's much easier to add and remove entire blocks of functionality (since multiple components can utilize the same Action class) and it removes a lot of the complexity introduced by having "a listener for everything".

In my opinion, this is one of the most elegant aspects of the Swing framework, and sadly, also one of the most underutilized.

Filed under  //   Java   programming   Swing  

New Paintings in my Home

I have a couple of new paintings hanging in my home! I'm really excited about it. I hope I'll eventually have my walls covered with amazing works by artists that I have some sort of connection with. These two were both by local artists who participated in the most recent Desert Bloom Phoenix event.

The larger one was created by Dumperfoo. The smaller one, of the Asian-inspired demon face, was created by Victor Moreno.

(download)

Filed under  //   art   asian   demon   desert bloom   paintings  

My DIY Practice Taiko

I decided it was about time I built a practice drum that I can use at home. It's hard to really get a feel for songs when you are hitting something that makes a sound that doesn't resemble a drum, or that has a form factor absolutely nothing like a real taiko (such as a phone book or bed). Using some fairly well-known techniques, I was able to produce a pretty decent practice drum in just a couple of hours from packing tape, duct tape, and a plastic trash bin. Total cost: about $40. Not too shabby!

(download)

I plan to make at least one more of these (for my son to use) and I'm thinking about making a video of the process to show others how to build them, as well.

Filed under  //   diy   music   practice   taiko  

Best Album Cover Ever Created

I know nothing about this band, and have never even heard of them before. Regardless, this is rather obviously the greatest album cover ever created by human hands.

Filed under  //   badass car   guns   robot vulture   steelwing   wasteland  

My New Portrait

I recently commissioned a portrait to be done of me in an illustrated style by the incredibly talented Cassandra Jean Piedra. I must say, I am extremely pleased with the results. I paid a very reasonable amount for this commission, and I highly recommend Cassandra to you.

Filed under  //   art   commission   illustration   portrait   taiko  

Moving

I have to move by the end of the month. This is nothing especially new, as I've moved many times before. It is also not a surprise at all, and is something I've been planning for quite some time. And it's not an especially big move, since I'm probably only moving a few miles westward (to Tempe, AZ) from where I currently live (Mesa, AZ).

Nevertheless, it's a disruptive and stressful activity, and it also causes me to reflect on the places I've lived and the ways that they have affected me.

I honestly feel kinda bad for people who are born in a place and then just stay there. I know that often those people will say they're content with that, but that doesn't resonate with me. I can't help but think that in some cases, they're just afraid of the unknown, and are clinging on to the familiar for no good reason at all. Or maybe they're just disinterested, or never saw it as an option financially. I don't know. I know from my own experience that there's a lot of world to see, and even with all my journeys I've only seen a minuscule sliver of it, but I've learned so much about people and myself by observing what has varied both within and without as I have relocated from place to place.

Do you give things up when you uproot? Yes, of course. Is it hard sometimes? Absolutely. Is it worth it in the end? One thousand times over, yes.

For one thing, I think American culture would be turned on its head if every American had to live in another country--any other country--for a year. Two years would be even better. I can say with confidence that inside the borders of the United States, we do not accurately perceive ourselves relative to the world in which we live, and we do not have a clear sense of how other nations view us. We are raised with a type of arrogance about America's place in the world, and most of us have no experiential context against which to validate or repudiate that.

By the same token, if we spend our entire lives in a particular city or region, journeying outside of it only for the relatively trivial, shallow experiences gained during vacations and business trips, we cannot possibly have a reasonable understanding of what kind of life we really want to lead, and whether or not the place where we dwell really fits us.

Anyway, the original reason I wanted to write this post was simply to present a list of the places where I've lived, so I can refer back to it in future posts. I have no smooth transition to offer. So here you go:

So here I am in Phoenix, the place that I hope to finally call home once and for all. I genuinely love it here. I love the people I've met, and the things that I've become involved in. I have real faith in the future of this city, despite the many challenges and problems, and I want to be a part of it.

An ex-girlfriend of mine told me I have itchy feet. I really don't. I hate moving, but I don't really regret any of my past moves, as I learned something about myself during each stint in a new place. This is how I have learned where I want to be, and where I want to stay. My feet don't itch at all.

Filed under  //   cities   life   moving   phoenix   self-discovery  

A Painful Realization

When I was a young child, I remember that I used to sit in the bathtub and play with various floating objects. I also had some kind of spray foam soap that was in a can decorated to look like a robot. I would sit there and hum long dramatic musical pieces to myself that I was making up on the fly.

When I grew into a slightly older boy, I had one of those spring-suspended hobby horses. It was positioned directly in front of the stereo in our living room. I would ride it for hours at a time, zoned out, listening to my parents' record collection, which included stuff like Santana and Eric Clapton. I would go on long flights of fancy in my imagination, building strange flying machines or having other adventures, always aligned with the music as the appropriate soundtrack. My zone-out sessions were so long that I wore through the metal springs on that hobby horse. Multiple times.

As a tween, I loved playing computer games on my Commodore 64. I also loved the wide array of music that they featured. I used a cheap tape recorder to make a "mix tape" of all of my favorite game songs, even in-game ones, by just holding the recorder near the computer speakers. That allowed me the joy of listening to these chiptunes without having to actually play the games.

Then I was a teenager. I got a drumkit and taught myself how to play rock drums (badly). I assembled collections of friends into a seemingly endless stream of garage bands, full of angst and good times, in which we constantly practiced for gigs that never really happened. I wrote many of our songs. I remember placing different-sized coins out on the coffee table to try to illustrate visually the concept of "parts" of a song to my bandmates: quarters are verse, nickels are chorus, this dime here represents the solo. They would look at the coins for reference while we rocked out.

Around the same time, I learned about composing multichannel MOD files. I learned the joy of finding the music others had written and shared online, which I could download and re-use instruments from. I started understanding that music could be composed using something besides just traditional notes and staves.

I began dating a girl who was not only a skilled pianist, but interested in the study of music cognition. Perhaps amusingly, she was also a big GWAR fan.

Then it came time to go to college. Like most people that age, I was still trying to figure out who I was and who I wanted to be.

Eventually, my love of the art and creativity I had seen in computer games, coupled with my love of technology, convinced me that I should study Computer Science. This may have been where I went wrong.

Throughout college, I continued writing music in my dorm rooms, much to the extreme chagrin of my downstairs neighbors. Technology advanced and I started composing using more sophisticated module formats than MOD, with more channels: Screamtracker, Composer 669, Impulse Tracker. I even got hired to write the music for a couple of shareware games, with a profit-sharing agreement. The music won rave reviews and awards.

I sold my drumkit.

As a Senior, one of my Senior Honors projects was a program I wrote, inspired by some comments by Brian Eno in an issue of Wired, that would allow musicians to compose snippets of music then "cross breed" them with snippets of music from other artists. The software did analysis of the structure of the two songs and represented that as a type of genetic code. Then the "offspring" style could be used to compose new music algorithmically, which sounded like a blend of the styles of the two original musicians. I got an A.

Then I got married, and I got busy with a job in the computer game industry. I had a hard drive failure that destroyed all of my unfinished songs, which was a heartbreaking event for me, and unfortunately, a landmark one. I made the decision to stop composing. I always assumed the ability to compose music was in no way special. Anybody could do it, I thought. It's not hard at all for me, so I'm sure it's not hard at all for anybody else. I should stop wasting my time, I thought.

A decade passed. It took some important events (the collapse of my marriage, my beginning to play taiko, and my meeting of some incredible local friends) to fully re-awaken in me my love of composing music.

So here's what the painful realization was.

For most of my life, I've thought of myself as a computer programmer who dabbles in music. I've had a wide variety of ideas for software projects, but somehow I just never felt like working on them. I wanted to be like those guys who love hacking away into the night...but I never was. I can easily stay up until 3 AM writing music, but not writing code. I have a job as a programmer. I'm very good at it. But I don't love it. What I love is writing music. I do love technology, but what I love most about technology is when it helps me unleash my creativity.

The painful realization for me is that it's been right in front of my face for my entire life, I just chose not to see it. So here I am, 35 years old, finally "getting it". I suppose I should be happy that I figured it out, but it's painful to realize how much time I spent missing such an obvious and fundamental truth about who I am.

I have built up much of my life around the assumption that I am first and foremost a Computer Geek, not a Musician. But the reality, the simple truth that I can only now finally accept, is that I am a Musician, who happens to enjoy using computers, and who works with them to pay the bills.

I don't love coding. I will never love coding. I have never loved coding. I like it...sometimes.

But what I love, what I truly love, and what I must embrace about myself, is that I love creating music. I love creating things. It is the process of creation that I enjoy, not the gears behind it.

This, for me, is a massive inflection point. There's no turning back.

Filed under  //   chiptune   creativity   music   screamtracker   self-discovery   self-improvement   tracking  

Java Programming Tip: Lost in DEFINED_VALUES - Datatypes vs. Constants

There are plenty of situations where you need to identify a few particular "types" of something in your code. For example, maybe you have three kinds of files: User Files, Administrator Files, and Log Files. Generally, the first solution I've seen people employ is to immediately start defining constants somewhere: USER_FILE, ADMIN_FILE, LOG_FILE. You probably know what I'm talking about. Chances are you've even done it. I know I have! Particularly before the introduction of typesafe enums in Java 5, this use of constants was commonplace.

It's a bad idea. The reason why may not be obvious, but let me tell you a story and perhaps it will become clear.

I was once asked to write an event bus to synchronize an application's internal state. I've posted previously about how to properly build an event bus, but at the time it was my first attempt to do so, and I really had no idea what I was doing. I began by writing a big interface file that contained all of the types of events you could possibly fire, defined with Strings associated. You know, stuff like this:

final String COMPONENT_CHANGED_EVENT = "ComponentChanged";

final String MOUSE_PRESSED_EVENT = "MousePressed";

Of course, beyond that, each event could have various specific variables associated with it:

final String COMPONENT_CHANGED_EVENT_COMPONENT_TYPE = "ComponentType";

final String MOUSE_PRESSED_EVENT_BUTTON_ID = "ButtonID";

final String MOUSE_PRESSED_EVENT_TIMESTAMP = "Timestamp";

You get the idea. There were only a handful of events to begin with, so it seemed like a reasonable solution at the time, and had the added benefit (I assumed) of linking the event types to nice human readable names that you could print out if you wanted to.

As you might imagine, the application continued to grow. New event types were introduced, and with them came new variables. Soon the interface file was screen after screen of inscrutable definitions. Worse yet, identifying the type of event in the code that was receiving the events amounted to gigantic switch statements checking for specific entries out of this interface file. It was a bad scene. I wished I could undo it. In fact, I still wish that today. I hope the coders who came after me replaced every bit of it with something more sensible!

So what should I have done instead? I should have utilized the Java language properly, leveraging its strong awareness of datatype, rather than trying to essentially redefine the concept of datatype on my own. I should have extended a common "Event" datatype, and then extended those subtypes further. Beyond simplifying the process of detecting and filtering event types, this would have allowed me to group variable definitions with their specific associated event datatype by putting them inside its definition, rather than by trying to "match the names" in a single huge file.

As misguided as my strategy was, it's not that uncommon, sadly. Most developers don't take it to the same extent, but I've seen it to varying degrees, and it's always ugly. So, if you find yourself trying to identify the "type" of anything by using static final fields or anything similar, stop and think for a moment. Investigate using typesafe enums. Investigate using true datatypes. Down the road you'll thank yourself for it (and maybe you'll remember to thank me, too)!

Filed under  //   constants   datatypes   events   Java   programming   tip  

Free Music Remixes: "You're For Me"

My friend and local musician, Nicholas DiBiase, composed and recorded a song called "You're For Me" with his band Hepnova in 2009.  You can listen to it for free here:

http://hepnova.bandcamp.com/track/youre-for-me

 

It was subsequently remixed with new vocals by New York-based dance/pop singer JC Cassis.  You can hear that version here:

http://hepnova.bandcamp.com/track/youre-for-me-featuring-jc-cassis-bob-devine

 

Well, then *I* got ahold of it.  :)  I got the original tracks from the band on request, and removed all the percussion.  Using a custom taiko instrument I built in GarageBand, I recorded parts of O, chu, shime, and chappa.  You can hear THAT version here, called the "Taiko Edition":

http://hepnova.bandcamp.com/track/youre-for-me-brandon-franklin-taiko-edition

 

Then I made another version where I took out EVERYTHING except for the taiko and the vocals, and called it the "Taisolation Booth" mix.  It's here:

http://hepnova.bandcamp.com/track/youre-for-me-brandon-franklin-taisolation-booth-mix

 

I recorded all the new parts in real-time using a MIDI keyboard, plugged into my MacBook running GarageBand.

These were very well-received by the band, and they decided to include them on their EP.  (!)  Please check out Hepnova's site and let them know if you enjoy these mixes or any of their other work!

Also, if you enjoy these, I wouldn't mind a comment on this post, either.  :)

 

Filed under  //   music   remix   taiko