PieterP:
I replied to your post here: Encoder Rotativo - Midi Serial - #3 by PieterP - Software - Arduino Forum
The MIDI controller library has been replaced by the Control Surface library:
Control Surface: RotaryEncoder.ino
Pieter
I was reviewing the codes, I was doing some tests but I could not do what I need. My knowledge of arduino is very little and recent and I apologize for the inconvenience that I may experience.
I'm still using the arduino for hairless, the only thing I get there is the following error:
"warning: got a status byte when we expecting 1 more data bytes, sending possibly incomplete MIDI message.
got unexpected data byte"
This is using the following code (I tried both options):
#include <Encoder.h> // Include the Encoder library.
// This must be done before the Control Surface library.
#include <Control_Surface.h> // Include the Control Surface library
// Instantiate a MIDI over USB interface.
USBMIDI_Interface midi;
// Instantiate a CCAbsoluteEncoder object
//CCAbsoluteEncoder enc = {
//{2, 3}, // pins
//MIDI_CC::Pan, // MIDI address (CC number + optional channel)
//1, // optional multiplier if the control isn't fast enough
//};
// Similarly, for Pitch Bend
PBAbsoluteEncoder enc = {
{2, 3}, // pins
CHANNEL_1, // MIDI channel
127, // large multiplier because Pitch Bend has high resolution
};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}
I have a midi driver (NanoKontrolStudio) whose encoder returns 2 notes, one for each side, and it's just what I need. As if each pulse was a pulse of a button. ej:
CW CC Number: 28
CCW CC Number: 29