A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Discuss mods and get help with mods ONLY
This topic is 9 years and 6 months old. Instead of replying, please begin a new topic, or search for another related topic that may be more suitable.
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby Spikehead777 » Thu Jun 11, 2009 5:59 am

This is a somewhat large script. However, it's quite an improvement over death_au's script, which I based mine off of.

Version 1.0b

Features:
1-4 Player Support (When FoFiX gets 3/4 player support, we'll be ready. =) Or if you happen to have a GH3 Guitar, a GH:WT Guitar, and a GH:WT Drum controller with 3 Wiimotes.)
GH3 Guitar, GH:WT Guitar, and GH:WT Drum support (any others that work with this, let me know!)
Controller Profiles per player (Player 1 likes the GH:WT Guitar and Player 2 is always on Drums, so set profiles accordingly!)
Calibration of analog values (if the default values don't suit you, change them!)
Analog vs. Digital (Don't have PPJoy? Leave the analog switches off, and digital keystrokes are used instead!)


Code: Select all

//GlovePIE script for Wiimote instruments
//Coded by Spikehead777 and based off of death_au's script.
//Version 1.0b

//Executes initialization options only once.
if (!var.setup)

//////////////////////////////GUITAR CONFIGURATION//////////////////////////////

//Analog Joystick Per Wiimote (PPJoy must be installed, 1 Joystick per player)
var.Guitar1.AnalogStick = false
var.Guitar2.AnalogStick = false
var.Guitar3.AnalogStick = false
var.Guitar4.AnalogStick = false

    //Minimum X of Analog Stick (Calibration)
    var.Guitar1.AStickXMin = 16
    var.Guitar2.AStickXMin = 16
    var.Guitar3.AStickXMin = 16
    var.Guitar4.AStickXMin = 16

    //Maximum X of Analog Stick (Calibration)
    var.Guitar1.AStickXMax = 47
    var.Guitar2.AStickXMax = 47
    var.Guitar3.AStickXMax = 47
    var.Guitar4.AStickXMax = 47

    //Minimum Y of Analog Stick (Calibration)
    var.Guitar1.AStickYMin = 16
    var.Guitar2.AStickYMin = 16
    var.Guitar3.AStickYMin = 16
    var.Guitar4.AStickYMin = 16

    //Maximum Y of Analog Stick (Calibration)
    var.Guitar1.AStickYMax = 47
    var.Guitar2.AStickYMax = 47
    var.Guitar3.AStickYMax = 47
    var.Guitar4.AStickYMax = 47

//Analog Whammy Per Wiimote (PPJoy must be installed, 1 Joystick per player)
var.Guitar1.AnalogWhammy = false
var.Guitar2.AnalogWhammy = false
var.Guitar3.AnalogWhammy = false
var.Guitar4.AnalogWhammy = false

    //Minimum Whammy Per Wiimote (Calibration)
    var.Guitar1.AWhammyMin = 16
    var.Guitar2.AWhammyMin = 16
    var.Guitar3.AWhammyMin = 16
    var.Guitar4.AWhammyMin = 16

    //Maximum Whammy Per Wiimote (Calibration)
    var.Guitar1.AWhammyMax = 27
    var.Guitar2.AWhammyMax = 27
    var.Guitar3.AWhammyMax = 27
    var.Guitar4.AWhammyMax = 27

//Slider Exists Per Wiimote
var.Guitar1.HasSlider = false
var.Guitar2.HasSlider = false
var.Guitar3.HasSlider = false
var.Guitar4.HasSlider = false

    //Analog Slider Per Wiimote (PPJoy must be installed, 1 Joystick per player)
    var.Guitar1.AnalogSlider = false
    var.Guitar2.AnalogSlider = false
    var.Guitar3.AnalogSlider = false
    var.Guitar4.AnalogSlider = false

        //Minimum Slider Per Wiimote (Calibration)
        var.Guitar1.ASliderMin = 0
        var.Guitar2.ASliderMin = 0
        var.Guitar3.ASliderMin = 0
        var.Guitar4.ASliderMin = 0

        //Maximum Slider Per Wiimote (Calibration)
        var.Guitar1.ASliderMax = 31
        var.Guitar2.ASliderMax = 31
        var.Guitar3.ASliderMax = 31
        var.Guitar4.ASliderMax = 31

//Analog Tilt Per Wiimote (PPJoy must be installed, 1 Joystick per player)
var.Guitar1.AnalogTilt = false
var.Guitar2.AnalogTilt = false
var.Guitar3.AnalogTilt = false
var.Guitar4.AnalogTilt = false

    //Sensitivity of Tilt per Wiimote when AnalogTilt is false
    var.Guitar1.TiltSensitivity = 60
    var.Guitar2.TiltSensitivity = 60
    var.Guitar3.TiltSensitivity = 60
    var.Guitar4.TiltSensitivity = 60

///////////////////////////////DRUM CONFIGURATION///////////////////////////////

//Analog Joystick Per Wiimote (PPJoy must be installed, 1 Joystick per player)
var.Drum1.AnalogStick = false
var.Drum2.AnalogStick = false
var.Drum3.AnalogStick = false
var.Drum4.AnalogStick = false

    //Minimum X of Analog Stick (Calibration)
    var.Drum1.AStickXMin = 16
    var.Drum2.AStickXMin = 16
    var.Drum3.AStickXMin = 16
    var.Drum4.AStickXMin = 16

    //Maximum X of Analog Stick (Calibration)
    var.Drum1.AStickXMax = 47
    var.Drum2.AStickXMax = 47
    var.Drum3.AStickXMax = 47
    var.Drum4.AStickXMax = 47

    //Minimum Y of Analog Stick (Calibration)
    var.Drum1.AStickYMin = 16
    var.Drum2.AStickYMin = 16
    var.Drum3.AStickYMin = 16
    var.Drum4.AStickYMin = 16

    //Maximum Y of Analog Stick (Calibration)
    var.Drum1.AStickYMax = 47
    var.Drum2.AStickYMax = 47
    var.Drum3.AStickYMax = 47
    var.Drum4.AStickYMax = 47


//////////////////////////////////CALIBRATION///////////////////////////////////
//The following function allows you to see debug values for calibrating.
//You should calibrate all of your axes in this script if you have PPJoy
//installed and you have the options to use analog axes enabled. 2 or more PPJoy
//virtual joysticks must be installed when playing with 2 or more players,
//unless you change all of the ppjoy commands in the controls list to use
//ppjoy1. Note, this only lets you see unfiltered values without the calibration
//in effect.
var.calibrate = false



//Frame Rate of updates
PIE.FrameRate = 300Hz

//Blink status of Wiimote LEDs when Wiimote inactive
var.LEDblink = 0

//Frames between blinking of Wiimote LEDs
var.LEDspeed = 100

//Current LED blink frame
var.LEDframe = 0

//Initialize Instruments
var.Wii1I = "D/C"
var.Wii2I = "D/C"
var.Wii3I = "D/C"
var.Wii4I = "D/C"

//Executes initialization options only once.
var.setup = true
endif

/////////////////////////////////////CONTROLS///////////////////////////////////

/////////////////////////////////PLAYER 1 GUITAR////////////////////////////////
Key.Enter        = var.Guitar1.StrumUp
Key.RightShift   = var.Guitar1.StrumDown
Key.F1           = var.Guitar1.Green
Key.F2           = var.Guitar1.Red
Key.F3           = var.Guitar1.Yellow
Key.F4           = var.Guitar1.Blue
Key.F5           = var.Guitar1.Orange
if (var.Guitar1.AnalogStick)
ppjoy1.Analog0   = (var.Guitar1.AStickX-var.Guitar1.AStickXMin)/(var.Guitar1.AStickXMax-var.Guitar1.AStickXMin)*2-1
ppjoy1.Analog1   = (var.Guitar1.AStickY-var.Guitar1.AStickYMin)/(var.Guitar1.AStickYMax-var.Guitar1.AStickYMin)*2-1
else
Key.Left         = var.Guitar1.DStickL
Key.Right        = var.Guitar1.DStickR
Key.Up           = var.Guitar1.DStickU
Key.Down         = var.Guitar1.DStickD
endif
Key.Escape       = var.Guitar1.Plus
Key.PageDown     = var.Guitar1.Minus
if (var.Guitar1.AnalogTilt)
ppjoy1.Analog2   = var.Guitar1.ATilt/90
else
Key.PageDown     = var.Guitar1.DTilt
endif
if (var.Guitar1.AnalogWhammy)
ppjoy1.Analog3   = (var.Guitar1.AWhammy-var.Guitar1.AWhammyMin)/(var.Guitar1.AWhammyMax-var.Guitar1.AWhammyMin)
else
Key.PageUp       = var.Guitar1.DWhammy
endif
if (var.Guitar1.HasSlider)
if (var.Guitar1.AnalogSlider)
ppjoy1.Analog4   = (var.Guitar1.ASlider-var.Guitar1.ASliderMin)/(var.Guitar1.ASliderMax-var.Guitar1.ASliderMin)
else
Key.F6           = var.Guitar1.DSliderG
Key.F7           = var.Guitar1.DSliderR
Key.F8           = var.Guitar1.DSliderY
Key.F9           = var.Guitar1.DSliderB
Key.F10          = var.Guitar1.DSliderO
endif
endif

/////////////////////////////////PLAYER 1 DRUMS/////////////////////////////////
Key.Space        = var.Drum1.Purple
Key.A            = var.Drum1.Red
Key.E            = var.Drum1.Yellow
Key.T            = var.Drum1.Blue
//Key.Y            = var.Drum1.Orange
Key.U            = var.Drum1.Green
if (var.Drum1.AnalogStick)
ppjoy1.Analog0   = (var.Drum1.AStickX-var.Drum1.AStickXMin)/(var.Drum1.AStickXMax-var.Drum1.AStickXMin)*2-1
ppjoy1.Analog1   = (var.Drum1.AStickY-var.Drum1.AStickYMin)/(var.Drum1.AStickYMax-var.Drum1.AStickYMin)*2-1
else
Key.Left         = var.Drum1.DStickL
Key.Right        = var.Drum1.DStickR
Key.Up           = var.Drum1.DStickU
Key.Down         = var.Drum1.DStickD
endif
Key.Escape       = var.Drum1.Plus
Key.PageDown     = var.Drum1.Minus

/////////////////////////////////PLAYER 2 GUITAR////////////////////////////////
Key.Delete       = var.Guitar2.StrumUp
Key.Insert       = var.Guitar2.StrumDown
Key.1            = var.Guitar2.Green
Key.2            = var.Guitar2.Red
Key.3            = var.Guitar2.Yellow
Key.4            = var.Guitar2.Blue
Key.5            = var.Guitar2.Orange
if (var.Guitar2.AnalogStick)
ppjoy2.Analog0   = (var.Guitar2.AStickX-var.Guitar2.AStickXMin)/(var.Guitar2.AStickXMax-var.Guitar2.AStickXMin)*2-1
ppjoy2.Analog1   = (var.Guitar2.AStickY-var.Guitar2.AStickYMin)/(var.Guitar2.AStickYMax-var.Guitar2.AStickYMin)*2-1
else
Key.Left         = var.Guitar2.DStickL
Key.Right        = var.Guitar2.DStickR
Key.Up           = var.Guitar2.DStickU
Key.Down         = var.Guitar2.DStickD
endif
Key.Console      = var.Guitar2.Plus
Key.Home         = var.Guitar2.Minus
if (var.Guitar2.AnalogTilt)
ppjoy2.Analog2   = var.Guitar2.ATilt/90
else
Key.Home         = var.Guitar2.DTilt
endif
if (var.Guitar2.AnalogWhammy)
ppjoy2.Analog3   = (var.Guitar2.AWhammy-var.Guitar2.AWhammyMin)/(var.Guitar2.AWhammyMax-var.Guitar2.AWhammyMin)
else
Key.End          = var.Guitar2.DWhammy
endif
if (var.Guitar2.HasSlider)
if (var.Guitar2.AnalogSlider)
ppjoy2.Analog4   = (var.Guitar2.ASlider-var.Guitar2.ASliderMin)/(var.Guitar2.ASliderMax-var.Guitar2.ASliderMin)
else
Key.F6           = var.Guitar2.DSliderG
Key.F7           = var.Guitar2.DSliderR
Key.F8           = var.Guitar2.DSliderY
Key.F9           = var.Guitar2.DSliderB
Key.F10          = var.Guitar2.DSliderO
endif
endif

/////////////////////////////////PLAYER 2 DRUMS/////////////////////////////////
Key.L            = var.Drum2.Purple
Key.Z            = var.Drum2.Red
Key.D            = var.Drum2.Yellow
Key.G            = var.Drum2.Blue
//Key.H            = var.Drum2.Orange
Key.J            = var.Drum2.Green
if (var.Drum2.AnalogStick)
ppjoy2.Analog0   = (var.Drum2.AStickX-var.Drum2.AStickXMin)/(var.Drum2.AStickXMax-var.Drum2.AStickXMin)*2-1
ppjoy2.Analog1   = (var.Drum2.AStickY-var.Drum2.AStickYMin)/(var.Drum2.AStickYMax-var.Drum2.AStickYMin)*2-1
else
Key.Left         = var.Drum2.DStickL
Key.Right        = var.Drum2.DStickR
Key.Up           = var.Drum2.DStickU
Key.Down         = var.Drum2.DStickD
endif
Key.Console      = var.Drum2.Plus
Key.End          = var.Drum2.Minus

/////////////////////////////////PLAYER 3 GUITAR////////////////////////////////
Key.Numpad2      = var.Guitar3.StrumUp
Key.Numpad1      = var.Guitar3.StrumDown
Key.Console      = var.Guitar3.Green
Key.1            = var.Guitar3.Red
Key.2            = var.Guitar3.Yellow
Key.3            = var.Guitar3.Blue
Key.4            = var.Guitar3.Orange
if (var.Guitar3.AnalogStick)
ppjoy3.Analog0   = (var.Guitar3.AStickX-var.Guitar3.AStickXMin)/(var.Guitar3.AStickXMax-var.Guitar3.AStickXMin)*2-1
ppjoy3.Analog1   = (var.Guitar3.AStickY-var.Guitar3.AStickYMin)/(var.Guitar3.AStickYMax-var.Guitar3.AStickYMin)*2-1
else
Key.Left         = var.Guitar3.DStickL
Key.Right        = var.Guitar3.DStickR
Key.Up           = var.Guitar3.DStickU
Key.Down         = var.Guitar3.DStickD
endif
Key.Numpad8      = var.Guitar3.Plus
Key.Numpad5      = var.Guitar3.Minus
if (var.Guitar3.AnalogTilt)
ppjoy3.Analog2   = var.Guitar3.ATilt/90
else
Key.Numpad5      = var.Guitar3.DTilt
endif
if (var.Guitar3.AnalogWhammy)
ppjoy3.Analog3   = (var.Guitar3.AWhammy-var.Guitar3.AWhammyMin)/(var.Guitar3.AWhammyMax-var.Guitar3.AWhammyMin)
else
Key.Numpad2      = var.Guitar3.DWhammy
endif
if (var.Guitar3.HasSlider)
if (var.Guitar3.AnalogSlider)
ppjoy3.Analog4   = (var.Guitar3.ASlider-var.Guitar3.ASliderMin)/(var.Guitar3.ASliderMax-var.Guitar3.ASliderMin)
else
Key.F6           = var.Guitar3.DSliderG
Key.F7           = var.Guitar3.DSliderR
Key.F8           = var.Guitar3.DSliderY
Key.F9           = var.Guitar3.DSliderB
Key.F10          = var.Guitar3.DSliderO
endif
endif

/////////////////////////////////PLAYER 3 DRUMS/////////////////////////////////
Key.Space        = var.Drum3.Purple
Key.A            = var.Drum3.Red
Key.E            = var.Drum3.Yellow
Key.T            = var.Drum3.Blue
//Key.Y            = var.Drum3.Orange
Key.U            = var.Drum3.Green
if (var.Drum3.AnalogStick)
ppjoy3.Analog0   = (var.Drum3.AStickX-var.Drum3.AStickXMin)/(var.Drum3.AStickXMax-var.Drum3.AStickXMin)*2-1
ppjoy3.Analog1   = (var.Drum3.AStickY-var.Drum3.AStickYMin)/(var.Drum3.AStickYMax-var.Drum3.AStickYMin)*2-1
else
Key.Left         = var.Drum3.DStickL
Key.Right        = var.Drum3.DStickR
Key.Up           = var.Drum3.DStickU
Key.Down         = var.Drum3.DStickD
endif
Key.Escape       = var.Drum3.Plus
Key.PageDown     = var.Drum3.Minus

/////////////////////////////////PLAYER 4 GUITAR////////////////////////////////
Key.Numpad6      = var.Guitar4.StrumUp
Key.Numpad3      = var.Guitar4.StrumDown
Key.5            = var.Guitar4.Green
Key.6            = var.Guitar4.Red
Key.7            = var.Guitar4.Yellow
Key.8            = var.Guitar4.Blue
Key.9            = var.Guitar4.Orange
if (var.Guitar4.AnalogStick)
ppjoy4.Analog0   = (var.Guitar4.AStickX-var.Guitar4.AStickXMin)/(var.Guitar4.AStickXMax-var.Guitar4.AStickXMin)*2-1
ppjoy4.Analog1   = (var.Guitar4.AStickY-var.Guitar4.AStickYMin)/(var.Guitar4.AStickYMax-var.Guitar4.AStickYMin)*2-1
else
Key.Left         = var.Guitar4.DStickL
Key.Right        = var.Guitar4.DStickR
Key.Up           = var.Guitar4.DStickU
Key.Down         = var.Guitar4.DStickD
endif
Key.Numpad9      = var.Guitar4.Plus
Key.Home         = var.Guitar4.Minus
if (var.Guitar4.AnalogTilt)
ppjoy4.Analog2   = var.Guitar4.ATilt/90
else
Key.Home         = var.Guitar4.DTilt
endif
if (var.Guitar4.AnalogWhammy)
ppjoy4.Analog3   = (var.Guitar4.AWhammy-var.Guitar4.AWhammyMin)/(var.Guitar4.AWhammyMax-var.Guitar4.AWhammyMin)
else
Key.End          = var.Guitar4.DWhammy
endif
if (var.Guitar4.HasSlider)
if (var.Guitar4.AnalogSlider)
ppjoy4.Analog4   = (var.Guitar4.ASlider-var.Guitar4.ASliderMin)/(var.Guitar4.ASliderMax-var.Guitar4.ASliderMin)
else
Key.F6           = var.Guitar4.DSliderG
Key.F7           = var.Guitar4.DSliderR
Key.F8           = var.Guitar4.DSliderY
Key.F9           = var.Guitar4.DSliderB
Key.F10          = var.Guitar4.DSliderO
endif
endif

/////////////////////////////////PLAYER 4 DRUMS////////////////////////////////
Key.L            = var.Drum4.Purple
Key.Z            = var.Drum4.Red
Key.D            = var.Drum4.Yellow
Key.G            = var.Drum4.Blue
//Key.H            = var.Drum4.Orange
Key.J            = var.Drum4.Green
if (var.Drum4.AnalogStick)
ppjoy4.Analog0   = (var.Drum4.AStickX-var.Drum4.AStickXMin)/(var.Drum4.AStickXMax-var.Drum4.AStickXMin)*2-1
ppjoy4.Analog1   = (var.Drum4.AStickY-var.Drum4.AStickYMin)/(var.Drum4.AStickYMax-var.Drum4.AStickYMin)*2-1
else
Key.Left         = var.Drum4.DStickL
Key.Right        = var.Drum4.DStickR
Key.Up           = var.Drum4.DStickU
Key.Down         = var.Drum4.DStickD
endif
Key.Console      = var.Drum4.Plus
Key.End          = var.Drum4.Minus

////////////////////////////////////////////////////////////////////////////////
/////////////////////////DO NOT MODIFY ANYTHING BELOW!!!////////////////////////
////////////////////////////////////////////////////////////////////////////////
//Unless you know what you're doing.

var.LEDframe += 1
if (var.LEDframe >= var.LEDspeed)
  var.LEDframe -= var.LEDspeed
  var.LEDblink = !var.LEDblink
  endif

//Wiimote Guitar/Drum switch

//1 = Guitar
//2 = Drums

if (var.Wii1I = "D/C") var.Wii1I = "???"
if (var.Wii2I = "D/C") var.Wii2I = "???"
if (var.Wii3I = "D/C") var.Wii3I = "???"
if (var.Wii4I = "D/C") var.Wii4I = "???"

if (Wiimote1.Exists)
  if (Wiimote1.One && Wiimote1.Expansion)
    var.Wii1I = "GUITAR"
    WiimotePoke(1, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(1, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(1, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(1, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  elseif (Wiimote1.Two && Wiimote1.Expansion)
    var.Wii1I = "DRUM"
    WiimotePoke(1, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(1, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(1, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(1, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  endif
else
  var.Wii1I = "D/C"
  var.Wii1P = 0
endif

if (Wiimote2.Exists)
  if (Wiimote2.One && Wiimote2.Expansion)
    var.Wii2I = "GUITAR"
    WiimotePoke(2, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(2, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(2, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(2, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  elseif (Wiimote2.Two && Wiimote2.Expansion)
    var.Wii2I = "DRUM"
    WiimotePoke(2, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(2, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(2, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(2, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  endif
else
  var.Wii2I = "D/C"
  var.Wii2P = 0
endif

if (Wiimote3.Exists)
  if (Wiimote3.One && Wiimote3.Expansion)
    var.Wii3I = "GUITAR"
    WiimotePoke(3, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(3, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(3, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(3, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  elseif (Wiimote3.Two && Wiimote3.Expansion)
    var.Wii3I = "DRUM"
    WiimotePoke(3, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(3, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(3, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(3, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  endif
else
  var.Wii3I = "D/C"
  var.Wii3P = 0
endif

if (Wiimote4.Exists)
  if (Wiimote4.One && Wiimote4.Expansion)
    var.Wii4I = "GUITAR"
    WiimotePoke(4, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(4, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(4, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(4, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  elseif (Wiimote4.Two && Wiimote4.Expansion)
    var.Wii4I = "DRUM"
    WiimotePoke(4, 0x4A400F0, 0x55) // Decrypt
    wait 100ms
    WiimotePoke(4, 0x4A400FB, 0) // Unknown
    wait 100ms
    WiimotePoke(4, 0x4A40040, 0)
    wait 100ms
    WiimoteSend(4, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
    wait 100ms
  endif
else
  var.Wii4I = "D/C"
  var.Wii4P = 0
endif

//Wiimote Player Switch
//Up = P1
//Right = P2
//Down = P3
//Left = P4

//Wiimote 1 Switch
if (var.Wii1I != "???" && var.Wii1I != "D/C")
  if (Wiimote1.Home)
    var.Wii1P = 0
  endif
  if (Wiimote1.Up)
    if (var.Wii2P != 1 && var.Wii3P != 1 && var.Wii4P != 1)
      var.Wii1P = 1
    endif
  endif
  if (Wiimote1.Right)
    if (var.Wii2P != 2 && var.Wii3P != 2 && var.Wii4P != 2)
      var.Wii1P = 2
    endif
  endif
  if (Wiimote1.Down)
    if (var.Wii2P != 3 && var.Wii3P != 3 && var.Wii4P != 3)
      var.Wii1P = 3
    endif
  endif
  if (Wiimote1.Left)
    if (var.Wii2P != 4 && var.Wii3P != 4 && var.Wii4P != 4)
      var.Wii1P = 4
    endif
  endif
endif

//Wiimote 2 Switch
if (var.Wii2I != "???" && var.Wii2I != "D/C")
  if (Wiimote2.Home)
    var.Wii2P = 0
  endif
  if (Wiimote2.Up)
    if (var.Wii1P != 1 && var.Wii3P != 1 && var.Wii4P != 1)
      var.Wii2P = 1
    endif
  endif
  if (Wiimote2.Right)
    if (var.Wii1P != 2 && var.Wii3P != 2 && var.Wii4P != 2)
      var.Wii2P = 2
    endif
  endif
  if (Wiimote2.Down)
    if (var.Wii1P != 3 && var.Wii3P != 3 && var.Wii4P != 3)
      var.Wii2P = 3
    endif
  endif
  if (Wiimote2.Left)
    if (var.Wii1P != 4 && var.Wii3P != 4 && var.Wii4P != 4)
      var.Wii2P = 4
    endif
  endif
endif

//Wiimote 3 Switch
if (var.Wii3I != "???" && var.Wii3I != "D/C")
  if (Wiimote3.Home)
    var.Wii3P = 0
  endif
  if (Wiimote3.Up)
    if (var.Wii2P != 1 && var.Wii1P != 1 && var.Wii4P != 1)
      var.Wii3P = 1
    endif
  endif
  if (Wiimote3.Right)
    if (var.Wii2P != 2 && var.Wii1P != 2 && var.Wii4P != 2)
      var.Wii3P = 2
    endif
  endif
  if (Wiimote3.Down)
    if (var.Wii2P != 3 && var.Wii1P != 3 && var.Wii4P != 3)
      var.Wii3P = 3
    endif
  endif
  if (Wiimote3.Left)
    if (var.Wii2P != 4 && var.Wii1P != 4 && var.Wii4P != 4)
      var.Wii3P = 4
    endif
  endif
endif

//Wiimote 4 Switch
if (var.Wii4I != "???" && var.Wii4I != "D/C")
  if (Wiimote4.Home)
    var.Wii4P = 0
  endif
  if (Wiimote4.Up)
    if (var.Wii2P != 1 && var.Wii3P != 1 && var.Wii1P != 1)
      var.Wii4P = 1
    endif
  endif
  if (Wiimote4.Right)
    if (var.Wii2P != 2 && var.Wii3P != 2 && var.Wii1P != 2)
      var.Wii4P = 2
    endif
  endif
  if (Wiimote4.Down)
    if (var.Wii2P != 3 && var.Wii3P != 3 && var.Wii1P != 3)
      var.Wii4P = 3
    endif
  endif
  if (Wiimote4.Left)
    if (var.Wii2P != 4 && var.Wii3P != 4 && var.Wii1P != 4)
      var.Wii4P = 4
    endif
  endif
endif

//Wiimote 1 LEDs
if (Wiimote1.Plus)
  Wiimote1.LEDS = 0
  Wiimote1.LED1 = Wiimote1.Battery > 0
  Wiimote1.LED2 = Wiimote1.Battery > 50
  Wiimote1.LED3 = Wiimote1.Battery > 100
  Wiimote1.LED4 = Wiimote1.Battery > 150
elseif (var.Wii1I = "???" || var.Wii1P = 0)
  Wiimote1.LED1 = var.LEDblink
  Wiimote1.LED2 = var.LEDblink
  Wiimote1.LED3 = var.LEDblink
  Wiimote1.LED4 = var.LEDblink
elseif (var.Wii1I = "GUITAR" || var.Wii1I = "DRUMS")
  Wiimote1.LED1 = (var.Wii1P = 1)
  Wiimote1.LED2 = (var.Wii1P = 2)
  Wiimote1.LED3 = (var.Wii1P = 3)
  Wiimote1.LED4 = (var.Wii1P = 4)
endif

//Wiimote 2 LEDs
if (Wiimote2.Plus)
  Wiimote2.LEDS = 0
  Wiimote2.LED1 = Wiimote2.Battery > 0
  Wiimote2.LED2 = Wiimote2.Battery > 50
  Wiimote2.LED3 = Wiimote2.Battery > 100
  Wiimote2.LED4 = Wiimote2.Battery > 150
elseif (var.Wii2I = "???" || var.Wii2P = 0)
  Wiimote2.LED1 = var.LEDblink
  Wiimote2.LED2 = var.LEDblink
  Wiimote2.LED3 = var.LEDblink
  Wiimote2.LED4 = var.LEDblink
elseif (var.Wii2I = "GUITAR" || var.Wii2I = "DRUMS")
  Wiimote2.LED1 = (var.Wii2P = 1)
  Wiimote2.LED2 = (var.Wii2P = 2)
  Wiimote2.LED3 = (var.Wii2P = 3)
  Wiimote2.LED4 = (var.Wii2P = 4)
endif

//Wiimote 3 LEDs
if (Wiimote3.Plus)
  Wiimote3.LEDS = 0
  Wiimote3.LED1 = Wiimote3.Battery > 0
  Wiimote3.LED2 = Wiimote3.Battery > 50
  Wiimote3.LED3 = Wiimote3.Battery > 100
  Wiimote3.LED4 = Wiimote3.Battery > 150
elseif (var.Wii3I = "???" || var.Wii3P = 3)
  Wiimote3.LED1 = var.LEDblink
  Wiimote3.LED2 = var.LEDblink
  Wiimote3.LED3 = var.LEDblink
  Wiimote3.LED4 = var.LEDblink
elseif (var.Wii3I = "GUITAR" || var.Wii3I = "DRUMS")
  Wiimote3.LED1 = (var.Wii3P = 1)
  Wiimote3.LED2 = (var.Wii3P = 2)
  Wiimote3.LED3 = (var.Wii3P = 3)
  Wiimote3.LED4 = (var.Wii3P = 4)
endif

//Wiimote 4 LEDs
if (Wiimote4.Plus)
  Wiimote4.LEDS = 0
  Wiimote4.LED1 = Wiimote4.Battery > 0
  Wiimote4.LED2 = Wiimote4.Battery > 50
  Wiimote4.LED3 = Wiimote4.Battery > 100
  Wiimote4.LED4 = Wiimote4.Battery > 150
elseif (var.Wii4I = "???" || var.Wii4P = 4)
  Wiimote4.LED1 = var.LEDblink
  Wiimote4.LED2 = var.LEDblink
  Wiimote4.LED3 = var.LEDblink
  Wiimote4.LED4 = var.LEDblink
elseif (var.Wii4I = "GUITAR" || var.Wii4I = "DRUMS")
  Wiimote4.LED1 = (var.Wii4P = 1)
  Wiimote4.LED2 = (var.Wii4P = 2)
  Wiimote4.LED3 = (var.Wii4P = 3)
  Wiimote4.LED4 = (var.Wii4P = 4)
endif

debug = "Player 1: "+var.Wii1P+" "+var.Wii1I
debug += "   Player 2: "+var.Wii2P+" "+var.Wii2I
debug += "   Player 3: "+var.Wii3P+" "+var.Wii3I
debug += "   Player 4: "+var.Wii4P+" "+var.Wii4I

//Guitar 1
if (var.Wii1I = "GUITAR")
  if (var.Wii1P = 1)
    var.Guitar1.AStickX = (Wiimote1.Exp0 & 63)
    var.Guitar1.AStickY = (Wiimote1.Exp1 & 63)
    var.Guitar1.DStickL  = (Wiimote1.Exp0 < 25)
    var.Guitar1.DStickR = (Wiimote1.Exp0 > 38)
    var.Guitar1.DStickD  = (Wiimote1.Exp1 > 38)
    var.Guitar1.DStickU    = (Wiimote1.Exp1 < 25)

    var.Guitar1.Green   = Wiimote1.Guitar.Fret1
    var.Guitar1.Red     = Wiimote1.Guitar.Fret2
    var.Guitar1.Yellow  = Wiimote1.Guitar.Fret3
    var.Guitar1.Blue    = Wiimote1.Guitar.Fret4
    var.Guitar1.Orange  = Wiimote1.Guitar.Fret5

    var.Guitar1.StrumUp   = Wiimote1.Guitar.StrumUp
    var.Guitar1.StrumDown = Wiimote1.Guitar.StrumDown
    var.Guitar1.Minus = Wiimote1.Guitar.Minus
    var.Guitar1.Plus = Wiimote1.Guitar.Plus

    var.Guitar1.ATilt = Wiimote1.Pitch
    var.Guitar1.DTilt = (var.Guitar1.TiltSensitivity < Wiimote1.Pitch < 100)

    var.Guitar1.AWhammy = (Wiimote1.Exp3 & 31)
    var.Guitar1.DWhammy = ((Wiimote1.Exp3 & 31) > 28)

    var.Guitar1.ASlider = (Wiimote1.Exp2 & 31)
    var.Guitar1.DSliderG = (Wiimote1.Exp2 & 31) = 04
    var.Guitar1.DSliderR = (Wiimote1.Exp2 & 31) = 10
    var.Guitar1.DSliderY = (Wiimote1.Exp2 & 31) = 18 || (Wiimote1.Exp2 & 31) = 19
    var.Guitar1.DSliderB = (Wiimote1.Exp2 & 31) = 23 || (Wiimote1.Exp2 & 31) = 24
    var.Guitar1.DSliderO = (Wiimote1.Exp2 & 31) = 31
  elseif (var.Wii1P = 2)
    var.Guitar2.AStickX = (Wiimote1.Exp0 & 63)
    var.Guitar2.AStickY = (Wiimote1.Exp1 & 63)
    var.Guitar2.DStickL  = (Wiimote1.Exp0 < 25)
    var.Guitar2.DStickR = (Wiimote1.Exp0 > 38)
    var.Guitar2.DStickD  = (Wiimote1.Exp1 > 38)
    var.Guitar2.DStickU    = (Wiimote1.Exp1 < 25)

    var.Guitar2.Green   = Wiimote1.Guitar.Fret1
    var.Guitar2.Red     = Wiimote1.Guitar.Fret2
    var.Guitar2.Yellow  = Wiimote1.Guitar.Fret3
    var.Guitar2.Blue    = Wiimote1.Guitar.Fret4
    var.Guitar2.Orange  = Wiimote1.Guitar.Fret5

    var.Guitar2.StrumUp   = Wiimote1.Guitar.StrumUp
    var.Guitar2.StrumDown = Wiimote1.Guitar.StrumDown
    var.Guitar2.Minus = Wiimote1.Guitar.Minus
    var.Guitar2.Plus = Wiimote1.Guitar.Plus

    var.Guitar2.ATilt = Wiimote1.Pitch
    var.Guitar2.DTilt = (var.Guitar2.TiltSensitivity < Wiimote1.Pitch < 100)

    var.Guitar2.AWhammy = (Wiimote1.Exp3 & 31)
    var.Guitar2.DWhammy = ((Wiimote1.Exp3 & 31) > 28)

    var.Guitar2.ASlider = (Wiimote1.Exp2 & 31)
    var.Guitar2.DSliderG = (Wiimote1.Exp2 & 31) = 04
    var.Guitar2.DSliderR = (Wiimote1.Exp2 & 31) = 10
    var.Guitar2.DSliderY = (Wiimote1.Exp2 & 31) = 18 || (Wiimote1.Exp2 & 31) = 19
    var.Guitar2.DSliderB = (Wiimote1.Exp2 & 31) = 23 || (Wiimote1.Exp2 & 31) = 24
    var.Guitar2.DSliderO = (Wiimote1.Exp2 & 31) = 31
  elseif (var.Wii1P = 3)
    var.Guitar3.AStickX = (Wiimote1.Exp0 & 63)
    var.Guitar3.AStickY = (Wiimote1.Exp1 & 63)
    var.Guitar3.DStickL  = (Wiimote1.Exp0 < 25)
    var.Guitar3.DStickR = (Wiimote1.Exp0 > 38)
    var.Guitar3.DStickD  = (Wiimote1.Exp1 > 38)
    var.Guitar3.DStickU    = (Wiimote1.Exp1 < 25)

    var.Guitar3.Green   = Wiimote1.Guitar.Fret1
    var.Guitar3.Red     = Wiimote1.Guitar.Fret2
    var.Guitar3.Yellow  = Wiimote1.Guitar.Fret3
    var.Guitar3.Blue    = Wiimote1.Guitar.Fret4
    var.Guitar3.Orange  = Wiimote1.Guitar.Fret5

    var.Guitar3.StrumUp   = Wiimote1.Guitar.StrumUp
    var.Guitar3.StrumDown = Wiimote1.Guitar.StrumDown
    var.Guitar3.Minus = Wiimote1.Guitar.Minus
    var.Guitar3.Plus = Wiimote1.Guitar.Plus

    var.Guitar3.ATilt = Wiimote1.Pitch
    var.Guitar3.DTilt = (var.Guitar3.TiltSensitivity < Wiimote1.Pitch < 100)

    var.Guitar3.AWhammy = (Wiimote1.Exp3 & 31)
    var.Guitar3.DWhammy = ((Wiimote1.Exp3 & 31) > 28)

    var.Guitar3.ASlider = (Wiimote1.Exp2 & 31)
    var.Guitar3.DSliderG = (Wiimote1.Exp2 & 31) = 04
    var.Guitar3.DSliderR = (Wiimote1.Exp2 & 31) = 10
    var.Guitar3.DSliderY = (Wiimote1.Exp2 & 31) = 18 || (Wiimote1.Exp2 & 31) = 19
    var.Guitar3.DSliderB = (Wiimote1.Exp2 & 31) = 23 || (Wiimote1.Exp2 & 31) = 24
    var.Guitar3.DSliderO = (Wiimote1.Exp2 & 31) = 31
  elseif (var.Wii1P = 4)
    var.Guitar4.AStickX = (Wiimote1.Exp0 & 63)
    var.Guitar4.AStickY = (Wiimote1.Exp1 & 63)
    var.Guitar4.DStickL  = (Wiimote1.Exp0 < 25)
    var.Guitar4.DStickR = (Wiimote1.Exp0 > 38)
    var.Guitar4.DStickD  = (Wiimote1.Exp1 > 38)
    var.Guitar4.DStickU    = (Wiimote1.Exp1 < 25)

    var.Guitar4.Green   = Wiimote1.Guitar.Fret1
    var.Guitar4.Red     = Wiimote1.Guitar.Fret2
    var.Guitar4.Yellow  = Wiimote1.Guitar.Fret3
    var.Guitar4.Blue    = Wiimote1.Guitar.Fret4
    var.Guitar4.Orange  = Wiimote1.Guitar.Fret5

    var.Guitar4.StrumUp   = Wiimote1.Guitar.StrumUp
    var.Guitar4.StrumDown = Wiimote1.Guitar.StrumDown
    var.Guitar4.Minus = Wiimote1.Guitar.Minus
    var.Guitar4.Plus = Wiimote1.Guitar.Plus

    var.Guitar4.ATilt = Wiimote1.Pitch
    var.Guitar4.DTilt = (var.Guitar4.TiltSensitivity < Wiimote1.Pitch < 100)

    var.Guitar4.AWhammy = (Wiimote1.Exp3 & 31)
    var.Guitar4.DWhammy = ((Wiimote1.Exp3 & 31) > 28)

    var.Guitar4.ASlider = (Wiimote1.Exp2 & 31)
    var.Guitar4.DSliderG = (Wiimote1.Exp2 & 31) = 04
    var.Guitar4.DSliderR = (Wiimote1.Exp2 & 31) = 10
    var.Guitar4.DSliderY = (Wiimote1.Exp2 & 31) = 18 || (Wiimote1.Exp2 & 31) = 19
    var.Guitar4.DSliderB = (Wiimote1.Exp2 & 31) = 23 || (Wiimote1.Exp2 & 31) = 24
    var.Guitar4.DSliderO = (Wiimote1.Exp2 & 31) = 31
  endif
endif
//Drums 1
if (var.Wii1I = "DRUM")
  if (var.Wii1P = 1)
    var.Drum1.AStickX = (Wiimote1.Exp0 & 63)
    var.Drum1.AStickY = (Wiimote1.Exp1 & 63)
    var.Drum1.DStickL  = (Wiimote1.Exp0 < 25)
    var.Drum1.DStickR = (Wiimote1.Exp0 > 38)
    var.Drum1.DStickD  = (Wiimote1.Exp1 > 38)
    var.Drum1.DStickU    = (Wiimote1.Exp1 < 25)

    var.Drum1.Purple  = ((Wiimote1.Exp2 & 62) >> 1) = 27
    var.Drum1.Red     = ((Wiimote1.Exp2 & 62) >> 1) = 25
    var.Drum1.Yellow  = ((Wiimote1.Exp2 & 62) >> 1) = 17
    var.Drum1.Blue    = ((Wiimote1.Exp2 & 62) >> 1) = 15
    var.Drum1.Orange  = ((Wiimote1.Exp2 & 62) >> 1) = 14
    var.Drum1.Green   = ((Wiimote1.Exp2 & 62) >> 1) = 18

    var.Drum1.Vel = 1-(((Wiimote1.Exp3 & 224) >> 5))

    var.Drum1.Plus = Wiimote1.Guitar.Plus
    var.Drum1.Minus = Wiimote1.Guitar.Minus
  elseif (var.Wii1P = 2)
    var.Drum2.AStickX = (Wiimote1.Exp0 & 63)
    var.Drum2.AStickY = (Wiimote1.Exp1 & 63)
    var.Drum2.DStickL  = (Wiimote1.Exp0 < 25)
    var.Drum2.DStickR = (Wiimote1.Exp0 > 38)
    var.Drum2.DStickD  = (Wiimote1.Exp1 > 38)
    var.Drum2.DStickU    = (Wiimote1.Exp1 < 25)

    var.Drum2.Purple  = ((Wiimote1.Exp2 & 62) >> 1) = 27
    var.Drum2.Red     = ((Wiimote1.Exp2 & 62) >> 1) = 25
    var.Drum2.Yellow  = ((Wiimote1.Exp2 & 62) >> 1) = 17
    var.Drum2.Blue    = ((Wiimote1.Exp2 & 62) >> 1) = 15
    var.Drum2.Orange  = ((Wiimote1.Exp2 & 62) >> 1) = 14
    var.Drum2.Green   = ((Wiimote1.Exp2 & 62) >> 1) = 18

    var.Drum2.Vel = 1-(((Wiimote1.Exp3 & 224) >> 5))

    var.Drum2.Plus = Wiimote1.Guitar.Plus
    var.Drum2.Minus = Wiimote1.Guitar.Minus
  elseif (var.Wii1P = 3)
    var.Drum3.AStickX = (Wiimote1.Exp0 & 63)
    var.Drum3.AStickY = (Wiimote1.Exp1 & 63)
    var.Drum3.DStickL  = (Wiimote1.Exp0 < 25)
    var.Drum3.DStickR = (Wiimote1.Exp0 > 38)
    var.Drum3.DStickD  = (Wiimote1.Exp1 > 38)
    var.Drum3.DStickU    = (Wiimote1.Exp1 < 25)

    var.Drum3.Purple  = ((Wiimote1.Exp2 & 62) >> 1) = 27
    var.Drum3.Red     = ((Wiimote1.Exp2 & 62) >> 1) = 25
    var.Drum3.Yellow  = ((Wiimote1.Exp2 & 62) >> 1) = 17
    var.Drum3.Blue    = ((Wiimote1.Exp2 & 62) >> 1) = 15
    var.Drum3.Orange  = ((Wiimote1.Exp2 & 62) >> 1) = 14
    var.Drum3.Green   = ((Wiimote1.Exp2 & 62) >> 1) = 18

    var.Drum3.Vel = 1-(((Wiimote1.Exp3 & 224) >> 5))

    var.Drum3.Plus = Wiimote1.Guitar.Plus
    var.Drum3.Minus = Wiimote1.Guitar.Minus
  elseif (var.Wii1P = 4)
    var.Drum4.AStickX = (Wiimote1.Exp0 & 63)
    var.Drum4.AStickY = (Wiimote1.Exp1 & 63)
    var.Drum4.DStickL  = (Wiimote1.Exp0 < 25)
    var.Drum4.DStickR = (Wiimote1.Exp0 > 38)
    var.Drum4.DStickD  = (Wiimote1.Exp1 > 38)
    var.Drum4.DStickU    = (Wiimote1.Exp1 < 25)

    var.Drum4.Purple  = ((Wiimote1.Exp2 & 62) >> 1) = 27
    var.Drum4.Red     = ((Wiimote1.Exp2 & 62) >> 1) = 25
    var.Drum4.Yellow  = ((Wiimote1.Exp2 & 62) >> 1) = 17
    var.Drum4.Blue    = ((Wiimote1.Exp2 & 62) >> 1) = 15
    var.Drum4.Orange  = ((Wiimote1.Exp2 & 62) >> 1) = 14
    var.Drum4.Green   = ((Wiimote1.Exp2 & 62) >> 1) = 18

    var.Drum4.Vel = 1-(((Wiimote1.Exp3 & 224) >> 5))

    var.Drum4.Plus = Wiimote1.Guitar.Plus
    var.Drum4.Minus = Wiimote1.Guitar.Minus
  endif
endif
//Guitar 2
if (var.Wii2I = "GUITAR")
  if (var.Wii2P = 1)
    var.Guitar1.AStickX = (Wiimote2.Exp0 & 63)
    var.Guitar1.AStickY = (Wiimote2.Exp1 & 63)
    var.Guitar1.DStickL  = (Wiimote2.Exp0 < 25)
    var.Guitar1.DStickR = (Wiimote2.Exp0 > 38)
    var.Guitar1.DStickD  = (Wiimote2.Exp1 > 38)
    var.Guitar1.DStickU    = (Wiimote2.Exp1 < 25)

    var.Guitar1.Green   = Wiimote2.Guitar.Fret1
    var.Guitar1.Red     = Wiimote2.Guitar.Fret2
    var.Guitar1.Yellow  = Wiimote2.Guitar.Fret3
    var.Guitar1.Blue    = Wiimote2.Guitar.Fret4
    var.Guitar1.Orange  = Wiimote2.Guitar.Fret5

    var.Guitar1.StrumUp   = Wiimote2.Guitar.StrumUp
    var.Guitar1.StrumDown = Wiimote2.Guitar.StrumDown
    var.Guitar1.Minus = Wiimote2.Guitar.Minus
    var.Guitar1.Plus = Wiimote2.Guitar.Plus

    var.Guitar1.ATilt = Wiimote2.Pitch
    var.Guitar1.DTilt = (var.Guitar1.TiltSensitivity < Wiimote2.Pitch < 100)

    var.Guitar1.AWhammy = (Wiimote2.Exp3 & 31)
    var.Guitar1.DWhammy = ((Wiimote2.Exp3 & 31) > 28)

    var.Guitar1.ASlider = (Wiimote2.Exp2 & 31)
    var.Guitar1.DSliderG = (Wiimote2.Exp2 & 31) = 04
    var.Guitar1.DSliderR = (Wiimote2.Exp2 & 31) = 10
    var.Guitar1.DSliderY = (Wiimote2.Exp2 & 31) = 18 || (Wiimote2.Exp2 & 31) = 19
    var.Guitar1.DSliderB = (Wiimote2.Exp2 & 31) = 23 || (Wiimote2.Exp2 & 31) = 24
    var.Guitar1.DSliderO = (Wiimote2.Exp2 & 31) = 31
  elseif (var.Wii2P = 2)
    var.Guitar2.AStickX = (Wiimote2.Exp0 & 63)
    var.Guitar2.AStickY = (Wiimote2.Exp1 & 63)
    var.Guitar2.DStickL  = (Wiimote2.Exp0 < 25)
    var.Guitar2.DStickR = (Wiimote2.Exp0 > 38)
    var.Guitar2.DStickD  = (Wiimote2.Exp1 > 38)
    var.Guitar2.DStickU    = (Wiimote2.Exp1 < 25)

    var.Guitar2.Green   = Wiimote2.Guitar.Fret1
    var.Guitar2.Red     = Wiimote2.Guitar.Fret2
    var.Guitar2.Yellow  = Wiimote2.Guitar.Fret3
    var.Guitar2.Blue    = Wiimote2.Guitar.Fret4
    var.Guitar2.Orange  = Wiimote2.Guitar.Fret5

    var.Guitar2.StrumUp   = Wiimote2.Guitar.StrumUp
    var.Guitar2.StrumDown = Wiimote2.Guitar.StrumDown
    var.Guitar2.Minus = Wiimote2.Guitar.Minus
    var.Guitar2.Plus = Wiimote2.Guitar.Plus

    var.Guitar2.ATilt = Wiimote2.Pitch
    var.Guitar2.DTilt = (var.Guitar2.TiltSensitivity < Wiimote2.Pitch < 100)

    var.Guitar2.AWhammy = (Wiimote2.Exp3 & 31)
    var.Guitar2.DWhammy = ((Wiimote2.Exp3 & 31) > 28)

    var.Guitar2.ASlider = (Wiimote2.Exp2 & 31)
    var.Guitar2.DSliderG = (Wiimote2.Exp2 & 31) = 04
    var.Guitar2.DSliderR = (Wiimote2.Exp2 & 31) = 10
    var.Guitar2.DSliderY = (Wiimote2.Exp2 & 31) = 18 || (Wiimote2.Exp2 & 31) = 19
    var.Guitar2.DSliderB = (Wiimote2.Exp2 & 31) = 23 || (Wiimote2.Exp2 & 31) = 24
    var.Guitar2.DSliderO = (Wiimote2.Exp2 & 31) = 31
  elseif (var.Wii2P = 3)
    var.Guitar3.AStickX = (Wiimote2.Exp0 & 63)
    var.Guitar3.AStickY = (Wiimote2.Exp1 & 63)
    var.Guitar3.DStickL  = (Wiimote2.Exp0 < 25)
    var.Guitar3.DStickR = (Wiimote2.Exp0 > 38)
    var.Guitar3.DStickD  = (Wiimote2.Exp1 > 38)
    var.Guitar3.DStickU    = (Wiimote2.Exp1 < 25)

    var.Guitar3.Green   = Wiimote2.Guitar.Fret1
    var.Guitar3.Red     = Wiimote2.Guitar.Fret2
    var.Guitar3.Yellow  = Wiimote2.Guitar.Fret3
    var.Guitar3.Blue    = Wiimote2.Guitar.Fret4
    var.Guitar3.Orange  = Wiimote2.Guitar.Fret5

    var.Guitar3.StrumUp   = Wiimote2.Guitar.StrumUp
    var.Guitar3.StrumDown = Wiimote2.Guitar.StrumDown
    var.Guitar3.Minus = Wiimote2.Guitar.Minus
    var.Guitar3.Plus = Wiimote2.Guitar.Plus

    var.Guitar3.ATilt = Wiimote2.Pitch
    var.Guitar3.DTilt = (var.Guitar3.TiltSensitivity < Wiimote2.Pitch < 100)

    var.Guitar3.AWhammy = (Wiimote2.Exp3 & 31)
    var.Guitar3.DWhammy = ((Wiimote2.Exp3 & 31) > 28)

    var.Guitar3.ASlider = (Wiimote2.Exp2 & 31)
    var.Guitar3.DSliderG = (Wiimote2.Exp2 & 31) = 04
    var.Guitar3.DSliderR = (Wiimote2.Exp2 & 31) = 10
    var.Guitar3.DSliderY = (Wiimote2.Exp2 & 31) = 18 || (Wiimote2.Exp2 & 31) = 19
    var.Guitar3.DSliderB = (Wiimote2.Exp2 & 31) = 23 || (Wiimote2.Exp2 & 31) = 24
    var.Guitar3.DSliderO = (Wiimote2.Exp2 & 31) = 31
  elseif (var.Wii2P = 4)
    var.Guitar4.AStickX = (Wiimote2.Exp0 & 63)
    var.Guitar4.AStickY = (Wiimote2.Exp1 & 63)
    var.Guitar4.DStickL  = (Wiimote2.Exp0 < 25)
    var.Guitar4.DStickR = (Wiimote2.Exp0 > 38)
    var.Guitar4.DStickD  = (Wiimote2.Exp1 > 38)
    var.Guitar4.DStickU    = (Wiimote2.Exp1 < 25)

    var.Guitar4.Green   = Wiimote2.Guitar.Fret1
    var.Guitar4.Red     = Wiimote2.Guitar.Fret2
    var.Guitar4.Yellow  = Wiimote2.Guitar.Fret3
    var.Guitar4.Blue    = Wiimote2.Guitar.Fret4
    var.Guitar4.Orange  = Wiimote2.Guitar.Fret5

    var.Guitar4.StrumUp   = Wiimote2.Guitar.StrumUp
    var.Guitar4.StrumDown = Wiimote2.Guitar.StrumDown
    var.Guitar4.Minus = Wiimote2.Guitar.Minus
    var.Guitar4.Plus = Wiimote2.Guitar.Plus

    var.Guitar4.ATilt = Wiimote2.Pitch
    var.Guitar4.DTilt = (var.Guitar4.TiltSensitivity < Wiimote2.Pitch < 100)

    var.Guitar4.AWhammy = (Wiimote2.Exp3 & 31)
    var.Guitar4.DWhammy = ((Wiimote2.Exp3 & 31) > 28)

    var.Guitar4.ASlider = (Wiimote2.Exp2 & 31)
    var.Guitar4.DSliderG = (Wiimote2.Exp2 & 31) = 04
    var.Guitar4.DSliderR = (Wiimote2.Exp2 & 31) = 10
    var.Guitar4.DSliderY = (Wiimote2.Exp2 & 31) = 18 || (Wiimote2.Exp2 & 31) = 19
    var.Guitar4.DSliderB = (Wiimote2.Exp2 & 31) = 23 || (Wiimote2.Exp2 & 31) = 24
    var.Guitar4.DSliderO = (Wiimote2.Exp2 & 31) = 31
  endif
endif
//Drums 2
if (var.Wii2I = "DRUM")
  if (var.Wii2P = 1)
    var.Drum1.AStickX = (Wiimote2.Exp0 & 63)
    var.Drum1.AStickY = (Wiimote2.Exp1 & 63)
    var.Drum1.DStickL  = (Wiimote2.Exp0 < 25)
    var.Drum1.DStickR = (Wiimote2.Exp0 > 38)
    var.Drum1.DStickD  = (Wiimote2.Exp1 > 38)
    var.Drum1.DStickU    = (Wiimote2.Exp1 < 25)

    var.Drum1.Purple  = ((Wiimote2.Exp2 & 62) >> 1) = 27
    var.Drum1.Red     = ((Wiimote2.Exp2 & 62) >> 1) = 25
    var.Drum1.Yellow  = ((Wiimote2.Exp2 & 62) >> 1) = 17
    var.Drum1.Blue    = ((Wiimote2.Exp2 & 62) >> 1) = 15
    var.Drum1.Orange  = ((Wiimote2.Exp2 & 62) >> 1) = 14
    var.Drum1.Green   = ((Wiimote2.Exp2 & 62) >> 1) = 18

    var.Drum1.Vel = 1-(((Wiimote2.Exp3 & 224) >> 5))

    var.Drum1.Plus = Wiimote2.Guitar.Plus
    var.Drum1.Minus = Wiimote2.Guitar.Minus
  elseif (var.Wii2P = 2)
    var.Drum2.AStickX = (Wiimote2.Exp0 & 63)
    var.Drum2.AStickY = (Wiimote2.Exp1 & 63)
    var.Drum2.DStickL  = (Wiimote2.Exp0 < 25)
    var.Drum2.DStickR = (Wiimote2.Exp0 > 38)
    var.Drum2.DStickD  = (Wiimote2.Exp1 > 38)
    var.Drum2.DStickU    = (Wiimote2.Exp1 < 25)

    var.Drum2.Purple  = ((Wiimote2.Exp2 & 62) >> 1) = 27
    var.Drum2.Red     = ((Wiimote2.Exp2 & 62) >> 1) = 25
    var.Drum2.Yellow  = ((Wiimote2.Exp2 & 62) >> 1) = 17
    var.Drum2.Blue    = ((Wiimote2.Exp2 & 62) >> 1) = 15
    var.Drum2.Orange  = ((Wiimote2.Exp2 & 62) >> 1) = 14
    var.Drum2.Green   = ((Wiimote2.Exp2 & 62) >> 1) = 18

    var.Drum2.Vel = 1-(((Wiimote2.Exp3 & 224) >> 5))

    var.Drum2.Plus = Wiimote2.Guitar.Plus
    var.Drum2.Minus = Wiimote2.Guitar.Minus
  elseif (var.Wii2P = 3)
    var.Drum3.AStickX = (Wiimote2.Exp0 & 63)
    var.Drum3.AStickY = (Wiimote2.Exp1 & 63)
    var.Drum3.DStickL  = (Wiimote2.Exp0 < 25)
    var.Drum3.DStickR = (Wiimote2.Exp0 > 38)
    var.Drum3.DStickD  = (Wiimote2.Exp1 > 38)
    var.Drum3.DStickU    = (Wiimote2.Exp1 < 25)

    var.Drum3.Purple  = ((Wiimote2.Exp2 & 62) >> 1) = 27
    var.Drum3.Red     = ((Wiimote2.Exp2 & 62) >> 1) = 25
    var.Drum3.Yellow  = ((Wiimote2.Exp2 & 62) >> 1) = 17
    var.Drum3.Blue    = ((Wiimote2.Exp2 & 62) >> 1) = 15
    var.Drum3.Orange  = ((Wiimote2.Exp2 & 62) >> 1) = 14
    var.Drum3.Green   = ((Wiimote2.Exp2 & 62) >> 1) = 18

    var.Drum3.Vel = 1-(((Wiimote2.Exp3 & 224) >> 5))

    var.Drum3.Plus = Wiimote2.Guitar.Plus
    var.Drum3.Minus = Wiimote2.Guitar.Minus
  elseif (var.Wii2P = 4)
    var.Drum4.AStickX = (Wiimote2.Exp0 & 63)
    var.Drum4.AStickY = (Wiimote2.Exp1 & 63)
    var.Drum4.DStickL  = (Wiimote2.Exp0 < 25)
    var.Drum4.DStickR = (Wiimote2.Exp0 > 38)
    var.Drum4.DStickD  = (Wiimote2.Exp1 > 38)
    var.Drum4.DStickU    = (Wiimote2.Exp1 < 25)

    var.Drum4.Purple  = ((Wiimote2.Exp2 & 62) >> 1) = 27
    var.Drum4.Red     = ((Wiimote2.Exp2 & 62) >> 1) = 25
    var.Drum4.Yellow  = ((Wiimote2.Exp2 & 62) >> 1) = 17
    var.Drum4.Blue    = ((Wiimote2.Exp2 & 62) >> 1) = 15
    var.Drum4.Orange  = ((Wiimote2.Exp2 & 62) >> 1) = 14
    var.Drum4.Green   = ((Wiimote2.Exp2 & 62) >> 1) = 18

    var.Drum4.Vel = 1-(((Wiimote2.Exp3 & 224) >> 5))

    var.Drum4.Plus = Wiimote2.Guitar.Plus
    var.Drum4.Minus = Wiimote2.Guitar.Minus
  endif
endif
//Guitar 3
if (var.Wii3I = "GUITAR")
  if (var.Wii3P = 1)
    var.Guitar1.AStickX = (Wiimote3.Exp0 & 63)
    var.Guitar1.AStickY = (Wiimote3.Exp1 & 63)
    var.Guitar1.DStickL  = (Wiimote3.Exp0 < 25)
    var.Guitar1.DStickR = (Wiimote3.Exp0 > 38)
    var.Guitar1.DStickD  = (Wiimote3.Exp1 > 38)
    var.Guitar1.DStickU    = (Wiimote3.Exp1 < 25)

    var.Guitar1.Green   = Wiimote3.Guitar.Fret1
    var.Guitar1.Red     = Wiimote3.Guitar.Fret2
    var.Guitar1.Yellow  = Wiimote3.Guitar.Fret3
    var.Guitar1.Blue    = Wiimote3.Guitar.Fret4
    var.Guitar1.Orange  = Wiimote3.Guitar.Fret5

    var.Guitar1.StrumUp   = Wiimote3.Guitar.StrumUp
    var.Guitar1.StrumDown = Wiimote3.Guitar.StrumDown
    var.Guitar1.Minus = Wiimote3.Guitar.Minus
    var.Guitar1.Plus = Wiimote3.Guitar.Plus

    var.Guitar1.ATilt = Wiimote3.Pitch
    var.Guitar1.DTilt = (var.Guitar1.TiltSensitivity < Wiimote3.Pitch < 100)

    var.Guitar1.AWhammy = (Wiimote3.Exp3 & 31)
    var.Guitar1.DWhammy = ((Wiimote3.Exp3 & 31) > 28)

    var.Guitar1.ASlider = (Wiimote3.Exp2 & 31)
    var.Guitar1.DSliderG = (Wiimote3.Exp2 & 31) = 04
    var.Guitar1.DSliderR = (Wiimote3.Exp2 & 31) = 10
    var.Guitar1.DSliderY = (Wiimote3.Exp2 & 31) = 18 || (Wiimote3.Exp2 & 31) = 19
    var.Guitar1.DSliderB = (Wiimote3.Exp2 & 31) = 23 || (Wiimote3.Exp2 & 31) = 24
    var.Guitar1.DSliderO = (Wiimote3.Exp2 & 31) = 31
  elseif (var.Wii3P = 2)
    var.Guitar2.AStickX = (Wiimote3.Exp0 & 63)
    var.Guitar2.AStickY = (Wiimote3.Exp1 & 63)
    var.Guitar2.DStickL  = (Wiimote3.Exp0 < 25)
    var.Guitar2.DStickR = (Wiimote3.Exp0 > 38)
    var.Guitar2.DStickD  = (Wiimote3.Exp1 > 38)
    var.Guitar2.DStickU    = (Wiimote3.Exp1 < 25)

    var.Guitar2.Green   = Wiimote3.Guitar.Fret1
    var.Guitar2.Red     = Wiimote3.Guitar.Fret2
    var.Guitar2.Yellow  = Wiimote3.Guitar.Fret3
    var.Guitar2.Blue    = Wiimote3.Guitar.Fret4
    var.Guitar2.Orange  = Wiimote3.Guitar.Fret5

    var.Guitar2.StrumUp   = Wiimote3.Guitar.StrumUp
    var.Guitar2.StrumDown = Wiimote3.Guitar.StrumDown
    var.Guitar2.Minus = Wiimote3.Guitar.Minus
    var.Guitar2.Plus = Wiimote3.Guitar.Plus

    var.Guitar2.ATilt = Wiimote3.Pitch
    var.Guitar2.DTilt = (var.Guitar2.TiltSensitivity < Wiimote3.Pitch < 100)

    var.Guitar2.AWhammy = (Wiimote3.Exp3 & 31)
    var.Guitar2.DWhammy = ((Wiimote3.Exp3 & 31) > 28)

    var.Guitar2.ASlider = (Wiimote3.Exp2 & 31)
    var.Guitar2.DSliderG = (Wiimote3.Exp2 & 31) = 04
    var.Guitar2.DSliderR = (Wiimote3.Exp2 & 31) = 10
    var.Guitar2.DSliderY = (Wiimote3.Exp2 & 31) = 18 || (Wiimote3.Exp2 & 31) = 19
    var.Guitar2.DSliderB = (Wiimote3.Exp2 & 31) = 23 || (Wiimote3.Exp2 & 31) = 24
    var.Guitar2.DSliderO = (Wiimote3.Exp2 & 31) = 31
  elseif (var.Wii3P = 3)
    var.Guitar3.AStickX = (Wiimote3.Exp0 & 63)
    var.Guitar3.AStickY = (Wiimote3.Exp1 & 63)
    var.Guitar3.DStickL  = (Wiimote3.Exp0 < 25)
    var.Guitar3.DStickR = (Wiimote3.Exp0 > 38)
    var.Guitar3.DStickD  = (Wiimote3.Exp1 > 38)
    var.Guitar3.DStickU    = (Wiimote3.Exp1 < 25)

    var.Guitar3.Green   = Wiimote3.Guitar.Fret1
    var.Guitar3.Red     = Wiimote3.Guitar.Fret2
    var.Guitar3.Yellow  = Wiimote3.Guitar.Fret3
    var.Guitar3.Blue    = Wiimote3.Guitar.Fret4
    var.Guitar3.Orange  = Wiimote3.Guitar.Fret5

    var.Guitar3.StrumUp   = Wiimote3.Guitar.StrumUp
    var.Guitar3.StrumDown = Wiimote3.Guitar.StrumDown
    var.Guitar3.Minus = Wiimote3.Guitar.Minus
    var.Guitar3.Plus = Wiimote3.Guitar.Plus

    var.Guitar3.ATilt = Wiimote3.Pitch
    var.Guitar3.DTilt = (var.Guitar3.TiltSensitivity < Wiimote3.Pitch < 100)

    var.Guitar3.AWhammy = (Wiimote3.Exp3 & 31)
    var.Guitar3.DWhammy = ((Wiimote3.Exp3 & 31) > 28)

    var.Guitar3.ASlider = (Wiimote3.Exp2 & 31)
    var.Guitar3.DSliderG = (Wiimote3.Exp2 & 31) = 04
    var.Guitar3.DSliderR = (Wiimote3.Exp2 & 31) = 10
    var.Guitar3.DSliderY = (Wiimote3.Exp2 & 31) = 18 || (Wiimote3.Exp2 & 31) = 19
    var.Guitar3.DSliderB = (Wiimote3.Exp2 & 31) = 23 || (Wiimote3.Exp2 & 31) = 24
    var.Guitar3.DSliderO = (Wiimote3.Exp2 & 31) = 31
  elseif (var.Wii3P = 4)
    var.Guitar4.AStickX = (Wiimote3.Exp0 & 63)
    var.Guitar4.AStickY = (Wiimote3.Exp1 & 63)
    var.Guitar4.DStickL  = (Wiimote3.Exp0 < 25)
    var.Guitar4.DStickR = (Wiimote3.Exp0 > 38)
    var.Guitar4.DStickD  = (Wiimote3.Exp1 > 38)
    var.Guitar4.DStickU    = (Wiimote3.Exp1 < 25)

    var.Guitar4.Green   = Wiimote3.Guitar.Fret1
    var.Guitar4.Red     = Wiimote3.Guitar.Fret2
    var.Guitar4.Yellow  = Wiimote3.Guitar.Fret3
    var.Guitar4.Blue    = Wiimote3.Guitar.Fret4
    var.Guitar4.Orange  = Wiimote3.Guitar.Fret5

    var.Guitar4.StrumUp   = Wiimote3.Guitar.StrumUp
    var.Guitar4.StrumDown = Wiimote3.Guitar.StrumDown
    var.Guitar4.Minus = Wiimote3.Guitar.Minus
    var.Guitar4.Plus = Wiimote3.Guitar.Plus

    var.Guitar4.ATilt = Wiimote3.Pitch
    var.Guitar4.DTilt = (var.Guitar4.TiltSensitivity < Wiimote3.Pitch < 100)

    var.Guitar4.AWhammy = (Wiimote3.Exp3 & 31)
    var.Guitar4.DWhammy = ((Wiimote3.Exp3 & 31) > 28)

    var.Guitar4.ASlider = (Wiimote3.Exp2 & 31)
    var.Guitar4.DSliderG = (Wiimote3.Exp2 & 31) = 04
    var.Guitar4.DSliderR = (Wiimote3.Exp2 & 31) = 10
    var.Guitar4.DSliderY = (Wiimote3.Exp2 & 31) = 18 || (Wiimote3.Exp2 & 31) = 19
    var.Guitar4.DSliderB = (Wiimote3.Exp2 & 31) = 23 || (Wiimote3.Exp2 & 31) = 24
    var.Guitar4.DSliderO = (Wiimote3.Exp2 & 31) = 31
  endif
endif
//Drums 3
if (var.Wii3I = "DRUM")
  if (var.Wii3P = 1)
    var.Drum1.AStickX = (Wiimote3.Exp0 & 63)
    var.Drum1.AStickY = (Wiimote3.Exp1 & 63)
    var.Drum1.DStickL  = (Wiimote3.Exp0 < 25)
    var.Drum1.DStickR = (Wiimote3.Exp0 > 38)
    var.Drum1.DStickD  = (Wiimote3.Exp1 > 38)
    var.Drum1.DStickU    = (Wiimote3.Exp1 < 25)

    var.Drum1.Purple  = ((Wiimote3.Exp2 & 62) >> 1) = 27
    var.Drum1.Red     = ((Wiimote3.Exp2 & 62) >> 1) = 25
    var.Drum1.Yellow  = ((Wiimote3.Exp2 & 62) >> 1) = 17
    var.Drum1.Blue    = ((Wiimote3.Exp2 & 62) >> 1) = 15
    var.Drum1.Orange  = ((Wiimote3.Exp2 & 62) >> 1) = 14
    var.Drum1.Green   = ((Wiimote3.Exp2 & 62) >> 1) = 18

    var.Drum1.Vel = 1-(((Wiimote3.Exp3 & 224) >> 5))

    var.Drum1.Plus = Wiimote3.Guitar.Plus
    var.Drum1.Minus = Wiimote3.Guitar.Minus
  elseif (var.Wii3P = 2)
    var.Drum2.AStickX = (Wiimote3.Exp0 & 63)
    var.Drum2.AStickY = (Wiimote3.Exp1 & 63)
    var.Drum2.DStickL  = (Wiimote3.Exp0 < 25)
    var.Drum2.DStickR = (Wiimote3.Exp0 > 38)
    var.Drum2.DStickD  = (Wiimote3.Exp1 > 38)
    var.Drum2.DStickU    = (Wiimote3.Exp1 < 25)

    var.Drum2.Purple  = ((Wiimote3.Exp2 & 62) >> 1) = 27
    var.Drum2.Red     = ((Wiimote3.Exp2 & 62) >> 1) = 25
    var.Drum2.Yellow  = ((Wiimote3.Exp2 & 62) >> 1) = 17
    var.Drum2.Blue    = ((Wiimote3.Exp2 & 62) >> 1) = 15
    var.Drum2.Orange  = ((Wiimote3.Exp2 & 62) >> 1) = 14
    var.Drum2.Green   = ((Wiimote3.Exp2 & 62) >> 1) = 18

    var.Drum2.Vel = 1-(((Wiimote3.Exp3 & 224) >> 5))

    var.Drum2.Plus = Wiimote3.Guitar.Plus
    var.Drum2.Minus = Wiimote3.Guitar.Minus
  elseif (var.Wii3P = 3)
    var.Drum3.AStickX = (Wiimote3.Exp0 & 63)
    var.Drum3.AStickY = (Wiimote3.Exp1 & 63)
    var.Drum3.DStickL  = (Wiimote3.Exp0 < 25)
    var.Drum3.DStickR = (Wiimote3.Exp0 > 38)
    var.Drum3.DStickD  = (Wiimote3.Exp1 > 38)
    var.Drum3.DStickU    = (Wiimote3.Exp1 < 25)

    var.Drum3.Purple  = ((Wiimote3.Exp2 & 62) >> 1) = 27
    var.Drum3.Red     = ((Wiimote3.Exp2 & 62) >> 1) = 25
    var.Drum3.Yellow  = ((Wiimote3.Exp2 & 62) >> 1) = 17
    var.Drum3.Blue    = ((Wiimote3.Exp2 & 62) >> 1) = 15
    var.Drum3.Orange  = ((Wiimote3.Exp2 & 62) >> 1) = 14
    var.Drum3.Green   = ((Wiimote3.Exp2 & 62) >> 1) = 18

    var.Drum3.Vel = 1-(((Wiimote3.Exp3 & 224) >> 5))

    var.Drum3.Plus = Wiimote3.Guitar.Plus
    var.Drum3.Minus = Wiimote3.Guitar.Minus
  elseif (var.Wii3P = 4)
    var.Drum4.AStickX = (Wiimote3.Exp0 & 63)
    var.Drum4.AStickY = (Wiimote3.Exp1 & 63)
    var.Drum4.DStickL  = (Wiimote3.Exp0 < 25)
    var.Drum4.DStickR = (Wiimote3.Exp0 > 38)
    var.Drum4.DStickD  = (Wiimote3.Exp1 > 38)
    var.Drum4.DStickU    = (Wiimote3.Exp1 < 25)

    var.Drum4.Purple  = ((Wiimote3.Exp2 & 62) >> 1) = 27
    var.Drum4.Red     = ((Wiimote3.Exp2 & 62) >> 1) = 25
    var.Drum4.Yellow  = ((Wiimote3.Exp2 & 62) >> 1) = 17
    var.Drum4.Blue    = ((Wiimote3.Exp2 & 62) >> 1) = 15
    var.Drum4.Orange  = ((Wiimote3.Exp2 & 62) >> 1) = 14
    var.Drum4.Green   = ((Wiimote3.Exp2 & 62) >> 1) = 18

    var.Drum4.Vel = 1-(((Wiimote3.Exp3 & 224) >> 5))

    var.Drum4.Plus = Wiimote3.Guitar.Plus
    var.Drum4.Minus = Wiimote3.Guitar.Minus
  endif
endif
//Guitar 4
if (var.Wii4I = "GUITAR")
  if (var.Wii4P = 1)
    var.Guitar1.AStickX = (Wiimote4.Exp0 & 63)
    var.Guitar1.AStickY = (Wiimote4.Exp1 & 63)
    var.Guitar1.DStickL  = (Wiimote4.Exp0 < 25)
    var.Guitar1.DStickR = (Wiimote4.Exp0 > 38)
    var.Guitar1.DStickD  = (Wiimote4.Exp1 > 38)
    var.Guitar1.DStickU    = (Wiimote4.Exp1 < 25)

    var.Guitar1.Green   = Wiimote4.Guitar.Fret1
    var.Guitar1.Red     = Wiimote4.Guitar.Fret2
    var.Guitar1.Yellow  = Wiimote4.Guitar.Fret3
    var.Guitar1.Blue    = Wiimote4.Guitar.Fret4
    var.Guitar1.Orange  = Wiimote4.Guitar.Fret5

    var.Guitar1.StrumUp   = Wiimote4.Guitar.StrumUp
    var.Guitar1.StrumDown = Wiimote4.Guitar.StrumDown
    var.Guitar1.Minus = Wiimote4.Guitar.Minus
    var.Guitar1.Plus = Wiimote4.Guitar.Plus

    var.Guitar1.ATilt = Wiimote4.Pitch
    var.Guitar1.DTilt = (var.Guitar1.TiltSensitivity < Wiimote4.Pitch < 100)

    var.Guitar1.AWhammy = (Wiimote4.Exp3 & 31)
    var.Guitar1.DWhammy = ((Wiimote4.Exp3 & 31) > 28)

    var.Guitar1.ASlider = (Wiimote4.Exp2 & 31)
    var.Guitar1.DSliderG = (Wiimote4.Exp2 & 31) = 04
    var.Guitar1.DSliderR = (Wiimote4.Exp2 & 31) = 10
    var.Guitar1.DSliderY = (Wiimote4.Exp2 & 31) = 18 || (Wiimote4.Exp2 & 31) = 19
    var.Guitar1.DSliderB = (Wiimote4.Exp2 & 31) = 23 || (Wiimote4.Exp2 & 31) = 24
    var.Guitar1.DSliderO = (Wiimote4.Exp2 & 31) = 31
  elseif (var.Wii4P = 2)
    var.Guitar2.AStickX = (Wiimote4.Exp0 & 63)
    var.Guitar2.AStickY = (Wiimote4.Exp1 & 63)
    var.Guitar2.DStickL  = (Wiimote4.Exp0 < 25)
    var.Guitar2.DStickR = (Wiimote4.Exp0 > 38)
    var.Guitar2.DStickD  = (Wiimote4.Exp1 > 38)
    var.Guitar2.DStickU    = (Wiimote4.Exp1 < 25)

    var.Guitar2.Green   = Wiimote4.Guitar.Fret1
    var.Guitar2.Red     = Wiimote4.Guitar.Fret2
    var.Guitar2.Yellow  = Wiimote4.Guitar.Fret3
    var.Guitar2.Blue    = Wiimote4.Guitar.Fret4
    var.Guitar2.Orange  = Wiimote4.Guitar.Fret5

    var.Guitar2.StrumUp   = Wiimote4.Guitar.StrumUp
    var.Guitar2.StrumDown = Wiimote4.Guitar.StrumDown
    var.Guitar2.Minus = Wiimote4.Guitar.Minus
    var.Guitar2.Plus = Wiimote4.Guitar.Plus

    var.Guitar2.ATilt = Wiimote4.Pitch
    var.Guitar2.DTilt = (var.Guitar2.TiltSensitivity < Wiimote4.Pitch < 100)

    var.Guitar2.AWhammy = (Wiimote4.Exp3 & 31)
    var.Guitar2.DWhammy = ((Wiimote4.Exp3 & 31) > 28)

    var.Guitar2.ASlider = (Wiimote4.Exp2 & 31)
    var.Guitar2.DSliderG = (Wiimote4.Exp2 & 31) = 04
    var.Guitar2.DSliderR = (Wiimote4.Exp2 & 31) = 10
    var.Guitar2.DSliderY = (Wiimote4.Exp2 & 31) = 18 || (Wiimote4.Exp2 & 31) = 19
    var.Guitar2.DSliderB = (Wiimote4.Exp2 & 31) = 23 || (Wiimote4.Exp2 & 31) = 24
    var.Guitar2.DSliderO = (Wiimote4.Exp2 & 31) = 31
  elseif (var.Wii4P = 3)
    var.Guitar3.AStickX = (Wiimote4.Exp0 & 63)
    var.Guitar3.AStickY = (Wiimote4.Exp1 & 63)
    var.Guitar3.DStickL  = (Wiimote4.Exp0 < 25)
    var.Guitar3.DStickR = (Wiimote4.Exp0 > 38)
    var.Guitar3.DStickD  = (Wiimote4.Exp1 > 38)
    var.Guitar3.DStickU    = (Wiimote4.Exp1 < 25)

    var.Guitar3.Green   = Wiimote4.Guitar.Fret1
    var.Guitar3.Red     = Wiimote4.Guitar.Fret2
    var.Guitar3.Yellow  = Wiimote4.Guitar.Fret3
    var.Guitar3.Blue    = Wiimote4.Guitar.Fret4
    var.Guitar3.Orange  = Wiimote4.Guitar.Fret5

    var.Guitar3.StrumUp   = Wiimote4.Guitar.StrumUp
    var.Guitar3.StrumDown = Wiimote4.Guitar.StrumDown
    var.Guitar3.Minus = Wiimote4.Guitar.Minus
    var.Guitar3.Plus = Wiimote4.Guitar.Plus

    var.Guitar3.ATilt = Wiimote4.Pitch
    var.Guitar3.DTilt = (var.Guitar3.TiltSensitivity < Wiimote4.Pitch < 100)

    var.Guitar3.AWhammy = (Wiimote4.Exp3 & 31)
    var.Guitar3.DWhammy = ((Wiimote4.Exp3 & 31) > 28)

    var.Guitar3.ASlider = (Wiimote4.Exp2 & 31)
    var.Guitar3.DSliderG = (Wiimote4.Exp2 & 31) = 04
    var.Guitar3.DSliderR = (Wiimote4.Exp2 & 31) = 10
    var.Guitar3.DSliderY = (Wiimote4.Exp2 & 31) = 18 || (Wiimote4.Exp2 & 31) = 19
    var.Guitar3.DSliderB = (Wiimote4.Exp2 & 31) = 23 || (Wiimote4.Exp2 & 31) = 24
    var.Guitar3.DSliderO = (Wiimote4.Exp2 & 31) = 31
  elseif (var.Wii4P = 4)
    var.Guitar4.AStickX = (Wiimote4.Exp0 & 63)
    var.Guitar4.AStickY = (Wiimote4.Exp1 & 63)
    var.Guitar4.DStickL  = (Wiimote4.Exp0 < 25)
    var.Guitar4.DStickR = (Wiimote4.Exp0 > 38)
    var.Guitar4.DStickD  = (Wiimote4.Exp1 > 38)
    var.Guitar4.DStickU    = (Wiimote4.Exp1 < 25)

    var.Guitar4.Green   = Wiimote4.Guitar.Fret1
    var.Guitar4.Red     = Wiimote4.Guitar.Fret2
    var.Guitar4.Yellow  = Wiimote4.Guitar.Fret3
    var.Guitar4.Blue    = Wiimote4.Guitar.Fret4
    var.Guitar4.Orange  = Wiimote4.Guitar.Fret5

    var.Guitar4.StrumUp   = Wiimote4.Guitar.StrumUp
    var.Guitar4.StrumDown = Wiimote4.Guitar.StrumDown
    var.Guitar4.Minus = Wiimote4.Guitar.Minus
    var.Guitar4.Plus = Wiimote4.Guitar.Plus

    var.Guitar4.ATilt = Wiimote4.Pitch
    var.Guitar4.DTilt = (var.Guitar4.TiltSensitivity < Wiimote4.Pitch < 100)

    var.Guitar4.AWhammy = (Wiimote4.Exp3 & 31)
    var.Guitar4.DWhammy = ((Wiimote4.Exp3 & 31) > 28)

    var.Guitar4.ASlider = (Wiimote4.Exp2 & 31)
    var.Guitar4.DSliderG = (Wiimote4.Exp2 & 31) = 04
    var.Guitar4.DSliderR = (Wiimote4.Exp2 & 31) = 10
    var.Guitar4.DSliderY = (Wiimote4.Exp2 & 31) = 18 || (Wiimote4.Exp2 & 31) = 19
    var.Guitar4.DSliderB = (Wiimote4.Exp2 & 31) = 23 || (Wiimote4.Exp2 & 31) = 24
    var.Guitar4.DSliderO = (Wiimote4.Exp2 & 31) = 31
  endif
endif
//Drums 4
if (var.Wii4I = "DRUM")
  if (var.Wii4P = 1)
    var.Drum1.AStickX = (Wiimote4.Exp0 & 63)
    var.Drum1.AStickY = (Wiimote4.Exp1 & 63)
    var.Drum1.DStickL  = (Wiimote4.Exp0 < 25)
    var.Drum1.DStickR = (Wiimote4.Exp0 > 38)
    var.Drum1.DStickD  = (Wiimote4.Exp1 > 38)
    var.Drum1.DStickU    = (Wiimote4.Exp1 < 25)

    var.Drum1.Purple  = ((Wiimote4.Exp2 & 62) >> 1) = 27
    var.Drum1.Red     = ((Wiimote4.Exp2 & 62) >> 1) = 25
    var.Drum1.Yellow  = ((Wiimote4.Exp2 & 62) >> 1) = 17
    var.Drum1.Blue    = ((Wiimote4.Exp2 & 62) >> 1) = 15
    var.Drum1.Orange  = ((Wiimote4.Exp2 & 62) >> 1) = 14
    var.Drum1.Green   = ((Wiimote4.Exp2 & 62) >> 1) = 18

    var.Drum1.Vel = 1-(((Wiimote4.Exp3 & 224) >> 5))

    var.Drum1.Plus = Wiimote4.Guitar.Plus
    var.Drum1.Minus = Wiimote4.Guitar.Minus
  elseif (var.Wii4P = 2)
    var.Drum2.AStickX = (Wiimote4.Exp0 & 63)
    var.Drum2.AStickY = (Wiimote4.Exp1 & 63)
    var.Drum2.DStickL  = (Wiimote4.Exp0 < 25)
    var.Drum2.DStickR = (Wiimote4.Exp0 > 38)
    var.Drum2.DStickD  = (Wiimote4.Exp1 > 38)
    var.Drum2.DStickU    = (Wiimote4.Exp1 < 25)

    var.Drum2.Purple  = ((Wiimote4.Exp2 & 62) >> 1) = 27
    var.Drum2.Red     = ((Wiimote4.Exp2 & 62) >> 1) = 25
    var.Drum2.Yellow  = ((Wiimote4.Exp2 & 62) >> 1) = 17
    var.Drum2.Blue    = ((Wiimote4.Exp2 & 62) >> 1) = 15
    var.Drum2.Orange  = ((Wiimote4.Exp2 & 62) >> 1) = 14
    var.Drum2.Green   = ((Wiimote4.Exp2 & 62) >> 1) = 18

    var.Drum2.Vel = 1-(((Wiimote4.Exp3 & 224) >> 5))

    var.Drum2.Plus = Wiimote4.Guitar.Plus
    var.Drum2.Minus = Wiimote4.Guitar.Minus
  elseif (var.Wii4P = 3)
    var.Drum3.AStickX = (Wiimote4.Exp0 & 63)
    var.Drum3.AStickY = (Wiimote4.Exp1 & 63)
    var.Drum3.DStickL  = (Wiimote4.Exp0 < 25)
    var.Drum3.DStickR = (Wiimote4.Exp0 > 38)
    var.Drum3.DStickD  = (Wiimote4.Exp1 > 38)
    var.Drum3.DStickU    = (Wiimote4.Exp1 < 25)

    var.Drum3.Purple  = ((Wiimote4.Exp2 & 62) >> 1) = 27
    var.Drum3.Red     = ((Wiimote4.Exp2 & 62) >> 1) = 25
    var.Drum3.Yellow  = ((Wiimote4.Exp2 & 62) >> 1) = 17
    var.Drum3.Blue    = ((Wiimote4.Exp2 & 62) >> 1) = 15
    var.Drum3.Orange  = ((Wiimote4.Exp2 & 62) >> 1) = 14
    var.Drum3.Green   = ((Wiimote4.Exp2 & 62) >> 1) = 18

    var.Drum3.Vel = 1-(((Wiimote4.Exp3 & 224) >> 5))

    var.Drum3.Plus = Wiimote4.Guitar.Plus
    var.Drum3.Minus = Wiimote4.Guitar.Minus
  elseif (var.Wii4P = 4)
    var.Drum4.AStickX = (Wiimote4.Exp0 & 63)
    var.Drum4.AStickY = (Wiimote4.Exp1 & 63)
    var.Drum4.DStickL  = (Wiimote4.Exp0 < 25)
    var.Drum4.DStickR = (Wiimote4.Exp0 > 38)
    var.Drum4.DStickD  = (Wiimote4.Exp1 > 38)
    var.Drum4.DStickU    = (Wiimote4.Exp1 < 25)

    var.Drum4.Purple  = ((Wiimote4.Exp2 & 62) >> 1) = 27
    var.Drum4.Red     = ((Wiimote4.Exp2 & 62) >> 1) = 25
    var.Drum4.Yellow  = ((Wiimote4.Exp2 & 62) >> 1) = 17
    var.Drum4.Blue    = ((Wiimote4.Exp2 & 62) >> 1) = 15
    var.Drum4.Orange  = ((Wiimote4.Exp2 & 62) >> 1) = 14
    var.Drum4.Green   = ((Wiimote4.Exp2 & 62) >> 1) = 18

    var.Drum4.Vel = 1-(((Wiimote4.Exp3 & 224) >> 5))

    var.Drum4.Plus = Wiimote4.Guitar.Plus
    var.Drum4.Minus = Wiimote4.Guitar.Minus
  endif
endif

//Show calibration values when enabled.
if (var.calibrate)
  debug = ""
  debug += "Joystick X/Y: "+var.Guitar1.AStickX+", "+var.Guitar1.AStickY
  debug += " Whammy: "+var.Guitar1.AWhammy
  debug += " Slide Bar (GH:WT): "+var.Guitar1.ASlider
  debug += " Tilt Position: "+var.Guitar1.ATilt
endif


Instructions/Getting Started:

Connect your Wiimote to your PC via a wireless Bluetooth adapter.
--Your Wiimote's LEDs will be blinking.
Run the script.
--Your Wiimote's LEDs will be blinking slower now, and the Debug Bar at the top will show a ??? next to all of the connected Wiimotes. Any Wiimotes that are not connected will show D/C in the Debug Bar.
Plug your Guitar or Drum controller in now, if it's not already.
--No visual feedback.
Press 1 on your Wiimote if it's plugged into a Guitar controller, or 2 if it's plugged into a Drum controller.
--The Debug Bar at the bar will now tell you if a Guitar or a Drum controller is plugged into the corresponding Wiimote.
Press Up on the Wiimote's D-Pad to set yourself as Player 1, Right for Player 2, Down for Player 3, or Left for Player 4.
--The corresponding LED on your Wiimote will light up, and the other LEDs will turn off..
Press the Home button on your Wiimote to unset yourself as that player.
--The Wiimote's LEDs will all start blinking again.
Press the Plus button on your Wiimote.
--The Wiimote's LEDs will light up depending on how much battery power is left (4 LEDs - Full charge, 1 LED - Replace batteries)

Reference Manual:

Options:
--Replace the # where it says, Guitar#, or Drum# with the corresponding Player number.

var.Guitar#.AnalogStick (true or false)
--This variable tells the script that the joystick will report analog values to PPJoy (true) or will directly modify the keys set in the Controls section (false).
var.Guitar#.AStickXMin (real)
var.Guitar#.AStickXMax (real)
--These variables tell the script that the joystick's minimum X and maximum X (left and right) values reported to PPJoy are calibrated to be within the specified range.
var.Guitar#.AStickYMin (real)
var.Guitar#.AStickYMax (real)
--These variables tell the script that the joystick's minimum Y and maximum Y (up and down) values reported to PPJoy are calibrated to be within the specified range.
var.Guitar#.AnalogWhammy (true or false)
--This variable tells the script that the whammy bar will report analog values to PPJoy (true) or will directly modify the key set in the Controls section (false).
var.Guitar#.AWhammyMin (real)
var.Guitar#.AWhammyMax (real)
--These variables tell the script that the whammy bar's minimum and maximum (released and pressed) values reported to PPJoy are calibrated to be within the specified range.
var.Guitar#.HasSlider (true or false)
--This variable tells the script that the slider bar/touch strip exists (true) or doesn't exist (false).
var.Guitar#.AnalogSlider (true or false)
--This variable tells the script that the slider bar/touch strip will report analog values to PPJoy (true) or will directly modify the keys set in the Controls section (false).
var.Guitar#.ASliderMin (real)
var.Guitar#.ASliderMax (real)
--These variables tell the script that the slider bar/touch strip's minimum and maximum (released and pressed) values reported to PPJoy are calibrated to be within the specified range.
var.Guitar#.AnalogTilt (true or false)
--This variable tells the script that the tilt sensor will report analog values to PPJoy (true) or will directly modify the key set in the Controls section (false).
var.Guitar#.Tilt Sensitivity (real)
--This variable tells the script that the slider bar/touch strip exists (true) or doesn't exist (false).
var.Drum#.AnalogStick (true or false)
--This variable tells the script that the joystick will report analog values to PPJoy (true) or will directly modify the keys set in the Controls section (false).
var.Drum#.AStickXMin (real)
var.Drum#.AStickXMax (real)
--These variables tell the script that the joystick's minimum X and maximum X (left and right) values reported to PPJoy are calibrated to be within the specified range.
var.Drum#.AStickYMin (real)
var.Drum#.AStickYMax (real)
--These variables tell the script that the joystick's minimum Y and maximum Y (down and up) values reported to PPJoy are calibrated to be within the specified range.
var.calibrate (true or false)
--This variable tells the script to replace the default Debug Bar with an informative bar about the position of joystick axes, current whammy position, current slide bar/touch strip fret pressed, and current tilt position of Player 1 (true), or not (false). This variable will allow you to calibrate your joystick axes, whammy bar, and slide bar/touch strip.

Controls:
--Replace the # where it says, Guitar#, or Drum# with the corresponding Player number.

var.Guitar#.StrumUp
--Pulling the strum bar towards you, scrolls setlist up
var.Guitar#.StrumDown
--Pushing the strum bar away from you, scrolls setlist down
var.Guitar#.Green
--Confirms your selection
var.Guitar#.Red
--Goes back to the previous menu
var.Guitar#.Yellow
--Previews your currently highlighted song (Not working for me, but yellow works in-game. FoFiX Bug?)
var.Guitar#.Blue
--
var.Guitar#.Orange
--
var.Guitar#.DStickL
--Joystick when pushed left (when var.Guitar#.AnalogStick is false)
var.Guitar#.DStickR
--Joystick when pushed right (when var.Guitar#.AnalogStick is false)
var.Guitar#.DStickU
--Joystick when pulled up, scrolls setlist up (when var.Guitar#.AnalogStick is false)
var.Guitar#.DStickD
--Joystick when pushed down, scrolls setlist down (when var.Guitar#.AnalogStick is false)
var.Guitar#.Plus
--Pauses game
var.Guitar#.Minus
--Activates starpower
var.Guitar#.DTilt
--Tilting the guitar up, above the threshold specified with var.Guitar#.Tilt Sensitivity, activates starpower (when var.Guitar#.AnalogTilt is false)
var.Guitar#.DWhammy
--Pressing the whammy bar in, activates that one wooey-wooey effect like in Guitar Hero (supposed to, but more like mutes the track). XD (when var.Guitar#.AnalogWhammy is false)
var.Guitar#.DSliderG
--First slider fret below standard fret buttons (GH:WT Guitar only) (when var.Guitar#.AnalogSlider is false)
var.Guitar#.DSliderR
--Second slider fret below standard fret buttons (GH:WT Guitar only) (when var.Guitar#.AnalogSlider is false)
var.Guitar#.DSliderY
--Third slider fret below standard fret buttons (GH:WT Guitar only) (when var.Guitar#.AnalogSlider is false)
var.Guitar#.DSliderB
--Fourth slider fret below standard fret buttons (GH:WT Guitar only) (when var.Guitar#.AnalogSlider is false)
var.Guitar#.DSliderO
--Fifth slider fret below standard fret buttons (GH:WT Guitar only) (when var.Guitar#.AnalogSlider is false)
var.Drum#.Purple
--Foot pedal
var.Drum#.Red
--Left Drum pad
var.Drum#.Yellow
--Left Cymbal pad
var.Drum#.Blue
--Left Drum pad
var.Drum#.Orange
--Right Cymbal pad (when supported, we'll be ready. =) )
var.Drum#.Green
--Right Drum pad
var.Drum#.DStickL
--Joystick when pushed left (when var.Drum#.AnalogStick is false)
var.Drum#.DStickR
--Joystick when pushed right (when var.Drum#.AnalogStick is false)
var.Drum#.DStickU
--Joystick when pushed up, scrolls setlist up (when var.Drum#.AnalogStick is false)
var.Drum#.DStickD
--Joystick when pulled down, scrolls setlist down (when var.Drum#.AnalogStick is false)
var.Drum#.Plus
--Pauses game
var.Drum#.Minus
--Activates starpower

Troubleshooting:
When running the script, my Wiimote isn't recognized by GlovePIE and the Debug Bar reads D/C on all Wiimotes.
--If the Wiimote's LEDs aren't blinking at all, or they stopped blinking when the script was running, try reconnecting your Wiimote to your PC.
--If the Wiimote's LEDs are blinking, but haven't stopped blinking, try enabling the Bluetooth Fix in GlovePIE's TroubleShooter menu.

Holy crap, I wrote a lot. At least I can say to RTFM if someone asks a question that's listed in here. I'd only do that just to be mean though, and I'm not like that.

Anything that seems vague or needs clarifying, or if it looks like I missed something, let me know. I know I'm going to revise this script for some time. Some things that should be in the documentation, I intentionally left if either because I would change it soon or it's not supposed to be edited by novices. Comments are welcome. I am also open to suggestions, though I can't guarantee your suggestion will be included in the script. All of these are welcome as long as it abides by the forum rules.

Have fun, enjoy, knock yourself out, whatever. "Just don't do anything the good lord wouldn't do." - Harold and Kumar Go to White Castle

Changelog:

1.0b - Minor issue with drums not working, fixed now.

1.0a - Corrected potential error with LEDs on Wiimotes 3 and 4

1.0 - Initial Release

EDIT: Added Version tag (Because I may update the script eventually, and then you will know if you have the latest version or not. If your script doesn't have a version tag in it, it's version 1.0 so you might consider adding it.).
Last edited by Spikehead777 on Sun Jun 21, 2009 1:34 pm, edited 3 times in total.
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.
Blue Heaven!
User avatar
death_au
Member
Posts: 3991
Joined: December 12th, 2007
Location: Australia
Reputation: 5
Contact:

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared!

Postby death_au » Sun Jun 14, 2009 6:17 am

:2thumbsup:
This looks nice. I looks like where my script was probably headed, but as I keep stating, I have little time and equipment to test. When and if I get my equipment up and running again, I will definitely be using this script. (although I'd like to see some others use this script to see how it works for everyone else)

In fact, if this script gets positive reviews from others, I may close my other thread.
kirezar
Member
Posts: 115
Joined: August 30th, 2008
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared!

Postby kirezar » Sun Jun 14, 2009 12:13 pm

I tested the script today for guitars and it works great, I couldn't connect the drums when I tried, but was probably my error, great script

death_au don't close your thread
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared!

Postby Spikehead777 » Sun Jun 21, 2009 1:20 pm

kirezar wrote:I tested the script today for guitars and it works great, I couldn't connect the drums when I tried, but was probably my error, great script

death_au don't close your thread


Well, you could've connected the drums, but they wouldn't work anyways. I'm working on a fix for that right now, but in the mean time, if you absolutely need to use the drums, you can use death_au's script with my modifications to it. I will edit this post and the first post when I can update on the issue.

EDIT: A little hasty with posting...I should also say that when I first tested drums with my own script, they worked fine. Now, something happened, and now they don't work anymore. =/ Oh well, bugs happen.

EDIT2: *Faceplant* Doh! That's not good...I put "DRUMS" instead of "DRUM". =P Script works fine here now on my end.
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.
Blue Heaven!
User avatar
death_au
Member
Posts: 3991
Joined: December 12th, 2007
Location: Australia
Reputation: 5
Contact:

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared!

Postby death_au » Sun Jun 21, 2009 7:11 pm

Spikehead777 wrote:EDIT2: *Faceplant* Doh! That's not good...I put "DRUMS" instead of "DRUM". =P Script works fine here now on my end.

Hahaha :laugh:
I hate those errors. I get them all the time.
I luv Fallout!!!
User avatar
sonicandshadow97
Member
Posts: 926
Joined: January 21st, 2009
Location: Playin' Fallout 3
Reputation: 3

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby sonicandshadow97 » Sun Jun 21, 2009 7:47 pm

I gotta check this out.
Image Image
Check out my songs. My most recent one is On the Backs of Angels by Dream Theater (Soon to be upped) And I am working on The Mob Rules by Adrenaline Mob.
D Mon
Member
Posts: 1
Joined: July 13th, 2009
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby D Mon » Tue Jul 14, 2009 1:28 pm

my wiimote is blinking slowy
ly but pressing 1, up, +, or home doesnt do anything even though its in the WT controler
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby Spikehead777 » Thu Jul 16, 2009 7:03 pm

D Mon wrote:my wiimote is blinking slowy
ly but pressing 1, up, +, or home doesnt do anything even though its in the WT controler


I'm going to have to ask a few questions.

First, when you run the script, does the debug bar say "???" on any Wiimote? If there's no "???", then either one of two things needs to happen:
You'll need to toggle the Bluetooth Fix in GlovePIE's TroubleShooter menu (toggle as in, turn it on if it's off, or turn it off if it's on.).
You'll need to unplug and replug your guitar or drum controller from the Wiimote.
You'll need to reconnect your Wiimote to the PC.

If there is a "???", then either something weird is happening or it's just user error.
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.
pingspongz
Member
Posts: 9
Joined: July 16th, 2009
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby pingspongz » Fri Jul 17, 2009 3:19 am

hi... I have a Nyko Wii Guitar (frontman). It works with ALL Guitar Hero games and Rock band 2. Im trying to use it on PC but I cant !!!

I already tried all scripts i found... Today I tested death_au script and it didnt work. He said to try yours, but when I use it my keyboard and/or mouse get crazy! Dont stop scrolling to the right and down. But I managed to enter on frets on fire to test and its not working too.

I cant understand.... Why??? help me man!! I need it.. especially now with Guitar Hero world tour for PC !!

ps: wiimote works perfectly.
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby Spikehead777 » Fri Jul 17, 2009 4:50 am

Hmm, I just replied to your other post on death_au's topic. Lol. XD

I see what's happening. I get this problem too in FoF with PPJoy virtual joysticks. However, I have considered it a non-issue because it stops after you tell the script what type of controller it is and which player it belongs to. If your Wiimote is working fine in GlovePIE, then your guitar should work fine too.

First of all, do you have GlovePIE 3.0? If not, I'd suggest grabbing a copy of that up first and then trying the scripts again before trying anything else.

Second, did you read the "Instructions/Getting Started:" section right under the script in the first post?

Since your Wiimote works fine, I shouldn't have to say anything else. It'll either be a problem with GlovePIE or a problem with my script. I'm not going to try to fix a controller with a short in the first three inches of cable coming out of the controller with duct tape. Oh wait. I already did. XD
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.
pingspongz
Member
Posts: 9
Joined: July 16th, 2009
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby pingspongz » Fri Jul 17, 2009 8:33 pm

so I will keep posting there, to be less confusing... thank you again!

ps: still not working =(
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby Spikehead777 » Sat Jul 18, 2009 9:57 am

pingspongz wrote:so I will keep posting there, to be less confusing... thank you again!

ps: still not working =(


I'd rather keep discussion about a script I created in a topic about the same script that I created, not a topic about a script that death_au made. =)

pingspongz wrote:Im using gloepie 0.3 ... yes.... and i tried 0.29 too.

Tried both scripts and others that i found... Bluetooth fix not helped.

Spike, i readed all our informations about your script. My keyboard and mouse get crazy AFTER I choose guitar and player.

HEEEEEEEEELP !

ps: sorry my poor english.. i´m brazilian.


Keyboard and mouse get crazy? Unless you changed the default settings, only the keyboard should be having problems. I'm looking through the script right now (I have two versions of the script: a private version and a public version. The private version is basically my own default settings that I like; nothing else is different about either version).

Anyways, what I want you to do, is to scroll down a bit until you see:

Code: Select all

//////////////////////////////////CALIBRATION///////////////////////////////////
//The following function allows you to see debug values for calibrating.
//You should calibrate all of your axes in this script if you have PPJoy
//installed and you have the options to use analog axes enabled. 2 or more PPJoy
//virtual joysticks must be installed when playing with 2 or more players,
//unless you change all of the ppjoy commands in the controls list to use
//ppjoy1. Note, this only lets you see unfiltered values without the calibration
//in effect.
var.calibrate = false


Change that last line to "var.calibrate = true" (No quotes) and run the script. The debug bar that pops up next to the run button will allow you to see some information about calibration. If your keyboard goes crazy, then some calibration values might be wrong. Just play with the joystick, wiggle the whammy bar, and tilt the guitar up and tell me what values you see. The values for the joystick should both be between 0-63, the values for the whammy bar should be between 0-31, and the values for the tilt sensor, it should be 0-90 degrees. When the joystick is not pressed in any direction, the values should be between 25 and 38. Please post what values you are getting.

My prediction is that, with your guitar, the joystick center for right and down lie just above 38 or so, causing the constant scrolling down and right. If this is true, then I need to add in another variable to change. XD

Okay, somewhere between the sacred silence and sleep, something went wrong with my script. I did a quick test of using "digital" inputs, and somehow, with emulating the keyboard, it constantly registers keydown presses really fast. This means that in FoFiX, pressing the joystick with var.GuitarX.AnalogStick false, the game will scroll through the options, really fast. I guess this means that the rewrite I was planning to do is going to come sooner than I thought, huh? =/ For now, if you want to reliably use my script with the joystick, var.GuitarX.AnalogStick needs to be true, and at least one PPJoy Joystick needs to be installed. Personally though, I only use the strum bar when scrolling through songs, rather than the joystick. =)


EDIT: I am always screwing up quote tags on this forum... -_-

EDIT2: Important info.
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.
pingspongz
Member
Posts: 9
Joined: July 16th, 2009
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby pingspongz » Sat Jul 18, 2009 4:43 pm

man.. its very difficult to me explain the problems in english hehehe.. but i will try:

i did what u said... When I use calibration true and press wiimote down or up, the keyboard start getting crazy (yes its only the keyboard).

the values are joy 46,46 whammy 14 slide 14 ... tilt value sometimes freeze, probably a bug because of the keyboard pressing too fast.
Sometimes joy value changed to 63,63 ... and back to 46...
Dont matter what I press (joy, whammy, buttons), nothing happens and values dont change. Only tilt (when it not freeze).


I tried to use "var.Guitar1.AnalogStick = true" like u said... the keyboard seemed to stop going to right and down. But sometimes the screen still goes UP or DOWN, but I could manage to enter Frets on Fire and tried to configurate guitar keys..... nothing happens! none of the buttons are working, neither pick.

any other suggestion? thank you for your attention, im very grateful.

---- EDIT ----

spike.. I know its not about your script, but maybe you could help me with another problem:

I got Guitar Hero World Tour for PC ... I wanted to use my Eletronic Drum (Yamaha DTXpress 3). I have a midi cable, its working OK with other games like DTX Mania. But I cant manage to use it with GHWT, cause its accept only KEYBOARD or GHWT DRUM KIT.

I thought it was easy to find a program to bind my midi device to work as a pc keyboard, so I could use it with KEYBOARD option. But I cant find. When I try to google about it, I only find the opposite: using keyboard to simulate midi.

Maybe glovepie could help me with this? Do u have any other idea?

Thank you AGAIN!
massagedetq
Member
Posts: 35
Joined: November 14th, 2008
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby massagedetq » Sat Jul 18, 2009 7:36 pm

How to install that script?
User avatar
Spikehead777
Member
Posts: 450
Joined: November 18th, 2007
Location: See Toxicity Lyrics.
Reputation: 0

Re: A wild Wii GH3/WT/Drums GlovePIE script has appeared! v1.0a

Postby Spikehead777 » Sun Jul 19, 2009 3:32 am

pingspongz wrote:man.. its very difficult to me explain the problems in english hehehe.. but i will try:


You're doing well. =)

i did what u said... When I use calibration true and press wiimote down or up, the keyboard start getting crazy (yes its only the keyboard).

the values are joy 46,46 whammy 14 slide 14 ... tilt value sometimes freeze, probably a bug because of the keyboard pressing too fast.
Sometimes joy value changed to 63,63 ... and back to 46...
Dont matter what I press (joy, whammy, buttons), nothing happens and values dont change. Only tilt (when it not freeze).

I tried to use "var.Guitar1.AnalogStick = true" like u said... the keyboard seemed to stop going to right and down. But sometimes the screen still goes UP or DOWN, but I could manage to enter Frets on Fire and tried to configurate guitar keys..... nothing happens! none of the buttons are working, neither pick.


any other suggestion? thank you for your attention, im very grateful.


Then I'm guessing something in my script may need to change. Oh, and the bit about "var.GuitarX.AnalogStick = true" was me documenting an issue. Although, it doesn't help that the information I found for the Nkyo Frontman says, "It must be initialized in the new method", and I can't find how to initialize in the "new method" anywhere.

pingspongz wrote:---- EDIT ----

spike.. I know its not about your script, but maybe you could help me with another problem:

I got Guitar Hero World Tour for PC ... I wanted to use my Eletronic Drum (Yamaha DTXpress 3). I have a midi cable, its working OK with other games like DTX Mania. But I cant manage to use it with GHWT, cause its accept only KEYBOARD or GHWT DRUM KIT.

I thought it was easy to find a program to bind my midi device to work as a pc keyboard, so I could use it with KEYBOARD option. But I cant find. When I try to google about it, I only find the opposite: using keyboard to simulate midi.

Maybe glovepie could help me with this? Do u have any other idea?

Thank you AGAIN!


I know GlovePIE allows you to emulate a MIDI device, but I'm not sure if GlovePIE allows MIDI devices to emulate keyboards. Unfortunately, the only thing I own that's related to MIDIs are .mid files. =/

massagedetq wrote:How to install that script?


You need GlovePIE 0.3 (I kept calling it 3.0 when it's really 0.3...). Run GlovePIE 0.3, copy the script from the the first post, and paste it into GlovePIE. Then run the script by pressing the "Run" button (It has a green "play" icon on the button.)
PM me for my Wii or DS Friend Codes.

http://www.fretsonfire.org/forums/viewtopic.php?f=11&t=38434 My Wii GH:WT Guitar and Drum GlovePIE script. Also supports GH3 guitars!
Since "DragonFail" "sucks" so much, I won't post anything related or about them any longer.

Return to “FOF Mod Discussion and Support”

Who is online

Users browsing this forum: No registered users and 9 guests