Created
November 14, 2021 13:36
-
-
Save empathicqubit/ebf4c32849bd6242a0f52bb7ea3e2cfd to your computer and use it in GitHub Desktop.
GlovePIE script for MIDI control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://www.tobias-erichsen.de/software/loopmidi.html */ | |
Var.XExists = XInput2.Exists | |
Var.A = XInput2.A | |
Var.B = XInput2.B | |
Var.X = XInput2.X | |
Var.Y = XInput2.Y | |
Var.Start = Xinput2.Start | |
Var.Back = Xinput2.Back | |
Var.ShoulderR = Xinput2.RightShoulder | |
Var.ShoulderL = Xinput2.LeftShoulder | |
Var.TriggerL = Xinput2.LeftTrigger | |
Var.TriggerR = Xinput2.RightTrigger | |
Var.LeftStickXraw = Xinput2.Joy1X | |
Var.LeftStickYraw = Xinput2.Joy1Y | |
Var.RightStickXraw = Xinput2.Joy2X | |
Var.RightStickYraw = Xinput2.Joy2Y | |
Var.LeftRaw = Xinput2.Left | |
Var.RightRaw = Xinput2.Right | |
Var.UpRaw = Xinput2.Up | |
Var.DownRaw = Xinput2.Down | |
/*===================| | |
| D Pad Filter. | | |
|So that only one of | | |
|8 directions can be | | |
|pressed at a time | | |
|===================*/ | |
Var.L = Var.LeftRaw & ((not Var.DownRaw)+(not Var.RightRaw)+(not Var.UpRaw)) | |
Var.LD = (Var.LeftRaw + Var.DownRaw) & ((not Var.RightRaw)+(not Var.UpRaw)) | |
Var.D = Var.DownRaw & ((not Var.LeftRaw)+(not Var.RightRaw)+(not Var.UpRaw)) | |
Var.DR = (Var.DownRaw + Var.RightRaw) & ((not Var.LeftRaw)+(not Var.UpRaw)) | |
Var.R = Var.RightRaw & ((not Var.DownRaw)+(not Var.LeftRaw)+(not Var.UpRaw)) | |
Var.RU = (Var.RightRaw + Var.UpRaw) & ((not Var.DownRaw)+(not Var.LeftRaw)) | |
Var.U = Var.UpRaw & ((not Var.DownRaw)+(not Var.RightRaw)+(not Var.LeftRaw)) | |
Var.UL = (Var.UpRaw + Var.LeftRaw) & ((not Var.DownRaw)+(not Var.RightRaw)) | |
/*================================== | |
| Clean Up the Sticks Add Deadzone | | |
==================================*/ | |
Var.LeftStickX = Deadzone (Var.LeftStickXraw, 0.2) | |
Var.LeftStickY = Deadzone (Var.LeftStickYraw, 0.2) | |
Var.RightStickX = Deadzone (Var.RightStickXraw, 0.2) | |
Var.RightStickY = Deadzone (Var.RightStickYraw, 0.2) | |
Var.OutDevName = Midi2.OutDevName | |
Var.PitchWheel = (Var.LeftStickY * 0.7) + 0.5 | |
Midi2.PitchWheel = Var.PitchWheel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment