Compare commits

...

28 Commits

Author SHA1 Message Date
e5198e23d5 update to current 2023-03-03 23:09:25 -06:00
6f37d6aa9e minor update 2022-06-21 12:05:51 -05:00
4375fa11d5 lots of updating 2022-06-21 12:04:45 -05:00
8e3fc209aa Update 'flag.ahk' 2022-03-17 15:26:39 -05:00
6f970f33ce suppress COM errors 2022-03-17 15:26:06 -05:00
6a6b8ad9c6 remove Sleep 2022-03-14 10:34:40 -05:00
2047191848 Massively improve functionality
flag now runs off a RasPi with its own API. Response time is faster than the windows desktop app
2022-03-14 10:31:19 -05:00
dd4b8fd4df Slight logic changes 2022-03-14 10:29:56 -05:00
aba5e85d32 Update 'VB.ahk' 2022-03-11 11:02:02 -06:00
2a69cd57fe remove duplicated code 2022-03-11 11:01:17 -06:00
4eadb236da Reorganize functions, pause if YT or Netflix are active 2021-12-10 08:38:52 -06:00
0581ed413b mute both mic input and output when mic mute is pressed 2021-11-24 11:44:42 -06:00
2fcdf6fd3b refactor code
much better handling of commands, but still needs some improvement
2021-01-20 08:18:23 -06:00
c11053c3c3 add flag code, readme and VB update tomorrow 2021-01-19 15:39:04 -06:00
04dbc311fe Merge branch 'master' of https://daviddaily.dev/david/VoiceMeeter-interface
Conflicts:
	VB.ahk
2020-10-14 19:46:41 -05:00
de33a5956a add shortcut for thumbs up/down in YT music 2020-10-14 19:14:37 -05:00
551afbc885 trying to add soundboard stuff 2020-06-03 15:19:18 -05:00
d1ec2fed49 slight edits 2020-05-31 14:01:56 -05:00
a6e519f913 add some PTT 2020-05-26 22:51:21 -05:00
861da37375 Merge branch 'master' of https://daviddaily.dev/david/VoiceMeeter-interface 2020-05-20 14:15:07 -05:00
a6bd9c5d14 change mute button to mute all output, volume buttons control desktop volume 2020-05-20 14:14:48 -05:00
a7632b0925 add link to wiki 2020-05-18 23:07:27 -05:00
1dbef5671d add toggle for media functionality 2020-05-18 23:04:39 -05:00
52495a60d1 Add ability to control music with the Track section, Cycle to pause 2020-05-18 23:03:05 -05:00
ee10219104 changed the math of the range back to default, no need for extra compensation like I thought 2020-05-18 16:13:20 -05:00
605f57448a Update config file, clean up code quite a bit 2020-05-12 22:59:34 -05:00
89be8ada50 Merge branch 'master' of https://daviddaily.dev/david/VoiceMeeter-interface 2020-05-11 23:04:10 -05:00
6adcd99cb0 remove unnecesary lines 2020-05-11 23:03:54 -05:00
5 changed files with 380 additions and 232 deletions

View File

