Control surface + library encoder = the full adventure with Presonus studio one

Hello, i am requesting help from PieterP for his rotaryencoder.ino.

i have simplest schematic possible, one single encoder.

whatever the mode i use from those on the list, the final result on the DAW ( FL studio or presonus studio one ) i got for a single tick i do to the right from +63 to 100%, depending the mode, and the opposite value when i turn to the left.

i am an old fart in audio creation, not in electronic, but i would have expected a simple +/-1 on the encoder when i make a tick .

int pin 2&3 or not int pin (22,23) , same behavior... not a wiring issue.

i understand subjet may be discussed hundreds of times already, i try to read what i find before asking help, i already read this page :

which is the exact pb i have , except that i do not use airless and loopmidi but i use a bootloader from mocolufa, and it works perfectly for button and pots, so this not firmware issue neither.

fully working in absolute mode with absoluteRotaryEncoder.ino, i can raise a mixer volume to max, but of course when i set the encoder on another fader channel, the very 1st move takes the value of the encoder itself instead of starting from the value of the new focused fader.

i just don't know, i am requesting your help, because from this point my knowledge has hit a wall.



found out this page that seems to respond by using code and setting usb to be mackie .

the code of the guy is massive, am totally drowned

but as i understand, he manages to get the midi values back to the encoders to prevent jumps that occurs with the absolute mode.

if anyone can help, indicate solution to what i am looking for, i would appreciate.


just found out the name V_POT_1 was the name of the encoder 1 of the mackie control unit.

and by using default rotary encoder.ino but setting studio one in mackie control ( main unit ) the encoder just works fine with what it is assigned, PAN on channel 1.

so it is a big step.

i got the list from archive .org of a sniffed mackie control parameters , i am searching for explanation on how the MCU is used with the library


If the code works with an CCAbsoluteEncoder, that means that your DAW is configured to interpret whatever values it receives as absolute positions.
If you want to use CCRotaryEncoder, you have to tell your DAW that the values it receives are relative. This is something you have to change in the settings of your DAW, you cannot do anything about it in your Arduino code.

If you configure the Arduino as a Mackie Control Universal in your DAW settings, the RotaryEncoder.ino example should just work. It selects the right address (MCU::V_POT_1) and the correct relative mode (MACKIE_CONTROL_RELATIVE).

hey PieterP ! nice to see you, i have read a lot from you this days. i wish you are fine.

i refreshed the page to add my discovery and this is exactly what you are telling right now !,

any no mackie hardware added for studio one will make any auto detect "information" as knob. and mackie selection based HUI/control/extend will make studio one detect/assign differently the detected information as encoder like but locked by design to minimal function and also from what is declared from you library.

i found out the solution by reading this page :

and indeed from what you say, it makes change how presonus care about the information model it receives.

and i am very proud to announce that from my 1 encoder and 2 opened project files with same assigned encoder, the +1 -1 without jump is fully working and i am veryyyyyyy happy of that because it unlocks the next step of my project !
i can focus to merge the notes & volt modele file ( very simple, just uncomment to add pot, button, mux, ) but not containing any encoder, with your own template and see how i can combine that.

thanks for your response again.


i changed the name of the thread because since i didn't find on single place all the informations i need to understand what i am doing and help me to build my controller, i will update with informations for a new encoder specific problem, then the solution when i find it.

the very next step is now to dig in studio one how i can open the assign function on encoder instead of buttons, because i plan to use encoders for zoom in/out vertically the track lines, zoom in/out horizontally, and a scroll left/right with a jog ( wondering if broken trackball would do the job ).

response in the next episode :slight_smile:


i finished the soldering and all the assembly of the controller, but there is something strange with my HY040 encoders.

i placed them on board by pair 23-23 to 52-53. they are not catching all ticks on rotations, both sides.

the ticking light TX shows, just confirmed by midi input analyser in studio one, that when i turn in one side, the +65 +65 +65 +65 got randomly some couterwise -2 -2 -2 and it break of course the movement of the encoder.

i thought it was probably bad encoders, so i took one, and i used it on pin 2-3 alone, and the result is even worse way more uncatched ticks.

but also when i got an uncatched tick, if i replay it back and forth by pushing the axe of the encoder on a side, the arduino is catching it.

i am a bit confused, any idea ?

i used those one

That sounds like a poor-quality encoder to me.

Hi Pieter.

Do you have a link of good quality encoders to suggest to me pls ? a reference or something ?

No, I don't have any recommendations, maybe someone else on the forum can answer that.

Before you go out to buy new ones, make sure that it's not the wiring that's faulty. You can try the examples that come with the Encoder library. Also try using interrupt pins instead of 22-23 and 52-53.

Already done and was worse on pin 2-3 with way less detection ( tx blinking )

i am still investigating i totally disassembly one and i do not see why it behaves asymetrically, one side way better than other, and the bias occur by physically tilting the axis.

i wear one in putting axis in the drill to rotate fast and make a print on metal, check pictures,
same response on the arduino.

The problem is not fully about the encoders.

One encoder on pin 22-23, i turn clockwise to get the erratic behavior.
->if i flip the cables, the erratic behavior is transfered counterclockwise, and it should not...

looking at debouncing and how to get into the code to understand what can be done.

i saw you remove " uint8_t pulsesPerStep " from the example.

i do not see any parameter that can help at the moment.

i think this guy got the solution but i don't know how to copy his code to put in midi destination library :

otherwise, using :

CCRotaryEncoder enc1 = {
{22, 23},

reduce problem by amplify the swing of value per tick, so when a single'd tick was not recognized, now it can pulse a +1 to +3..... so it means the arduino still understand what it receives, the reason why one 4 pulse per step the arduino won't take some steps is above my understanding at the moment.