We could be guitar heroes

Before I went on holiday, I began to think about getting my Rock Band guitar controller to act as a MIDI instrument in GarageBand. I’m still fiddling with it, and since implementing a couple of extra features, I’m increasingly happy with the results.

The setup in ControllerMate, initially quite straightforward, is gradually becoming fairly hairy. Here’s what it looks like now. Click through to see a bigger, annotated version.

Rock Band controller MIDI setup in ControllerMate

Features:

  • Sends MIDI notes based on the fret you are holding while strumming up or down. Release the fret to stop the note, exactly as you’d expect in Rock Band or Guitar Hero.
  • Pick a major key by holding a fret button and tapping ‘Start’. First fret (green button) + start = C major, second fret = D, etc.
  • Hold ‘Back’ while picking a key to make it minor. e.g. 3rd fret + ‘Back’ + ‘Start’ = E minor.
  • Additionally hold the next fret up to make it sharp. e.g. 1st + 2nd fret + ‘Start’ = C# major. 2nd + 3rd fret = ‘Back’ + ‘Start’ = D# minor.
  • Within the chosen key, first fret (green button) is the root note, while the others are intervals on the major/minor pentatonic scale. e.g. for C major, the frets are C, D, E, G, A. For C minor they are C, Eb, F, G, Bb.
  • Move the pickup selector to the 2nd position to engage ‘drone’ mode, in which the root note for the current key is played on a second MIDI channel whenever it is played. Handy for having a different MIDI voice sustaining the chord. I’d like to add ‘chord’ and ’strum’ and ‘arpeggiate’ modes in other pickup switch positions, though I think strumming and arpeggiating could be better handled by plugins responding to simpler MIDI notes which represent the current chord.
  • The whammy bar controls the MIDI pitch bend. Different VST plugins choose to respond to pitch bend in different ways, so depending on your instrument you can even set this up to be a guitar slide rather than a simple bend.
  • Left and right on the D pad to move up and down by 7 semitones. allowing you to explore the circle of fifths. Sort of. This bit needs some more work.
  • Upper set of frets play up an octave.

If you’ve got a Rock Band guitar and want to use it as MIDI instrument, in GarageBand or anything else, I’m very happy to make the current version of my patch available. Most of the features should work with the Guitar Hero controller too, though I have not tried this yet. Let me know if you want to try my setup and don’t fancy re-creating it from the picture above, though obviously you’ll need the MIDI-enabled beta of ControllerMate, which is available to paying ControllerMate users who have paired their registration details with their forum membership, on the beta forum.

I think ControllerMate is easily worth the $15, and access to the MIDI-aware beta should make it an even easier decision.

Background / further reading:

Rocking Outside the Xbox

My lovely friends at IBM bought me a lovely leaving present: a copy of Rock Band for the Xbox 360. I’ve been enjoying it greatly, and have been working my way through a solo guitar career as well as in band mode with my wife (our band is called Good Girl OK after the praise/release phrases we use when training her our dog. Good girl, good girl… OK).

Tonight I decided it was time to take advantage of the USB connections on those instruments and get the guitar, drums and keyboard hooked up to GarageBand.

My first exploration involved

GarageBand (and similar things. I really like Reaper) has a number of interfaces for people hoping to glue together random peripherals. Perhaps the simplest if the ‘musical typing’ on screen keyboard feature which lets you use your qwerty keyboard as a virtual instrument.

GarageBand Musical Typing

I started playing with ControllerMate to make it emulate keyboard events based on the guitar controls. There’s a lot of fun to be had in fiddling with this, and Ken’s post on the ControllerMate forums got me most of the way there very quickly.

ControllerMate - Rock Band guitar

Holding the green button (e.g. the first fret) and strumming up or down creates an emulated ‘a’ keypress, which is held until the green button is released. Additional up/down strums while green is still held do what you’d expect. Expand it to all five buttons and I ended up with something like this.

ControllerMate - Rock Band guitar (full)

Look carefully and you’ll see that it also includes whammy bar mapped to the six levels of modulation and left and right buttons mapped to octave up/down.

In short, ControllerMate is a lot of fun. It also looks as though it’s pretty trivial to hook it up to a Wiimote too. This got me thinking about alternative approaches, particularly something better than emulated keypresses and on screen keyboards and ‘musical typing’.

I’ve talked about MIDI, and it’s trendier younger brother OSC, here before. Since these items showing up in ControllerMate, (including Wiimotes via Bluetooth and Guitar Hero / Rock Band instruments via USB) are all HID (Human Interface Device) peripherals, it struck me that I’d been meaning to find a general purpose HID -> MIDI/OSC solution for some time. The closest thing on Windows is probably GlovePIE, but even before my switch to Mac I’d been leery of the licence, which states that “You may not use this software on military bases, or for military purposes, or in Israel…”. Eek.

