Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadAPI(1);
- host.defineController("Novation", "Novation ReMOTE SL37", "1.0",
- "f56c04a0-c304-11e4-8830-0800200c9a66");
- host.defineMidiPorts(3, 1);
- var LOWEST_CC
- = 0;host.addDeviceNameBasedDiscoveryPair(["3- ReMOTE SL", "MIDIIN2 (3-ReMOTE SL)", "MIDIIN3 (3-ReMOTE SL)"],["3-ReMOTE SL"]);
- var HIGHEST_CC = 127;
- function init()
- {
- host.getMidiInPort
- (0).setMidiCallback(onMidi);
- generic = host.getMidiInPort(0).createNoteInput
- ("", "Novation ReMOTE keyboard");
- generic.setShouldConsumeEvents(false);
- //
- Make CCs 1-119 freely mappable
- userControls = host.createUserControlsSection
- (HIGHEST_CC - LOWEST_CC + 1);
- for(var i=LOWEST_CC; i<=HIGHEST_CC; i++)
- {
- userControls.getControl(i - LOWEST_CC).setLabel("CC" + i);
- }
- }
- function onMidi
- (status, data1, data2)
- {
- if (isChannelController(status))
- {
- if (data1 >=
- LOWEST_CC && data1 <= HIGHEST_CC)
- {
- var index = data1 - LOWEST_CC;
- userControls.getControl(index).set(data2, 128);
- }
- }
- }
- function exit()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement