2014-01-18 04:51:46 -05:00
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
;* RULES - MIDI FILTERS
|
|
|
|
;*************************************************
|
|
|
|
|
|
|
|
/*
|
2014-01-19 02:34:27 -05:00
|
|
|
The MidiRules section is for modifying midi input from some other source.
|
|
|
|
See hotkeys below if you wish to generate midi messages from hotkeys.
|
|
|
|
|
|
|
|
Write your own MidiRules and put them in this section.
|
|
|
|
Keep rules together under proper section, notes, cc, program change etc.
|
|
|
|
Keep them after the statusbyte has been determined.
|
|
|
|
Examples for each type of rule will be shown.
|
|
|
|
The example below is for note type message.
|
|
|
|
|
|
|
|
Remember byte1 for a noteon/off is the note number, byte2 is the velocity of that note.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
ifequal, byte1, 20 ; if the note number coming in is note # 20
|
2014-01-18 04:51:46 -05:00
|
|
|
{
|
2014-01-19 02:34:27 -05:00
|
|
|
byte1 := (do something in here) ; could be do something to the velocity(byte2)
|
|
|
|
gosub, SendNote ; send the note out.
|
2014-01-18 04:51:46 -05:00
|
|
|
}
|
2014-01-19 02:34:27 -05:00
|
|
|
*/
|
2014-01-18 04:51:46 -05:00
|
|
|
|
2014-01-19 02:34:27 -05:00
|
|
|
MidiRules:
|
2014-01-18 04:51:46 -05:00
|
|
|
|
2014-01-19 02:34:27 -05:00
|
|
|
; =============== Note On/Off ===============
|
|
|
|
if statusbyte between 128 and 159
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Add your own note filters here.
|
|
|
|
byte1 is the note number, byte2 is the velocity.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
ifequal, byte1, 20 ; if the note number coming in is note # 20
|
|
|
|
{
|
|
|
|
byte1 := (do something in here) ; could be do something to the velocity(byte2)
|
|
|
|
gosub, SendNote ; send the note out.
|
|
|
|
}
|
|
|
|
*/
|
2014-01-18 04:51:46 -05:00
|
|
|
} ; end of note block
|
2014-01-19 02:34:27 -05:00
|
|
|
|
|
|
|
; =============== CCs (continuous controllers) ===============
|
|
|
|
if statusbyte between 176 and 191
|
|
|
|
{
|
|
|
|
tmp_axis_val := Floor((byte2 / 127) * AxisMax_X)
|
|
|
|
VJoy_SetAxis(tmp_axis_val, iInterface, HID_USAGE_X)
|
|
|
|
|
|
|
|
; Default action code below
|
|
|
|
cc := byte1 ; pass them as is, no change.
|
|
|
|
gosub, ShowMidiInMessage
|
|
|
|
GuiControl,12:, MidiMsOut, CC %statusbyte% %chan% %cc% %byte2%
|
|
|
|
gosub, ShowMidiOutMessage
|
|
|
|
;gosub, sendCC
|
2014-01-18 04:51:46 -05:00
|
|
|
}
|
|
|
|
|
2014-01-19 02:34:27 -05:00
|
|
|
; Is midi input a Program Change?
|
|
|
|
if statusbyte between 192 and 208 ; check if message is in range of program change messages for byte1 values. ; !!!!!!!!!!!! no edit
|
2014-01-18 04:51:46 -05:00
|
|
|
{
|
2014-01-19 02:34:27 -05:00
|
|
|
gosub, sendPC
|
2014-01-18 04:51:46 -05:00
|
|
|
}
|
|
|
|
Return
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
;* MIDI OUTPUT LABELS TO CALL
|
|
|
|
;*************************************************
|
|
|
|
|
2014-01-19 02:34:27 -05:00
|
|
|
SendNote: ;(h_midiout,Note) ; send out note messages ; this should probably be a funciton
|
2014-01-18 04:51:46 -05:00
|
|
|
note = %byte1% ; this var is added to allow transpostion of a note
|
|
|
|
midiOutShortMsg(h_midiout, statusbyte, note, byte2) ; call the midi funcitons with these params.
|
2014-01-19 02:34:27 -05:00
|
|
|
gosub, ShowMidiOutMessage
|
2014-01-18 04:51:46 -05:00
|
|
|
Return
|
|
|
|
|
2014-01-19 02:34:27 -05:00
|
|
|
SendCC:
|
2014-01-18 04:51:46 -05:00
|
|
|
midiOutShortMsg(h_midiout, statusbyte, cc, byte2)
|
2014-01-19 02:34:27 -05:00
|
|
|
Return
|
2014-01-18 04:51:46 -05:00
|
|
|
|
|
|
|
SendPC:
|
|
|
|
gosub, ShowMidiOutMessage
|
|
|
|
midiOutShortMsg(h_midiout, statusbyte, pc, byte2)
|
|
|
|
Return
|
|
|
|
|
|
|
|
|
|
|
|
|