-
Notifications
You must be signed in to change notification settings - Fork 2
/
wheel_vis_sample.ahk
64 lines (52 loc) · 1.59 KB
/
wheel_vis_sample.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;
; AutoHotkey Version: 1.0.47.x
; Language: English
; Platform: Win9x/NT
; Author: Dabbler, edit from stuff by ribbet.1 and others
;
; Script Function:
; Reads values from wheel and CC1 and displays them as progressbars
; midi in, select device from shortcut menu, needs midi_in_lib.ahk and midi_in.dll in folder
;
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance, Force
Gui, -Caption +Border +ToolWindow
Gui, Color, EEAA99
Gui, +LastFound
WinSet, TransColor, EEAA99
Gui, Add, Progress, w384 h10 cBlue -0x1 Range0-127 vbar_X ; value goes upto 127, bar length is 384
Gui, Add, Progress, x+10 w384 h10 cRed -0x1 Range0-16384 vbar_Y ; value goes upto 16384 (my CC1 controller's output), bar length is 384
Gui, Show, x5 y707 , W_Meter ; position and show, Adjust X & Y to suit your screen res
OnExit, sub_exit
if (midi_in_Open(0))
ExitApp
;-------------------- Midi "hotkey" mappings -----------------------
listenCC(1, "do_cc_one", 0)
listenWheel("do_wheel", 0)
return
;----------------------End of auto execute section--------------------
sub_exit:
midi_in_Close()
ExitApp
;-------------------------Miscellaneous hotkeys-----------------------
Esc::ExitApp
;----------------------------------------------
;experiment
do_cc_one(ccnumber, ccvel)
{
if (ccvel)
{
left_bar := ccvel
GuiControl,, bar_X, %left_bar%
; ccvel is the value
}
}
do_wheel(wheelin)
{
right_bar := wheelin
GuiControl,, bar_Y, %right_bar%
; wheelin is the value
}
;------------------------- Midi input library ----------------------
#include midi_in_lib.ahk