diff --git a/build/nsis/Mixxx.nsi b/build/nsis/Mixxx.nsi deleted file mode 100644 index 0aa97ad90f20..000000000000 --- a/build/nsis/Mixxx.nsi +++ /dev/null @@ -1,601 +0,0 @@ -; Mixxx.nsi -; -; Mixxx NSI install script. -; This has uninstall support, optional mutli-user install support, -; and optionally installs start menu shortcuts, controller mappings and additional skins. -; -; By Tue Haste Andersen , June 2004. -; Heavily modified since by Albert Santoni, Garth Dahlstrom and Sean Pappalardo. -; -; Lots of bits lifted from http://www.improve.dk/downloads/InstallScript.txt -; -; Use best compression -SetCompressor /SOLID lzma - -;-------------------------------- -; Definitions - -!define PRODUCT_NAME "Mixxx" -;!define PRODUCT_VERSION "" ; Specified by the SConscript -!define PRODUCT_PUBLISHER "The Mixxx Development Team" -!define PRODUCT_WEB_SITE "http://www.mixxx.org" - -; Assumes this script is locaed in \mixxx\build\nsis -!define BASE_BUILD_DIR "..\.." - -!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Mixxx.exe" -!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME} (${PRODUCT_VERSION})" - -; The name of the installer -!ifdef x64 - Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (64-bit)" - !define BITWIDTH "64" - !define ARCH "x64" -; In order for the below line to work, you must patch your C:\Program Files (x86)\NSIS\Include\MultiUser.nsh file with the one given at this link: -; http://sourceforge.net/tracker/?func=detail&atid=373085&aid=2355677&group_id=22049 - !define MULTIUSER_USE_PROGRAMFILES64 "True" -!else - Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" - !define BITWIDTH "32" - !define ARCH "x86" -!endif - -!define MULTIUSER_INSTALLMODE_INSTDIR "${PRODUCT_NAME}" -!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" -!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallDir" -!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" -!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "InstallDir" - -!define PRODUCT_UNINST_ROOT_KEY SHELL_CONTEXT - -!define MULTIUSER_EXECUTIONLEVEL Highest -!define MULTIUSER_MUI -!define MULTIUSER_INSTALLMODE_COMMANDLINE ; Allows command-line installs to specify the mode - ; with /AllUsers or /CurrentUser -!include MultiUser.nsh - -;Include Modern UI -!include "MUI2.nsh" - -; Disable the Nullsoft Installer branding text at the bottom. -BrandingText " " - -; The file to write and default installation directory. This is provided by the -; SConscript. Write to the base directory (assuming we are in /build/nsis/ -OutFile "${BASE_BUILD_DIR}\${PACKAGE_NAME}" - -; Registry key to check for directory (so if you install again, it will -; overwrite the old one automatically) -;InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" "" - -;-------------------------------- -; Interface Settings - -!define MUI_ABORTWARNING - -!define MUI_HEADERIMAGE -;!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH -!define MUI_HEADERIMAGE_BITMAP ${BASE_BUILD_DIR}\res\images\mixxx_install_logo.bmp -!define MUI_ICON "${BASE_BUILD_DIR}\res\images\ic_mixxx.ico" - -; Pages -!insertmacro MUI_PAGE_LICENSE "${BASE_BUILD_DIR}\LICENSE" -!insertmacro MULTIUSER_PAGE_INSTALLMODE -!insertmacro MUI_PAGE_COMPONENTS -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES - -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - -;Languages -!insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -; Install functions - -Function .onInit ; Prevent multiple installer instances - System::Call 'kernel32::CreateMutexA(i 0, i 0, t "runningMixxxInstallerMutex") i .r1 ?e' - Pop $R0 - - StrCmp $R0 0 +3 - MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." - Abort - - !insertmacro MULTIUSER_INIT - -FunctionEnd - -;------------------------------- -; Install the VC redistributable DLLs if they're not already. -Function InstallVCRedist - Push $R0 - Call CheckVCRedist - Pop $R0 - StrCmp $R0 "-1" 0 VCRedistDone - - ; Install them - SetOutPath $TEMP - - ; Put the VC redist installer files there - File ${WINLIB_PATH}\vc_redist.${ARCH}.exe - - ClearErrors - ; Call it & wait for it to install - ExecWait "$TEMP\vc_redist.${ARCH}.exe /quiet /install /norestart" - Delete "$TEMP\vc_redist.${ARCH}.exe" - IfErrors 0 VCRedistDone - MessageBox MB_ICONSTOP|MB_OK "There was a problem installing the Microsoft Visual C++ libraries.$\r$\nYou may need to run this installer as an administrator." - Abort - - ; OLD VC stuff below - - ; NOTE: you need to check the mixxx.exe.manifest file in the win??_build directory - ; and place the appropriate versions of the listed DLL files and their manifest files - ; into the mixxx-win[64]lib-msvc directory for packaging before making the installer - ; (Visual C++ 2005 is msvc?80.dll and Microsoft.VC80.CRT.manifest, - ; Visual C++ 2008 is msvc?90.dll and Microsoft.VC90.CRT.manifest) - ; - ; See http://mixxx.org/wiki/doku.php/build_windows_installer for full details. - ; - ; All the MSVC files are located here if you have MSVC 2008 installed. (x86) - ;File "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" - ;File "$%VCINSTALLDIR%\redist\x86\Microsoft.VC90.CRT\*" - ;File "$%VS90COMNTOOLS%\..\..\VC\redist\x86\Microsoft.VC90.CRT\*" - - ; NOTE: The Microsoft Visual C++ 2010 Runtime gets rid of the manifest file, so it - ; is no longer necessary if we switch to deploying with MSVC 2010. - Albert - - ; If you have the msvc DLLs & manifest elsewhere, - ; copy them to the WINLIB_PATH and uncomment these: - ;File ${WINLIB_PATH}\msvcr*.dll ; Required - ;File ${WINLIB_PATH}\msvcp*.dll ; Required - ;File /nonfatal ${WINLIB_PATH}\msvcm*.dll ; Not (currently) required, so nonfatal - ;File ${WINLIB_PATH}\Microsoft.VC*.CRT.manifest ; Required on MSVC < 2010, apparently - - VCRedistDone: - Exch $R0 - -FunctionEnd - -;------------------------------- -; Test if Visual C++ Redistributables are installed -; Returns -1 if they're not -Function CheckVCRedist - Push $R0 - ClearErrors - ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\${ARCH}" "Installed" - - IfErrors 0 VSRedistInstalled - StrCpy $R0 "-1" - -VSRedistInstalled: - Exch $R0 - -FunctionEnd - -;-------------------------------- -; The stuff to install - -Section "Mixxx (required)" SecMixxx - - SectionIn RO - - Call InstallVCRedist - - ; Set output path to the installation directory. - SetOutPath $INSTDIR - - ; Put binary files there - File "${BASE_BUILD_DIR}\dist${BITWIDTH}\mixxx.exe" - - !ifdef STATICDEPS - ; The below is not fatal if Mixxx is built with static dependencies - ; since there may not be any DLLs to bundle - File /nonfatal "${BASE_BUILD_DIR}\dist${BITWIDTH}\*.dll" - !else - File "${BASE_BUILD_DIR}\dist${BITWIDTH}\*.dll" - !endif - - ; If PDB files are present bundle them. For release builds we will not copy - ; PDBs into the distXX folder so they won't get bundled. - File /nonfatal "${BASE_BUILD_DIR}\dist${BITWIDTH}\*.pdb" - - ; And documentation, licence etc. - File "${BASE_BUILD_DIR}\Mixxx-Manual.pdf" - File "${BASE_BUILD_DIR}\LICENSE" - File "${BASE_BUILD_DIR}\README" - File "${BASE_BUILD_DIR}\COPYING" - - SetOutPath $INSTDIR\sqldrivers - ; Copies both DLLs and PDBs. - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\sqldrivers\*" - - SetOutPath $INSTDIR\imageformats - ; Copies both DLLs and PDBs. - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\imageformats\*" - - SetOutPath $INSTDIR\fonts - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\fonts\*" - - SetOutPath $INSTDIR\plugins - ; Copies both DLLs and PDBs. - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\plugins\*" - - SetOutPath $INSTDIR\plugins\soundsource - ; Copies both DLLs and PDBs. - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\plugins\soundsource\*" - - SetOutPath $INSTDIR\plugins\vamp - ; Copies both DLLs and PDBs. - File /nonfatal /r "${BASE_BUILD_DIR}\dist${BITWIDTH}\plugins\vamp\*" - - SetOutPath $INSTDIR\keyboard - File "${BASE_BUILD_DIR}\dist${BITWIDTH}\keyboard\*.kbd.cfg" - - ; HID/MIDI controller presets - SetOutPath $INSTDIR\controllers - File ${BASE_BUILD_DIR}\dist${BITWIDTH}\controllers\*.xml - File ${BASE_BUILD_DIR}\dist${BITWIDTH}\controllers\*.js - - ; Skins - SetOutPath "$INSTDIR\skins" - File /r ${BASE_BUILD_DIR}\dist${BITWIDTH}\skins\* - - ; Write the installation path into the registry - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Mixxx.exe" - - ; Write the uninstall keys for Windows - WriteUninstaller "$INSTDIR\UninstallMixxx.exe" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\UninstallMixxx.exe" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Mixxx.exe" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" - WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" - WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "NoModify" 1 - WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "NoRepair" 1 - -SectionEnd - -; Optional sections (can be disabled by the user) - -Section "Translations" SecTranslations - SetOutPath "$INSTDIR\translations" - File /r ${BASE_BUILD_DIR}\dist${BITWIDTH}\translations\*.qm - File /r ${QTDIR}\translations\qt_*.qm -SectionEnd - -Section "Start Menu Shortcuts" SecStartMenu - CreateDirectory "$SMPROGRAMS\Mixxx" - SetOutPath $INSTDIR - CreateShortCut "$SMPROGRAMS\Mixxx\Mixxx.lnk" "$INSTDIR\mixxx.exe" "" "$INSTDIR\mixxx.exe" 0 - CreateShortCut "$SMPROGRAMS\Mixxx\Manual.lnk" "$INSTDIR\Mixxx-Manual.pdf" "" "$INSTDIR\Mixxx-Manual.pdf" 0 -SectionEnd - -Section "Desktop Shortcut" SecDesktop - SetOutPath $INSTDIR - CreateShortCut "$DESKTOP\Mixxx.lnk" "$INSTDIR\mixxx.exe" "" "$INSTDIR\mixxx.exe" 0 -SectionEnd - -;-------------------------------- -; Descriptions - - ; Language strings - LangString DESC_SecMixxx ${LANG_ENGLISH} "Mixxx itself in US English" - LangString DESC_SecStartMenu ${LANG_ENGLISH} "Mixxx program group containing useful shortcuts appearing under the [All] Programs section under the Start menu" - LangString DESC_SecDesktop ${LANG_ENGLISH} "Shortcut to Mixxx placed on the Desktop" - LangString DESC_SecTranslations ${LANG_ENGLISH} "Translations for all available languages" - - ;Assign language strings to sections - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SecMixxx} $(DESC_SecMixxx) - !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_SecStartMenu) - !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} $(DESC_SecDesktop) - !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} $(DESC_SecTranslations) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - - -;-------------------------------- -; Uninstaller - -Function un.onUninstSuccess - HideWindow - MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK -FunctionEnd - -Function un.onInit - !insertmacro MUI_UNGETLANGUAGE - MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES +2 - Abort - !insertmacro MULTIUSER_UNINIT -FunctionEnd - -Section "Uninstall" - - ; Remove files and uninstaller - Delete $INSTDIR\mixxx.exe - Delete $INSTDIR\mixxx.log - Delete $INSTDIR\*.dll - Delete $INSTDIR\*.pdb - Delete $INSTDIR\*.manifest - Delete $INSTDIR\UninstallMixxx.exe - Delete $INSTDIR\Mixxx-Manual.pdf - Delete $INSTDIR\LICENSE - Delete $INSTDIR\README - Delete $INSTDIR\COPYING - Delete $INSTDIR\sqldrivers\* - RMDir "$INSTDIR\sqldrivers" - Delete $INSTDIR\imageformats\* - RMDir "$INSTDIR\imageformats" - Delete $INSTDIR\fonts\* - RMDir "$INSTDIR\fonts" - Delete $INSTDIR\plugins\soundsource\* - RMDir "$INSTDIR\plugins\soundsource" - Delete $INSTDIR\plugins\vamp\* - RMDir "$INSTDIR\plugins\vamp" - Delete $INSTDIR\plugins\* - RMDir "$INSTDIR\plugins" - Delete $INSTDIR\translations\* - RMDir "$INSTDIR\translations" - - ; Remove keyboard mappings - ; TODO(XXX): Only delete files that were not changed since install - ; Custom Keyboard mappings should be placed in Custom.kbd.cfg in user folder - Delete $INSTDIR\keyboard\*.kbd.cfg - RMDir "$INSTDIR\keyboard" ; No /r flag means remove the directory only if it's empty - - ; Remove midi mappings/scripts that we may have installed - ; TODO: Only delete files that were not changed since install - ; Get this list with dir /b /s \res\controllers >> filestodelete.txt and creative search & replace - Delete "$INSTDIR\controllers\Akai MPD24.midi.xml" - Delete "$INSTDIR\controllers\Akai-LPD8-RK-scripts.js" - Delete "$INSTDIR\controllers\Akai-LPD8-RK.midi.xml" - Delete "$INSTDIR\controllers\American Audio RADIUS 2000 CH1.midi.xml" - Delete "$INSTDIR\controllers\American Audio RADIUS 2000 CH2.midi.xml" - Delete "$INSTDIR\controllers\American Audio VMS2.midi.xml" - Delete "$INSTDIR\controllers\American Audio VMS4.midi.xml" - Delete "$INSTDIR\controllers\American-Audio-RADIUS-2000-scripts.js" - Delete "$INSTDIR\controllers\American-Audio-VMS2-scripts.js" - Delete "$INSTDIR\controllers\American-Audio-VMS4-scripts.js" - Delete "$INSTDIR\controllers\Behringer BCD2000.midi.xml" - Delete "$INSTDIR\controllers\Behringer BCD3000 Advanced.midi.xml" - Delete "$INSTDIR\controllers\Behringer BCD3000.midi.xml" - Delete "$INSTDIR\controllers\Behringer CMDStudio4a.midi.xml" - Delete "$INSTDIR\controllers\Behringer-BCD2000-scripts.js" - Delete "$INSTDIR\controllers\Behringer-BCD3000-Advanced-scripts.js" - Delete "$INSTDIR\controllers\Behringer-BCD3000-scripts.js" - Delete "$INSTDIR\controllers\Behringer CMD Micro.midi.xml" - Delete "$INSTDIR\controllers\Behringer-CMD-Micro-scripts.js" - Delete "$INSTDIR\controllers\Behringer-CMDStudio4a-scripts.js" - Delete "$INSTDIR\controllers\common-bulk-midi.js" - Delete "$INSTDIR\controllers\common-controller-scripts.js" - Delete "$INSTDIR\controllers\common-hid-devices.js" - Delete "$INSTDIR\controllers\common-hid-packet-parser.js" - Delete "$INSTDIR\controllers\Denon DN HS5500.midi.xml" - Delete "$INSTDIR\controllers\Denon DN SC2000.midi.xml" - Delete "$INSTDIR\controllers\Denon MC3000.midi.xml" - Delete "$INSTDIR\controllers\Denon-DN-HS5500-scripts.js" - Delete "$INSTDIR\controllers\Denon-DN-SC2000.midi.js" - Delete "$INSTDIR\controllers\Denon-MC3000-scripts.js" - Delete "$INSTDIR\controllers\Denon-MC4000-scripts.js" - Delete "$INSTDIR\controllers\Denon MC4000.midi.xml" - Delete "$INSTDIR\controllers\Denon-MC6000MK2-scripts.js" - Delete "$INSTDIR\controllers\Denon-MC6000MK2.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech CDJ-101.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech DJM-101.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech i-Mix Reload.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech Kontrol One.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech Mix-101.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech Mixer One.midi.xml" - Delete "$INSTDIR\controllers\DJ-Tech-CDJ-101-scripts.js" - Delete "$INSTDIR\controllers\DJ-Tech-DJM-101-scripts.js" - Delete "$INSTDIR\controllers\DJ-Tech-i-Mix-Reload-scripts.js" - Delete "$INSTDIR\controllers\DJ-Tech-Kontrol-One-scripts.js" - Delete "$INSTDIR\controllers\DJ-Tech-Mixer-One-scripts.js" - Delete "$INSTDIR\controllers\DJTechTools MIDI Fighter.midi.xml" - Delete "$INSTDIR\controllers\DJTechTools-MIDIFighter-scripts.js" - Delete "$INSTDIR\controllers\EKS Otus.hid.xml" - Delete "$INSTDIR\controllers\EKS-Otus.js" - Delete "$INSTDIR\controllers\Electrix Tweaker.midi.xml" - Delete "$INSTDIR\controllers\Electrix-Tweaker-scripts.js" - Delete "$INSTDIR\controllers\Evolution_Xsession.midi.xml" - Delete "$INSTDIR\controllers\FaderFoxDJ2.midi.xml" - Delete "$INSTDIR\controllers\Gemini CDMP-7000 L audio.midi.xml" - Delete "$INSTDIR\controllers\Gemini CDMP-7000 R audio.midi.xml" - Delete "$INSTDIR\controllers\Gemini-CDMP-7000-scripts.js" - Delete "$INSTDIR\controllers\Gemini FirstMix.midi.xml" - Delete "$INSTDIR\controllers\Gemini-FirstMix-scripts.js" - Delete "$INSTDIR\controllers\Hercules DJ Console 4-Mx.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console Mac Edition.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console Mk1.hid.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console Mk2.hid.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console Mk2.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console Mk4.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console RMX 2.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console RMX Advanced.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console RMX.hid.xml" - Delete "$INSTDIR\controllers\Hercules DJ Console RMX.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control AIR.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control Instinct.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control MP3 e2-scripts.js" - Delete "$INSTDIR\controllers\Hercules DJ Control MP3 e2.bulk.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control MP3 e2.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control MP3.hid.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control MP3.midi.xml" - Delete "$INSTDIR\controllers\Hercules DJ Control Steel.midi.xml" - Delete "$INSTDIR\controllers\Hercules P32 DJ.midi.xml" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-4-Mx-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-Mk1-hid-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-Mk2-hid-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-Mk2-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-Mk4-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-RMX-2-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-RMX-hid-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Console-RMX-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Control-AIR-scripts.js" - Delete "$INSTDIR\controllers\Hercules DJControl Compact.midi.xml" - Delete "$INSTDIR\controllers\Hercules-DJControl-Compact-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Control-Instinct-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Control-MP3-hid-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Control-MP3-scripts.js" - Delete "$INSTDIR\controllers\Hercules-DJ-Control-Steel-scripts.js" - Delete "$INSTDIR\controllers\Hercules-mp3e2-compat.js" - Delete "$INSTDIR\controllers\Hercules-P32-scripts.js" - Delete "$INSTDIR\controllers\HID-Keyboard.js" - Delete "$INSTDIR\controllers\HID-Trackpad.js" - Delete "$INSTDIR\controllers\Ion Discover DJ.midi.xml" - Delete "$INSTDIR\controllers\Ion-Discover-DJ-scripts.js" - Delete "$INSTDIR\controllers\KANE_QuNeo.midi.xml" - Delete "$INSTDIR\controllers\KANE_QuNeo_scripts.js" - Delete "$INSTDIR\controllers\Kontrol Dj KDJ500.midi.xml" - Delete "$INSTDIR\controllers\Kontrol-Dj-KDJ500-scripts.js" - Delete "$INSTDIR\controllers\Korg nanoKONTROL 2.midi.xml" - Delete "$INSTDIR\controllers\Korg nanoKONTROL.midi.xml" - Delete "$INSTDIR\controllers\Korg nanoPAD2.midi.xml" - Delete "$INSTDIR\controllers\Korg-nanoKONTROL-2-scripts.js" - Delete "$INSTDIR\controllers\Korg-nanoPAD2-scripts.js" - Delete "$INSTDIR\controllers\lodash.mixxx.js" - Delete "$INSTDIR\controllers\M-Audio-Xponent-scripts.js" - Delete "$INSTDIR\controllers\M-Audio_Xponent.midi.xml" - Delete "$INSTDIR\controllers\korg_nanokontrol2.mixco.output.js" - Delete "$INSTDIR\controllers\korg_nanokontrol2.mixco.output.midi.xml" - Delete "$INSTDIR\controllers\M-Audio_Xsession_pro.midi.xml" - Delete "$INSTDIR\controllers\maudio_xponent.mixco.output.js" - Delete "$INSTDIR\controllers\maudio_xponent.mixco.output.midi.xml" - Delete "$INSTDIR\controllers\midi-controls-0.0.js" - Delete "$INSTDIR\controllers\Midi-Keyboard.midi.xml" - Delete "$INSTDIR\controllers\Midi_for_light.midi.xml" - Delete "$INSTDIR\controllers\Midi_for_light-scripts.js" - Delete "$INSTDIR\controllers\MidiTech-MidiControl.midi.xml" - Delete "$INSTDIR\controllers\Mixman DM2 (Linux).js" - Delete "$INSTDIR\controllers\Mixman DM2 (Linux).midi.xml" - Delete "$INSTDIR\controllers\Mixman DM2 (OS X).js" - Delete "$INSTDIR\controllers\Mixman DM2 (OS X).midi.xml" - Delete "$INSTDIR\controllers\Mixman DM2 (Windows).midi.xml" - Delete "$INSTDIR\controllers\MixVibes U-Mix Control 2.midi.xml" - Delete "$INSTDIR\controllers\MixVibes U-Mix Control Pro 2.midi.xml" - Delete "$INSTDIR\controllers\MixVibes-U-Mix-Control-Pro-2-scripts.js" - Delete "$INSTDIR\controllers\Nintendo Wiimote.hid.xml" - Delete "$INSTDIR\controllers\Nintendo-Wiimote.js" - Delete "$INSTDIR\controllers\Novation Dicer.midi.xml" - Delete "$INSTDIR\controllers\Novation Launchpad.midi.xml" - Delete "$INSTDIR\controllers\Novation-Dicer-scripts.js" - Delete "$INSTDIR\controllers\Novation-Launchpad-Mini-scripts.js" - Delete "$INSTDIR\controllers\Novation-Launchpad-Mini.midi.xml" - Delete "$INSTDIR\controllers\Novation-Launchpad-scripts.js" - Delete "$INSTDIR\controllers\novation_twitch.mixco.output.js" - Delete "$INSTDIR\controllers\novation_twitch.mixco.output.midi.xml" - Delete "$INSTDIR\controllers\Numark DJ2Go.midi.xml" - Delete "$INSTDIR\controllers\Numark Mixtrack Pro.midi.xml" - Delete "$INSTDIR\controllers\Numark MIXTRACK.midi.xml" - Delete "$INSTDIR\controllers\Numark-Mixtrack-3.midi.xml" - Delete "$INSTDIR\controllers\Numark-Mixtrack-3-scripts.js" - Delete "$INSTDIR\controllers\Numark N4.midi.xml" - Delete "$INSTDIR\controllers\Numark NS7.midi.xml" - Delete "$INSTDIR\controllers\Numark Omni Control.midi.xml" - Delete "$INSTDIR\controllers\Numark Total Control.midi.xml" - Delete "$INSTDIR\controllers\Numark V7.midi.xml" - Delete "$INSTDIR\controllers\Numark-DJ2Go-scripts.js" - Delete "$INSTDIR\controllers\Numark-Mixtrack-Pro-scripts.js" - Delete "$INSTDIR\controllers\Numark-MixTrack-scripts.js" - Delete "$INSTDIR\controllers\Numark-N4-scripts.js" - Delete "$INSTDIR\controllers\Numark-NS7-scripts.js" - Delete "$INSTDIR\controllers\Numark-Omni-Control-scripts.js" - Delete "$INSTDIR\controllers\Numark-Total-Control-scripts.js" - Delete "$INSTDIR\controllers\Numark-V7-scripts.js" - Delete "$INSTDIR\controllers\Pioneer CDJ HID.hid.xml" - Delete "$INSTDIR\controllers\Pioneer CDJ-2000.midi.xml" - Delete "$INSTDIR\controllers\Pioneer CDJ-350 Ch1.midi.xml" - Delete "$INSTDIR\controllers\Pioneer CDJ-350 Ch2.midi.xml" - Delete "$INSTDIR\controllers\Pioneer CDJ-850.midi.xml" - Delete "$INSTDIR\controllers\Pioneer-CDJ-2000-scripts.js" - Delete "$INSTDIR\controllers\Pioneer-CDJ-350-scripts.js" - Delete "$INSTDIR\controllers\Pioneer-CDJ-850-scripts.js" - Delete "$INSTDIR\controllers\Pioneer-CDJ-HID.js" - Delete "$INSTDIR\controllers\Pioneer-DDJ-SB.midi.xml" - Delete "$INSTDIR\controllers\Pioneer-DDJ-SB-scripts.js" - Delete "$INSTDIR\controllers\Pioneer-DDJ-SB2.midi.xml" - Delete "$INSTDIR\controllers\Pioneer-DDJ-SB2-scripts.js" - Delete "$INSTDIR\controllers\Pioneer DDJ-SX.midi.xml" - Delete "$INSTDIR\controllers\Pioneer-DDJ-SX-scripts.js" - Delete "$INSTDIR\controllers\Reloop Beatmix 2-4.midi.xml" - Delete "$INSTDIR\controllers\Reloop Beatpad.midi.xml" - Delete "$INSTDIR\controllers\Reloop Digital Jockey 2 Controller Edition.midi.xml" - Delete "$INSTDIR\controllers\Reloop Terminal Mix 2-4.js" - Delete "$INSTDIR\controllers\Reloop Terminal Mix 2-4.midi.xml" - Delete "$INSTDIR\controllers\Reloop-Beatmix-2-4-scripts.js" - Delete "$INSTDIR\controllers\Reloop-Beatpad-scripts.js" - Delete "$INSTDIR\controllers\Reloop Jockey 3 ME.midi.xml" - Delete "$INSTDIR\controllers\Reloop-Digital-Jockey2-Controller-scripts.js" - Delete "$INSTDIR\controllers\Reloop-Jockey-3-ME-scripts.js" - Delete "$INSTDIR\controllers\Sony SixxAxis.hid.xml" - Delete "$INSTDIR\controllers\Sony-SixxAxis.js" - Delete "$INSTDIR\controllers\Stanton SCS.1d.midi.xml" - Delete "$INSTDIR\controllers\Stanton SCS.1m.midi.xml" - Delete "$INSTDIR\controllers\Stanton SCS.3d.midi.xml" - Delete "$INSTDIR\controllers\Stanton SCS.3d Alternate.midi.xml" - Delete "$INSTDIR\controllers\Stanton SCS.3m.midi.xml" - Delete "$INSTDIR\controllers\Stanton-SCS1d-scripts.js" - Delete "$INSTDIR\controllers\Stanton-SCS1m-scripts.js" - Delete "$INSTDIR\controllers\Stanton-SCS3d-scripts.js" - Delete "$INSTDIR\controllers\Stanton-SCS3d-alternate-scripts.js" - Delete "$INSTDIR\controllers\Stanton-SCS3m-scripts.js" - Delete "$INSTDIR\controllers\TrakProDJ iPad.midi.xml" - Delete "$INSTDIR\controllers\TrakProDJ-iPad-scripts.js" - Delete "$INSTDIR\controllers\Traktor Kontrol F1.hid.xml" - Delete "$INSTDIR\controllers\Traktor Kontrol X1.midi.xml" - Delete "$INSTDIR\controllers\Traktor-Kontrol-F1-scripts.js" - Delete "$INSTDIR\controllers\Traktor-Kontrol-X1.js" - Delete "$INSTDIR\controllers\Traktor Kontrol S4 MK2.hid.xml" - Delete "$INSTDIR\controllers\Traktor-Kontrol-S4-MK2-hid-scripts.js" - Delete "$INSTDIR\controllers\us428.midi.xml" - Delete "$INSTDIR\controllers\Vestax Spin.midi.xml" - Delete "$INSTDIR\controllers\Vestax Typhoon.midi.xml" - Delete "$INSTDIR\controllers\Vestax Typhoon Enhanced.midi.xml" - Delete "$INSTDIR\controllers\Vestax VCI-100-3DEX.midi.xml" - Delete "$INSTDIR\controllers\Vestax VCI-100-hile.midi.xml" - Delete "$INSTDIR\controllers\Vestax VCI-100.midi.xml" - Delete "$INSTDIR\controllers\Vestax VCI-100MKII.midi.xml" - Delete "$INSTDIR\controllers\Vestax-VCI-100MKII-scripts.js" - Delete "$INSTDIR\controllers\Vestax VCI-300.midi.xml" - Delete "$INSTDIR\controllers\Vestax VCI-400.midi.xml" - Delete "$INSTDIR\controllers\Vestax-Spin-scripts.js" - Delete "$INSTDIR\controllers\Vestax-Typhoon-scripts.js" - Delete "$INSTDIR\controllers\Vestax-VCI-100-3DEX-scripts.js" - Delete "$INSTDIR\controllers\Vestax-VCI-100-hile.js" - Delete "$INSTDIR\controllers\Vestax-VCI-100-scripts.js" - Delete "$INSTDIR\controllers\Vestax-VCI-300-scripts.js" - Delete "$INSTDIR\controllers\Vestax-VCI-400-scripts.js" - Delete "$INSTDIR\controllers\Wireless DJ App.midi.xml" - Delete "$INSTDIR\controllers\Wireless-DJ-scripts.js" - Delete "$INSTDIR\controllers\Xone K2.midi.xml" - Delete "$INSTDIR\controllers\Xone-K2-scripts.js" - - - ;Delete $INSTDIR\controllers\*.* ; Avoid this since it will delete customized files too - RMDir "$INSTDIR\controllers" - - ; Remove skins we (might have) installed - Delete $INSTDIR\skins\*.* ; This just deletes files at the root of the skins directory - RMDir /r "$INSTDIR\skins\Deere" - RMDir /r "$INSTDIR\skins\LateNight" - RMDir /r "$INSTDIR\skins\Shade" - ; The lack of the /r prevents deleting any sub-directories we didn't explicitly delete above - RMDir "$INSTDIR\skins" - - ; Remove shortcuts, if any - Delete "$SMPROGRAMS\Mixxx\*.*" - Delete "$DESKTOP\Mixxx.lnk" - - ; Remove directories used - RMDir "$SMPROGRAMS\Mixxx" - RMDir "$INSTDIR" - - ; Remove registry keys - DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" - DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" - SetAutoClose true - -SectionEnd diff --git a/res/controllers/Behringer CMD-MM-1-Advanced.midi.xml b/res/controllers/Behringer CMD-MM-1-Advanced.midi.xml new file mode 100644 index 000000000000..9062f8e5b90c --- /dev/null +++ b/res/controllers/Behringer CMD-MM-1-Advanced.midi.xml @@ -0,0 +1,464 @@ + + + + +]> + + + Behringer CMD MM-1 Advanced + Swiftb0y + This mapping is supposed to be used in combination with the Launchpad Mk2 mapping by midiparse + https://www.mixxx.org/forums/viewtopic.php?f=7&t=9276 + https://www.mixxx.org/wiki/doku.php/behringer_cmd_mm-1_advanced_mapping + + + + + + + + [MixerEQ] + CMDMM.knob + knob[2,3] + &CC; + 0x0F + + + + + + [MixerEQ] + CMDMM.knob + knob[4,1] + &CC; + 0x09 + + + + + + [Channel4] + CMDMM.cue + pfl + ¬eOn; + 0x33 + + + + + + [EffectRack1_EffectUnit1] + CMDMM.fxButton + group_[Channel2]_enable + ¬eOn; + 0x17 + + + + + + [Channel1] + CMDMM.fader + volume + &CC; + 0x30 + + + + + + [MixerEQ] + CMDMM.knob + knob[3,4] + &CC; + 0x14 + + + + + + [Master] + CMDMM.unshift + shiftOff + ¬eOff; + 0x10 + + + + + + [Library] + CMDMM.libraryEncoder + left/right library select encoder + &CC; + 0x03 + + + + + + + [Master] + CMDMM.ctrl + ctrlOn + ¬eOn; + 0x11 + + + + + + [MixerEQ] + CMDMM.knob + knob[1,3] + &CC; + 0x0E + + + + + + [EffectRack1_EffectUnit2] + CMDMM.fxButton + group_[Channel3]_enable + ¬eOn; + 0x1C + + + + + + [Master] + crossfader + native/direct crossfader mapping + &CC; + 0x40 + + + + + + [MixerEQ] + CMDMM.knob + knob[3,1] + &CC; + 0x08 + + + + + + [Channel3] + CMDMM.cue + pfl + ¬eOn; + 0x32 + + + + + + [MixerEQ] + CMDMM.knob + knob[2,4] + &CC; + 0x13 + + + + + + [EffectRack1_EffectUnit2] + CMDMM.out2 + Master Gain + &CC; + 0x02 + + + + + + [Master] + CMDMM.shift + shiftOn + ¬eOn; + 0x10 + + + + + + [MixerEQ] + CMDMM.knob + knob[4,2] + &CC; + 0x0D + + + + + + [EffectRack1_EffectUnit1] + CMDMM.fxButton + group_[Channel3]_enable + ¬eOn; + 0x1B + + + + + + [Channel2] + CMDMM.cue + pfl + ¬eOn; + 0x31 + + + + + + [MixerEQ] + CMDMM.knob + knob[2,1] + &CC; + 0x07 + + + + + + [MixerEQ] + CMDMM.knob + knob[1,4] + &CC; + 0x12 + + + + + + [EffectRack1_EffectUnit2] + CMDMM.fxButton + group_[Channel4]_enable + ¬eOn; + 0x20 + + + + + + [Master] + CMDMM.out1 + Master balance + &CC; + 0x01 + + + + + + [MixerEQ] + CMDMM.knob + knob[3,2] + &CC; + 0x0C + + + + + + [Channel4] + CMDMM.fader + volume + &CC; + 0x33 + + + + + + [Channel1] + CMDMM.cue + pfl + ¬eOn; + 0x30 + + + + + + [MixerEQ] + CMDMM.knob + knob[1,1] + &CC; + 0x06 + + + + + + [EffectRack1_EffectUnit2] + CMDMM.fxButton + group_[Channel1]_enable + ¬eOn; + 0x14 + + + + + + [MixerEQ] + CMDMM.knob + knob[4,3] + &CC; + 0x11 + + + + + + [EffectRack1_EffectUnit1] + CMDMM.fxButton + group_[Channel4]_enable + ¬eOn; + 0x1F + + + + + + [Library] + CMDMM.libraryButton + Middle click libraryEncoder + ¬eOn; + 0x03 + + + + + + [MixerEQ] + CMDMM.knob + knob[2,2] + &CC; + 0x0B + + + + + + [Channel3] + CMDMM.fader + volume + &CC; + 0x32 + + + + + + [Master] + headMix + native/direct pfl mix + &CC; + 0x05 + + + + + + [EffectRack1_EffectUnit1] + CMDMM.fxButton + group_[Channel1]_enable + ¬eOn; + 0x13 + + + + + + [MixerEQ] + CMDMM.knob + knob[3,3] + &CC; + 0x10 + + + + + + [MixerEQ] + CMDMM.knob + knob[1,2] + &CC; + 0x0A + + + + + + [EffectRack1_EffectUnit2] + CMDMM.fxButton + group_[Channel2]_enable + ¬eOn; + 0x18 + + + + + + [Channel2] + CMDMM.fader + volume + &CC; + 0x31 + + + + + + [MixerEQ] + CMDMM.knob + knob[4,4] + &CC; + 0x15 + + + + + + [Master] + CMDMM.unctrl + ctrlOff + ¬eOff; + 0x11 + + + + + + [Master] + headGain + native/direct pfl volume + &CC; + 0x04 + + + + + + [Master] + CMDMM.middleButton + Button in the Middle (shift on other mappings) + ¬eOn; + 0x12 + + + + + + + + diff --git a/res/controllers/Behringer-CMD-MM-1-Advanced-scripts.js b/res/controllers/Behringer-CMD-MM-1-Advanced-scripts.js new file mode 100644 index 000000000000..2a80c435a314 --- /dev/null +++ b/res/controllers/Behringer-CMD-MM-1-Advanced-scripts.js @@ -0,0 +1,576 @@ + +//GLOBAL VARS + +var channelNumber = 5; + +var invertColor = true; //false=(off=orange,on=blue);true=(off=blue,on=orange); +var defaultChannelSequence = [3, 1, 2, 4]; +var channelMode = [true, true, true, true]; //true=deck;false=fxChannel +var standardKnobBehavior = 0; // 0 = [High,Mid,Low,Quickeffect]; 1 = [Gain,High,Mid,Low]; 2 = [Effect1Meta,Effect2Meta,Effect3Meta,mix]; + + +CMDMM = {}; //controller itself +MIDI = {}; //midi related constants +CALLBACK = {}; //Every callback function +FUNCTIONS = {}; //misc for assigning controls + + +//takes functions as arguments and executes them based on the current state of shift and control; +CMDMM.modes = function(normal, shift, ctrl, thirdLevel) { + switch (CMDMM.getLevel()) { + case 0: + if (normal !== undefined) { + normal(); + } + break; + case 1: + if (shift !== undefined) { + shift(); + } + break; + case 2: + if (ctrl !== undefined) { + ctrl(); + } + break; + case 3: + if (thirdLevel !== undefined) { + thirdLevel(); + } + break; + default: + print("invalid Level: " + CMDMM.getLevel()); + break; + } +}; + + + +MIDI.noteOn = 0x90 + (channelNumber - 1); +MIDI.noteOff = 0x80 + (channelNumber - 1); +MIDI.CC = 0xB0 + (channelNumber - 1); + +//0x00 = orange; 0x01 = blue; +CMDMM.on = (invertColor ? 0x00 : 0x01); +CMDMM.off = (invertColor ? 0x01 : 0x00); +CMDMM.blink = 0x02; + + +CMDMM.buttons = [0x12, 0x13, 0x14, 0x17, 0x18, 0x1B, 0x1C, 0x1F, 0x20, 0x30, 0x31, 0x32, 0x33, ]; +// ^ ^Fx1 ^Fx2 ^Fx1 ^Fx2 ^Fx1 ^Fx2 ^Fx1 ^Fx2 ^CUE1^CUE2^CUE3^CUE4 +// | ^Channel1 ^Channel2 ^Channel3 ^Channel4 +// ^middlebutton + +CMDMM.varStorage = { + level: 0, //stores the current level (shift/ctrl/thirdlevel) + knobAssignment: standardKnobBehavior, + channelSequence: defaultChannelSequence, + channelKind: channelMode, //true=deck,false=fxUnit + ChannelAssignmentStatus: [ + [0, 0], + [0, 0], + [0, 0], + [0, 0] + ], +}; + +CMDMM.getShift = function() { + return CMDMM.varStorage.level === 1; +}; +CMDMM.shift = function() { + CMDMM.varStorage.level++; + CMDMM.updateLEDs(); + FUNCTIONS.ignoreNextValue(); +}; +CMDMM.unshift = function() { + CMDMM.varStorage.level--; + CMDMM.updateLEDs(); + FUNCTIONS.ignoreNextValue(); +}; + +CMDMM.getCtrl = function() { + return CMDMM.varStorage.level === 2; +}; +CMDMM.ctrl = function() { + CMDMM.varStorage.level += 2; + CMDMM.updateLEDs(); + FUNCTIONS.ignoreNextValue(); +}; +CMDMM.unctrl = function() { + CMDMM.varStorage.level -= 2; + CMDMM.updateLEDs(); + FUNCTIONS.ignoreNextValue(); +}; + +CMDMM.getThird = function() { + return (CMDMM.varStorage.level == 3 ? true : false); +}; +CMDMM.getLevel = function() { + return CMDMM.varStorage.level; +}; + + +CMDMM.cue = function(channel, control, value, status, group) { + var cueChannel = CMDMM.varStorage.channelSequence[control - 0x30]; + if (CMDMM.varStorage.channelKind[control - 0x30]) { + CMDMM.modes( + function() { + script.toggleControl("[Channel" + cueChannel + "]", "pfl"); + }, + function() { + //load track into selected channel + engine.setParameter("[Channel" + cueChannel + "]", "LoadSelectedTrack", 1); + }, + function() { + /* + //enable pfl for EffectN N = number of channel (a bit weird, but it works) + script.toggleControl("[EffectRack1_EffectUnit"+cueChannel+"]", "group_[Headphone]_enable"); + //OBSOLETE + */ + }, + function() { + CMDMM.varStorage.channelKind[control - 0x30] = !CMDMM.varStorage.channelKind[control - 0x30]; + CALLBACK.cue(); + CALLBACK.fxButton(); + }); + } else { + CMDMM.modes( + function() { + script.toggleControl("[EffectRack1_EffectUnit" + cueChannel + "]", "group_[Headphone]_enable"); + }, + function() { + script.toggleControl("[EffectRack1_EffectUnit" + cueChannel + "]", "group_[Master]_enable"); + }, + function() { + script.toggleControl("[EffectRack1_EffectUnit" + cueChannel + "_Effect3]", "enabled"); + }, + function() { + CMDMM.varStorage.channelKind[control - 0x30] = !CMDMM.varStorage.channelKind[control - 0x30]; + CALLBACK.cue(); + CALLBACK.fxButton(); + } + ); + } +}; + +CMDMM.fxButton = function(channel, control, value, status, group) { + var button = CMDMM.buttons.indexOf(control); //returns integers from 1 to 8 + var realChannel = Math.floor((button - 1) / 2); //realchannelNumbers (0to3) + var mixxxChannel = CMDMM.varStorage.channelSequence[realChannel]; + if (CMDMM.varStorage.channelKind[realChannel]) { + CMDMM.modes( + function() { + var channelButton = button % 2 === 0 ? 2 : 0; + if (engine.getValue("[Channel" + mixxxChannel + "]", "orientation") === channelButton) { + engine.setValue("[Channel" + mixxxChannel + "]", "orientation", 1); + } else { + engine.setValue("[Channel" + mixxxChannel + "]", "orientation", channelButton); //checks if buttonnumber is even, if true, return Left if false, return right; + } + + }, + function() { + var effectUnit = button % 2 === 0 ? 2 : 1; //checks if buttonnumber is even, if true, return effectUnit 2 if false, return effectUnit 1; + // maps button to range [0;7], divides and floors it (result: [0;3]). That value is being used to lookup the right channel. + script.toggleControl("[EffectRack1_EffectUnit" + effectUnit + "]", "group_[Channel" + mixxxChannel + "]_enable"); + }, + function() { + var effectUnit = button % 2 === 0 ? 4 : 3; //checks if buttonnumber is even, if true, return effectUnit 4 if false, return effectUnit 3; + script.toggleControl("[EffectRack1_EffectUnit" + effectUnit + "]", "group_[Channel" + mixxxChannel + "]_enable"); + }, + function() { + var left_right = button % 2 === 0 ? 2 : 1; + CMDMM.varStorage.ChannelAssignmentStatus[realChannel][left_right - 1] = CMDMM.varStorage.ChannelAssignmentStatus[realChannel][left_right - 1] === 0 ? 1 : 0; + //basically inverting the one bit ^^ + CMDMM.varStorage.channelSequence[realChannel] = CMDMM.varStorage.ChannelAssignmentStatus[realChannel][0] + CMDMM.varStorage.ChannelAssignmentStatus[realChannel][1] * 2 + 1; + CALLBACK.fxButton(); + /* + var buttonSet = CMDMM.varStorage.ChannelAssignmentStatus[realChannel]; + var whichButton = button%2===0 ? 1:0; + var isActive = buttonSet[whichButton]; + var value = whichButton*(isActive?-1:1); + CMDMM.varStorage.channelSequence[realChannel] +=value; + CMDMM.varStorage.ChannelAssignmentStatus[realChannel][whichButton] = !isActive; + CALLBACK.fxButton();*/ + } + ); + } else { + CMDMM.modes( + function() { + var effectUnit = button % 2 === 0 ? 2 : 1; //checks if buttonnumber is even, if true, return effectUnit 2 if false, return effectUnit 1; + // maps button to range [0;7], divides and floors it (result: [0;3]). That value is being used to lookup the right channel. + script.toggleControl("[EffectRack1_EffectUnit" + mixxxChannel + "]", "group_[Channel" + effectUnit + "]_enable"); + }, + function() { + var effectUnit = button % 2 === 0 ? 4 : 3; //checks if buttonnumber is even, if true, return effectUnit 4 if false, return effectUnit 3; + // maps button to range [0;7], divides and floors it (result: [0;3]). That value is being used to lookup the right channel. + script.toggleControl("[EffectRack1_EffectUnit" + mixxxChannel + "]", "group_[Channel" + effectUnit + "]_enable"); + }, + function() { + var effectUnit = button % 2 === 0 ? 2 : 1; + script.toggleControl("[EffectRack1_EffectUnit" + mixxxChannel + "_Effect" + effectUnit + "]", "enabled"); + }, + function() { + var left_right = button % 2 === 0 ? 2 : 1; + CMDMM.varStorage.ChannelAssignmentStatus[realChannel][left_right - 1] = CMDMM.varStorage.ChannelAssignmentStatus[realChannel][left_right - 1] === 0 ? 1 : 0; + //basically inverting the one bit ^^ + CMDMM.varStorage.channelSequence[realChannel] = CMDMM.varStorage.ChannelAssignmentStatus[realChannel][0] + CMDMM.varStorage.ChannelAssignmentStatus[realChannel][1] * 2 + 1; + CALLBACK.fxButton(); + } + ); + } +}; +FUNCTIONS.prepFXUnitSettings = function() { + // Enable the FX buttons on every channel and sets the dryWetKnob of their units to 0 (fully dry) as recommended by Be in #1329 + for (var i = 1; i <= 4; i++) { + engine.setParameter("[EffectRack1_EffectUnit" + i + "]", "mix", 0); + for (var ii = 1; ii <= 4; ii++) { + engine.setParameter("[EffectRack1_EffectUnit" + i + "]", "group_[Channel" + ii + "]_enable", 1); + } + } +}; +FUNCTIONS.assignKnobsWithQuickEffect = function() { + CMDMM.knob = function(channel, control, value, status, group) { + var realChannel = (control - 0x06) % 4; + var mixxxChannel = CMDMM.varStorage.channelSequence[realChannel]; + if (CMDMM.varStorage.channelKind[realChannel]) { + var parameterNum = -(Math.floor((control - 0x06) / 4) - 3); //get the horizontal row of the button and translates it to the number + var parameter = (parameterNum === 0 ? "super1" : ("parameter" + parameterNum)); + var mixxxGroup = (parameterNum === 0) ? ("[QuickEffectRack1_[Channel" + mixxxChannel + "]]") : "[EqualizerRack1_[Channel" + mixxxChannel + "]_Effect1]"; + engine.setParameter(mixxxGroup, parameter, value / 127); + } else { + var parameterNum = Math.floor((control - 0x06) / 4) + 1; + var parameter = (parameterNum === 4) ? "super1" : "meta"; + var mixxxGroup = ("[EffectRack1_EffectUnit" + mixxxChannel + ((parameterNum === 4) ? "" : ("_Effect" + parameterNum)) + "]"); + engine.setParameter(mixxxGroup, parameter, value / 127); + } + }; +}; +FUNCTIONS.assignKnobsWithGain = function() { + CMDMM.knob = function(channel, control, value, status, group) { + var realChannel = (control - 0x06) % 4; + var mixxxChannel = CMDMM.varStorage.channelSequence[realChannel]; + if (CMDMM.varStorage.channelKind[realChannel]) { + var parameterNum = -(Math.floor((control - 0x06) / 4) - 2) + 2; //get the horizontal row of the button and translates it to the number + var parameter = (parameterNum === 4 ? "pregain" : ("parameter" + parameterNum)); + var mixxxGroup = (parameterNum === 4) ? ("[Channel" + mixxxChannel + "]") : "[EqualizerRack1_[Channel" + mixxxChannel + "]_Effect1]"; + engine.setParameter(mixxxGroup, parameter, value / 127); + } else { + var parameterNum = Math.floor((control - 0x06) / 4) + 1; + var parameter = (parameterNum === 4) ? "super1" : "meta"; + var mixxxGroup = ("[EffectRack1_EffectUnit" + mixxxChannel + ((parameterNum === 4) ? "" : ("_Effect" + parameterNum)) + "]"); + engine.setParameter(mixxxGroup, parameter, value / 127); + } + }; +}; +FUNCTIONS.assignKnobsEffectOnly = function() { + CMDMM.knob = function(channel, control, value, status, group) { + var realChannel = (control - 0x06) % 4; + var mixxxChannel = CMDMM.varStorage.channelSequence[realChannel]; + var parameterNum = Math.floor((control - 0x06) / 4) + 1; + var parameter = (parameterNum === 4) ? "mix" : "meta"; + var mixxxGroup = ("[EffectRack1_EffectUnit" + mixxxChannel + ((parameterNum === 4) ? "" : ("_Effect" + parameterNum)) + "]"); + engine.setParameter(mixxxGroup, parameter, value / 127); + }; +}; +CMDMM.updateLEDs = function() { + //could be better implemented, but its easy and it works. + CALLBACK.middleButton(); + CALLBACK.fxButton(); + CALLBACK.cue(); +}; +FUNCTIONS.ignoreNextValue = function() { + for (var i = 1; i <= 4; i++) { + engine.softTakeoverIgnoreNextValue("[QuickEffectRack1_[Channel" + i + "]]", "super1", true); + engine.softTakeoverIgnoreNextValue("[Channel" + i + "]", "rate", true); + engine.softTakeoverIgnoreNextValue("[Channel" + i + "]", "volume", true); + engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit" + i + "]", "mix", true); + engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit" + i + "]", "super1", true); + for (var ii = 1; ii <= 3; ii++) { + engine.softTakeoverIgnoreNextValue("[EqualizerRack1_[Channel" + i + "]_Effect1]", "parameter" + ii, true); + engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit" + i + "_Effect" + ii + "]", "meta", true); + } + } +}; + +FUNCTIONS.cycleKnobAssignment = function() { + // 0 = [High,Mid,Low,Quickeffect]; 1 = [Gain,High,Mid,Low]; + switch (CMDMM.varStorage.knobAssignment) { + case 2: + CMDMM.varStorage.knobAssignment = 0; + FUNCTIONS.assignKnobsEffectOnly(); + break; + case 1: + CMDMM.varStorage.knobAssignment++; + FUNCTIONS.assignKnobsWithGain(); + break; + case 0: + CMDMM.varStorage.knobAssignment++; + FUNCTIONS.assignKnobsWithQuickEffect(); + break; + default: + print("INVALID KNOB ASSIGNMENT (" + CMDMM.varStorage.knobAssignment + ")!"); + break; + } +}; + +CMDMM.fader = function(channel, control, value, status, group) { + if (CMDMM.varStorage.channelKind[control - 0x30]) { + CMDMM.modes(function() { + engine.setParameter("[Channel" + CMDMM.varStorage.channelSequence[control - 0x30] + "]", "volume", value / 127); + }, + function() { + engine.setParameter("[Channel" + CMDMM.varStorage.channelSequence[control - 0x30] + "]", "rate", value / 127); + }, + function() { + //empty so fadermovement can be ignored while pressing ctrl + } + ); + } else { + CMDMM.modes( + function() { + engine.setParameter("[EffectRack1_EffectUnit" + CMDMM.varStorage.channelSequence[(control - 0x30)] + "]", "mix", value / 127); + } + ); + } +}; + +CMDMM.out1 = function(channel, control, value, status, group) { + engine.setParameter("[Master]", "balance", value / 127); +}; +CMDMM.out2 = function(channel, control, value, status, group) { + engine.setParameter("[Master]", "gain", value / 127); +}; + +FUNCTIONS.resetColor = function() { + for (var i = CMDMM.buttons.length - 1; i >= 0; i--) { + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[i], CMDMM.off); + } +}; + +CMDMM.libraryEncoder = function(channel, control, value, status, group) { + CMDMM.modes( + function() { + //print("using deprecated SelectTrackKnob as long there is no way to select from just the tracks!") + engine.setValue("[Playlist]", "SelectTrackKnob", value > 0x40 ? 1 : -1); + }, + function() { + //navigate preview track + engine.setParameter("[PreviewDeck1]", "beatjump", (value > 0x40) ? 16 : -16); + }, + function() { + + } + ); +}; +CMDMM.libraryButton = function(channel, control, value, status, group) { + CMDMM.modes( + function() { + engine.setParameter("[PreviewDeck1]", "LoadSelectedTrack", 1); + }, + function() { + engine.setParameter("[PreviewDeck1]", "play", 1); + } + ); +}; + +CMDMM.middleButton = function(channel, control, value, status, group) { + CMDMM.modes(function() { + script.toggleControl("[Master]", "maximize_library"); + //engine.setValue("[Master]","maximize_library", 1); + //maximize Library + }, + function() { + engine.setValue("[Master]", "crossfader", 0); + }, + function() { + FUNCTIONS.cycleKnobAssignment(); + CALLBACK.middleButton(); + }, + function() { + CMDMM.varStorage.channelSequence = defaultChannelSequence; + CMDMM.updateLEDs(); + } + ); +}; + +CALLBACK.vuMeterL = function(value, group, control) { + midi.sendShortMsg(MIDI.CC, 80, (value * 15) + 48); +}; +CALLBACK.vuMeterR = function(value, group, control) { + midi.sendShortMsg(MIDI.CC, 81, (value * 15) + 48); +}; + + +CALLBACK.registerCallbacks = function() { + //VuMeters + engine.makeConnection("[Master]", "VuMeterL", CALLBACK.vuMeterL); + engine.makeConnection("[Master]", "VuMeterR", CALLBACK.vuMeterR); + //engine.makeConnection("[Master]","maximize_library",CALLBACK.middleButton);// doesnt work, help? + //cueButtons (pfl) + for (var i = 1; i <= 4; i++) { + engine.makeConnection("[Channel" + i + "]", "pfl", CALLBACK.cue); + engine.makeConnection("[Channel" + i + "]", "play", CALLBACK.cue); + engine.makeConnection("[Channel" + i + "]", "orientation", CALLBACK.fxButton); + for (var ii = 1; ii <= 4; ii++) { + engine.makeConnection("[EffectRack1_EffectUnit" + i + "]", "group_[Channel" + ii + "]_enable", CALLBACK.fxButton); + } + for (var ii = 1; ii <= 2; ii++) { + engine.makeConnection("[EffectRack1_EffectUnit" + i + "_Effect" + ii + "]", "enabled", CALLBACK.fxButton); + } + engine.makeConnection("[EffectRack1_EffectUnit" + i + "_Effect3]", "enabled", CALLBACK.cue); + engine.makeConnection("[EffectRack1_EffectUnit" + i + "]", "group_[Headphone]_enable", CALLBACK.cue); + engine.makeConnection("[EffectRack1_EffectUnit" + i + "]", "group_[Master]_enable", CALLBACK.cue); + } +}; +CALLBACK.middleButton = function() { + switch (CMDMM.getLevel()) { + case 0: + //midi.sendShortMsg(MIDI.noteOn,CMDMM.buttons[0],engine.getParameter("[Master]","maximize_library")?CMDMM.on:CMDMM.off); break; + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[0], CMDMM.off); + break; + case 1: + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[0], engine.getValue("[Master]", "crossfader") ? CMDMM.on : CMDMM.off); + break; + case 2: + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[0], CMDMM.varStorage.knobAssignment); + break; //[High,Mid,Low,Quickeffect]=orange, [Gain,High,Mid,Low] = blue; + case 3: + //midi.sendShortMsg(MIDI.noteOn,CMDMM.buttons[0],CMDMM.varStorage.channelSequence===[3,1,2,4]?0x01:0x00); break; //[3,1,2,4]ChannelAssignment = blue; [1,2,3,4] = orange; + } +}; +CALLBACK.fxButton = function() { + for (var channel = 1; channel <= 4; channel++) { + if (CMDMM.varStorage.channelKind[channel - 1]) { + switch (CMDMM.getLevel()) { + case 0: + var orientationButton = engine.getValue("[Channel" + CMDMM.varStorage.channelSequence[channel - 1] + "]", "orientation"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel) * 2 - 1], orientationButton === 0 ? CMDMM.on : CMDMM.off); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel) * 2 - 0], orientationButton === 2 ? CMDMM.on : CMDMM.off); + break; + case 1: + for (var fxUnit = 1; fxUnit <= 2; fxUnit++) { + var effectUnitValue = engine.getValue("[EffectRack1_EffectUnit" + fxUnit + "]", "group_[Channel" + CMDMM.varStorage.channelSequence[channel - 1] + "]_enable"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + fxUnit], effectUnitValue ? CMDMM.on : CMDMM.off); + // ^strange but working solution to get values from 1 to 8 + } + break; + case 2: + for (var fxUnit = 3; fxUnit <= 4; fxUnit++) { + var effectUnitValue = engine.getValue("[EffectRack1_EffectUnit" + fxUnit + "]", "group_[Channel" + CMDMM.varStorage.channelSequence[channel - 1] + "]_enable"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + fxUnit - 2], effectUnitValue ? CMDMM.on : CMDMM.off); + // ^strange but working solution to get values from 1 to 8 + } + break; + case 3: + for (var i = 1; i <= 2; i++) { + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + i], CMDMM.varStorage.ChannelAssignmentStatus[channel - 1][i - 1] ? CMDMM.on : CMDMM.off); + } + break; + } + } else { + switch (CMDMM.getLevel()) { + case 0: + for (var fxUnit = 1; fxUnit <= 2; fxUnit++) { + var effectUnitValue = engine.getValue("[EffectRack1_EffectUnit" + CMDMM.varStorage.channelSequence[channel - 1] + "]", "group_[Channel" + fxUnit + "]_enable"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + fxUnit], effectUnitValue ? CMDMM.on : CMDMM.off); + // ^strange but working solution to get values from 1 to 8 + } + break; + case 1: + for (var fxUnit = 3; fxUnit <= 4; fxUnit++) { + var effectUnitValue = engine.getValue("[EffectRack1_EffectUnit" + CMDMM.varStorage.channelSequence[channel - 1] + "]", "group_[Channel" + fxUnit + "]_enable"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + fxUnit - 2], effectUnitValue ? CMDMM.on : CMDMM.off); + // ^strange but working solution to get values from 1 to 8 + } + break; + case 2: + for (var fxUnit = 1; fxUnit <= 2; fxUnit++) { + var value = engine.getValue("[EffectRack1_EffectUnit" + CMDMM.varStorage.channelSequence[channel - 1] + "_Effect" + fxUnit + "]", "enabled"); + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + fxUnit], value ? CMDMM.on : CMDMM.off); + // ^strange but working solution to get values from 1 to 8 + } + break; + case 3: + for (var i = 1; i <= 2; i++) { + midi.sendShortMsg(MIDI.noteOn, CMDMM.buttons[(channel - 1) * 2 + i], CMDMM.varStorage.ChannelAssignmentStatus[channel - 1][i - 1] ? CMDMM.on : CMDMM.off); + } + break; + } + } + } +}; +CALLBACK.cue = function() { + var value = 0; + for (var channel = 1; channel <= 4; channel++) { + var mixxxChannel = CMDMM.varStorage.channelSequence[channel - 1]; + if (CMDMM.varStorage.channelKind[channel - 1]) { + switch (CMDMM.getLevel()) { + case 0: + value = engine.getValue("[Channel" + mixxxChannel + "]", "pfl") ? CMDMM.on : CMDMM.off; + break; + case 1: + value = engine.getValue("[Channel" + mixxxChannel + "]", "play") ? CMDMM.on : CMDMM.off; + break; + case 2: + value = engine.getValue("[EffectRack1_EffectUnit" + mixxxChannel + "]", "group_[Headphone]_enable") ? CMDMM.on : CMDMM.off; + break; + case 3: + value = CMDMM.off; + /* + value = engine.getValue("[Channel"+CMDMM.varStorage.channelSequence[channel-1]+"]","rate")?CMDMM.on:CMDMM.off; + break; + */ + } + } else { + switch (CMDMM.getLevel()) { + case 0: + value = engine.getValue("[EffectRack1_EffectUnit" + mixxxChannel + "]", "group_[Headphone]_enable") ? CMDMM.on : CMDMM.off; + break; + case 1: + value = engine.getValue("[EffectRack1_EffectUnit" + mixxxChannel + "]", "group_[Master]_enable") ? CMDMM.on : CMDMM.off; + break; + case 2: + value = engine.getValue("[EffectRack1_EffectUnit" + mixxxChannel + "_Effect3]", "enabled") ? CMDMM.on : CMDMM.off; + break; + case 3: + value = CMDMM.on; + } + } + midi.sendShortMsg(MIDI.noteOn, channel + 0x2F, value); + } +}; +FUNCTIONS.buttonFromChannelNumber = function() { + for (var i = 0; i < 4; i++) { + CMDMM.varStorage.ChannelAssignmentStatus[i][0] = (CMDMM.varStorage.channelSequence[i] === 2 || CMDMM.varStorage.channelSequence[i] === 4) ? 1 : 0; + CMDMM.varStorage.ChannelAssignmentStatus[i][1] = CMDMM.varStorage.channelSequence[i] >= 3 ? 1 : 0; + } +}; +FUNCTIONS.enableSoftTakeover = function() { + for (var i = 1; i <= 4; i++) { + engine.softTakeover("[QuickEffectRack1_[Channel" + i + "]]", "super1", true); + //engine.softTakeover("[Channel"+i+"]","rate",true); + engine.softTakeover("[Channel" + i + "]", "volume", true); + engine.softTakeover("[EffectRack1_EffectUnit" + i + "]", "mix", true); + engine.softTakeover("[EffectRack1_EffectUnit" + i + "]", "super1", true); + for (var ii = 1; ii <= 3; ii++) { + engine.softTakeover("[EqualizerRack1_[Channel" + i + "]_Effect1]", "parameter" + ii, true); + engine.softTakeover("[EffectRack1_EffectUnit" + i + "_Effect" + ii + "]", "meta", true); + } + } +}; + +CMDMM.init = function() { + FUNCTIONS.resetColor(); + FUNCTIONS.buttonFromChannelNumber(); + FUNCTIONS.cycleKnobAssignment(); + FUNCTIONS.enableSoftTakeover(); + FUNCTIONS.prepFXUnitSettings(); + CALLBACK.registerCallbacks(); + CMDMM.updateLEDs(); +}; + + +CMDMM.shutdown = function() { + //reset Button LEDs + FUNCTIONS.resetColor(); +}; diff --git a/res/controllers/Novation Launchpad.midi.xml b/res/controllers/Novation Launchpad.midi.xml deleted file mode 100644 index b04fdef5b564..000000000000 --- a/res/controllers/Novation Launchpad.midi.xml +++ /dev/null @@ -1,737 +0,0 @@ - - - - Novation Launchpad - zestoi - Multi page mapping for the Novation Launchpad - http://mixxx.org/forums/viewtopic.php?f=7&t=3739 - - - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x68 - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x69 - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6A - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6B - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6C - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6D - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6E - - - - - - [Master] - NovationLaunchpad.incomingData - 0xb0 - 0x6F - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x8 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x18 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x28 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x38 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x48 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x58 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x68 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x78 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x0 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x1 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x2 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x3 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x4 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x5 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x6 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x7 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x10 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x11 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x12 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x13 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x14 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x15 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x16 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x17 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x20 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x21 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x22 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x23 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x24 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x25 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x26 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x27 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x30 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x31 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x32 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x33 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x34 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x35 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x36 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x37 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x40 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x41 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x42 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x43 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x44 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x45 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x46 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x47 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x50 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x51 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x52 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x53 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x54 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x55 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x56 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x57 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x60 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x61 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x62 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x63 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x64 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x65 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x66 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x67 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x70 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x71 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x72 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x73 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x74 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x75 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x76 - - - - - - [Master] - NovationLaunchpad.incomingData - 0x90 - 0x77 - - - - - - - - diff --git a/res/controllers/Novation-Launchpad-scripts.js b/res/controllers/Novation-Launchpad-scripts.js deleted file mode 100644 index 394e39deb5eb..000000000000 --- a/res/controllers/Novation-Launchpad-scripts.js +++ /dev/null @@ -1,813 +0,0 @@ -/****************************************************************/ -/* Novation Launchpad Mapping */ -/* For Mixxx version 1.11 */ -/* Author: zestoi */ -/****************************************************************/ - -NovationLaunchpad = { - - init: function() { - - // - // setup variables and methods - // - - this.page = 1; - this.shift = 0; - this.shift2 = 0; - this.callbacks = {}; - this.feedbacks = {}; - this.cache = [{}, {}, {}, {}]; - this.feedback_cache = {}; - this.toggle_cache = [{}, {}, {}, {}]; - this.name2control = {}; - this.control2name = {}; - this.vumeters = []; - - var self = NovationLaunchpad; - self.instance = this; // needed for incoming data from the launchpad - - this.colors = self.colors(); - this.capture = self.capture; - this.feedback = self.feedback; - this.send = self.send; - this.button = self.button; - this.toggle = self.toggle; - this.hotcue = self.hotcue; - this.flanger = self.flanger; - this.jog = self.jog; - this.get = self.get; - this.loop = self.loop; - this.gator = self.gator; - this.set_page = self.set_page; - this.vfader = self.vfader; - this.vumeter = self.vumeter; - this.vumeter_toggle = self.vumeter_toggle; - this.playlist = self.playlist; - - // - // map the midi config into something more useful - // - - var buttons = self.buttons(); - for (name in buttons) { - var type = buttons[name][0]; - var chan = buttons[name][1]; - var value = buttons[name][2]; - var status = (type == 'cc') ? 0xb0 + chan - 1 : 0x90 + chan - 1; - this.name2control[name]= [ status, value ]; - this.control2name["" + status + value] = name; // stringify it - } - - // - // reset device, enable flashing colors - // - - midi.sendShortMsg(0xb0, 0x0, 0x0); - midi.sendShortMsg(0xb0, 0x0, 0x28); - - ///////////////////////////////////////////////////////////////////////// - // button layout mapping starts here - ///////////////////////////////////////////////////////////////////////// - - // shift buttons - - this.button("arm", "all", 1, 'hi_yellow', 'lo_yellow', '', '', function(g, n, v) { this.shift = v > 0 ? 1 : 0; }); - this.button("solo", "all", 1, 'hi_yellow', 'lo_yellow', '', '', function(g, n, v) { this.shift2 = v > 0 ? 1 : 0; }); - this.toggle("mixer", "all", 0, 'hi_red', 'lo_red', '', '', function(g, n, v) { this.set_page(v > 0 ? 2 : 1); }); - this.toggle("vol", "all", 2, 'hi_red', 'lo_red', '', '', function(g, n, v) { this.vumeter_toggle(v); }); - - //// MAIN PAGE //// - - // track navigation - - this.playlist("up", 0, "SelectPrevTrack"); - this.playlist("down", 0, "SelectNextTrack"); - this.button("left", "press", 0, 'hi_yellow', 'lo_yellow', "[Playlist]", "SelectPrevPlaylist"); - this.button("right", "press", 0, 'hi_yellow', 'lo_yellow', "[Playlist]", "SelectNextPlaylist"); - - // deck mappings - - for (deck=1; deck<=2; deck++) { - var offset = deck == 1 ? 0 : 4; - var group = "[Channel" + deck + "]"; - - // tracks - - this.toggle("0," + (offset + 0), "all", 1, 'hi_red', 'lo_red', group, "quantize"); - this.toggle("0," + (offset + 1), "all", 1, 'hi_red', 'lo_red', group, "keylock"); - this.toggle("0," + (offset + 2), "all", 1, 'hi_red', 'lo_red', group, "pfl"); - this.button("0," + (offset + 3), "all", 1, 'hi_yellow', 'lo_amber', group, "LoadSelectedTrack"); - - // flanger - - this.flanger("1," + (offset + 0), 1, group, 0.5, 1500000, 333); - this.flanger("1," + (offset + 1), 1, group, 1, 500000, 666); - - // spinback effect - - this.button("1," + (offset + 2), "all", 1, 'hi_red', 'lo_red', group, "", function(g, n, v) { - script.spinback(g, v > 0); - }); - - // brake effect - - this.button("1," + (offset + 3), "all", 1, 'hi_red', 'lo_red', group, "", function(g, n, v) { - script.brake(g, v > 0); - }); - - // instant loops - - this.loop("2," + (offset + 0), 1, group, 1); - this.loop("2," + (offset + 1), 1, group, 0.5); - this.loop("2," + (offset + 2), 1, group, 0.25); - this.loop("2," + (offset + 3), 1, group, 0.125); - - // loop in or loop half when active - - this.button("3," + (offset + 0), "press", 1, 'hi_green', 'lo_green', group, "", function(g, n, v) { - if (engine.getValue(g, "loop_enabled")) { - engine.setValue(g, "loop_halve", 1); - } - else { - engine.setValue(g, "loop_in", 1); - } - }); - - // loop out or loop double when active - - this.button("3," + (offset + 1), "press", 1, 'hi_green', 'lo_green', group, "", function(g, n, v) { - if (engine.getValue(g, "loop_enabled")) { - engine.setValue(g, "loop_double", 1); - } - else { - engine.setValue(g, "loop_out", 1); - } - }); - - // reloop or exit loop - - this.button("3," + (offset + 2), "all", 1, 'hi_green', 'lo_green', group, "reloop_exit"); - - // gator effect - - this.gator("3," + (offset + 3), 1, group, 8, 0.7); - - // led feedback for loop in/out buttons to show loop status - - engine.connectControl(group, "loop_enabled", function(value, g, e) { - var offset = g == "[Channel1]" ? 0 : 4; // value not closed - this.send("3," + (offset + 0), this.colors[value > 0 ? 'hi_green' : 'lo_green'], 1); - this.send("3," + (offset + 1), this.colors[value > 0 ? 'hi_green' : 'lo_green'], 1); - this.feedback_cache[g + e] = value; - }); - - // hotcues or needle drop with shift2 pressed - - this.hotcue("4," + (offset + 0), 1, group, 1); - this.hotcue("4," + (offset + 1), 1, group, 2); - this.hotcue("4," + (offset + 2), 1, group, 3); - this.hotcue("4," + (offset + 3), 1, group, 4); - this.hotcue("5," + (offset + 0), 1, group, 5); - this.hotcue("5," + (offset + 1), 1, group, 6); - this.hotcue("5," + (offset + 2), 1, group, 7); - this.hotcue("5," + (offset + 3), 1, group, 8); - - // transport - - this.button("6," + (offset + 0), "all", 1, 'hi_yellow', 'lo_red', group, "cue_default"); - - this.button("6," + (offset + 1), "press", 1, 'hi_yellow', 'lo_yellow', group, "rate", function(g, n, v) { - engine.setValue(g, n, 0); - }); - - this.button("6," + (offset + 2), "press", 1, 'hi_yellow', 'lo_yellow', group, "rate_perm_down_small"); - this.button("6," + (offset + 3), "press", 1, 'hi_yellow', 'lo_yellow', group, "rate_perm_up_small"); - - // play button - this.toggle("7," + (offset + 0), "press", 1, 'hi_yellow', 'lo_red', group, "play"); - - // flash play button when near end of track - engine.connectControl(group, "playposition", function(value, g, e) { - if (value > 0.9 && engine.getValue(g, "play") > 0) { - this.send(g == "[Channel1]" ? "7,0" : "7,4", this.colors['flash_hi_red'], 1); - } - this.feedback_cache[g + e] = value; - }); - - // sync or move beatgrid when shift is pressed - - this.button("7," + (offset + 1), "all", 1, 'hi_yellow', 'lo_amber', group, "beatsync", function(g, n, v) { - if (this.shift > 0) - engine.setValue(g, "beats_translate_curpos", v > 0 ? 1 : 0); - else - engine.setValue(g, n, v > 0 ? 1 : 0); - }); - - // fwd/rev when not playing unless shift and then fine jog movements for beat gridding, jog when playing, jog more when shift+playing - - this.jog("7," + (offset + 2), 1, group, "back"); - this.jog("7," + (offset + 3), 1, group, "fwd"); - } - - //// MIXER PAGE //// - - this.toggle("0,0", "all", 2, 'flash_hi_red', 'lo_red', "[Channel1]", "filterHighKill"); - this.toggle("0,1", "all", 2, 'flash_hi_red', 'lo_red', "[Channel1]", "filterMidKill"); - this.toggle("0,2", "all", 2, 'flash_hi_red', 'lo_red', "[Channel1]", "filterLowKill"); - this.toggle("0,5", "all", 2, 'flash_hi_red', 'lo_red', "[Channel2]", "filterHighKill"); - this.toggle("0,6", "all", 2, 'flash_hi_red', 'lo_red', "[Channel2]", "filterMidKill"); - this.toggle("0,7", "all", 2, 'flash_hi_red', 'lo_red', "[Channel2]", "filterLowKill"); - - this.vfader(7, 0, 2, 7, 'hi_orange', 'lo_green', "[Channel1]", "filterLow"); - this.vfader(7, 1, 2, 7, 'hi_orange', 'lo_green', "[Channel1]", "filterMid"); - this.vfader(7, 2, 2, 7, 'hi_orange', 'lo_green', "[Channel1]", "filterHigh"); - this.vfader(7, 5, 2, 7, 'hi_orange', 'lo_green', "[Channel2]", "filterLow"); - this.vfader(7, 6, 2, 7, 'hi_orange', 'lo_green', "[Channel2]", "filterMid"); - this.vfader(7, 7, 2, 7, 'hi_orange', 'lo_green', "[Channel2]", "filterHigh"); - - this.vfader(7, 3, 2, 8, 'hi_yellow', 'lo_red', "[Channel1]", "volume"); - this.vfader(7, 4, 2, 8, 'hi_yellow', 'lo_red', "[Channel2]", "volume"); - this.vumeter(7, 3, 2, 8, 'hi_yellow', 'lo_red', "[Channel1]", "VuMeter"); - this.vumeter(7, 4, 2, 8, 'hi_yellow', 'lo_red', "[Channel2]", "VuMeter"); - - ///////////////////////////////////////////////////////////////////////// - // button layout mapping ends here - ///////////////////////////////////////////////////////////////////////// - }, - - // - // empty shutdown method - // - - shutdown: function() { - }, - - // - // convert incoming midi to a 'name' and call callbacks (if any) - // - - incomingData: function(channel, control, value, status, group) { - var me = NovationLaunchpad.instance; - if ((name = me.control2name["" + status + control]) != undefined) { - if (me.callbacks[name] != undefined) { - var callbacks = me.callbacks[name]; - for (var i=0; i 0) || - (callbacks[i][0] == "release" && value == 0)) { - - // - // call a callback function for this control - // - - callbacks[i][2].call(me, group, name, value); - } - } - } - } - } - }, - - // - // gator effect using high eq kill - // - - gator: function(name, page, group, rate, depth) { - this.button(name, "all", page, 'hi_red', 'lo_red', group, "", function(g, n, v) { - var self = NovationLaunchpad; - if (typeof(self.gator_timer) != undefined && self.gator_timer != null) { - engine.stopTimer(self.gator_timer); - self.gator_timer = null; - } - - if (v > 0) { - if ((bpm = engine.getValue(g, 'bpm')) > 0) { - var interval = parseInt(1000 / bpm * 60 / rate); - self.gator_direction = false; - self.gator_depth = depth; - self.gator_timer = engine.beginTimer(interval, 'NovationLaunchpad.process_gator("' + g + '")'); - } - } - else { - engine.setValue(group, 'filterHighKill', 0); - } - }); - }, - - // - // gator - // - - process_gator: function(group) { - var self = NovationLaunchpad; - self.gator_direction = !self.gator_direction; - engine.setValue(group, 'filterHighKill', self.gator_direction ? 1 : 0); - }, - - // - // flanger button - // - - flanger: function(name, page, group, depth, period, delay) { - this.button(name, "all", page, 'hi_amber', 'lo_amber', group, "flanger", function(g, name, v) { - if (v > 0) { - engine.setValue("[Flanger]", "lfoDepth", depth); - engine.setValue("[Flanger]", "lfoPeriod", period); - engine.setValue("[Flanger]", "lfoDelay", delay); - } - engine.setValue(group, "flanger", v > 0 ? 1 : 0); - }); - }, - - loop: function(name, page, group, size) { - this.button(name, "all", page, 'hi_yellow', 'lo_yellow', group, "", function(g, name, v) { - if (v > 0) { - engine.setValue(g, "beatloop_" + size + "_activate", 1); - } - else { - if (engine.getValue(g, "beatloop_" + size + "_enabled")) { - engine.setValue(g, "beatloop_" + size + "_toggle", 1); - } - } - }); - }, - - // - // track scrolling - // - - playlist: function(name, page, action) { - this.button(name, "all", page, 'hi_yellow', 'lo_yellow', "[Playlist]", action, function(g, n, v) { - var self = NovationLaunchpad; - if (typeof(self.playlist_timer) != undefined && self.playlist_timer != null) { - engine.stopTimer(self.playlist_timer); - self.playlist_timer = null; - } - - if (v > 0) { - engine.setValue("[Playlist]", action, 1); - self.playlist_timer = engine.beginTimer(this.shift > 0 ? 30 : 150, 'NovationLaunchpad.process_playlist("' + action + '")'); - } - }); - }, - - process_playlist: function(name) { - engine.setValue("[Playlist]", name, 1); - }, - - // - // map a callback to a launchpad button name - // - - capture: function(name, values, page, func) { - if (this.callbacks[name] == undefined) { - this.callbacks[name] = [ [ values, page, func ] ]; - } - else { - this.callbacks[name].push([ values, page, func ]); - } - }, - - // - // send back to the launchpad for leds by name - // - - send: function(name, value, page) { - if (page == 0 || this.page == page) { - if ((control = this.name2control[name]) != undefined) { - if (this.cache[page][name] == value) return; - midi.sendShortMsg(control[0], control[1], value); - } - } - this.cache[page][name] = value; - }, - - // - // hold button - // - - button: function(name, values, page, on_color, off_color, group, event, callback) { - - // launchpad => mixxx - - this.capture(name, "all", page, function(g, name, value) { - - if (callback == undefined) { - engine.setValue(group, event, value); - } - else if (typeof(callback) == "function") { - if (values == "all" || (values == "press" && value > 0) || (values == "release" && value == 0)) { - callback.call(this, group, event, value); - } - } - - if (values == "all" || (values == "press" && value > 0) || (values == "release" && value == 0)) { - this.send(name, this.colors[value > 0 ? on_color : off_color], page); - } - }); - - // mixxx => launchpad - - engine.connectControl(group, event, function(value, g, e) { - this.send(name, this.colors[value > 0 ? on_color : off_color], page); - this.feedback_cache[g + e] = value; - }); - - // init led - - this.send(name, this.colors[off_color], page); - }, - - // - // toggle - // - - toggle: function(name, values, page, on_color, off_color, group, event, callback) { - this.capture(name, "press", page, function(g, name, value) { - if (typeof(this.toggle_cache[page][name]) == "undefined") { - this.toggle_cache[page][name] = 0; - } - this.toggle_cache[page][name] = this.toggle_cache[page][name] == 0 ? 1 : 0; - - if (callback == undefined) { - engine.setValue(group, event, this.toggle_cache[page][name]); - } - else if (typeof(callback) == "function") { - callback.call(this, group, event, this.toggle_cache[page][name]); - } - - this.send(name, this.colors[this.toggle_cache[page][name] > 0 ? on_color : off_color], page); - }); - - // mixxx => launchpad - - engine.connectControl(group, event, function(value, g, e) { - this.send(name, this.colors[value > 0 ? on_color : off_color], page); - this.toggle_cache[page][name] = value > 0 ? 1 : 0; - this.feedback_cache[g + e] = value; - }); - - // init led - - this.send(name, this.colors[off_color], page); - }, - - // - // hotcues - // - - hotcue: function(name, page, group, num) { - - // launchpad => mixxx - - this.capture(name, "press", page, function(g, name, value) { - if (this.shift2) { - engine.setValue(group, "playposition", (num-1)/8); - } - else if (this.shift) { - engine.setValue(group, "hotcue_" + num + "_clear", 1); - } - else { - engine.setValue(group, "hotcue_" + num + "_activate", 1); - } - }); - - // mixxx => launchpad - - engine.connectControl(group, "hotcue_" + num + "_enabled", function(value, g, e) { - this.send(name, this.colors[value > 0 ? 'hi_red' : 'black'], page); - this.feedback_cache[g + e] = value; - }); - }, - - // - // jog - // - - jog: function(name, page, group, dir) { - this.button(name, "all", page, 'hi_yellow', 'lo_amber', group, "", function(g, n, v) { - - if (dir == "fwd") { - mult = 1; - rate = "rate_temp_up"; - } - else { - mult = -1; - rate = "rate_temp_down"; - } - - if (engine.getValue(g, "play") > 0) { - if (this.shift > 0) { - engine.setValue(g, rate, v > 0 ? 1 : 0); - } - else { - engine.setValue(g, rate + "_small", v > 0 ? 1 : 0); - } - } - else if (this.shift > 0) { - if (v > 0) { - engine.setValue(g, 'jog', 0.2 * mult); - } - } - else engine.setValue(g, dir, v); - }); - }, - - // - // turn a column of pads into a virtual fader - // - - vfader: function(y, x, page, nbtns, on_color, off_color, group, action) { - var incr = 1 / nbtns; - - // launchpad => mixxx - - for (var btn=0; btn launchpad - - engine.connectControl(group, action, function(value, g, e) { - for (btn=0; btn btn*incr) { - this.send((y-btn)+","+x, this.colors[on_color], page); - } - else { - this.send((y-btn)+","+x, this.colors[off_color], page); - } - } - this.feedback_cache[g + e] = value; - }); - }, - - // - // turn a column of pads into a vumeter - // - - vumeter: function(y, x, page, nbtns, on_color, off_color, group, action) { - var incr = 1 / nbtns; - this.vumeters.push([ y, x, page, nbtns, on_color, off_color, group, action ]); - engine.connectControl(group, action, function(value, g, e) { - if (this.vumeter_shift > 0) { - for (btn=0; btn btn*incr) { - this.send((y-btn)+","+x, this.colors[on_color], page); - } - else { - this.send((y-btn)+","+x, this.colors[off_color], page); - } - } - } - this.feedback_cache[g + e] = value; - }); - }, - - vumeter_toggle: function(v) { - this.vumeter_shift = v > 0 ? 1 : 0; - - // - // clear fader leds when enabling vumeter and set back the leds for the volume if disabling - // - - for (i in this.vumeters) { - - var value = this.vumeter_shift > 0 ? 0 : this.feedback_cache[ this.vumeters[i][6] + 'volume' ]; - - if (value != undefined) { - var y = this.vumeters[i][0]; - var x = this.vumeters[i][1]; - var page = this.vumeters[i][2]; - var nbtns = this.vumeters[i][3]; - var on_color = this.vumeters[i][4]; - var off_color = this.vumeters[i][5]; - var incr = 1 / nbtns; - - for (btn=0; btn btn*incr) { - this.send((y-btn)+","+x, this.colors[on_color], page); - } - else { - this.send((y-btn)+","+x, this.colors[off_color], page); - } - } - } - } - }, - - // - // get the last value sent to a launchpad led - // - - get: function(name, page) { - if (typeof(this.cache[page][name]) == undefined) { - return 0; - } - else { - return this.cache[page][name]; - } - }, - - // - // set page - // - - set_page: function(page) { - if (page == this.page) return; - - var updates = {}; - var flashing = []; - - for (i in this.cache[page]) { - if (this.cache[this.page][i] == undefined || this.cache[this.page][i] != this.cache[page][i]) { - updates[i] = this.cache[page][i]; - } - } - - for (i in this.cache[this.page]) { - if (this.cache[page][i] == undefined) { - updates[i] = 0x4; // black with copy bit set - } - else if (this.cache[this.page][i] != this.cache[page][i] && updates[i] == undefined) { - updates[i] = this.cache[page][i]; - } - } - - // select buffer 1 - midi.sendShortMsg(0xb0, 0x0, 0x31); - - for (i in updates) { - if ((control = this.name2control[i]) != undefined) { - - // 0 makes no sense - need 0x4 for black/off - if (updates[i] == 0) { - updates[i] = 0x4; - } - - // send out non-flashing colors with copy bit removed - if (updates[i] & 0x4) { - midi.sendShortMsg(control[0], control[1], updates[i] & 0xfb); - } - else { - // send out off for this buffer for a flashing color - midi.sendShortMsg(control[0], control[1], 0x4); - flashing.push([ control[0], control[1], updates[i] ]); - } - } - } - - // select buffer 0 - midi.sendShortMsg(0xb0, 0x0, 0x34); - - // send out any flashing updates - for (i in flashing) { - midi.sendShortMsg(flashing[i][0], flashing[i][1], flashing[i][2]); - } - - // re-enable internal buffer cycling for flashing colors - midi.sendShortMsg(0xb0, 0x0, 0x28); - - this.page = page; - }, - - // - // define colors - // - - colors: function() { - return { - black: 4, - - lo_red: 1 + 4, - mi_red: 2 + 4, - hi_red: 3 + 4, - lo_green: 16 + 4, - mi_green: 32 + 4, - hi_green: 48 + 4, - lo_amber: 17 + 4, - mi_amber: 34 + 4, - hi_amber: 51 + 4, - hi_orange: 35 + 4, - lo_orange: 18 + 4, - hi_yellow: 50 + 4, - lo_yellow: 33 + 4, - - flash_lo_red: 1, - flash_mi_red: 2, - flash_hi_red: 3, - flash_lo_green: 16, - flash_mi_green: 32, - flash_hi_green: 48, - flash_lo_amber: 17, - flash_mi_amber: 34, - flash_hi_amber: 51, - flash_hi_orange: 35, - flash_lo_orange: 18, - flash_hi_yellow: 50, - flash_lo_yellow: 33 - } - }, - - // - // define midi for all the buttons (as we can't define names in the xml or access that data here) - // to create a 90 degree rotated mapping just redefine this list so "0,0" is still top left etc - // - - buttons: function() { - return { - 'up': [ 'cc', 1, 0x68 ], - 'down': [ 'cc', 1, 0x69 ], - 'left': [ 'cc', 1, 0x6A ], - 'right': [ 'cc', 1, 0x6B ], - 'session': [ 'cc', 1, 0x6C ], - 'user1': [ 'cc', 1, 0x6D ], - 'user2': [ 'cc', 1, 0x6E ], - 'mixer': [ 'cc', 1, 0x6F ], - 'vol': [ 'note', 1, 0x8 ], - 'pan': [ 'note', 1, 0x18 ], - 'snda': [ 'note', 1, 0x28 ], - 'sndb': [ 'note', 1, 0x38 ], - 'stop': [ 'note', 1, 0x48 ], - 'trkon': [ 'note', 1, 0x58 ], - 'solo': [ 'note', 1, 0x68 ], - 'arm': [ 'note', 1, 0x78 ], - '0,0': [ 'note', 1, 0x00 ], - '0,1': [ 'note', 1, 0x01 ], - '0,2': [ 'note', 1, 0x02 ], - '0,3': [ 'note', 1, 0x03 ], - '0,4': [ 'note', 1, 0x04 ], - '0,5': [ 'note', 1, 0x05 ], - '0,6': [ 'note', 1, 0x06 ], - '0,7': [ 'note', 1, 0x07 ], - '1,0': [ 'note', 1, 0x10 ], - '1,1': [ 'note', 1, 0x11 ], - '1,2': [ 'note', 1, 0x12 ], - '1,3': [ 'note', 1, 0x13 ], - '1,4': [ 'note', 1, 0x14 ], - '1,5': [ 'note', 1, 0x15 ], - '1,6': [ 'note', 1, 0x16 ], - '1,7': [ 'note', 1, 0x17 ], - '2,0': [ 'note', 1, 0x20 ], - '2,1': [ 'note', 1, 0x21 ], - '2,2': [ 'note', 1, 0x22 ], - '2,3': [ 'note', 1, 0x23 ], - '2,4': [ 'note', 1, 0x24 ], - '2,5': [ 'note', 1, 0x25 ], - '2,6': [ 'note', 1, 0x26 ], - '2,7': [ 'note', 1, 0x27 ], - '3,0': [ 'note', 1, 0x30 ], - '3,1': [ 'note', 1, 0x31 ], - '3,2': [ 'note', 1, 0x32 ], - '3,3': [ 'note', 1, 0x33 ], - '3,4': [ 'note', 1, 0x34 ], - '3,5': [ 'note', 1, 0x35 ], - '3,6': [ 'note', 1, 0x36 ], - '3,7': [ 'note', 1, 0x37 ], - '4,0': [ 'note', 1, 0x40 ], - '4,1': [ 'note', 1, 0x41 ], - '4,2': [ 'note', 1, 0x42 ], - '4,3': [ 'note', 1, 0x43 ], - '4,4': [ 'note', 1, 0x44 ], - '4,5': [ 'note', 1, 0x45 ], - '4,6': [ 'note', 1, 0x46 ], - '4,7': [ 'note', 1, 0x47 ], - '5,0': [ 'note', 1, 0x50 ], - '5,1': [ 'note', 1, 0x51 ], - '5,2': [ 'note', 1, 0x52 ], - '5,3': [ 'note', 1, 0x53 ], - '5,4': [ 'note', 1, 0x54 ], - '5,5': [ 'note', 1, 0x55 ], - '5,6': [ 'note', 1, 0x56 ], - '5,7': [ 'note', 1, 0x57 ], - '6,0': [ 'note', 1, 0x60 ], - '6,1': [ 'note', 1, 0x61 ], - '6,2': [ 'note', 1, 0x62 ], - '6,3': [ 'note', 1, 0x63 ], - '6,4': [ 'note', 1, 0x64 ], - '6,5': [ 'note', 1, 0x65 ], - '6,6': [ 'note', 1, 0x66 ], - '6,7': [ 'note', 1, 0x67 ], - '7,0': [ 'note', 1, 0x70 ], - '7,1': [ 'note', 1, 0x71 ], - '7,2': [ 'note', 1, 0x72 ], - '7,3': [ 'note', 1, 0x73 ], - '7,4': [ 'note', 1, 0x74 ], - '7,5': [ 'note', 1, 0x75 ], - '7,6': [ 'note', 1, 0x76 ], - '7,7': [ 'note', 1, 0x77 ] - }; - } -}; -