Just trying to setup my trusted faderfox lc2 for transport control i found i have to write a script for it.
I´m here for the music but i also don´t mind a challenge so i started the codeacademy course on js. Now i´m almost finished and look at an existing script and the api documentation i feel like there´s still a long way to go.
I also feel like understanding this and writing this script can´t be too far from creating a simple web interface for churning out scripts from entered cc numbers/notes and functions.
This is a half-rant , please tell me i´m on the right track and almost there OR to sit back and wait because someone´s on to this.
Some hints for startes would be nice too, the "intro" thread here starts with "this info is outdated".
I´m not a coder - how long will this take me?
-
- KVRian
- 818 posts since 18 Oct, 2014
- KVRAF
- 4805 posts since 21 Jan, 2008 from oO
there was a faderfox control script mentioned by Thomas once, not sure wich version or if this is going to be finished.
Nobody can tell you how long it will take to learn all that stuff, since everbody learns at a different speed, however getting into this is quite an approach wich will lead to something good usually. Just don`t get too frustrated but it will take some time if its all new to you.
good luck!
Nobody can tell you how long it will take to learn all that stuff, since everbody learns at a different speed, however getting into this is quite an approach wich will lead to something good usually. Just don`t get too frustrated but it will take some time if its all new to you.
good luck!
JamWide - a cross-platform Ninjam client for DAWs
-
- KVRian
- Topic Starter
- 818 posts since 18 Oct, 2014
Ok almost there
, thanks for the encouragement.
Digging through Mozilla´s JS reference helped a lot as did inspecting the midi.js. Here´s what i came up with:
Two questions remain:
Is it possible to deactivate a loaded midi clock transmitter?
How can i test for the midi channel of the input? I tried the following:
but apparently this is not how it works.
Digging through Mozilla´s JS reference helped a lot as did inspecting the midi.js. Here´s what i came up with:
Code: Select all
loadAPI(1);
host.defineController("Faderfox", "LC2", "1.0", "5a92dfe0-80d2-11e4-b4a9-0800200c9a66");
host.defineMidiPorts(1, 0);
function init() {
transport = host.createTransport();
host.getMidiInPort(0).setMidiCallback(onMidi);
cursorTrack = host.createArrangerCursorTrack(2, 0);
primaryDevice = cursorTrack.getPrimaryDevice();
}
function exit() {
}
function onMidi(status, data1, data2) {
if (isNoteOn(status) && data2 > 0) {
switch (data1) {
case 0x00: transport.tapTempo();
break;
case 0x01: transport.tapTempo();
break;
case 0x67: transport.tapTempo();
break;
case 0x20: transport.tapTempo();
break;
case 0x2B: transport.rewind();
break;
case 0x2C: transport.fastForward();
break;
case 0x2D: transport.toggleClick();
break;
case 0x2E: transport.play();
break;
case 0x2F: transport.stop();
break;
case 0x30: transport.record();
break;
default: break;
}
} ;
if (isChannelController) {
switch (data1) {
case 0x00: primaryDevice.getMacro(0).getAmount().set(data2, 128);
break;
case 0x01: primaryDevice.getMacro(1).getAmount().set(data2, 128);
break;
case 0x02: primaryDevice.getMacro(2).getAmount().set(data2, 128);
break;
case 0x03: primaryDevice.getMacro(3).getAmount().set(data2, 128);
break;
case 0x04: primaryDevice.getMacro(4).getAmount().set(data2, 128);
break;
case 0x05: primaryDevice.getMacro(5).getAmount().set(data2, 128);
break;
case 0x06: primaryDevice.getMacro(6).getAmount().set(data2, 128);
break;
case 0x07: primaryDevice.getMacro(7).getAmount().set(data2, 128);
break;
}
};
}
Is it possible to deactivate a loaded midi clock transmitter?
How can i test for the midi channel of the input? I tried the following:
Code: Select all
if (isChannelController && (MIDIChannel(status)==15)) {