@ -1,7 +1,9 @@
# Korg NanoKontrol2 -> AHK -> VoiceMeeter
This is something I threw together from multiple different sources for the VoiceMeeter control with AHK to the MIDI interaction with AHK.
This is something I threw together from multiple different very old sources for the VoiceMeeter control with AHK to the MIDI interaction with AHK.
This should be good to go, I also included the "Scene data file" (the config) for the Korg software to configure the channels and CCs for the sliders as I have it set up. [Here is a short YouTube video on it.](https://youtu.be/vUhjOVIFs08)
After first startup if you would no longer like the dialog box that shows the MIDI output to show, you can change line 1 of `MidiStart.ahk` to read `ShowGUI := False`. You can edit AHK files in any plaintext editor, including notepad.
After first startup if you would no longer like the dialog box that shows the MIDI output to show, you can change line 1 of [MidiStart.ahk](https://daviddaily.dev/david/VoiceMeeter-interface/src/branch/master/MIDI/MidiStart.ahk) to read `ShowGUI := False`. You can edit AHK files in any plaintext editor, including notepad.
#### [Further information can be found in the Wiki](https://daviddaily.dev/david/VoiceMeeter-interface/wiki)

595
VB.ahk
View File

@ -1,4 +1,4 @@
#NoEnv
SetWorkingDir, A_MyDocuments\D3K
#SingleInstance force
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
@ -7,9 +7,8 @@
#Persistent
ListLines Off
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode RegEx
SetTitleMatchMode, RegEx
StringCaseSense Off
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
OnExit("cleanup_before_exit")
SetFormat, Float, 0.3
@ -26,6 +25,7 @@ if (A_Is64bitOS) {
VMR_DLL_FULL_PATH .= VMR_DLL_FILENAME_32
}
; == START OF EXECUTION ==
; ========================
@ -57,6 +57,18 @@ if (login_result == 1) {
Sleep 2000
}
Switch A_Args[1]
{
Case "restart":
adjustToggle("Command.Restart", "1")
Reload ; It doesn't like processing MIDI after we send commands to VM ¯\_(ツ)_/¯
Return
Case "show":
adjustToggle("Command.Show", "1")
Reload ; It doesn't like processing MIDI after we send commands to VM ¯\_(ツ)_/¯
Return
}
; == MIDI ==
; ==========
#Include, MIDI\MidiStart.ahk
@ -64,43 +76,102 @@ if (login_result == 1) {
#Include, MIDI\MidiRules.ahk ; this file contains: Rules for manipulating midi input then sending modified midi output.
#Include, MIDI\Midi_under_the_hood.ahk ; this file contains: (DO NOT EDIT THIS FILE) all the dialogs to set up midi ports and midi message handling.
; Cases explained so you don't have to go into the korg software:
; Faders (Control Channel 1-8, left to right)
; 0 = Fader
; 1 = Dial
; 2 = S
; 3 = M
; 4 = R
; Other buttons (Control Channel 10)
; 1 = Track <
; 2 = Track >
; 3 = Cycle
; 4 = Marker Set
; 5 = Marker <
; 6 = Marker >
; 7 = <<
; 8 = >>
; 9 = Stop
; 10 = Play
; 11 = Record
midiCCin:
cc := byte1 ; The Control Channel
val := byte2 ; The value (0-127 for faders, 0 or 1 for buttons (that part is set with the software))
nonmusic := "Netflix|YouTube|Corridor" ; Windows to control media in instead of music
; Definitions for the virtual faders
WorkLapR := "Strip[0]."
MicR := "Strip[1]."
PhoneR := "Strip[2]."
;empty := "Strip[3]."
Music := "Strip[4]."
Desktop := "Strip[5]."
CommsR := "Strip[6]."
AlissaR := "Strip[7]."
MicS := "Bus[0]."
Speakers := "Bus[1]."
;empty := "Bus[2]."
PhoneS := "Bus[3]."
WorkLapS := "Bus[4]."
CommsS := "Bus[5]."
AlissaS := "Bus[6]."
Switch chan
{
Case 1: ; The first fader: Work Laptop Out
Case 1: ; The first fader: Work Laptop
Switch cc
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Strip[0]" . ".Gain", Lvl)
adjustVolLvl(WorkLapR "Gain", Lvl)
adjustVolLvl(AlissaR "Gain", Lvl)
Return
Case 1:
Lvl := dial_to_pan(val)
adjustVolLvl("Strip[0]" . ".Pan_x", Lvl)
Lvl := fader_to_fader(val)
adjustVolLvl(WorkLapS "Gain", Lvl) ; WL Send, hardly ever needs adjusted
adjustVolLvl(AlissaS "Gain", Lvl) ; Audio sent to Alissa
Return
Case 2:
adjustToggle("Strip[0]" . ".Solo", val)
adjustToggle(WorkLapR "Solo", val)
adjustToggle(AlissaR "Solo", val)
Return
Case 3:
adjustToggle("Strip[0]" . ".Mute", val)
adjustToggle(WorkLapS "Mute", val) ; WL Send mute, if I need to mute it I can just use the fader
flag("WLsend", val)
Return
Case 4:
adjustToggle("Strip[0]" . ".B2", val)
adjustToggle(WorkLapR "A4", val) ; Sends audio to phone VBAN stream
Return
Default:
Return
}
Case 2: ; The second fader: Work Laptop In
Case 2: ; The second fader: Phone
Switch cc
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Bus[2]" . ".Gain", Lvl)
adjustVolLvl(PhoneS "Gain", Lvl)
Return
Case 1:
Lvl := fader_to_fader(val)
adjustVolLvl(PhoneR "Gain", Lvl)
Return
Case 2:
If (val)
{
adjustToggle("Command.Restart", val)
Reload ; It doesn't like processing MIDI after we restart VM ¯\_(ツ)_/¯
}
Return
Case 3:
adjustToggle("Bus[2]" . ".Mute", val)
adjustToggle(PhoneS "Mute", val)
adjustToggle(PhoneR "Mute", val)
Return
Default:
Return
@ -110,54 +181,82 @@ midiCCin:
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Strip[3]" . ".Gain", Lvl)
adjustVolLvl(Desktop "Gain", Lvl)
Return
Case 1:
Lvl := dial_to_pan(val)
adjustVolLvl("Strip[3]" . ".Pan_x", Lvl)
adjustVolLvl(Desktop "Pan_x", Lvl)
Case 2:
adjustToggle("Strip[3]" . ".Solo", val)
adjustToggle(Desktop "Solo", val)
Return
Case 3:
adjustToggle("Strip[3]" . ".Mute", val)
adjustToggle(Desktop "Mute", val)
Return
Case 4:
adjustToggle("Strip[3]" . ".B2", val)
adjustToggle(Desktop "A4", val)
Return
Default:
Return
}
Case 4: ; The third fader: Comms In
Case 4: ; The fourth fader: Comms Receive
Switch cc
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Bus[3]" . ".Gain", Lvl)
adjustVolLvl(CommsR "Gain", Lvl)
Return
Case 1:
Lvl := dial_to_pan(val)
adjustVolLvl(CommsR "Pan_x", Lvl)
; make Telegram go in the opposite direction
Lvl := dial_to_rev_pan(val)
adjustVolLvl(AlissaR "Pan_x", Lvl)
Case 2:
adjustToggle(CommsR "Solo", val)
Return
Case 3:
adjustToggle("Bus[3]" . ".Mute", val)
adjustToggle(CommsR "Mute", val)
Return
Case 4: ; sends Comms recieve and Alissa to Phone
adjustToggle(CommsR "A4", val)
adjustToggle(AlissaR "A4", val)
Return
Default:
Return
}
Case 5: ; The fifth fader: Comms Out
Case 5: ; The fifth fader: Comms Send
Switch cc
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Strip[4]" . ".Gain", Lvl)
adjustVolLvl(CommsS "Gain", Lvl)
Return
Case 1:
Lvl := dial_to_pan(val)
adjustVolLvl("Strip[4]" . ".Pan_x", Lvl)
Case 2:
adjustToggle("Strip[4]" . ".Solo", val)
Case 2: ; Push to Talk/Mute
if (readParam(CommsS "Mute"))
{
adjustToggle(CommsS "Mute", False)
flag("Csend", False)
} else {
adjustToggle(CommsS "Mute", True)
flag("Csend", True)
}
Return
Case 3:
adjustToggle("Strip[4]" . ".Mute", val)
adjustToggle(CommsS "Mute", val)
flag("Csend",val)
Return
Case 4:
adjustToggle("Strip[4]" . ".B2", val)
Case 4: ; Send music to Discord & Work
adjustToggle(Music "B1", val)
adjustToggle(Music "B2", val)
adjustToggle(Music "A5", val)
if (val)
{
Send {F22} ; Toggle PTT/Voice Activity (Shows up as UNK133 in discord)
Send {F23 down} ; PTT button (Shows up as UNK134 in discord)
} else {
Send {F23 up}
Send {F22} ; Toggle PTT/Voice Activity
}
Return
Default:
Return
@ -167,10 +266,17 @@ midiCCin:
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Bus[0]" . ".Gain", Lvl)
adjustVolLvl(Speakers "Gain", Lvl)
Return
Case 1:
Lvl := fader_to_fader(val)
adjustVolLvl(AlissaR "Gain", Lvl)
Case 3:
adjustToggle("Bus[0]" . ".Mute", val)
adjustToggle(Speakers "Mute", val)
Return
Case 4:
adjustToggle(AlissaR "Mute", val)
adjustToggle(AlissaS "Mute", val)
Return
Default:
Return
@ -180,10 +286,17 @@ midiCCin:
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Bus[1]" . ".Gain", Lvl)
adjustVolLvl(MicS "Gain", Lvl)
Return
Case 2:
adjustToggle(MicR "Mute", val)
Return
Case 3:
adjustToggle("Bus[1]" . ".Mute", val)
adjustToggle(MicR "Mute", val)
adjustToggle(MicS "Mute", val)
Return
Case 4:
adjustToggle(MicR "Mute", val)
Return
Default:
Return
@ -193,229 +306,220 @@ midiCCin:
{
Case 0:
Lvl := fader_to_fader(val)
adjustVolLvl("Strip[2]" . ".Gain", Lvl)
adjustVolLvl(Music "Gain", Lvl)
Return
Case 1:
Lvl := dial_to_pan(val)
adjustVolLvl("Strip[2]" . ".Pan_x", Lvl)
adjustVolLvl(Music "Pan_x", Lvl)
Case 2:
adjustToggle("Strip[2]" . ".Solo", val)
adjustToggle(Music "Solo", val)
Return
Case 3:
adjustToggle("Strip[2]" . ".Mute", val)
adjustToggle(Music "Mute", val)
Return
Case 4:
adjustToggle("Strip[2]" . ".B1", val)
adjustToggle("Strip[2]" . ".B2", val)
adjustToggle(Music "A4", val)
Return
Default:
Return
}
Case 10: ; VoiceMeeter recorder controls
Case 10: ; Buttons on the left
Switch cc
{
Case 1: ; Media Previous
if (val)
{
If (WinActive(nonmusic,, "Music"))
{
Send, {j} ; Skip back
} Else
{
Send, {Media_Prev}
}
}
Return
Case 2: ; Media Next
if (val)
{
If (WinActive(nonmusic,, "Music"))
{
Send, {l} ; skip forward
} Else
{
Send, {Media_Next}
}
}
Return
Case 3: ; Media Play/Pause
If (WinActive(nonmusic,, "Music"))
{
Send, {Space}
} Else
{
Send, {Media_Play_Pause}
}
Return
Case 4: ; Set button
if (val)
{
if (readParam(CommsS "Mute"))
{
adjustToggle(CommsS "Mute", False)
remuteC := True
}
if (readParam(WorkLapS "Mute"))
{
adjustToggle(WorkLapS "Mute", False)
remuteW := True
}
Send {F22} ; Toggle PTT/Voice Activity
Send {F23 down} ; PTT
adjustToggle("Recorder.Play", True)
} else {
if (remuteC)
{
adjustToggle(CommsS "Mute", True)
remuteC := ""
}
if (remuteW)
{
adjustToggle(WorkLapS "Mute", True)
remuteW := ""
}
Send {F23 up} ; PTT
Send {F22} ; Toggle PTT/Voice Activity
adjustToggle("Recorder.Stop", True)
Sleep, 250
adjustToggle("Recorder.Stop", True)
}
Return
Case 5: ; <- under Marker / dislike song
if !(val)
{
Send {F20}
}
Return
Case 6: ; -> under Marker / like song
if !(val)
{
Send {F21}
}
Return
Case 7: ; Rewind
adjustToggle("Recorder" . ".REW", val)
if (val)
{
adjustToggle("Recorder.REW", True)
} else {
adjustToggle("Recorder.Play", True)
}
Return
Case 8: ; Fast Forward
adjustToggle("Recorder" . ".FF", val)
if (val)
{
adjustToggle("Recorder.FF", True)
} else {
adjustToggle("Recorder.Play", True)
}
Return
Case 9:
adjustToggle("Recorder" . ".Stop", val)
adjustToggle("Recorder.Stop", val)
Return
Case 10:
adjustToggle("Recorder" . ".Play", val)
adjustToggle("Recorder.Play", val)
Return
Case 11:
adjustToggle("Recorder" . ".Record", val)
adjustToggle("Recorder.Record", val)
Return
Default:
Gosub, SendCC
Return
}
Default:
Gosub, SendCC
Return
}
Return
fader_to_fader(val) ; Translates MIDI fader values to the VoiceMeeter software faders
{
; The upper limit for faders in VM is 12.0
; The lower limit for the faders in VM that I would like is -40.0, how low it should go when the physical fader is all the way at the bottom
nval := Round(((val / 127) * 52) - 40)
Return nval
}
; Formula: ((value / max value) * total range) - negative part of range
dial_to_pan(val)
{
nval := Round((val / 127) - 0.5, 2)
Return nval
}
; == HOTKEYS ==
; =============
/*
Volume_Up::
If GetKeyState("ScrollLock", "T") ; Control music volume if scroll lock is on
{
cLvl := readParam("Strip[2]" . ".Gain")
if (cLvl != "")
{
cLvl += 1
adjustVolLvl("Strip[2]" . ".Gain", cLvl)
}
Return
}
b0M := Round(readParam("Bus[0]" . ".Mute"))
b1M := Round(readParam("Bus[1]" . ".Mute"))
if !(b0M)
{
cLvl := readParam("Bus[0]" . ".Gain")
if (cLvl != "")
{
cLvl += 1
adjustVolLvl("Bus[0]" . ".Gain", cLvl)
}
}
if !(b1M)
{
cLvl := readParam("Bus[1]" . ".Gain")
if (cLvl != "")
{
cLvl += 1
adjustVolLvl("Bus[1]" . ".Gain", cLvl)
}
}
return
Volume_Down::
If GetKeyState("ScrollLock", "T") ; Control music volume if scroll lock is on
{
cLvl := readParam("Strip[2]" . ".Gain")
if (cLvl != "")
{
cLvl -= 1
adjustVolLvl("Strip[2]" . ".Gain", cLvl)
}
Return
}
b0M := Round(readParam("Bus[0]" . ".Mute"))
b1M := Round(readParam("Bus[1]" . ".Mute"))
if !(b0M)
{
cLvl := readParam("Bus[0]" . ".Gain")
if (cLvl != "")
{
cLvl -= 1
adjustVolLvl("Bus[0]" . ".Gain", cLvl)
}
}
if !(b1M)
{
cLvl := readParam("Bus[1]" . ".Gain")
if (cLvl != "")
{
cLvl -= 1
adjustVolLvl("Bus[1]" . ".Gain", cLvl)
}
}
return
*/
; (untested cause I don't use them)
Volume_Mute::
b0M := Round(readParam("Bus[0]" . ".Mute")) ; Speakers
b1M := Round(readParam("Bus[1]" . ".Mute")) ; Headphones
cM := b0M + b1M
if (cM = "2")
{ ; Unmute the ones that were unmuted before
adjustToggle("Bus[0]" . ".Mute", b0Ms) ; Speakers
adjustToggle("Bus[1]" . ".Mute", b1Ms) ; Headphones
} else {
if !(b0M) ; Speakers
{
b0Ms := True
} else {
b0Ms := False
}
if !(b1M) ; Headphones
{
b1Ms := True
} else {
b1Ms := False
}
; Mute
adjustToggle("Bus[0]" . ".Mute", "0") ; Speakers
adjustToggle("Bus[1]" . ".Mute", "0") ; Headphones
}
Return
/*
!m:: ; Mute: No audio out
Send {F23}
b3M := Round(readParam("Bus[3]" . ".Mute")) ; Comms IN
s4M := Round(readParam("Strip[4]" . ".Mute")) ; Comms OUT
If (s4M)
{
adjustToggle("Bus[3]" . ".Mute", "1") ; Comms IN
adjustToggle("Strip[4]" . ".Mute", "1") ; Comms OUT
return
}
If !(b3M)
{
adjustToggle("Bus[3]" . ".Mute", "0")
} else {
adjustToggle("Bus[3]" . ".Mute", "1")
}
Return
!n:: ; Deafen: No audio in or out
Send {F24}
s4M := Round(readParam("Strip[4]" . ".Mute")) ; Comms OUT
If (s4M)
{
adjustToggle("Bus[3]" . ".Mute", "1") ; Comms IN
adjustToggle("Strip[4]" . ".Mute", "1") ; Comms OUT
} else {
adjustToggle("Bus[3]" . ".Mute", "0") ; Comms IN
Sleep, 650 ; Delay so that the "deafened" sound from discord can play
adjustToggle("Strip[4]" . ".Mute", "0") ; Comms OUT
}
Return
!j:: ; Mute toggle for meetings on work laptop
Send {F24}
cM := Round(readParam("Bus[2]" . ".Mute"))
b0M := readParam(Speakers "Mute") ; Speakers
b1M := readParam(MicS "Mute") ; Headphones
b2M := readParam(WorkLapS "Mute") ; Work Laptop Send
b3M := readParam(PhoneS "Mute") ; Comms Send
b4M := readParam(AlissaS "Mute") ; Recording
cM := b0M + b1M + b2M + b3M + b4M
if (cM)
{
adjustToggle("Bus[2]" . ".Mute", "1") ; Work Laptop
adjustToggle("Bus[3]" . ".Mute", "0") ; Comms IN
adjustToggle("Strip[3]" . ".Mute", "0") ; Desktop
Sleep, 650 ; Delay so that the "deafened" sound from discord can play
adjustToggle("Strip[4]" . ".Mute", "0") ; Comms OUT
}
if !(cM)
{
adjustToggle("Bus[2]" . ".Mute", "0") ; Work Laptop
adjustToggle("Bus[3]" . ".Mute", "1") ; Comms IN
adjustToggle("Strip[4]" . ".Mute", "1") ; Comms OUT
adjustToggle("Strip[3]" . ".Mute", "1") ; Desktop
if (cM = "5")
{ ; Unmute the ones that were unmuted before
adjustToggle(Speakers "Mute", b0Ms) ; Speakers
adjustToggle(MicS "Mute", b1Ms) ; Headphones
adjustToggle(WorkLapS "Mute", b2Ms) ; Work Laptop Send
adjustToggle(PhoneS "Mute", b3Ms) ; Comms Send
adjustToggle(AlissaS "Mute", b4Ms) ; Recording
} else {
adjustToggle(Speakers "Mute", True) ; Speakers
adjustToggle(MicS "Mute", True) ; Headphones
adjustToggle(WorkLapS "Mute", True) ; Work Laptop Send
adjustToggle(PhoneS "Mute", True) ; Comms Send
adjustToggle(AlissaS "Mute", True) ; Recording
b0Ms := b0M
b1Ms := b1M
b2Ms := b2M
b3Ms := b3M
b4Ms := b4M
}
Return
*/
; == Functions ==
; ===============
readParam(loc){
; I need to redo this function...
flag(loc, val)
{
Switch loc
{
Case "Csend": ; Comms send
If !(val) ; Unmuted
{
If (readParam(WorkLapS "Mute")) ; WLsend unmuted
{
data := "blink/red"
} Else
{
data := "on/green"
}
} Else
{
data := "off"
}
Case "WLsend": ; WL send
If !(val) ; Unmuted
{
If !(readParam(CommsS "Mute")) ; Comms muted
{
data := "blink/red"
} Else
{
data := "on/green"
}
} Else
{
data := "off"
}
Default:
Return
}
Run %A_AhkPath% "flag.ahk" %data%
Return
}
readParam(loc)
{
Loop
{
pDirty := DLLCall(VMR_FUNCTIONS["IsParametersDirty"]) ;Check if parameters have changed.
@ -431,44 +535,75 @@ readParam(loc){
tParamVal := 0.0
NumPut(0.0, tParamVal, 0, "Float")
statusLvl := DllCall(VMR_FUNCTIONS["GetParameterFloat"], "AStr", loc, "Ptr", &tParamVal, "Int")
tParamVal := NumGet(tParamVal, 0, "Float")
tParamVal := Round(NumGet(tParamVal, 0, "Float")) ; This wasn't originally rounded, which would return 1.000 instead of 1, which is just silly
if (statusLvl < 0)
return ""
else
return tParamVal
}
adjustVolLvl(loc, tVol) {
adjustVolLvl(loc, tVol)
{
if (tVol > 12.0)
tVol := 12.0
else if (tVol < -60.0)
tVol := -60.0
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", loc, "Float", tVol, "Int")
Return
}
adjustToggle(loc, tM) {
if (tM = 0)
tM := 1
else
tM := 0
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", loc, "Float", tM, "Int")
adjustToggle(func, togg)
{
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "Float", togg, "Int")
; transition flag logic here?
Return
}
adjustString(func, str)
{
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "AStr", str, "Str")
Return
}
fader_to_fader(val) ; Translates MIDI fader values to the VoiceMeeter software faders
{
; The upper limit for faders in VM is 12.0
; The lower limit for the faders in VM that I would like is -40.0, how low it should go when the physical fader is all the way at the bottom
nval := Round(((val / 127) * 72) - 60)
Return nval
}
; Formula: ((value / max value) * total range) - negative part of range
dial_to_pan(val)
{
nval := Round((val / 127) - 0.5, 2)
Return nval
}
dial_to_rev_pan(val) ; Pans in the opposite direction
{
val := Round((val / 127) - 0.5, 2)
val := -val
Return val
}
add_vmr_function(func_name) {
add_vmr_function(func_name)
{
VMR_FUNCTIONS[func_name] := DllCall("GetProcAddress", "Ptr", VMR_MODULE, "AStr", "VBVMR_" . func_name, "Ptr")
if (ErrorLevel || VMR_FUNCTIONS[func_name] == 0)
die("Failed to register VMR function " . func_name . ".")
}
cleanup_before_exit(exit_reason, exit_code) {
cleanup_before_exit(exit_reason, exit_code)
{
DllCall(VMR_FUNCTIONS["Logout"], "Int")
; OnExit functions must return 0 to allow the app to exit.
return 0
}
die(die_string:="UNSPECIFIED FATAL ERROR.", exit_status:=254) {
die(die_string:="UNSPECIFIED FATAL ERROR.", exit_status:=254)
{
MsgBox 16, FATAL ERROR, %die_string%
ExitApp exit_status
}
}

BIN
default.nktrl2_data Normal file

Binary file not shown.

11
flag.ahk Normal file
View File

@ -0,0 +1,11 @@
If !(A_Args[1])
{
Exit
}
ComObjError(0)
msg := "http://RasPi.daily:8888/lights/" . A_Args[1]
req := ComObjCreate("WinHttp.WinHttpRequest.5.1")
req.Open("GET", msg, True)
req.Send()
Sleep, 75
Exit

Binary file not shown.