 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
cheesenuggett
Joined: 13 May 2007 Posts: 5
Digg It |
Posted: Mon May 14, 2007 10:42 pm Post subject: assiging wiimote movements/buttons to midi actions |
|
|
hey, im clueless on scripting glovePIE but i found a script that makes all my wiimote buttons MIDI notes. now i want to find a way to make the tilt on the x and y axis assignable in software such as ableton live... right now its not assignable but still works with random knobs(when i re-wire into reason).
also, when i make a "smacking" or drum hitting motion, it plays a very high note, i would like to be able to assign this as well, if possible.
the script i found is in french, which ironically enough i wouldnt understand in english
| Code: | /********************************
Wiimote to midi, beta 0.1
Use your Wiimote to control Ableton live, Arkaos midi..
contact: crustea@free.fr
********************************/
/********************************
Setup des boutons de la wiimote
********************************/
//Keyboard notes
//Pour renvoyer des valeurs du clavier, décommentez cette partie, et commentez Midi notes
//n'hésitez pas à modifier la valeur avant le "=" pour l'adapter à vos besoins
/*
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
//Pour renvoyer des MIDI notes, décommentez cette partie, et commentez Keyboard notes
//n'hésitez pas à modifier la valeur avant le "=" pour l'adapter à vos besoins
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 de la gravité/accélération de la wiimote
********************************/
// ce sont les lignes magiques, qui convertissent les rotations X, Y, Z en #CC 31, 32, 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
//program change beta
//if wiimote.A then
//endif
//Ca ce sont des test sur l'acceleration, en débugage pour l'instant...
midi2.C3 = Wiimote.RelAccX >= 15
//var.accX = Wiimote.RelAccX
//var.accX2 = (MapRange(Wiimote.RelAccY, -2,2, 1,128))
//midi2.Slider3 = var.accX
//debug = var.accX
//key.ctrl + key.g = Wiimote.RelAccX >= 25 && Wiimote.RelAccY >= 25
//debug = (MapRange(Wiimote.RelAccX, -10,20, 1,128)-1)/127
//midi2.Slider3 = (MapRange(Wiimote.RelAccY, 10, -10 , 1,128)-1)/127
//midi2.Slider4 = (MapRange(Wiimote.RelAccY, 26,-26, 1,128)-1)/127
//midi2.Slider3 = (Wiimote.RelAccZ) in m per s per s
//Wiimote.RelAccY
// je suis en train de bosser sur les autres variables pour améliorer ce script, n'hésitez pas à me contacter si vous voulez des fonctions particulières ou si vous avez de nouvelles idées..
|
if you can make any sense of that on how to change it to make the x and y tilt assignable midi triggers i would be very greatful
if you need any spects i am using midiyoke, WIDCOMM stack, kensington bluetooth, dont know if that means anything
thanks for any help! |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Wed May 16, 2007 10:17 pm Post subject: |
|
|
Hi
I'm also a relative newcomer to GlovePIE, but in the last 2/3 weeks I have successfully compiled a number of simple yet flexible midi-scripts, which allow pretty extensive control of Ableton and AudioMulch, using midi notes and CCs, from tilt, acceleration and button presses:
http://www.youtube.com/watch?v=7VSsLa-n56Y
if you want any scripts or tips, just say the word
Brendan |
|
| Back to top |
|
 |
cheesenuggett
Joined: 13 May 2007 Posts: 5
Digg It |
Posted: Wed May 16, 2007 11:37 pm Post subject: |
|
|
DUDE TIGHT! that is exactly what i want
i am not too knowledgable on assignable functions in ableton but yes that is precisely what i want to do. i want to make the x and y axis of the wiimote assignable, also i want to make the nunchuck joystick assignable to modulation. the problem is that i ReWire into reason, so i dont know how to control reason from ableton. but i would LOVE to know how to make wiimote have assignable rotation!!! |
|
| Back to top |
|
 |
dchild
Joined: 17 May 2007 Posts: 18
Digg It |
Posted: Thu May 17, 2007 12:12 am Post subject: |
|
|
Hey jjcomet
Nice Vid
much like yourself i'm a noob ableton lover trying to nail the perfect setup.
I've managed to get to the point yout at but would be greatful if you could share your script?
I'm using a program called Bomes Midi translator Pro that takes an input from midi yoke. The program enables you to use presets, so your 8 Faders could become 32 with three simple presets. Press up / left / right to activate the three presets.
I've alos read your thread about turning the Y axis into a keyboard. Have you any idea how i can turn the nunchuck into a 12 octave keyboard which only plays a note when you make a pressing motion? |
|
| Back to top |
|
 |
cheesenuggett
Joined: 13 May 2007 Posts: 5
Digg It |
Posted: Thu May 17, 2007 12:27 am Post subject: |
|
|
| would you be willing to post your script for use with "Bomes Midi translator"? im dyin here |
|
| Back to top |
|
 |
marko.ugh.oh
Joined: 17 May 2007 Posts: 2
Digg It |
Posted: Thu May 17, 2007 1:40 am Post subject: |
|
|
| Way, way cool... i am getting close to getting my mess to work with ablleton too but ... my wiimote sporadically hooks in/hooks up .... thanks all ya'll |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Thu May 17, 2007 9:41 am Post subject: |
|
|
Here's the script I used in the Ableton demo video; I'm only posting it the hope that some of you will be able to improve upon it. I am still, for example, getting very unreliable behaviour when I try to map midi-notes to Pitch and Roll (due to slight movement of the Wiimote); and I am also getting 'bounce' from the accelerometers: if someone could take the time to describe the difference between RawAccY and gY (with scripting examples)I'd really appreciate it
| Quote: |
/*independent controllers and triggers to Ableton; will work with
other sequencers too; feel free to adapt, change and improve
*/
midi.DeviceOut=2 //identify your own midi out device here
debug=(Wiimote.Battery*100)/170 + "%; " + midi.outdevname
var.defvol=0
if (Wiimote.B=true&&Wiimote.A=false) then //hold B, activates SmoothPitch CC14
midi.Control14=EnsureMapRange(Wiimote.SmoothPitch,0,90,0,127)/127
/*if you want a controller to return to zero, when you move to the next controller, insert "else midi.Control blabla = var.defvol" here*/
elseif (Wiimote.B=false&&Wiimote.A=true) then//hold A = SmoothRoll CC15
midi.Control15=EnsureMapRange(Wiimote.SmoothRoll,0,90,0,127)/127
elseif (Wiimote.B=true&&Wiimote.A=true) then //hold both = SmoothPitch CC20
midi.Control20=EnsureMapRange(Wiimote.SmoothPitch,0,90,0,127)/127
//and SmoothRoll CC21
midi.Control21=EnsureMapRange(Wiimote.SmoothRoll,0,90,60,127)/127
endif
//triggers
if pressed (Wiimote.RawAccy>30)then //'flickstart' note
midi.c0=true
endif
if pressed (Wiimote.Minus=true) then
midi.d0=true
endif
if pressed (Wiimote.Plus=true) then
midi.e0=true
endif
midi.c3=Wiimote.One
midi.d3=Wiimote.Two
midi.e3=Wiimote.Home
//I send C3 note to a miditrack sampler, via the random and scale plugins to
//create a simple melody from one note
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|