Rotary encoder with midi potentiometer!

Hi! I've got an Arduino Uno and Rotary Encoder. I like to use as a midi controller Traktor Scratch Pro software. I found a variety of code already on the internet, but unfortunately none of them worked properly. Can you help him, how could I do that the idea? Thanks in advance!

I can't help with the details, but how far did you get? I assume you don't have a MIDI interface with a regular MIDI connector and you're using USB?

Did you find the [[u]MIDI USB software library[/u][/b] to make the Arduino USB port work like a USB-MIDI port? Does Trackor "see" the MIDI device? Once Trackor sees the MIDI controller, write a little test program to send a few MIDI messages to make sure it's communicating. Once everything is communicating, you can work on reading the rotary encoder and converting the readings to MIDI messages. (You might want to separately-experiment with reading the rotary encoder and sending some information to the Serial Monitor before combining the MIDI code.)](https://www.arduino.cc/en/Reference/MIDIUSB)

Midi solved a part dualMoco technique. The problem is that I can not solve at all not to properly manage the Used Rotary encored Traktor.

I found a seemingly good code, but teensy board was written and gives a lot of mistakes. I have an Arduino Uno board and I want to use.
Can you help me to know what the code change that?

#include <Encoder.h>

Encoder enc_one(2, 3);
int value; 

long enc_one_previous  = -999;
byte button_previous; 

void setup() {
  pinMode(23, INPUT_PULLUP); 
}



void loop() {
  value = enc_one.read();
  if(value > 127) {    enc_one.write(127);   }
  else if(value < 0) {    enc_one.write(0);  } 
  
  value = constrain(value, 0, 127);
  if (value != enc_one_previous) {    enc_one_previous = value;    usbMIDI.sendControlChange(1, value, 1);  }
  
  value = digitalRead(23); 
  if(value != button_previous) {    button_previous = value;    usbMIDI.sendControlChange(2, (1 - value) * 127, 1);    delay(3);  }
}