https://forum.processing.org/topic/control-p5-pro-midi-conflict


Hello it appears that both libraries use a class called Controller and when I add Control P5 to my sketch I get this error
"The type Controller is ambiguous"

due to this line for my ProMidi set up

Copy code
  1. void controllerIn(Controller controller, int device, int channel) {
  2.   int num = controller.getNumber();
  3.   int val = controller.getValue();

Does anyone have any recommendations for how to get them to play together nice?
thanks
kris

Replies(2)

hi, both promidi and controlp5 implement a class with name Controller. when importing both packages, processing/the compiler gets confused and doesnt know which Controller class to use. to make your compiler happy again, use the full path for each class Controller when used inside your code by either using promidi.Controller or controlP5.Controller where applicable. for your snippet above use:

Copy code
  1. void controllerIn(promidi.Controller controller, int device, int channel) {
  2.   int num = controller.getNumber();
  3.   int val = controller.getValue();


Thank you Andreas for both the answer and such a robust library.
I am relatively green when it comes to programming but am using both these libraries to really dive in and get some experience under my belt.

I have a separate question if you have the time: Im trying to create a simple framework for my Korg PadKontrol midi controller so that I can use either a midi controller or a controlP5 window to change variable parameters with a slider. I would like the slider to visually update when a variable is changed through means other than itself and I cant figure out how to do this.

I looked through the java doc reference on the control p5 site and found a few things that look possibly helpful but they are just shots in the dark. Can you recommend any methods for doing this?

thanks again

Posted by chacolina