Searching around, I found junXion which maps HID inputs to MIDI and OSC outputs on a Mac. Just what I wanted. Instant MIDI drums.

junXion

Looks interesting, and I like the free demo very much (reduced functionality and stops working after 20 minutes, but gives you a chance to try it). The full version costs €75 though, and I was sure I could find something similar in less than €75 worth of looking around time.

It turns out I was right. Hint: if I can buy your cool tool for $15 using PayPal (as was the case with ControllerMate) I will generally have registered for it before I can blink. Attempt to charge too much, and I get curious as to whether there’s something cheaper/free. I can’t be alone in this behaviour.

I dug around for about 10 minutes before I found MultiControl by Alexander Refsum Jensenius. This maps HID devices to OSC and MIDI outputs and doesn’t cost a penny.

MultiControl

Not a bad trade-off at all. I have not tried the OSC support yet, and support for MIDI notes is broken very strange and unconventional, but support for MIDI control messages is good and will no doubt prove useful.

It gets better though. Registered users of ControllerMate should check the ControllerMate forums. There’s a beta preview version which can send and receive MIDI messages. Awesome. I think I’ve found my new favourite thing.

Update: I’ve now got a fairly good setup in ControllerMate. Here’s a description (with demo video) which describes how it works.

Open Tech 2008


Photo of Kim Plowright speaking at Open Tech 2008 shared by O’Reilly GMT.

I went to Open Tech 2008 on Saturday. Open Tech describes itself as

an informal, low cost one-day conference on technology, society and low-carbon living, featuring Open Source ways of working and technologies that anyone can have a go at

['at which anyone can have a go', surely?]

If you’re wondering about its heritage, before Open Tech 2008 came Open Tech 2005 (at which BBC Backstage was launched), NotCon 2004 (which saw the launch of TheyWorkForYou, which Cory Doctorow called the worlds finest advocacy web site and I also love) and the NTK Festival of Inappropriate Technology in 2002.

Those of you who know me know that I am a geek, but I was thoroughly outgeeked by many of the participants at the event. In fact, it which was every bit the geek-fest I expected it to be but (with very few exceptions) the presentations turned out to be engaging and interesting. It was easy to find something of interest in the packed schedule with its three parallel sessions. To give you a sense of how packed (and how easy), here are just some of the things I missed

And here’s what I saw, with my woefully inadequate notes for each session…

Continue reading Open Tech 2008…

Current Cost presentation at Open Tech 2008

Here’s the presentation Nick and I gave at Open Tech 2008 yesterday.

SlideShare | View with comments at SlideShare

I really enjoyed the whole event and will try to put up some notes up about it tomorrow.

Brief thoughts on virtual worlds

My boss’s boss Luba recently asked me to put together a short video for an internal conference on the future of applications. I didn’t have long, so I wandered around Hursley with my camera and my laptop for an afternoon, thinking out loud about the near future for virtual worlds.

For anyone following virtual worlds, none of this will come as a surprise. It’s just a very quick summary covering some subjects I tend to talk about a lot anyway.

In putting it together, I distracted myself by buying the full version of ScreenFlow, which made the gratuitous picture-in-picture stuff from 2:09 onwards stupidly easy and is generally a lot of fun.

Update: transcript:

Introduction
Hello. My name’s Roo and I’m here in IBM Hursley.

There’s a number of virtual worlds projects now. Not all of them are external. Not all of them are public-facing, although there are some of those as well There’s a variety of recruitment events and conferences - public outreach is definitely a big thing for IBM in virtual worlds - but unlike most companies it’s not the only thing we do. We’re also exploring collaboration. There are a number of different projects now, inside IBM’s firewall, exploring what does it mean to come together and work as a team when you’re using a virtual world. Is it different to Instant Messaging? Is it different to using a teleconference? And the answer seems to be that yes, it is different.

Interoperability

In the last 12 or 18 months there have been a lot of people meeting and talking and signing deals and agreeing to interoperate and open up a lot more. Linden Lab have made a joint press release with IBM in which we talk about avatar portability and being able to move your avatar between virtual worlds. A lot of people hear that and they get confused. They start thinking, well I don’t want my Dwarf from World of Warcraft to move into my Second Life space, that would be nonsensical. And indeed it would be. There’s very limited appeal for that kind of interoperability. I think what people really could be thinking of instead is more like could I bring my friends list with me? Could I bring my contact list? Could I bring my wallet? Could I bring my inventory? What are the standards what are the services that are going to be required in order to make true interoperability between virtual worlds make sense.

