2014-01-18 04:51:46 -05:00
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
;* RULES - MIDI FILTERS
|
|
|
|
;*************************************************
|
|
|
|
|
|
|
|
/*
|
2014-01-26 23:42:59 -05:00
|
|
|
The MidiRules section is for mapping MIDI input to actions.
|
2014-01-25 09:13:33 -05:00
|
|
|
Alter these functions as required.
|
2014-01-25 00:49:59 -05:00
|
|
|
*/
|
2014-01-19 02:34:27 -05:00
|
|
|
|
2014-01-25 00:49:59 -05:00
|
|
|
ProcessNote(device, channel, note, velocity, isNoteOn) {
|
2014-01-26 23:42:59 -05:00
|
|
|
global iInterface
|
|
|
|
|
|
|
|
if (note >= 1 and note <= 32) {
|
|
|
|
VJoy_SetBtn(isNoteOn, iInterface, note)
|
|
|
|
button_state_text := isNoteOn ? "On" : "Off"
|
|
|
|
DisplayOutput("Button " + button_state_text, note)
|
|
|
|
}
|
2014-01-25 00:49:59 -05:00
|
|
|
}
|
2014-01-18 04:51:46 -05:00
|
|
|
|
2014-01-25 00:49:59 -05:00
|
|
|
ProcessCC(device, channel, cc, value) {
|
2014-01-26 23:42:59 -05:00
|
|
|
global iInterface, HID_USAGE_X, HID_USAGE_Y, AxisMax_X, AxisMax_Y
|
2014-01-25 00:49:59 -05:00
|
|
|
if (cc == 7) {
|
2014-01-26 23:42:59 -05:00
|
|
|
scaled_value := ConvertCCValueToScale(value, 8, 120)
|
|
|
|
new_axis_value := ConvertToAxis(scaled_value, AxisMax_X)
|
2014-01-25 09:13:33 -05:00
|
|
|
VJoy_SetAxis(new_axis_value, iInterface, HID_USAGE_X)
|
2014-01-26 23:42:59 -05:00
|
|
|
DisplayOutput("Axis X", scaled_value)
|
|
|
|
} else if (cc == 27) {
|
|
|
|
scaled_value := ConvertCCValueToScale(value, 8, 112)
|
|
|
|
new_axis_value := ConvertToAxis(scaled_value, AxisMax_Y)
|
|
|
|
VJoy_SetAxis(new_axis_value, iInterface, HID_USAGE_Y)
|
|
|
|
DisplayOutput("Axis Y", scaled_value)
|
2014-01-25 00:49:59 -05:00
|
|
|
}
|
|
|
|
}
|
2014-01-18 04:51:46 -05:00
|
|
|
|
2014-01-25 00:49:59 -05:00
|
|
|
ProcessPC(device, channel, note, velocity) {
|
2014-01-26 23:42:59 -05:00
|
|
|
|
2014-01-25 00:49:59 -05:00
|
|
|
}
|
2014-01-19 02:34:27 -05:00
|
|
|
|
2014-01-25 09:13:33 -05:00
|
|
|
ProcessPitchBend(device, channel, value) {
|
|
|
|
|
|
|
|
}
|
2014-01-18 04:51:46 -05:00
|
|
|
|