/******************************** Wiimote to midi, beta 0.1 Use your Wiimote to control Ableton live, Arkaos midi.. contact: crustea@gmail.com www.antivj.com ********************************/ /******************************** Wiimote's buttons ********************************/ //Keyboard notes //To send "keyboard events" instead of "midi notes", uncomment this part, and comment "Midi notes" part above. //Values before the "=" caracter are the keyboard events that you emulate. /* Up = Wiimote.Up or Wiimote.Classic.Up Down = Wiimote.Down or Wiimote.Classic.Down Left = Wiimote.Left or Wiimote.Classic.Left Right = Wiimote.Right or Wiimote.Classic.Right Q = Wiimote.A or Wiimote.Classic.a W = Wiimote.B or Wiimote.Classic.b One = Wiimote.One Two = Wiimote.Two Home = Wiimote.Home or Wiimote.Classic.Home Minus = Wiimote.Minus or Wiimote.Classic.Minus NumPadPlus = Wiimote.Plus or Wiimote.Classic.Plus X = Wiimote.Classic.x Y = Wiimote.Classic.y v = Wiimote.Nunchuk.ZButton or Wiimote.Classic.ZL or Wiimote.Classic.ZR L = Wiimote.Classic.L R = Wiimote.Classic.R C = Wiimote.Nunchuk.CButton */ //Midi notes //To send MIDI notes, uncomment this part (done by default), and comment the "Keyboard notes" part //The value before the "=" caracter is the midi note. midi2.C0 = Wiimote.Up or Wiimote.Classic.Up midi2.D0 = Wiimote.Left or Wiimote.Classic.Left midi2.E0 = Wiimote.Right or Wiimote.Classic.Right midi2.F0 = Wiimote.Down or Wiimote.Classic.Down midi2.G0 = Wiimote.A or Wiimote.Classic.a midi2.A0 = Wiimote.B or Wiimote.Classic.b midi2.B0 = Wiimote.Minus or Wiimote.Classic.Minus midi2.C1 = Wiimote.Home or Wiimote.Classic.Home midi2.D1 = Wiimote.Plus or Wiimote.Classic.Plus midi2.E1 = Wiimote.One midi2.F1 = Wiimote.Two //midi2.A2 = Wiimote.Nunchuk.CButton //midi2.B2 = Wiimote.Classic.x //midi2.C2 = Wiimote.Classic.y //midi2.D2 = Wiimote.Nunchuk.ZButton or Wiimote.Classic.ZL or Wiimote.Classic.ZR //midi2.E2 = Wiimote.Classic.L //midi2.F2 = Wiimote.Classic.R /******************************** Setup for gravity values ********************************/ // these are the magic line, which converts X, Y and Z rotation values to Midi #CC 31, 32 and 33. var.xOffset = 1 var.yOffset = -28 var.zOffset = 2 var.xRot = Wiimote.RawForceX + var.xOffset var.yRot = Wiimote.RawForceY + var.yOffset var.zRot = Wiimote.RawForceZ + var.zOffset midi2.Control31= (EnsureMapRange(var.xRot, 26,-26, 0,1)) midi2.Control32= (EnsureMapRange(var.yRot, 26,-26, 0,1)) midi2.Control33= (EnsureMapRange(var.zRot, 26,-26, 0,1)) //Old code: (MapRange(var.xRot, 26,-26, 1,127)-1)/127 /******************************** Setup for acceleration values ********************************/ //Just a test for now, comment the line above to disable X acceleration to midi note midi2.C3 = Wiimote.RelAccX >= 15 // I'm still working on this script to improve it, don't hesitate to post comments or ask for some updates, or if you have new ideas. crustea@gmail.com