Bringing together different services APIs and data sources in the intranet and visualising them and allowing people to come together and collaborate around those things. It’s all SOA. It’s all just Service Oriented Architecture. We’re simply treating a virtual world as another endpoint - another way of consuming and composing different services and bringing them together.

Augmented reality

Once you get into the idea of a mobile device with a screen and a camera and sufficient processing power to do some interesting things then augmented reality starts to rear its head as well. This idea of dynamic overlays on top of the real world, and holding up your mobile phone and looking through the screen and using the camera and the onboard processing to display real-time information about the real world.

I don’t like making predictions, but I think I can pretty confidently say that we should pay attention to augmented reality. I think it’s going to be a pretty important theme in the next generation of applications.

She Went Of Her Own Accord (.com)

In case you missed it, the super secret new side-project has finally gone live.

She Went Of Her Own Accord (.com)

Nick and I have wanted to do this for a few years. I registered the domain recently and we quietly hacked an instance of WordPress in our spare time last week to get something usable in place. Today, shewentofherownaccord.com is a modest but fast-growing user contributed collection of jokes. Specifically, and this is important, jokes in the following form:

My wife’s gone to the Caribbean.

Jamaica?

No, she went of her own accord.

There are as many of these jokes as there are place names and the imagination to create (sometimes quite convoluted) puns with them. The 1st line is a setup, 2nd line is a place-pun, 3rd line is a retort. It’s all about respecting the constraints of the form, in the same way that Haiku are more beautiful because of the constraints, not despite them.

My favourite feature - and I can say this with full modesty because, as with most of the interesting features, Nick added it - is the master map.

Jamiaca?

In the four days since we quietly launched the site it has already grown from 24 to 62 jokes meaning that we’ve already reached a stage where user contributions outnumber our own. Some of them are really funny too (someone calling himself Gruff has been responsible for some of my favourites so far).

There’s lots of work still to do but if you’re inspired to add your own or want to find out more then come join us. It’s already a lot of fun.

Speaking at Open Tech 2008

Open Tech 2008 is

an informal, low cost one-day conference on technology, society and low-carbon living, featuring Open Source ways of working and technologies that anyone can have a go at.

The Schedule includes the very lovely Kim Plowright talking about art history with Matt Webb, which will be worth the price of admission on its own. Other things not to miss include Gavin Starks talking about AMEE, Suw Charman doing ORG things, Simon Willison on OpenID, Gavin Bell on that and other distributed federated stuff, Tom Loosemore on ‘The Bastard Child of Biard and Berners Lee’, Adrian Hon on ‘We Tell Stories‘ and many many more.

I’ve offered a short slot on Current Cost meters which has been accepted and is scheduled to happen during the 4-5pm session in the Upper Hall. Nick O’Leary has agreed to help me out too. It will mainly involve us talking about how (and why) you’d want to track your house’s electricity consumption. (In case you’ve missed it, the interwebs have recently been filling up with interesting hackers’ discoveries about the Current Cost recently. In addition to Nick’s Google Chart API tricks and my radial Google Charts charting stuff there are details of the XML format from Rich Cumbers, tips on how the serial connection works from Chris Hand and previously unknown details about buying official cables from Current Cost via James Wallis. There are tips, tricks and ideas galore to share). By the time the events comes round, there will be even more to talk about too I’m sure, and in a way that feels more like an informal but useful talk rather than a blog post full of links.

Open Tech 2008 will take place on Saturday 5th July 2008, 11am-6pm, at ULU, Malet street. Tickets cost a mere £5, paid on the door.

(I’m also doing 3 minutes at Interesting 2008 on Saturday the 21st of June. Something about LEGO).

I’m, like, totally serial!

I hooked up an old Matrix Orbital LK205-24-USB LCD display with my Arduino today. This 80-character backlit display can be plugged into a computer using the handy dandy USB cable (hence the -USB part of the name) but it turns out it has a 5V TTL serial jumper on the back which can provide power the display, as well as an alternative means to control it.

Arduino + Matrix Orbital LCD display

It was incredibly quick and easy to get it connected up to my new favourite toy, the Arduino. The one thing that took me a few moments to realise (as in, “why isn’t this working? Oh…”) is that the Receive and Transmit pins are relative rather than absolute. It sounds stupid to say it now, but the Rx pin on the Arduino has to be connected to the Tx pin on the LCD display, and vice versa.

Arduino + Matrix Orbital LCD display

