WII midi ROCKS TrY IT!
here's a little script I just knocked up to control the mouse cursor with the 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
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
Thanks for the reply forge, but it turns out the GUI component does not automatically script for different output devices - despite their being present in the dropdown. I did a google search, and came up with an answer: precede your MIDI references with:
Midi.DeviceOut=2
("2" may vary depending on how many ports you have installed.)
This is INSANELY cool by the way. I made a wireless expression pedal by velcroing a WiiMote to the side of an old volume pedal LOL! Can't get much simpler than that.
I still need to take one of these apart to see about rewiring to the buttons etc, but Nintendo used some really weird screw heads putting these things together!
Midi.DeviceOut=2
("2" may vary depending on how many ports you have installed.)
This is INSANELY cool by the way. I made a wireless expression pedal by velcroing a WiiMote to the side of an old volume pedal LOL! Can't get much simpler than that.
I still need to take one of these apart to see about rewiring to the buttons etc, but Nintendo used some really weird screw heads putting these things together!
you can also try the notation
midi2.channel1.ModWheel = Joystick1.x
where the '2' after midi is the number of your interface, this can be seen in the GUI tab .. but using that doesn't seem to add the relevant identifier. So I've taken to just typing it.
Obviously, the 'joystick' part is only relevant to a joystick input.
midi2.channel1.ModWheel = Joystick1.x
where the '2' after midi is the number of your interface, this can be seen in the GUI tab .. but using that doesn't seem to add the relevant identifier. So I've taken to just typing it.
Obviously, the 'joystick' part is only relevant to a joystick input.
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.
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.

------
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
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
yes - I only discovered this a couple of days ago and it has opened up my world - it's amazing how well it works and it's really quite surprisingly easy
I agree though, the GUI view is not all that - but what I use it for is more as a resource for finding out what controls are available
Angstrom - have you tried using more than one keyboard yet?
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
Angstrom wrote: 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
this uses the Wiimote's D-Pad as a mouse - I thought this might be useful as it's quite difficult to control a mouse cursor with the motion tracking - but using the D-Pad is a little awkward
//uses the D-pad as a mouse
mouse.DirectInputX -= 15*deadzone(wiimote.Left)
mouse.DirectInputX += 15*deadzone(wiimote.Right)
mouse.DirectInputY += 15*deadzone(wiimote.Down)
mouse.DirectInputY -= 15*deadzone(wiimote.up)
Mouse.LeftButton = Wiimote.B
Mouse.RightButton = Wiimote.A
//uses the D-pad as a mouse
mouse.DirectInputX -= 15*deadzone(wiimote.Left)
mouse.DirectInputX += 15*deadzone(wiimote.Right)
mouse.DirectInputY += 15*deadzone(wiimote.Down)
mouse.DirectInputY -= 15*deadzone(wiimote.up)
Mouse.LeftButton = Wiimote.B
Mouse.RightButton = Wiimote.A
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:
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:
//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))
}
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)
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)
rather than posting all these scripts here, I've created a new GlovePIE thread that is not just for Wiimote stuff
http://www.ableton.com/forum/viewtopic.php?t=88813
http://www.ableton.com/forum/viewtopic.php?t=88813
yeah I've just been using midi1.Control23 or whatever - if midi1 doesnt work then try going through the numbers till you find it - the drop down menu in GUI mode might only serve as a clue as to what number GlovePIE thinks is the midi number for MIDI yoke NT1 - so for example if it is second in that menu (under Microsoft GS wavetable... or something) then try midi2.mbenigni wrote:Thanks for the reply forge, but it turns out the GUI component does not automatically script for different output devices - despite their being present in the dropdown. I did a google search, and came up with an answer: precede your MIDI references with:
Midi.DeviceOut=2
("2" may vary depending on how many ports you have installed.)
This is INSANELY cool by the way. I made a wireless expression pedal by velcroing a WiiMote to the side of an old volume pedal LOL! Can't get much simpler than that.
I still need to take one of these apart to see about rewiring to the buttons etc, but Nintendo used some really weird screw heads putting these things together!