Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping for Intech TEK2 #13521

Merged
merged 4 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions res/controllers/Intech TEK2.midi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset mixxxVersion="2.3.0" schemaVersion="1">
<info>
<name>Intech TEK2</name>
</info>
<controller id="TEK2">
<scriptfiles>
<file functionprefix="" filename="Intech TEK2.scripts.js"/>
</scriptfiles>
<controls>
<control>
<group>[Channel1]</group>
<key>TEK2.wheelTurn</key>
<status>0xB0</status>
<midino>0x08</midino>
<options>
<script-binding/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>TEK2.wheelTurn</key>
<status>0xB0</status>
<midino>0x09</midino>
<options>
<script-binding/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>TEK2.wheelTouch</key>
<status>0x90</status>
<midino>0x28</midino>
<options>
<script-binding/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>TEK2.wheelTouch</key>
<status>0x90</status>
<midino>0x29</midino>
<options>
<script-binding/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>play</key>
<description>MIDI Learned from 2 messages.</description>
<status>0x90</status>
<midino>0x20</midino>
<options>
<normal/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>cue_default</key>
<description>MIDI Learned from 2 messages.</description>
<status>0x90</status>
<midino>0x21</midino>
<options>
<normal/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>play</key>
<description>MIDI Learned from 2 messages.</description>
<status>0x90</status>
<midino>0x22</midino>
<options>
<normal/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>cue_default</key>
<description>MIDI Learned from 2 messages.</description>
<status>0x90</status>
<midino>0x23</midino>
<options>
<normal/>
</options>
</control>
</controls>
<outputs/>
</controller>
</MixxxControllerPreset>
33 changes: 33 additions & 0 deletions res/controllers/Intech TEK2.scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// eslint-disable-next-line no-var
var TEK2 = {};
TEK2.jogScratchSensitivity = 1;
TEK2.jogPitchSensitivity = 1.6;

TEK2.init = function() {};

TEK2.shutdown = function() {};

// The button that enables/disables scratching
TEK2.wheelTouch = function(channel, control, value, status, group) {
const deckNumber = script.deckFromGroup(group);
if (value === 0x7f) {
// If button downs
const alpha = 1.0 / 8;
const beta = alpha / 32;
engine.scratchEnable(deckNumber, 100, 33 + 1 / 3, alpha, beta);
} else {
// If button up
engine.scratchDisable(deckNumber);
}
};

TEK2.wheelTurn = function(channel, control, value, status, group) {
const newValue = value - 64;

const deckNumber = script.deckFromGroup(group);
if (engine.isScratching(deckNumber)) {
engine.scratchTick(deckNumber, newValue / TEK2.jogScratchSensitivity); // Scratch!
} else {
engine.setValue(group, "jog", newValue / TEK2.jogPitchSensitivity); // Pitch bend
}
};