It was also a chance to learn how to use the excellent Arduino SoftwareSerial library, which lets you use digital pins as virtual serial connections. Especially handy if you want to have multiple serial connections at one (for example, if you want to continue to use the built in serial port for sending and receiving data from the computer). It even seems to work at 19200 baud required for this display, which I wasn’t expecting. The same thing will work nicely for the Current Cost device (which spits out 3.3V TTL serial at 2400 or 9600 baud depending on the model) too.

Here’s a little Arduino sketch I cobbled together, based on the Software Serial example and this Serial LCD tutorial.

#include <SoftwareSerial.h>
#define rxPin 6 // software Rx pin (connect to Tx on LCD)
#define txPin 7 // software Tx pin (connect to Rx on LCD)

// set up a new serial port
SoftwareSerial swSerial =  SoftwareSerial(rxPin, txPin);

void setup()  {
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
  swSerial.begin(19200);
  // and set the date rate for the real serial port
  Serial.begin(9600);
  delay(100); // (can't use port immediately?)
  clearLCD();
  swSerial.print("Hello, world!");
}

void loop() {
   // retransmit bytes read from the computer to LCD
   if (Serial.available() > 0) {
      byte inchar = Serial.read();
      swSerial.print(inchar);
   }
}

// Clear the LCD (works with my Matrix Orbital LK204-24-USB)
// See http://www.arduino.cc/playground/Learning/SerialLCD
// (and compare with your LCD display docs)
// for many more LCD display helper functions.
void clearLCD(){
  swSerial.print(254, BYTE);
  swSerial.print(88, BYTE);
}

I’m thinking about turning it into an in-house Twitter display, or possibly something which lets me check the artist and title of the current iTunes track being played on our Mac-Mini-acting-as-a-living-room-media-center without having to turn on the television. That’s something I find myself doing at least, ooh, a couple of times per month, so of course a massively overengineered solution technical would be perfect. I have a feeling that as soon as I start using it, I’ll want to use it for more things.

Doorbell update

Quick update to last week’s post about the doorbell project. I’ve now squeezed in into an Altoids tin (surely everybody’s favourite project box), complete with a little hole for the radio antenna. It’s now permanently connected to the Mac Mini in the living room, meaning roo_house on Twitter now makes an update (”There’s somebody at the door”) when the bell is pushed.

Doorbell/Arduino/Altoids

Doorbell/Arduino/Altoids

Hacking the doorbell

I bought a new doorbell. It actually came as a set, with two ringers. One is battery operated and the other is mains powered, plugging straight into the wall. I once again find myself attempting to keep up with Nick. Having seen his doorbell projectI knew exactly what I had to do: it was time to hook my doorbell up to an Arduino board and put it on the internet.

Repurposed

The red wire is +3V, the black is ground. The doorbell chime unit used to draw its power from two AA batteries, so now it gets the same three volts from the Arduino instead.

The short dangling white wire is actually the antenna for wireless reception of the signal from the remote button, while the long white wire once completed the circuit to the buzzer. The Arduino treats it as an analog signal (and uses the built in pullup resistors to ’steer’ the input to high). I should probably use it to drive a transistor to close a digital switch instead. This way works for now though.

The USB cable currently supplies the power and also acts as a serial line, down which the message that the doorbell has been triggered is sent. Eventually I’d like to use an ethernet shield, or even an ethernet-enabled Arduino like this one (which I do hope will be available soon!).

Here’s the Arduino sketch (tweaked slightly from Nick’s blog post).

int ledPin = 13;   // LED connected to digital pin 13
int potPin = 0;    // white doorbell wire to analog pin 0
int val = 0;

long time = 0;
long debounce = 5000;

void setup() {
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Serial.begin(9600);           // open serial port at 9600 baud
  digitalWrite(14 + potPin, HIGH); // set pullup on the analog pin
                                // (analog 0 = digital 14, a1 = d15, etc)
}

void loop() {
  val = analogRead(potPin);
  if (val < 100) {              // if the circuit is completed
  // (for me, it generally drops from 1023 to ~ 15 when 'ringing')
    if (millis()-time > debounce) {
      Serial.println("ON");
      digitalWrite(ledPin, HIGH);   // sets the LED on
      delay(500);                   // ...wait for half a second
      digitalWrite(ledPin, LOW);    // and turns the LED off
      time = millis();
    }
  }
}

To hook it up to my house’s twitter feed, I just need to open the serial line on the attached computer, doing something like this every time a new line is added

curl -u email@example.com:password -d status="There's somebody at the door" http://twitter.com/statuses/update.xml

Update: it’s now housed in an Altoids tin.

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
The postings on this site are my own and don't necessarily represent my employer's positions, strategies or opinions.