ZioGuido / GMLAB_D9X

Repository for the GMLAB D9X Midi Drawbar Controller
13 stars 5 forks source link

Call of overloaded 'begin(int)' is ambiguous #1

Closed jlevianderson closed 3 years ago

jlevianderson commented 3 years ago

Hello! I am trying to reprogram the Arduino in Arduino IDE using the 'GMLAB_D9X.ino' code provided. I have edited the user definition of the midi map to correspond with my keyboard but when I try to verify the code I receive this error:

"Call of overloaded 'begin(int)' is ambiguous"

I have downloaded and included the required libraries but I'm not sure if I missed a step. I will attach the full error report below:

"/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino: In function 'void SendMidiCC(int, int, int)': /Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:38: warning: narrowing conversion of '(176 | channel)' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing] midiEventPacket_t CC = {0x0B, 0xB0 | channel, num, value};


/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:59: warning: narrowing conversion of 'num' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
   midiEventPacket_t CC = {0x0B, 0xB0 | channel, num, value};
                                                           ^
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:59: warning: narrowing conversion of 'value' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino: In function 'void setup()':
NordElectro5:489:15: error: call of overloaded 'begin(int)' is ambiguous
   mcp0.begin(0);
               ^
In file included from /Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:9:0:
/Users/bluedream/Documents/Arduino/libraries/Adafruit_MCP23017_Arduino_Library/Adafruit_MCP23017.h:26:8: note: candidate: void Adafruit_MCP23017::begin(uint8_t, TwoWire*)
   void begin(uint8_t addr, TwoWire *theWire = &Wire);
        ^~~~~
/Users/bluedream/Documents/Arduino/libraries/Adafruit_MCP23017_Arduino_Library/Adafruit_MCP23017.h:27:8: note: candidate: void Adafruit_MCP23017::begin(TwoWire*)
   void begin(TwoWire *theWire = &Wire);
        ^~~~~
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:547:42: warning: invalid conversion from 'void (*)()' to 'timerEventHandler {aka void (*)(MillisTimer&)}' [-fpermissive]
   ButtonTimer.expiredHandler(CheckButtons);
                                          ^
In file included from /Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:11:0:
/Users/bluedream/Documents/Arduino/libraries/MillisTimer-master/MillisTimer.h:37:10: note:   initializing argument 1 of 'void MillisTimer::expiredHandler(timerEventHandler)'
     void expiredHandler(timerEventHandler handler);
          ^~~~~~~~~~~~~~
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:551:41: warning: invalid conversion from 'void (*)()' to 'timerEventHandler {aka void (*)(MillisTimer&)}' [-fpermissive]
   LedAnimTimer.expiredHandler(DoSpeedLED);
                                         ^
In file included from /Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:11:0:
/Users/bluedream/Documents/Arduino/libraries/MillisTimer-master/MillisTimer.h:37:10: note:   initializing argument 1 of 'void MillisTimer::expiredHandler(timerEventHandler)'
     void expiredHandler(timerEventHandler handler);
          ^~~~~~~~~~~~~~
exit status 1
call of overloaded 'begin(int)' is ambiguous"

Line 473 of the 'GMLAB_D9X.ino' code appears to be generating this error:

"mcp0.begin(0);"

Thank you for any help! Not sure if this is an issue with the version of one of the libraries I'm using or if there's something else I need to do to get this thing reprogrammed. Let me know if there's any additional information I can provide to help get this solved.
Much appreciated! :)
ZioGuido commented 3 years ago

Hi, the error apparently resides in the MillisTimer library. Try to use an older version.

Guido.

Il giorno lun 8 feb 2021 alle ore 09:47 JLA notifications@github.com ha scritto:

Hello! I am trying to reprogram the Arduino in Arduino IDE using the 'GMLAB_D9X.ino' code provided. I have edited the user definition of the midi map to correspond with my keyboard but when I try to verify the code I receive this error:

"Call of overloaded 'begin(int)' is ambiguous"

I have downloaded and included the required libraries but I'm not sure if I missed a step. I will attach the full error report below:

"/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino: In function 'void SendMidiCC(int, int, int)': /Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:38: warning: narrowing conversion of '(176 | channel)' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing] midiEventPacket_t CC = {0x0B, 0xB0 | channel, num, value};


