Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 21, 2012 02:22AM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 21, 2012 05:44AM | Registered: 13 years ago Posts: 14 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 22, 2012 02:43AM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 22, 2012 03:23AM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 22, 2012 04:45AM | Registered: 13 years ago Posts: 14 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 22, 2012 07:24AM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 26, 2012 12:29AM | Registered: 13 years ago Posts: 14 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. September 21, 2012 06:07PM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. February 20, 2013 01:32PM | Registered: 12 years ago Posts: 9 |
Quote
debug="<"+wiimote.Exists+"> "
if(wiimote.Exists) then
if(key.Space) then
debug+=" *** POKE!! ***"
var.space=true
var.ini=true
endif
if(!var.space) debug+=" Safe to connect. Press SPACE to poke"
else
debug+=" ..waiting to connect.."
wait 10ms
endif
if(var.ini) then
debug+=" Active :D"
if(!var.init) then
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
midi.DeviceOut = 2
midi.DefaultChannel = 1
var.init = true
endif
var.SX = (wiimote2.Exp0 & 0x3F) - 31
var.SY = (wiimote2.Exp1 & 0x3F) - 31
var.BE = !(wiimote2.Exp5 & 0x10)
var.BM = !(wiimote2.Exp4 & 0x10)
var.BP = !(wiimote2.Exp4 & 0x04)
var.ED = ((wiimote2.Exp2 & 0x60) >> 2) + ((wiimote2.Exp3 & 0xE0) >> 5)
var.CS = ((wiimote2.Exp2 & 0x1E) >> 1) - 8
var.RTT =((wiimote2.Exp0 & 0xC0) >> 3) + ((wiimote2.Exp1 & 0xC0) >> 5) + ((wiimote2.Exp2 & 0x80) >> 7)
if (wiimote2.Exp2 & 0x01) var.RTT = var.RTT - 32
var.RBG =!(wiimote2.Exp5 & 0x20)
var.RBR =!(wiimote2.Exp4 & 0x02)
var.RBB =!(wiimote2.Exp5 & 0x04)
var.LTT = (wiimote2.Exp3 & 0x1F)
if (wiimote2.Exp4 & 0x01) var.LTT = var.LTT - 32
var.LBG =!(wiimote2.Exp5 & 0x08)
var.LBR =!(wiimote2.Exp4 & 0x20)
var.LBB =!(wiimote2.Exp5 & 0x80)
var.WONE = Wiimote2.One
var.WTWO = Wiimote2.Two
var.WA = Wiimote2.A
var.WDOWN = Wiimote2.Down
var.WUP = Wiimote2.Up
var.WHOME = Wiimote2.Home
var.WPLUS = Wiimote2.Plus
var.WMINUS = Wiimote2.Minus
var.SX1 = (wiimote1.Exp0 & 0x3F) - 31
var.SY1 = (wiimote1.Exp1 & 0x3F) - 31
var.BE1 = !(wiimote1.Exp5 & 0x10)
var.BM1 = !(wiimote1.Exp4 & 0x10)
var.BP1 = !(wiimote1.Exp4 & 0x04)
var.ED1 = ((wiimote1.Exp2 & 0x60) >> 2) + ((wiimote1.Exp3 & 0xE0) >> 5)
var.CS1 = ((wiimote1.Exp2 & 0x1E) >> 1) - 8
var.RTT1 =((wiimote1.Exp0 & 0xC0) >> 3) + ((wiimote1.Exp1 & 0xC0) >> 5) + ((wiimote1.Exp2 & 0x80) >> 7)
if (wiimote1.Exp2 & 0x01) var.RTT1 = var.RTT1 - 32
var.RBG1 =!(wiimote1.Exp5 & 0x20)
var.RBR1 =!(wiimote1.Exp4 & 0x02)
var.RBB1 =!(wiimote1.Exp5 & 0x04)
var.LTT1 = (wiimote1.Exp3 & 0x1F)
if (wiimote1.Exp4 & 0x01) var.LTT1 = var.LTT1 - 32
var.LBG1 =!(wiimote1.Exp5 & 0x08)
var.LBR1 =!(wiimote1.Exp4 & 0x20)
var.LBB1 =!(wiimote1.Exp5 & 0x80)
var.WONE1 = Wiimote1.One
var.WTWO1 = Wiimote1.Two
var.WA1 = Wiimote1.A
var.WDOWN1 = Wiimote1.Down
var.WUP1 = Wiimote1.Up
var.WHOME1 = Wiimote1.Home
var.WPLUS1 = Wiimote1.Plus
var.WMINUS1 = Wiimote1.Minus
if(var.CS<0)var.CS++
midi.Yoke1.channel1.C1 = var.BE
midi.Yoke1.channel1.C2 = var.BM
midi.Yoke1.channel1.C3 = var.BP
midi.Control3 = MapRange(var.ED,0,31,0,1)
midi.Yoke1.channel1.B1 = var.RBG
midi.Yoke1.channel1.B2 = var.RBB
midi.Yoke1.channel1.B3 = var.RBR
midi.Yoke1.channel1.B4 = var.LBG
midi.Yoke1.channel1.B5 = var.LBB
midi.Yoke1.channel1.B6 = var.LBR
midi.Control6 = MapRange(var.LTT,-30,30,0,1)
midi.Control7 = MapRange(var.RTT,-30,30,0,1)
midi.Control8 = MapRange(var.CS,-7,7,0,1)
midi.Yoke1.channel1.C4 = var.WONE
midi.Yoke1.channel1.C5 = var.WTWO
midi.Yoke1.channel1.C6 = var.WA
midi.Yoke1.channel1.C7 = var.WDOWN
midi.Yoke1.channel1.C8 = var.WUP
midi.Control14 = MapRange(var.SX,-31,32,0,1)
midi.Control15 = MapRange(var.SY,-31,32,0,1)
midi.Yoke1.channel1.Csharp1 = var.WHOME
midi.Yoke1.channel1.Csharp2 = var.WPLUS
midi.Yoke1.channel1.Csharp3 = var.WMINUS+
endif
if(var.CS1<0)var.CS1++
midi.Yoke1.channel1.Csharp4 = var.BE1
midi.Yoke1.channel1.Csharp5 = var.BM1
midi.Yoke1.channel1.Csharp6 = var.BP1
midi.Control22 = MapRange(var.ED1,0,31,0,1)
midi.Yoke1.channel1.A1 = var.RBG1
midi.Yoke1.channel1.A2 = var.RBB1
midi.Yoke1.channel1.A3 = var.RBR1
midi.Yoke1.channel1.A4 = var.LBG
midi.Yoke1.channel1.A5 = var.LBB
midi.Yoke1.channel1.A6 = var.LBR
midi.Control25 = MapRange(var.LTT,-30,30,0,1)
midi.Control26 = MapRange(var.RTT1,-30,30,0,1)
midi.Control28 = MapRange(var.CS1,-7,7,0,1)
midi.Yoke1.channel1.Csharp7 = var.WONE1
midi.Yoke1.channel1.Csharp8 = var.WTWO1
midi.Yoke1.channel1.E1 = var.WA1
midi.Yoke1.channel1.E2 = var.WDOWN1
midi.Yoke1.channel1.E3 = var.WUP1
midi.Control34 = MapRange(var.SX1,-31,32,0,1)
midi.Control35 = MapRange(var.SY1,-31,32,0,1)
midi.Yoke1.channel1.E4 = var.WHOME1
midi.Yoke1.channel1.E5 = var.WPLUS1
midi.Yoke1.channel1.E6 = var.WMINUS1
endif
Re: Need help with ambitious project - DJ Hero Midi Control for windows. February 20, 2013 07:10PM | Registered: 12 years ago Posts: 9 |
Re: Need help with ambitious project - DJ Hero Midi Control for windows. February 21, 2013 01:56AM | Registered: 12 years ago Posts: 9 |
Quote
/// Wii DJ Hero Midi Output
// Jezzick (Thanks to Facing Tomorrow and Guy from GlovePie.org)
// Traktor/Osculator changes by Moz
debug="<"+wiimote.Exists+"> "
if(wiimote.Exists) then
if(key.Space) then
debug+=" *** POKE!! ***"
var.space=true
var.ini=true
endif
if(!var.space) debug+=" Safe to connect. Press SPACE to poke"
else
debug+=" ..waiting to connect.."
wait 10ms
endif
if(var.ini) then
debug+=" Active :D"
if(!var.init) then
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
midi.DeviceOut = 2
midi.DefaultChannel = 1
var.init = true
endif
var.SX = (wiimote1.Exp0 & 0x3F) - 31
var.SY = (wiimote1.Exp1 & 0x3F) - 31
var.BE = !(wiimote1.Exp5 & 0x10)
var.BM = !(wiimote1.Exp4 & 0x10)
var.BP = !(wiimote1.Exp4 & 0x04)
var.ED = ((wiimote1.Exp2 & 0x60) >> 2) + ((wiimote1.Exp3 & 0xE0) >> 5)
var.CS = ((wiimote1.Exp2 & 0x1E) >> 1) - 8
var.RTT =((wiimote1.Exp0 & 0xC0) >> 3) + ((wiimote1.Exp1 & 0xC0) >> 5) + ((wiimote1.Exp2 & 0x80) >> 7)
if (wiimote1.Exp2 & 0x01) var.RTT = var.RTT - 32
var.RBG =!(wiimote1.Exp5 & 0x20)
var.RBR =!(wiimote1.Exp4 & 0x02)
var.RBB =!(wiimote1.Exp5 & 0x04)
var.LTT = (wiimote1.Exp3 & 0x1F)
if (wiimote1.Exp4 & 0x01) var.LTT = var.LTT - 32
var.LBG =!(wiimote1.Exp5 & 0x08)
var.LBR =!(wiimote1.Exp4 & 0x20)
var.LBB =!(wiimote1.Exp5 & 0x80)
var.WONE = wiimote1.One
var.WTWO = wiimote1.Two
var.WA = wiimote1.A
var.WDOWN = wiimote1.Down
var.WUP = wiimote1.Up
var.WHOME = wiimote1.Home
var.WPLUS = wiimote1.Plus
var.WMINUS = wiimote1.Minus
var.SX2 = (wiimote2.Exp0 & 0x3F) - 31
var.SY2 = (wiimote2.Exp1 & 0x3F) - 31
var.BE2 = !(wiimote2.Exp5 & 0x10)
var.BM2 = !(wiimote2.Exp4 & 0x10)
var.BP2 = !(wiimote2.Exp4 & 0x04)
var.ED2 = ((wiimote2.Exp2 & 0x60) >> 2) + ((wiimote2.Exp3 & 0xE0) >> 5)
var.CS2 = ((wiimote2.Exp2 & 0x1E) >> 1) - 8
var.WONE2 = wiimote2.One
var.WTWO2 = wiimote2.Two
var.WA2 = wiimote2.A
var.WDOWN2 = wiimote2.Down
var.WUP2 = wiimote2.Up
var.WHOME2 = wiimote2.Home
var.WPLUS2 = wiimote2.Plus
var.WMINUS2 = wiimote2.Minus
if(var.CS<0)var.CS++
if not var.BE == var.BE1 then midi.Control0 = var.BE
if not var.BM == var.BM1 then midi.Control1 = var.BM
if not var.BP == var.BP1 then midi.Control2 = var.BP
if not var.ED == var.ED1 then midi.Control3 = MapRange(var.ED,0,31,0,1)
if not var.RBG == var.RBG1 then midi.Control4 = var.RBG
if not var.RBB == var.RBB1 then midi.Control5 = var.RBB
if not var.RBR == var.RBR1 then midi.Control6 = var.RBR
if not var.RTT == 0 then midi.Control7 = MapRange(var.RTT,-30,30,0,1)
if not var.CS == var.CS1 then midi.Control8 = MapRange(var.CS,-7,7,0,1)
if not var.WONE == var.WONE1 then midi.Control9 = var.WONE
if not var.WTWO == var.WTWO1 then midi.Control10 = var.WTWO
if not var.WA == var.WA1 then midi.Control11 = var.WA
if not var.WDOWN == var.WDOWN1 then midi.Control12 = var.WDOWN
if not var.WUP == var.WUP1 then midi.Control13 = var.WUP
if not var.SX == 0 then midi.Control14 = MapRange(var.SX,-31,32,0,1)
if not var.SY == 0 then midi.Control15 = MapRange(var.SY,-31,32,0,1)
if not var.WHOME == var.WHOME1 then midi.Control16 = var.WHOME
if not var.WPLUS == var.WPLUS1 then midi.Control17 = var.WPLUS
if not var.WMINUS == var.WMINUS1 then midi.Control18 = var.WMINUS
var.SX1 = var.SX
var.SY1 = var.SY
var.BE1 = var.BE
var.BM1 = var.BM
var.BP1 = var.BP
var.ED1 = var.ED
var.CS1 = var.CS
var.RTT1 = var.RTT
var.RBG1 = var.RBG
var.RBR1 = var.RBR
var.RBB1 = var.RBB
var.LTT1 = var.LTT
var.LBG1 = var.LBG
var.LBR1 = var.LBR
var.LBB1 = var.LBB
var.WONE1 = var.WONE
var.WTWO1 = var.WTWO
var.WA1 = var.WA
var.WDOWN1 = var.WDOWN
var.WUP1 = var.WUP
var.WHOME1 = var.WHOME
var.WPLUS1 = var.WPLUS
var.WMINUS1 = var.WMINUS
endif
if(var.CS2<0)var.CS2++
if not var.BE2 == var.BE12 then midi.Control50 = var.BE2
if not var.BM2 == var.BM12 then midi.Control51 = var.BM2
if not var.BP2 == var.BP12 then midi.Control52 = var.BP2
if not var.ED2 == var.ED12 then midi.Control53 = MapRange(var.ED2,0,31,0,1)
if not var.CS2 == var.CS12 then midi.Control58 = MapRange(var.CS2,-7,7,0,1)
if not var.WONE2 == var.WONE12 then midi.Control59 = var.WONE2
if not var.WTWO2 == var.WTWO12 then midi.Control60 = var.WTWO2
if not var.WA2 == var.WA12 then midi.Control61 = var.WA2
if not var.WDOWN2 == var.WDOWN12 then midi.Control62 = var.WDOWN2
if not var.WUP2 == var.WUP12 then midi.Control63 = var.WUP2
if not var.SX2 == 0 then midi.Control64 = MapRange(var.SX2,-31,32,0,1)
if not var.SY2 == 0 then midi.Control65 = MapRange(var.SY2,-31,32,0,1)
if not var.WHOME2 == var.WHOME12 then midi.Control66 = var.WHOME2
if not var.WPLUS2 == var.WPLUS12 then midi.Control67 = var.WPLUS2
if not var.WMINUS2 == var.WMINUS12 then midi.Control68 = var.WMINUS2
var.SX12 = var.SX2
var.SY12 = var.SY2
var.BE12 = var.BE2
var.BM12 = var.BM2
var.BP12 = var.BP2
var.ED12 = var.ED2
var.CS12 = var.CS2
var.WONE12 = var.WONE2
var.WTWO12 = var.WTWO2
var.WA12 = var.WA2
var.WDOWN12 = var.WDOWN2
var.WUP12 = var.WUP2
var.WHOME12 = var.WHOME2
var.WPLUS12 = var.WPLUS2
var.WMINUS12 = var.WMINUS2
endif
Re: Need help with ambitious project - DJ Hero Midi Control for windows. July 27, 2013 12:22PM | Registered: 11 years ago Posts: 1 |