http://www.ableton.com/forum/viewtopic.php?t=68280
but it's kind of outgrown it - GlovePIE is not just about using the Wiimote as a controler, although that is why I got into it, instead it allows you to use just about any hardware to send MIDI or OSC messages, including the mouse, trackpad, keyboard, joystick
GlovePIE is free here:
http://carl.kenner.googlepages.com/glovepie_download
it requires a bit of geekiness, although you can just get scripts off other people and paste them in, or load up script files, and the scripting is actually not that hard to get your head around really
SO this thread can be a repository for any GlovePIE scripts or tips
so I'll start by reposting the most useful postings in the other thread
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Wimote D-pad mouse wrote:here's a little script I just knocked up to control the mouse cursor with the Wiimote D-Pad
B is left click and A is right click
mouse.DirectInputX = mouse.DirectInputX - 15*deadzone(wiimote.Left)
mouse.DirectInputX = mouse.DirectInputX + 15*deadzone(wiimote.Right)
mouse.DirectInputY = mouse.DirectInputY + 15*deadzone(wiimote.Down)
mouse.DirectInputY = mouse.DirectInputY - 15*deadzone(wiimote.up)
Mouse.LeftButton = Wiimote.B
Mouse.RightButton = Wiimote.A
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Angstrom wrote:glovePie is just so excellent.
I've not really thought of a decent reason for using a Wiimote, but glovePIE has opened up the avenues for so many daft things it is untrue.
now, with 16 USB keyboards I think I could have a very cool interface!Multiple Keyboards
You can read from multiple keyboards with GlovePIE, if you have Windows XP. You will probably need extra USB keyboards. Multiple keyboards are rare, and not especially useful. You can’t write to multiple keyboards, because I haven’t seen any programs other than mine that can tell which keyboard you used.
Just put a number after the word keyboard, like this:
midi.BassDrum1 = keyboard2.Enter
It uses RawInput instead of DirectInput for reading multiple keyboards, so sometimes you can get better or worse results just by changing one of your “keyboard”s to a “keyboard1” so that it uses RawInput instead. You only need to mention keyboard1 once in your script to force it to use RawInput. RawInput will conflict with some exclusive-mode DirectInput software.
You can tell how many keyboards there are with Keyboard.Count. You can tell whether a keyboard exists with Keyboard2.Exists.
today I have been controlling sampler from a USB skateboard game controller, lean forward and the filter opens, lean back and it closes. Very useless, but funny.
next I think I might try a bit of Speech recognition to midi.
that will certainly look like shite on stage. but again, entertaining for me.
I altered that text a bit from the manual, I swapped the word Rocket Launcher for Drumfill.Just use the said( ) function like this:
Enter = said(“drumfill”)
That will press the “Enter” key, whenever you say “drumfill” into the microphone.
You can also use the AskedFor( ) function like this:
Enter = AskedFor(“drumfill”)
The AskedFor function will only trigger if you say something like “can I please have a drumfill?”. It will not trigger if you just say “drumfill”
------
more fun : get extra screen real estate.
It shifts the entire screen contents in any direction, exposing new desktop space. For example :
Screen.ScrollX =(Joystick1.x)*Screen.Width
will scroll the screen left and right and will triple the usable size of your screen !
I think this will be very useful for session a view that is 20 times wider than the screen
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>mouse as XYZ controller part 1 wrote:
I have been trying to use more than one mouse so that I can have 1 wireless mouse that I use as an X/Y/Z controller (wheel is Z)
this works
midi1.channel2.Control21 = MapRange(Mouse3.DirectInputX, 10,-10, 1,0)
midi1.channel2.Control22 = MapRange(Mouse3.DirectInputY, 10,-10, 1,0)
but it is erratic as hell - I need to figure out the right range to map or the right units to map in - I read in the manual that Mouse is either measured in 'Mickeys' (normally 400dpi) when using mouse.DirectInput but the example here
Pie.MouseDPI = 800
midi.BassDrum1 = mouse.DirectInputX < -0.5 inches
midi.CrashCymbal1 = mouse.DirectInputX > 0.5 inches
debug = mouse.DirectInputX in inches
is for a mouse that's 800 dpi and triggers those samples when moving 0.5 in to the left or right - I dont want that, I want it to sweep from 0-127 from left to right
using those settings here makes it jump from 0-127
not sure if that last debug line is needed
the mouse movement seems to reset itself every couple of centimetres and jump back to 0 - so moving left to right the mapped control in Live just keeps sweeping very quickly from 0-127
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Controlling Lives macros with a Wiimote using instant mapping wrote: Ok! here is a script I've been working on - I started with Chris Vine's script then went through and tried to pick out the relevant bits, checking against the manual
This script allows you to control knobs using the Roll and pitch motions and combined with Live's Instant mapping I'm using 8 of the Wiimote's buttons to choose which of the 8 macro controls to control in Live independently (so when the left button on the D-Pad is held the Roll motion turns Macro 1 on the selected device...etc) all the controls and buttons are described in the comments
this creates a nice little magic wand that lets you choose your knob then turn it
a nice added feature is the LEDs on the Wiimote follow which macro is selected - as there are only 4 LEDs then macros 5-8 are also represented by LEDs 1-4
on the Wiimote X is the roll from left side down buttons to the left, 90 degrees round to horizontal with the buttons facing up, Y is the next 90 degrees round to buttons facing right and Z is the Tilt and follows where the Wiimote points vertically, pointing at the ceiling or floor
pressing the "home" button makes controls 41-43 active which respond to x,y,z of the Wiimote which I've used for a Grain delay amount/feedback and pitch
at the moment the B trigger is set to enable controls 30,31,32 which I'm using as a reverb send and havent decided what else yet
you press the keys on the keyboard a,q,w,e,r,t,y,u,i,o,p,k,l to assign each of the control numbers in Live, because the motion of the Wiimote can make it difficult to assign controls
To use this with instant mapping you will need to set up the UserConfiguration.txt file so the encoders receive controls 33-40 - or you can change them in GLove PIE to whatever you want
so create a folder "GlovePIE" in C:\Documents and Settings\yourname\Application Data\Ableton\Live 7.0.2\Preferences\User Remote Scripts and save the UserConfiguration.txt file with your encoder settings in to it
then make sure your Wiimote is connected via Bluetooth, paste the following script into Glove PIE and hit run
you will also need MIDI yoke. This script uses "midi1" which on my system is "MIDI yoke NT 1" but you can use a different one by using the "replace all" in Glove PIE's search menu and replacing "midi1" with whatever number you want
so here's the script:
Script wrote: //Forge's Ableton script to control Macros with instant mapping
//thanks to Chris Vine
//pressing A triggers C0
midi1.channel3.C0 = Wiimote1.A
//these variables are created to help smooth the controls
//I'm exploring how to make it smoother
var.xRot = smooth((Wiimote1.gx * 30), 10)
var.yRot = smooth((Wiimote1.gy * 30), 10)
var.zRot = smooth((Wiimote1.gz * 30), 10)
//press keys to Map MIDI controls in Live - Wii changes too much to map
//easily - control30 uses A just because I added it later
//this is not case sensitive, a different command is probably needed to
// select case - I will explore better key commands with modifiers later
midi.Control30 = Keyboard.a
midi.Control31 = Keyboard.Q
midi.Control32 = Keyboard.W
midi.Control33 = Keyboard.E
midi.Control34 = Keyboard.R
midi.Control35 = Keyboard.T
midi.Control36 = Keyboard.Y
midi.Control37 = Keyboard.U
midi.Control38 = Keyboard.I
midi.Control39 = Keyboard.O
midi.Control41 = Keyboard.P
midi.Control42 = Keyboard.k
midi.Control43 = Keyboard.l
/* if B is pressed these controls are active
using a range of 13 to -13 seems to allow for a full MIDI knob sweep
rolling 90 deg left to right from Wii left side down with buttons to the left
*/
if Wiimote1.B = true {
midi1.Control30= (EnsureMapRange(var.zRot, 13,-13, 0,1))
midi1.Control31= (EnsureMapRange(var.xRot, 13,-13, 0,1))
midi1.Control32= (EnsureMapRange(var.yRot, 13,-13, 0,1))
}
//with Left D-pad button held, roll controls Macro 1 and
//LED 1 lights up
if Wiimote1.Left = true {
midi3.Control33= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led1 = true
wait 100 ms
Wiimote1.Led1 = false
}
//with Up D-pad button held, roll controls Macro 2 and
//LED 2 lights up
if Wiimote1.up = true {
midi3.Control34= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led2 = true
wait 100 ms
Wiimote1.Led2 = false
}
//with Right D-pad button held, roll controls Macro 3 and
//LED 3 lights up
if Wiimote1.Right = true {
midi3.Control35= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led3 = true
wait 100 ms
Wiimote1.Led3 = false
}
//with Down D-pad button held, roll controls Macro 4 and
//LED 4 lights up
if Wiimote1.Down = true {
midi3.Control36= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led4 = true
wait 100 ms
Wiimote1.Led4 = false
}
//with minus button held, roll controls Macro 5 and
//LED 1 lights up
if Wiimote1.Minus = true {
//midi3.Control33= (EnsureMapRange(var.zRot, 13,-13, 0,1))
midi3.Control37= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led1 = true
wait 100 ms
Wiimote1.Led1 = false
}
//with plus button held, roll controls Macro 6 and
//LED 2 lights up
if Wiimote1.Plus = true {
midi3.Control38= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led2 = true
wait 100 ms
Wiimote1.Led2 = false
}
////with the '1' button held, roll controls Macro 7 and
//LED 3 lights up
if Wiimote1.one = true {
midi3.Control39= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led3 = true
wait 100 ms
Wiimote1.Led3 = false
}
//with the '2' button held, roll controls Macro 8 and
//LED 4 lights up
if Wiimote1.two = true {
midi3.Control40= (EnsureMapRange(var.xRot, 13,-13, 0,1))
Wiimote1.Led4 = true
wait 100 ms
Wiimote1.Led4 = false
}
// if home is pressed, these controls are active - I use them like this:
//41: Grain delay dry/wet or send; 42: GDelay Pitch,
//43: GDly feedback - this is all still being worked out
if Wiimote1.Home = true {
midi1.Control41= (EnsureMapRange(var.xRot, 13,-13, 0,1))
midi1.Control42= (EnsureMapRange(var.yRot, 13,-13, 0,1))
midi1.Control43= (EnsureMapRange(var.zRot, 13,-13, 0,1))
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>forge wrote:regarding smoothing - I'm still trying to figure that one out, you can actually change the control from 0-127 1 at a time by moving the Wiimote a bit more slowly, but you can hear a bit of stepping when moving more quickly or naturally
the only smoothing going on in this script is with this:
var.xRot = smooth((Wiimote1.gx * 30), 10)
var.yRot = smooth((Wiimote1.gy * 30), 10)
var.zRot = smooth((Wiimote1.gz * 30), 10)
I think var.xRot is the variable which is created here with the initial value of the Wiimote's X value times 30 (which is for 30 frames per second which is the timing GlovePIE is working on I think) then the 10 means it is smoothing by averaging out values of the last 10 frames - this value can be changed to anything from 1-30 (actually it's probably 0-30 but 0 would be pointless)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>lightsaber script wrote:
this requires the sounds with the script file from http://www.wiiscript.co.uk/scripts/scripts/Scripts.zip
from this site:
http://www.wiiscript.co.uk/
//LiightSaber V 1.0 by Freeman Speaketh/US of Anarchy
//Feel free to modify and redistribute, but leave this here
//Credits to the creators of Mac Saber for the sound effects
// set these to the offsets when the wiimote is at rest
// will be different for each wiimote
var.xOffset = 12
var.yOffset = -36
var.zOffset = 14
//Settings
var.Swing = 20 //Adjusts how far you have to swing
var.Rumble = true //Enables or Disables rumble
var.swingTime = 50 //Adjusts time between swings (in ms)
//Home button exits LiightSaber. Double press exits GlovePIE
if Wiimote.Home
if doubleclicked(Wiimote.Home)
ExitPie
else
wait 200 ms
ExitProgram
endif
endif
//Change these to whatever sounds you like
PlaySound("Sounds/swing0.wav") = var.A
PlaySound("Sounds/swing1.wav") = var.B
PlaySound("Sounds/swing2.wav") = var.C
PlaySound("Sounds/swing3.wav") = var.D
PlaySound("Sounds/swing4.wav") = var.E
PlaySound("Sounds/swing5.wav") = var.F
PlaySound("Sounds/on0.wav") = var.H
PlaySound("Sounds/off0.wav") = var.I
//B Toggles Saber on/off
if Wiimote.B = 1 and (var.wait = false or null)
var.wait = true
if var.onOff = false
var.H = true
wait 500 ms
var.H = false
var.onOff = true
else
var.I = true
wait 500 ms
var.I = false
var.onOff = false
endif
var.wait = false
endif
if var.onOff = false
debug = "Press B to turn your LiightSaber on!"
Wiimote.Leds = 0
Wiimote.Rumble = 0
else
wait 25 ms
Wiimote.Leds = 0
//Determines amount of swing after 100 ms
var.swingTime = var.swingTime / 2
var.xRot = Wiimote.RawForceX + var.xOffset
wait var.swingTime ms
Wiimote.Rumble = 0
wait var.swingTime ms
var.xRot1 = wiimote.RawForceX + var.xOffset - var.xRot
var.yRot = Wiimote.RawForceY + var.yOffset
wait var.swingTime ms
Wiimote.Rumble = 0
wait var.swingTime ms
var.yRot1 = wiimote.RawForceY + var.yOffset - var.yRot
var.zRot = Wiimote.RawForceZ + var.zOffset
wait var.swingTime ms
Wiimote.Rumble = 0
wait var.swingTime ms
var.zRot1 = wiimote.RawForceZ + var.zOffset - var.zRot
debug = ""
//Determines sounds played
if var.xRot1 > var.Swing
var.A = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else if var.xRot1 < - var.Swing
var.B = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else if var.yRot1 > var.Swing
var.C = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else if var.yRot1 < - var.Swing
var.D = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else if var.zRot1 > var.Swing
var.E = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else if var.zRot1 < - var.Swing
var.F = true
Wiimote.Rumble = var.Rumble
Wiimote.Leds = 15
debug = "Hit! "
else
var.A = false
var.B = false
var.C = false
var.D = false
var.E = false
var.F = false
endif
endif
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>wiiscript wrote:some scripts and info can be found here: http://www.wiiscript.co.uk/scripts/scripts/Scripts.zip
from this site:
http://www.wiiscript.co.uk/
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>the GlovePIE forum on WiiLi wrote:
http://www.wiili.org/forum/glovepie-f44.html