Last active
July 30, 2022 23:48
-
-
Save marcsello/4c9d7e85a20134d61f67bf97c274608c to your computer and use it in GitHub Desktop.
Edited Numark MIXTRACK Mixxx mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version='1.0' encoding='utf-8'?> | |
| <MixxxControllerPreset mixxxVersion="1.9.0+" schemaVersion="1"> | |
| <info> | |
| <name>Numark MIXTRACK (marcsello)</name> | |
| <author>Matteo ([email protected]), RAWRR, uncleeugene and Marcsello</author> | |
| <description>Numark MixTrack Mapping v1.0b (customized by Marcsello)</description> | |
| </info> | |
| <controller id="Numark"> | |
| <scriptfiles> | |
| <file filename="Numark-MixTrack-scripts-marcsello.js" functionprefix="NumarkMixTrack"/> | |
| </scriptfiles> | |
| <controls> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>volume</key> | |
| <status>0xB0</status> | |
| <midino>0x08</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>volume</key> | |
| <status>0xB0</status> | |
| <midino>0x09</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Master]</group> | |
| <key>crossfader</key> | |
| <status>0xB0</status> | |
| <midino>0x0A</midino> | |
| <options> | |
| <invert/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Master]</group> | |
| <key>headVolume</key> | |
| <status>0xB0</status> | |
| <midino>0x0B</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Master]</group> | |
| <key>headMix</key> | |
| <status>0xB0</status> | |
| <midino>0x0C</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>rate</key> | |
| <status>0xB0</status> | |
| <midino>0x0D</midino> | |
| <options> | |
| <soft-takeover/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>rate</key> | |
| <status>0xB0</status> | |
| <midino>0x0E</midino> | |
| <options> | |
| <soft-takeover/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>filterHigh</key> | |
| <status>0xB0</status> | |
| <midino>0x10</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>filterHigh</key> | |
| <status>0xB0</status> | |
| <midino>0x11</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>filterMid</key> | |
| <status>0xB0</status> | |
| <midino>0x12</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>filterMid</key> | |
| <status>0xB0</status> | |
| <midino>0x13</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>filterLow</key> | |
| <status>0xB0</status> | |
| <midino>0x14</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>filterLow</key> | |
| <status>0xB0</status> | |
| <midino>0x15</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Master]</group> | |
| <key>volume</key> | |
| <status>0xB0</status> | |
| <midino>0x17</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.jogWheel</key> | |
| <status>0xB0</status> | |
| <midino>0x18</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.jogWheel</key> | |
| <status>0xB0</status> | |
| <midino>0x19</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Playlist]</group> | |
| <key>NumarkMixTrack.selectKnob</key> | |
| <status>0xB0</status> | |
| <midino>0x1A</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect2]</group> | |
| <key>effect_selector</key> | |
| <description>MIDI Learned from 3 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x1B</midino> | |
| <options> | |
| <selectknob/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect2]</group> | |
| <key>meta</key> | |
| <description>MIDI Learned from 248 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x1C</midino> | |
| <options> | |
| <diff/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect3]</group> | |
| <key>meta</key> | |
| <description>MIDI Learned from 248 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x1D</midino> | |
| <options> | |
| <diff/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect2]</group> | |
| <key>effect_selector</key> | |
| <description>MIDI Learned from 18 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x1E</midino> | |
| <options> | |
| <selectknob/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect2]</group> | |
| <key>meta</key> | |
| <description>MIDI Learned from 253 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x1F</midino> | |
| <options> | |
| <diff/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect3]</group> | |
| <key>meta</key> | |
| <description>MIDI Learned from 231 messages.</description> | |
| <status>0xB0</status> | |
| <midino>0x20</midino> | |
| <options> | |
| <diff/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>cue_default</key> | |
| <status>0x90</status> | |
| <midino>0x33</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>LoadSelectedTrack</key> | |
| <status>0x90</status> | |
| <midino>0x34</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.PlayPause</key> | |
| <status>0x90</status> | |
| <midino>0x3B</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>cue_default</key> | |
| <status>0x90</status> | |
| <midino>0x3C</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>sync_enabled</key> | |
| <description>MIDI Learned from 4 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x40</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.PlayPause</key> | |
| <description>asdasd</description> | |
| <status>0x90</status> | |
| <midino>0x42</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>beatjump_backward</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x43</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>beatjump_forward</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x44</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>beatjump_backward</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x45</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>beatjump_forward</key> | |
| <description>MIDI Learned from 4 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x46</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>sync_enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x47</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.toggleScratchMode</key> | |
| <status>0x90</status> | |
| <midino>0x48</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>cue_goto</key> | |
| <status>0x90</status> | |
| <midino>0x4A</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>LoadSelectedTrack</key> | |
| <status>0x90</status> | |
| <midino>0x4B</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>cue_goto</key> | |
| <status>0x90</status> | |
| <midino>0x4C</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.WheelTouch</key> | |
| <status>0x90</status> | |
| <midino>0x4D</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.WheelTouch</key> | |
| <status>0x90</status> | |
| <midino>0x4E</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Playlist]</group> | |
| <key>NumarkMixTrack.toggleDirectoryMode</key> | |
| <status>0x90</status> | |
| <midino>0x4F</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.toggleScratchMode</key> | |
| <status>0x90</status> | |
| <midino>0x50</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.ToggleKeylock</key> | |
| <status>0x90</status> | |
| <midino>0x51</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.ToggleKeylock</key> | |
| <status>0x90</status> | |
| <midino>0x52</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.loopIn</key> | |
| <status>0x90</status> | |
| <midino>0x53</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.loopOut</key> | |
| <status>0x90</status> | |
| <midino>0x54</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.reLoop</key> | |
| <status>0x90</status> | |
| <midino>0x55</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.loopIn</key> | |
| <status>0x90</status> | |
| <midino>0x56</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.loopOut</key> | |
| <status>0x90</status> | |
| <midino>0x57</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.reLoop</key> | |
| <status>0x90</status> | |
| <midino>0x58</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>quantize</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x59</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect1]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5A</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect2]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5B</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect3]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5C</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>quantize</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5D</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect1]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 6 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5E</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect2]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x5F</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect3]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x60</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.toggleManualLooping</key> | |
| <status>0x90</status> | |
| <midino>0x61</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.toggleManualLooping</key> | |
| <status>0x90</status> | |
| <midino>0x62</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>NumarkMixTrack.toggleDragMode</key> | |
| <description>asdasd</description> | |
| <status>0x90</status> | |
| <midino>0x63</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>NumarkMixTrack.toggleDragMode</key> | |
| <description>asdasd</description> | |
| <status>0x90</status> | |
| <midino>0x64</midino> | |
| <options> | |
| <script-binding/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel1]</group> | |
| <key>pfl</key> | |
| <status>0x90</status> | |
| <midino>0x65</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Channel2]</group> | |
| <key>pfl</key> | |
| <status>0x90</status> | |
| <midino>0x66</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit2_Effect2]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 4 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x67</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[EffectRack1_EffectUnit1_Effect2]</group> | |
| <key>enabled</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x68</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| <control> | |
| <group>[Master]</group> | |
| <key>maximize_library</key> | |
| <description>MIDI Learned from 2 messages.</description> | |
| <status>0x90</status> | |
| <midino>0x69</midino> | |
| <options> | |
| <normal/> | |
| </options> | |
| </control> | |
| </controls> | |
| <outputs> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>beat_active</key> | |
| <status>0x90</status> | |
| <midino>0x4A</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>cue_indicator</key> | |
| <status>0x90</status> | |
| <midino>0x33</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>pfl</key> | |
| <status>0x90</status> | |
| <midino>0x65</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>play</key> | |
| <status>0x90</status> | |
| <midino>0x3B</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>quantize</key> | |
| <status>0x90</status> | |
| <midino>0x59</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| <minimum>-0.1</minimum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>rate</key> | |
| <status>0x90</status> | |
| <midino>0x70</midino> | |
| <on>0x64</on> | |
| <maximum>0.1</maximum> | |
| <minimum>-0.1</minimum> | |
| </output> | |
| <output> | |
| <group>[Channel1]</group> | |
| <key>sync_enabled</key> | |
| <status>0x90</status> | |
| <midino>0x40</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>beat_active</key> | |
| <status>0x90</status> | |
| <midino>0x4C</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>cue_indicator</key> | |
| <status>0x90</status> | |
| <midino>0x3C</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>pfl</key> | |
| <status>0x90</status> | |
| <midino>0x66</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>play</key> | |
| <status>0x90</status> | |
| <midino>0x42</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>quantize</key> | |
| <status>0x90</status> | |
| <midino>0x5D</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| <minimum>-0.1</minimum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>rate</key> | |
| <status>0x90</status> | |
| <midino>0x71</midino> | |
| <on>0x64</on> | |
| <maximum>0.1</maximum> | |
| <minimum>-0.1</minimum> | |
| </output> | |
| <output> | |
| <group>[Channel2]</group> | |
| <key>sync_enabled</key> | |
| <status>0x90</status> | |
| <midino>0x47</midino> | |
| <on>0x00</on> | |
| <off>0x64</off> | |
| <maximum>0.1</maximum> | |
| </output> | |
| </outputs> | |
| </controller> | |
| </MixxxControllerPreset> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //////////////////////////////////////////////////////////////////////// | |
| // JSHint configuration // | |
| //////////////////////////////////////////////////////////////////////// | |
| /* global engine */ | |
| /* global script */ | |
| /* global midi */ | |
| /* global bpm */ | |
| /* global components */ | |
| //////////////////////////////////////////////////////////////////////// | |
| // Numark Mixtrack Mapping Script Functions (customized by Marcsello) | |
| // 26/06/2011 - v1.0b | |
| // Matteo <[email protected]> | |
| // With contributions from | |
| // uncleeugene | |
| // RAWRR | |
| var NumarkMixTrack = {} | |
| NumarkMixTrack.init = function(id) { // called when the MIDI device is opened & set up | |
| NumarkMixTrack.id = id; // Store the ID of this device for later use | |
| NumarkMixTrack.directoryMode = false; | |
| // 0 = left deck, 1 = right deck | |
| NumarkMixTrack.scratchMode = [false, false]; | |
| NumarkMixTrack.scratching = [false, false]; | |
| NumarkMixTrack.KeyIsLocked = [false,false]; | |
| NumarkMixTrack.manualLooping = [false, false]; | |
| NumarkMixTrack.dragMode = [false, false]; | |
| NumarkMixTrack.braking = [false, false]; | |
| // 0 = common, 1 = left deck, 2 = right deck | |
| NumarkMixTrack.leds = [ | |
| // Common | |
| { "directory": 0x73, "file": 0x72 }, | |
| // Deck 1 | |
| { "rate": 0x70, "scratchMode": 0x48, "keylock": 0x51, "manualLoop": 0x61, "loopIn": 0x53, "loopOut": 0x54, "reLoop": 0x55, "effect": 0x63, "hiKill": 0x5c,"midKill": 0x5b, "lowKill": 0x5a}, | |
| // Deck 2 | |
| { "rate": 0x71, "scratchMode": 0x50, "keylock": 0x52, "manualLoop": 0x62, "loopIn": 0x56, "loopOut": 0x57, "reLoop": 0x58, "effect": 0x64, "hiKill": 0x60,"midKill": 0x5f, "lowKill": 0x5e} | |
| ]; | |
| // Helper to match effect ID to led | |
| NumarkMixTrack.effectLeds = ["lowKill", "midKill", "hiKill"] | |
| // Set initial state of leds | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[0]["file"], true); | |
| for (var deck=1; deck<3; deck++) { | |
| var group = NumarkMixTrack.deckToGroup(deck); | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| // Set a single timer for flashing leds | |
| NumarkMixTrack.flash_timer = engine.beginTimer(250,"NumarkMixTrack.flash()"); | |
| NumarkMixTrack.flash_timer_state = false; | |
| NumarkMixTrack.connections = [ | |
| engine.makeConnection('[Channel1]', 'loop_enabled', NumarkMixTrack.update_loop_leds_callback), | |
| engine.makeConnection('[Channel2]', 'loop_enabled', NumarkMixTrack.update_loop_leds_callback), | |
| engine.makeConnection('[Channel1]', 'beatloop_size', NumarkMixTrack.update_loop_leds_callback), | |
| engine.makeConnection('[Channel2]', 'beatloop_size', NumarkMixTrack.update_loop_leds_callback), | |
| // loading a track may reset loops | |
| // Effect leds may change | |
| engine.makeConnection('[Channel1]', 'track_loaded', NumarkMixTrack.track_loaded_callback), | |
| engine.makeConnection('[Channel2]', 'track_loaded', NumarkMixTrack.track_loaded_callback), | |
| // Effect | |
| engine.makeConnection('[EffectRack1_EffectUnit1_Effect1]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| engine.makeConnection('[EffectRack1_EffectUnit1_Effect2]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| engine.makeConnection('[EffectRack1_EffectUnit1_Effect3]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| engine.makeConnection('[EffectRack1_EffectUnit2_Effect1]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| engine.makeConnection('[EffectRack1_EffectUnit2_Effect2]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| engine.makeConnection('[EffectRack1_EffectUnit2_Effect3]', 'enabled', NumarkMixTrack.update_effect_led_callback), | |
| // Play | |
| engine.makeConnection('[Channel1]', 'play', NumarkMixTrack.play_callback), | |
| engine.makeConnection('[Channel2]', 'play', NumarkMixTrack.play_callback), | |
| ] | |
| } | |
| NumarkMixTrack.shutdown = function(id) { // called when the MIDI device is closed | |
| var lowestLED = 0x30; | |
| var highestLED = 0x73; | |
| for (var i=lowestLED; i<=highestLED; i++) { | |
| NumarkMixTrack.setLED(i, false); // Turn off all the lights | |
| } | |
| engine.stopTimer(NumarkMixTrack.flash_timer); | |
| for (var i=0; i < NumarkMixTrack.sync_connections.length; i++) { | |
| NumarkMixTrack.connections[i].disconnect(); | |
| } | |
| } | |
| NumarkMixTrack.groupToDeck = function(group) { | |
| /* | |
| var matches = group.match(/^\[Channel(\d+)\]$/); | |
| if (matches == null) { | |
| return -1; | |
| } else { | |
| return matches[1]; | |
| } | |
| */ | |
| // substring is faster than regex | |
| return parseInt(group.substring(8,9)); | |
| } | |
| NumarkMixTrack.effectGroupToDeck = function(group) { | |
| var matches = group.match(/^\[EffectRack1_EffectUnit(\d+)_Effect\d+\]$/); | |
| if (matches == null) { | |
| return -1; | |
| } else { | |
| return matches[1]; | |
| } | |
| } | |
| NumarkMixTrack.deckToGroup = function(deck) { | |
| return "[Channel" + deck + "]" | |
| } | |
| NumarkMixTrack.samplesPerBeat = function(group) { | |
| // FIXME: Get correct channels for current deck | |
| var sampleRate = engine.getValue(group, "track_samplerate"); | |
| var channels = 2; | |
| var bpm = engine.getValue(group, "file_bpm"); | |
| var ret=channels * sampleRate * 60 / bpm; | |
| return channels * sampleRate * 60 / bpm; | |
| } | |
| NumarkMixTrack.setLED = function(value, status) { | |
| if (status) { | |
| status = 0x64; | |
| } else { | |
| status = 0x00; | |
| } | |
| midi.sendShortMsg(0x90, value, status); | |
| } | |
| NumarkMixTrack.selectKnob = function(channel, control, value, status, group) { | |
| if (value > 63) { | |
| value = value - 128; | |
| } | |
| if (NumarkMixTrack.directoryMode) { | |
| if (value < 0) { | |
| for (var i = 0; i < -value; i++) { | |
| engine.setValue(group, "SelectNextPlaylist", 1); | |
| } | |
| } else { | |
| for (var i = 0; i < value; i++) { | |
| engine.setValue(group, "SelectPrevPlaylist", 1); | |
| } | |
| } | |
| } else { | |
| engine.setValue(group, "SelectTrackKnob", -value); | |
| } | |
| } | |
| // This is a very magical part | |
| // The name of the functions are the ones that are printed in white on the controller (for manual mode) | |
| // First the led controls | |
| NumarkMixTrack.update_loop_leds = function(group, deck) { | |
| var manualLooping = NumarkMixTrack.manualLooping[deck-1]; | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["manualLoop"], manualLooping); | |
| var loopEnabled = !!engine.getValue(group, 'loop_enabled'); | |
| if (manualLooping) { | |
| var start = engine.getValue(group, "loop_start_position"); | |
| var end = engine.getValue(group, "loop_end_position"); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopIn"], start != -1); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopOut"], end != -1); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["reLoop"], loopEnabled); | |
| } else { | |
| var beatloop_size = engine.getValue(group, 'beatloop_size'); | |
| var min_reached = beatloop_size < 0.0625; // min is 0.03125 | |
| if (loopEnabled) { | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopIn"], NumarkMixTrack.flash_timer_state && (!min_reached)); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["reLoop"], NumarkMixTrack.flash_timer_state); | |
| } else { | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopIn"], !min_reached); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["reLoop"], true); | |
| } | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopOut"], loopEnabled); | |
| } | |
| } | |
| NumarkMixTrack.update_loop_leds_callback = function(value, group, control) { | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| NumarkMixTrack.update_effect_leds = function(group, deck) { | |
| for (var i = 1; i <4; i++) { | |
| if (engine.getValue("[EffectRack1_EffectUnit" + deck + "_Effect" + i + "]", 'enabled')) { | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck][NumarkMixTrack.effectLeds[i-1]], NumarkMixTrack.flash_timer_state) | |
| } | |
| } | |
| } | |
| // Update all effect leds for a deck | |
| NumarkMixTrack.update_effect_leds_callback = function(value, group, control) { | |
| var deck = NumarkMixTrack.effectGroupToDeck(group); | |
| NumarkMixTrack.update_effect_leds(group, deck); | |
| } | |
| // Callback to update a single effect indicator led | |
| NumarkMixTrack.update_effect_led_callback = function(value, group, control) { | |
| var matches = group.match(/^\[EffectRack1_EffectUnit(\d+)_Effect(\d+)\]$/); | |
| var deck = matches[1]; | |
| var effect = matches[2]; | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck][NumarkMixTrack.effectLeds[effect-1]], NumarkMixTrack.flash_timer_state && !!value) | |
| } | |
| NumarkMixTrack.track_loaded_callback = function(value, group, control) { | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| NumarkMixTrack.update_effect_leds(group, deck); | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| NumarkMixTrack.ResetEffects(deck); | |
| } | |
| NumarkMixTrack.play_callback = function(value, group, control) { | |
| if (value) { | |
| return; // run when stopped | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| NumarkMixTrack.braking[deck-1] = false; | |
| } | |
| NumarkMixTrack.flash = function() { // I do like flashing leds | |
| NumarkMixTrack.flash_timer_state = !NumarkMixTrack.flash_timer_state; | |
| for (var deck=1; deck<3; deck++) { | |
| var group = NumarkMixTrack.deckToGroup(deck); | |
| var manualLooping = NumarkMixTrack.manualLooping[deck-1]; | |
| if (!manualLooping) { | |
| var loopEnabled = !!engine.getValue(group, 'loop_enabled'); | |
| if (loopEnabled) { | |
| var beatloop_size = engine.getValue(group, 'beatloop_size'); | |
| var min_reached = beatloop_size < 0.0625; // min is 0.03125 | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["loopIn"], NumarkMixTrack.flash_timer_state && (!min_reached)) | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["reLoop"], NumarkMixTrack.flash_timer_state); | |
| } | |
| } | |
| for (var i = 1; i <4; i++) { | |
| if (engine.getValue("[EffectRack1_EffectUnit" + deck + "_Effect" + i + "]", 'enabled')) { | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck][NumarkMixTrack.effectLeds[i-1]], NumarkMixTrack.flash_timer_state) | |
| } | |
| } | |
| } | |
| } | |
| // Then the actual controls | |
| NumarkMixTrack.loopIn = function(channel, control, value, status, group) { | |
| if (!value) { | |
| // Work only on press | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| var manualLooping = NumarkMixTrack.manualLooping[deck-1]; | |
| if (manualLooping) { | |
| script.triggerControl(group, 'loop_in'); | |
| } else { | |
| script.triggerControl(group, 'loop_halve'); | |
| } | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| NumarkMixTrack.loopOut = function(channel, control, value, status, group) { | |
| if (!value) { | |
| // Work only on press | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| var manualLooping = NumarkMixTrack.manualLooping[deck-1]; | |
| if (manualLooping) { | |
| script.triggerControl(group, 'loop_out'); | |
| } else { | |
| // Well, this is the best I could came up with... | |
| var loopEnabled = !!engine.getValue(group, 'loop_enabled'); | |
| if (loopEnabled) { | |
| script.triggerControl(group, 'reloop_toggle') | |
| } else { | |
| script.triggerControl(group, 'beatloop_activate') | |
| } | |
| } | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| NumarkMixTrack.reLoop = function(channel, control, value, status, group) { | |
| if (!value) { | |
| // Work only on press | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| var manualLooping = NumarkMixTrack.manualLooping[deck-1]; | |
| if (manualLooping) { | |
| script.triggerControl(group, 'reloop_toggle'); | |
| } else { | |
| script.triggerControl(group, 'loop_double'); | |
| } | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| NumarkMixTrack.toggleManualLooping = function(channel, control, value, status, group) { | |
| if (!value) { | |
| // Work only on press | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| // Toggle setting and light | |
| NumarkMixTrack.manualLooping[deck-1] = !NumarkMixTrack.manualLooping[deck-1]; | |
| NumarkMixTrack.update_loop_leds(group, deck); | |
| } | |
| // End of loop related controls | |
| NumarkMixTrack.jogWheel = function(channel, control, value, status, group) { | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| var adjustedJog = parseFloat(value); | |
| var posNeg = 1; | |
| if (adjustedJog > 63) { // Counter-clockwise | |
| posNeg = -1; | |
| adjustedJog = value - 128; | |
| } | |
| if (NumarkMixTrack.scratching[deck-1]) { | |
| engine.scratchTick(deck, adjustedJog); | |
| } | |
| else | |
| { | |
| var gammaInputRange = 23; // Max jog speed | |
| var maxOutFraction = 0.5; // Where on the curve it should peak; 0.5 is half-way | |
| var sensitivity = 0.5; // Adjustment gamma | |
| var gammaOutputRange = 3; // Max rate change | |
| if (engine.getValue(group,"play")) { | |
| adjustedJog = posNeg * gammaOutputRange * Math.pow(Math.abs(adjustedJog) / (gammaInputRange * maxOutFraction), sensitivity); | |
| } else { | |
| adjustedJog = gammaOutputRange * adjustedJog / (gammaInputRange * maxOutFraction); | |
| } | |
| engine.setValue(group, "jog", adjustedJog); | |
| } | |
| } | |
| NumarkMixTrack.toggleDirectoryMode = function(channel, control, value, status, group) { | |
| // Toggle setting and light | |
| if (value) { | |
| if (NumarkMixTrack.directoryMode) { | |
| NumarkMixTrack.directoryMode = false; | |
| } else { | |
| NumarkMixTrack.directoryMode = true; | |
| } | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[0]["directory"], NumarkMixTrack.directoryMode); | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[0]["file"], !NumarkMixTrack.directoryMode); | |
| } | |
| } | |
| NumarkMixTrack.toggleScratchMode = function(channel, control, value, status, group) { | |
| if (!value) { | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| // Toggle setting and light | |
| if (NumarkMixTrack.scratchMode[deck-1]) { | |
| NumarkMixTrack.scratchMode[deck-1] = false; | |
| if (NumarkMixTrack.scratching[deck-1]) { | |
| engine.scratchDisable(deck); | |
| NumarkMixTrack.scratching[deck-1] = false; | |
| } | |
| } else { | |
| NumarkMixTrack.scratchMode[deck-1] = true; | |
| } | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["scratchMode"], NumarkMixTrack.scratchMode[deck-1]); | |
| } | |
| NumarkMixTrack.toggleDragMode = function(channel, control, value, status, group) { | |
| if (!value) { | |
| return; | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| NumarkMixTrack.dragMode[deck-1] = !NumarkMixTrack.dragMode[deck-1] | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["effect"], NumarkMixTrack.dragMode[deck-1]); | |
| } | |
| NumarkMixTrack.WheelTouch = function (channel, control, value, status, group) { | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| if (NumarkMixTrack.scratchMode[deck-1]) { | |
| if (value) { // Wheel touched | |
| engine.scratchEnable(deck, 512, 33+1/3, 0.2, (0.2)/32); | |
| NumarkMixTrack.scratching[deck-1] = true; | |
| } | |
| else { // Wheel left | |
| engine.scratchDisable(deck); | |
| NumarkMixTrack.scratching[deck-1] = false; | |
| } | |
| } | |
| } | |
| NumarkMixTrack.ToggleKeylock = function(channel, control, value, status, group) { | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| // Toggle setting and light | |
| if (value) { | |
| if (NumarkMixTrack.KeyIsLocked[deck-1]) { | |
| engine.setValue(group, "keylock", 0); | |
| NumarkMixTrack.KeyIsLocked[deck-1] = false; | |
| } else { | |
| engine.setValue(group, "keylock", 1); | |
| NumarkMixTrack.KeyIsLocked[deck-1] = true; | |
| } | |
| NumarkMixTrack.setLED(NumarkMixTrack.leds[deck]["keylock"], NumarkMixTrack.KeyIsLocked[deck-1]); | |
| } | |
| } | |
| NumarkMixTrack.ResetEffects = function(deck) { | |
| for (var i = 1; i < 4; i ++) { | |
| engine.setParameter("[EffectRack1_EffectUnit" + deck + "_Effect" + i + "]", "enabled", 0); | |
| } | |
| } | |
| NumarkMixTrack.PlayPause = function(channel, control, value, status, group) { | |
| if (!value) { | |
| return | |
| } | |
| var deck = NumarkMixTrack.groupToDeck(group); | |
| var isPlaying = engine.getValue(group, 'play') | |
| if (NumarkMixTrack.dragMode[deck-1]) { | |
| if (!isPlaying || NumarkMixTrack.braking[deck-1]) { | |
| engine.softStart(deck, true, 30); | |
| NumarkMixTrack.braking[deck-1] = false; | |
| } else { | |
| engine.brake(deck, true, 30); | |
| NumarkMixTrack.braking[deck-1] = true; | |
| } | |
| } else { | |
| engine.setValue(group, 'play', !isPlaying ); | |
| NumarkMixTrack.braking[deck-1] = false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment