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
|
|
|
|
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) {
|
2024-08-03 15:59:56 -04:00
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
;* Rotary Knob 1 (Master Volume Control) *
|
|
|
|
;*************************************************
|
|
|
|
|
|
|
|
if (cc = 21) {
|
|
|
|
scaled_value := ConvertCCValueToScale(value, 7, 120)
|
|
|
|
vol := Round(scaled_value * 100) ; Scale to percentage
|
|
|
|
SoundSet, vol, MASTER
|
|
|
|
; Minimizing feedback to optimize speed
|
2014-06-25 08:38:28 -04:00
|
|
|
DisplayOutput("Volume", vol)
|
2024-08-03 15:59:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (cc = 0 and value = 1) {
|
|
|
|
SoundSet, 1, MASTER, MUTE ; Unmute
|
|
|
|
DisplayOutput("Volume Unmuted", "")
|
|
|
|
} else if (cc = 0 and value = 0) {
|
|
|
|
SoundSet, 0, MASTER, MUTE ; Mute
|
|
|
|
DisplayOutput("Volume Muted", "")
|
|
|
|
}
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
;* Rotary Knob 2 (Mozilla Firefox Volume Control)*
|
|
|
|
;*************************************************
|
|
|
|
|
|
|
|
if (cc = 22) {
|
|
|
|
scaled_value := ConvertCCValueToScale(value, 7, 120)
|
|
|
|
vol := Round(scaled_value, 2) ; Scale to the range used by nircmd
|
|
|
|
; Adjust Firefox volume using nircmd
|
|
|
|
Run, nircmd setappvolume firefox.exe %vol%
|
|
|
|
; Minimizing feedback to optimize speed
|
|
|
|
scaled_value := ConvertCCValueToScale(vol, 0, 127)
|
|
|
|
percentage := Round(vol * 100) ; Scale to percentage
|
|
|
|
DisplayOutput("Firefox Volume", percentage)
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cc = 1 and value = 1) {
|
|
|
|
; Mute Mozilla Firefox
|
|
|
|
Run, nircmd muteappvolume firefox.exe 1
|
|
|
|
DisplayOutput("Firefox Muted", "")
|
|
|
|
} else if (cc = 1 and value = 0) {
|
|
|
|
; Unmute Mozilla Firefox
|
|
|
|
Run, nircmd muteappvolume firefox.exe 0
|
|
|
|
DisplayOutput("Firefox Unmuted", "")
|
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
|
|
|
|