Create a function for transposing musical chords

OK, within the limitations of the question as asked and not catering for a lot of things you'd need to allow for if using with real music (flats being the most obvious):

function t(c,a) {
  var s=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],i;
  return c.replace(/[A-G]#?/g,function(m){return s[(i=(s.indexOf(m)+a)%s.length)<0?i+s.length:i];});
}

This is my first attempt at code-golf, so I hope I've taken the right approach. Following is the readable version that I originally posted at stackoverflow.com:

function transposeChord(chord, amount) {
  var scale = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
  return chord.replace(/[CDEFGAB]#?/g,
                       function(match) {
                         var i = (scale.indexOf(match) + amount) % scale.length;
                         return scale[ i < 0 ? i + scale.length : i ];
                       });
}

Haskell, 146

c=zip(words"C C# D D# E F F# G G# A A# B")[0..]
x#n=maybe x(\i->fst$c!!mod(i+n)12)$lookup x c
(x:'#':y)%n=(x:"#")#n++y%n
(x:y)%n=[x]#n++y%n
x%_=x

This defines an operator % that transposes a chord by a given amount, so you'd use it like this:

*Main> "E"%1
"F"
*Main> "E"%4
"G#"
*Main> "Dsus7"%3
"Fsus7"
*Main> "C/G"%5
"F/C"
*Main> "F#sus7/A#"%1
"Gsus7/B"