/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:59:
warning: narrowing conversion of 'num' from 'int' to 'uint8_t {aka unsigned
char}' inside { } [-Wnarrowing]
midiEventPacket_t CC = {0x0B, 0xB0 | channel, num, value};
^
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:241:59:
warning: narrowing conversion of 'value' from 'int' to 'uint8_t {aka
unsigned char}' inside { } [-Wnarrowing]
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino: In
function 'void setup()':
NordElectro5:489:15: error: call of overloaded 'begin(int)' is ambiguous
mcp0.begin(0);
^
In file included from
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:9:0:
/Users/bluedream/Documents/Arduino/libraries/Adafruit_MCP23017_Arduino_Library/Adafruit_MCP23017.h:26:8:
note: candidate: void Adafruit_MCP23017::begin(uint8_t, TwoWire*)
void begin(uint8_t addr, TwoWire

*theWire = &Wire); ^~~~~
/Users/bluedream/Documents/Arduino/libraries/Adafruit_MCP23017_Arduino_Library/Adafruit_MCP23017.h:27:8:
note: candidate: void Adafruit_MCP23017::begin(TwoWire*)
void begin(TwoWire

*theWire = &Wire); ^~~~~
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:547:42:
warning: invalid conversion from 'void (*)()' to 'timerEventHandler {aka
void (

*)(MillisTimer&)}' [-fpermissive]
ButtonTimer.expiredHandler(CheckButtons); ^ In file included from
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:11:0:
/Users/bluedream/Documents/Arduino/libraries/MillisTimer-master/MillisTimer.h:37:10:
note: initializing argument 1 of 'void
MillisTimer::expiredHandler(timerEventHandler)' void
expiredHandler(timerEventHandler handler); ^~~~~~~~~~~~~~
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:551:41:
warning: invalid conversion from 'void (*)()' to 'timerEventHandler {aka
void (*)(MillisTimer&)}' [-fpermissive]
LedAnimTimer.expiredHandler(DoSpeedLED);
^
In file included from
/Users/bluedream/Documents/Arduino/NordElectro5/NordElectro5.ino:11:0:
/Users/bluedream/Documents/Arduino/libraries/MillisTimer-master/MillisTimer.h:37:10:
note: initializing argument 1 of 'void
MillisTimer::expiredHandler(timerEventHandler)'
void expiredHandler(timerEventHandler handler);
^~~~~~~~~~~~~~
exit status 1
call of overloaded 'begin(int)' is ambiguous"

Line 473 of the 'GMLAB_D9X.ino' code appears to be generating this error:

"mcp0.begin(0);"

Thank you for any help! Not sure if this is an issue with the version of
one of the libraries I'm using or if there's something else I need to do to
get this thing reprogrammed. Let me know if there's any additional
information I can provide to help get this solved.
Much appreciated! :)

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/ZioGuido/GMLAB_D9X/issues/1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHC6L2ALMUIECDYX64UPMTS56QKVANCNFSM4XISGHGQ>
.
jlevianderson commented 3 years ago

Thank you! I will try to download an older version of the library and see if it resolves the issue. I appreciate your help!

jlevianderson commented 3 years ago

Hello Guido! Thank you for pointing me in the right direction. I did need to use an older version of the MillisTimer library as well as the Adafruit MCP23017 library in order to get the code to verify correctly in the arduino IDE. Once that was complete I was able to program the Arduino to work with a Nord Electro 5 keyboard. I did need to use a TRS-B USB cable in order to communicate with the Arduino but I believe that was mentioned in the instructions.

I'll attach the code below in case you're interested in expanding the compatibility with the D9X to work with Nord Electro 5 keyboards as well. Information about the Nord Electro 5 MIDI Controller list can be found on page 21 in their user manual (https://www.nordkeyboards.com/sites/default/files/files/downloads/manuals/nord-electro-5/Nord%20Electro%205%20English%20User%20Manual%20v1.x%20Edition%20E.pdf)

Thank you for putting all of this together! This project helped fulfill my dad's dream of having drawbars on his keyboard! :)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // USER DEFINITION OF THE MIDI MAP //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

define EXP_PEDAL_CC 11

int DrawbarCCMap[3][9] = { { 16, 17, 18, 19, 20, 21, 22, 23, 24 }, // Organ Drawbar (1-9) { 64, 11, 0, 0, 0, 0, 0, 0, 0 } // Sustain (64), Control Pedal (Expression) (11) };

enum PotentiometerCCMap { kMidiCC_Volume = 7, kMidiCC_Overdrive = 76,
kMidiCC_Reverb = 91,
kMidiCC_KeyClick = 75, kMidiCC_EqBass = 8,
kMidiCC_EqTreble = 10,
};

enum ButtonCCMap { kMidiCC_VibratoType = 73, kMidiCC_VibratoUpper = 31,
kMidiCC_VibratoLower = 30,
kMidiCC_PercussionOn = 66,
kMidiCC_PercussionSoft = 70,
kMidiCC_PercussionFast = 71,
kMidiCC_PercussionThird = 72,
kMidiCC_RotaryOnOff = 85,
kMidiCC_RotarySlowFast = 1,
kMidiCC_RotaryRunStop = 68,
};

// The CC values sent for each of the 6 C/V positions int CVvalues[6] = { 0, 27, 52, 78, 102, 127 };