Saturday, September 27, 2008

Rock Band Guitar on the PC?

In the latest issue of MAKE Magazine (vol 15), they have a feature that lets you play your Guitar Hero guitar on the PC. Owen Grace of The Guitar Zeroes built some software in Max/MSP he coined 'Fretbuzz' that lets you actually interface these guitars with the PC, and offered it up for free to the community. That is awesome.

I thought it'd be a fun project. Wasn't until later that I realized I have Rock Band for the Xbox 360, not Guitar Hero. As it turns out though, happy ending: They both work. Here's the steps I went thought following the directions on the Fretbuzz page (my experience was slightly different than what their directions say)
  1. First, my Rock Band guitar wasn't recognized by my PC after plugging it into the USB port. After doing the obligatory Google search, I found I could download drivers for it here. Restarted computer. Checked under Start -> Control Panel -> Game Controllers, and my 'Harmonix Guitar for Xbox 360'was recognized.
  2. Went to The Guitar Zero's web site, and downloaded the Fretbuzz code, and started following the directions on its download page:
  3. Went to download (via the Fretbuzz page link) the Max\MSP software, but that link took me to the latest release. Fretbuzz says it wants the older version 4.6.3. I found that here under -> Older Max Windows Versions -> then downloaded 'Max/MSP 4.6.3 with documentation'. Installed after download in default location. (maybe the latest version does work, but I didn't want to jump through the hoops if it didn't)
  4. Downloaded the version of PeRColate from the Fretbuzz site, and followed the Fretbuzz site directions for installing it. They're right, the readme.rft that comes with the .zip is a bit confusing.
  5. Restarted my machine again per request by Max\MSP.
  6. Launched the runtime of Max\MSP (C:\Program Files\Cycling '74\MaxMSP 4.6\MaxRT.exe), and opened the specified file buzz_360.pat based on where I'd saved tghe Fretbuzz code. Clicked on the "Help Meee" button, and configured my guitar.
  7. Started playing!
It's just too bad that I'm not a musician. But maybe this will encourage me ;)

Friday, September 19, 2008

Adobe ExtendScript

How... did I go this long without knowing about this? (go down to the 'Adobe ExtendScript Toolkit' section for download and docs)
I guess in the back of my head I've known about it, but a co-worker today showed it to me in action: From their web page:
"The ExtendScript Toolkit (ESTK) 2.0 is a development and debugging tool for JavaScript scripts included with Adobe® CS3 Suites and applications such as Bridge, Photoshop, Illustrator, InDesign, and After Effects. ESTK 2.0 is a new and enhanced version that allows you to create, edit and debug ExtendScript (Adobe's JavaScript language) all with an updated user interface, a new text engine, and the ability to debug more than one script at a time."
The cool part is the debugger, that lets you step through the code, and watch the results on the fly (in say, Photoshop). So yes, I must have been in a hole, but now, I've seen the light.

Thursday, September 18, 2008

Stanford School of Engineering
Just ran across this. Great resource! Stanford has posted a bunch of their classes online. Currently have several courses based around programming:
  • Introduction to Computer Science
  • Artificial Intelligence
  • Linear Systems and Optimization
They have them up on Youtube (with many not related to programming), or their own viewer. Nice!

Wednesday, September 10, 2008

Just ran across Looks like it's a pretty recent startup, but seems to be a cool concept (if... you're a technical artist...). Currently seems a bit 3d Max skewed, but there is some Maya stuff in there as well.

Tuesday, September 9, 2008


I just ran across the web site It has a pile of videos to teach different programming languages: Python, Ruby, Java, Perl, Javascript, Blender (Python), and you can search by topic. Python has by far the most videos (currently 348), what a great resource.

Tuesday, September 2, 2008

Finally: Python can talk to Maya

I work in the the software package Maya, by Autodesk. As of version 'Maya 2008', they put Python scripting in Maya, to augment it's built-in scripting language, MEL. This is great, but Maya's 'Script Editor' leaves a LOT to be desired when it comes to authoring Python code. I've been using an external IDE called 'Wing Professional' to do my Python coding. And I knew that Wing had the ability to ouput what one was executing to a network socket. And I knew that Maya could open a socket. Problem was, the socket that Maya's mel command 'commandPort' open expects MEL commands, not Python commands. You could jump through some wrapper hoops to get them to talk, but I didn't care for it.
Enter Python's 'exec' command: It allows you to execute a module on disk as if it was interactively entered. So I came up with a plan:
  • In Wing, I have a script bound to a hot-key: It takes what the user has highlighted, and saves it off to a temp text file on disk. It then (through a socket) pings Maya, and tells it to evaluate that code.
  • When Maya launches it opens up a socket. Then when it gets the call from Python to do work, it finds the temp file, and runs 'exec' on it, and also prints the contents for the user.
This worked great, but one problem: Any variables defined during the execution were local to the execution. After execution was over, they were out of the scope of any other code. I tracked down that 'exec' had args that let you pass in a dictionary defining a certain variable scope. By passing in Python's base '__main__.__dict__' , I was able to add all the declared variables into that root scope, making them visible to all other interactive coding sessions.
FINALLY, Python can talk to Maya ;) I documented the whole thing (with code) on my Mel Wiki HERE.