OLD RELEASE NOTE Midifighter Classic Firmware-20110511

@ Midifidler and/or Fatlimey:

Does the new analog combo code work by taking data from the position of the full range CC and running an algorithm on it to determine what data it sends for the half range CC? (simplified example, if the full range value is X and the half range value is y, then y=2x-127, and if x<63 then y always=0) This would mean that the half-range CC would always move in increments of 2.

OR

has the firmware been updated such that the half-range CC sends a full 128 values throughout its travel?

Thanks guys, and good work!

Since I’ve been getting intimate with the firmware over the past few weeks, I can answer this.

The physical fader ranges from 0 to 127 (inclusive). Superfader A’s output also ranges from 0 to 127, while superfader B’s output ranges from 0 to 105. There is a three value buffer zone at each end of the physical faders range (0, 1, 2 and 125, 126, 127) which is not mapped to the superfaders. That is, a difference of 1 on superfader A is worth 1.04 on the physical fader (except, in practice, due to integer math, it is truncated, with a jump of 1 every 25 physical values). The diagram below shows this:

//   0  3             64           124 127
//   |--|-------------|-------------|--|   - full range
//      |0=======================127|      - CC A
//                    |0=========105|      - CC B

So, superfader A is zero when the physical fader is at 3 or less. It is at 127 when the physical fader is at 124 or greater.
Similarly, superfader B is at 0 when the physical fader is at 64 or less and at 105 when the physical fader is at 124 or greater.

The fader value, read from the analog input, is mapped from [from, to] to [low, high] (and overflow/underflow is clamped). The values for from, to, low and high are the ones mentioned above.

The code which does this remapping is as follows:

uint8_t remap(uint8_t value, uint8_t from, uint8_t to, uint8_t lo, uint8_t hi)
{
if (value < from) return lo;
if (value > to) return hi;
uint16_t numer = (value - from) * (hi - lo);
uint16_t denom = (to - from);
return (uint8_t)(lo + (numer / denom));
}

And the code which uses this is:

const uint8_t NOTEON_LOW = 3;
const uint8_t NOTEON_HIGH = 127 - NOTEON_LOW;
const uint8_t MIDI_ANALOG_NOTE = 100;
const uint8_t MIDI_ANALOG_CC = 16;
uint8_t cc_a = MIDI_ANALOG_CC + 2*i;
uint8_t cc_b = MIDI_ANALOG_CC + 2*i + 1;

// New mapping style:
//
//   0  3             64           124 127
//   |--|-------------|-------------|--|   - full range
//
//      |0=======================127|      - CC A
//                    |0=========105|      - CC B
//
//   |__|on____________________________|   - note A
//   |off___________________________|on|   - note B
//      3                          124

if (value >= NOTEON_LOW && value <= NOTEON_HIGH) {

// 1. Generate the default CC event.
midi_stream_cc(cc_a, remap(value, NOTEON_LOW,NOTEON_HIGH, 0,127));

// 2. If the value is in the range 50%-100%, output the
// second CC range.
static uint8_t second_cc_value = 0;
if (value >= 64) {
second_cc_value = remap(value, 64,NOTEON_HIGH, 0,105);
midi_stream_cc(cc_b, second_cc_value);
} else {
// Make sure we zero the second CC value when we
// enter the lower range.
if (second_cc_value > 0) {
second_cc_value = 0;
midi_stream_cc(cc_b, second_cc_value);
}
}
}

Since superfader B value is worth 1.7 measured physical “values”, you would expect it to move roughly in increments of two, but since the algorithm uses integer math, 1.7 would usually be rounded down to 1, so I’d expect that would increase in increments of one and jump multiple values every now and again, though I have not measured it. Try it with MIDI-OX or something and see for yourself perhaps?

Did that answer your question?

Yeah, what he said.

Those values may seem arbitrary but they came about by using these things a lot, trying it in the field and noting the annoyances and niggles that came up over time.

Yup, it’s the Midifighter secret sauce. It’s not a mathematically perfect map, instead it’s a functionally optimized one.

Some cool stuff with these faders. I’m yet to dive in but I’m interested in how to go about midi-learning with these superfaders? Does it work or do you have to manually set them based on the CC values ? What about the on/off notes ?

I think having a go with 2 faders is going to be my 1st mod.

@guywithknife: Yeah, that answers my question. Unfortunately I can’t try it out myself - I don’t have an extra fader or pot right now. Future project, I guess. Also, I’m a little shy of modding my midifighters - they’re the unnumbered ones that used to be Ean’s (midifighter competition). But it’s hard to resist - I love customizing - we’ll see how long I can hold out…

Solder a header to the motherboard and you can mod to your hearts content without hurting anything further.

Will the source code ever get pushed to github? This would make submitting modifications much easier.

You could push the source code to github yourself, if you wanted to.

I’m well aware of that and if I ever make any worthwhile changes it will probably be what I do. I was just hoping that the code would get pushed to the official github account, which does exist.

Well… regardless I’m loving the damn thing. Funnest MIDI controller ever. From top to bottom.

I have pushed the latest firmware source to my own github repository: Midifighter/DJTT Latest at master · danielytics/Midifighter · GitHub

You will also find code for my own mod there, though I have not “officially” released it yet, so there may still be some bugs and especially formatting errors and lack of comments. I will fix this before I properly announce the code, alongside a blog post explaining the changes I made.

Is this for all midifighters or just the midifighter pro .

This is absolutely NOT for the MF Pro’s. This is only meant for the MF Classic

than you

i keep getting this error (this application has failed to start because libusb0.dll was not found . Renstalling the application may fix this problem . telling me midi fighter erased getting nothng from midi fighter flash of hex failed please helppppp

got it back into boot mode but now it tells me midi fighter update failed it goes to downloading hex and boom shuts down. STUPID STUPID STUPID DUHHHHHH
forgot to load hex file .Working great now

not working

i have installed drivers and followed instructions but it always says it fails??? how the heck do i get it in bootloader mode!!!

Hi Guys,

Sorry there was an issue on our file server which the firmware is retrieved from.
It should work again now.
Sorry for any time wasted!

I have a problem with the update, after it i cant use any mapping on traktor, when i connect the midi fighter the signal arrives to traktor but no effects or actions happens…

i have update both, traktor and midi fighter and i ve tried lots of .tsi files, but no one works…

I cant use my midifighter with traktor after doing the update, the instant gratification doenst work, HELP PLEASE!!!