Welcome! Log In Create A New Profile

Advanced

Math question. Clarification on what some code actually is.

Posted by gnunoob 
Math question. Clarification on what some code actually is.
December 05, 2014 11:06AM
Everyone I am so sorry for asking this I'm sure it is a question that i should know already but I have been looking for the answer and confused myself to the point of not knowing if Im even asking the right questions.

For a year or so I have been using a script to use my DJ Hero decks as MIDI controllers. My question is, in the expressions below, what exactly is Exp0, Exp5, I dont understand what that represents.

or 0x3F or 0x10 it looks like its shortcode for something, I mean when followed by -31, to alter anything, should I be changing -31 or changing 0x3F?

Example: var.LTT2 = that is the left turn table. I would like to increase the sensitivity of the device, to send more data, and therefor allowing me to fast forward or rewind using the deck as a jog wheel, faster than before, it was doing + a split second when it moves I want to instead + 4 seconds when it moves. Not those numbers exactly of course just attempting to ask the right question.

I get that at the end of the code, if LTT2 = 0, its not moving, then assign it to control the MIDI controller 77. But the map range, -30,30,0,1, I'm not understanding what those numbers are representing. So I cannot figure out which numbers to change to alter my device to either do more or less.

If anyone could explain this to me, that would be awesome thank you so much. Or at least send me to a forum post where it is already explained I just don't know how to word the question to get the right answer from a search.


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.LTT2 = (wiimote2.Exp3 & 0x1F)
if (wiimote2.Exp4 & 0x01) var.LTT2 = var.LTT2 - 32

if not var.LTT2 == 0 then midi.Control77 = MapRange(var.LTT2,-30,30,0,1)
Sorry, only registered users may post in this forum.

Click here to login