I need help with this arduino leonardo, I can't find any code that serves to control a kontakt library, can anyone help me
Welcome to the forum
There is a language problem here
What is a "kontact" ? A relay perhaps ?
i am assuming it is the NI Kontakt, a sample player with extensive sound library.
That Kontakt will take any midi input, i suggest you have a look at the control surface library.
kontakt is a vst that runs virtual keyboard libraries, and it has buttons and knobs that can be controlled by a midi controller, but I need a code that I can address any function within kontakt, like button or effect knob , volume.
So we are talking about the same program.
In standalone mode, right-click on the knob will open the midi-learn function.
You will need to specify the midi-input device in the midi settings.
a Leonardo can act as a USB-midi device (if configured that way) , and you can send any midi message you want from it.
If used as a plugin for a DAW you will be using the DAW's midi implementation, which will vary per specific program.
Control Surface is probably the most straight forward library for you to use, and was written (and usually also supported) by someone active on this forum.
can you tell me if the arduino leonardo accepts this code? it gave me an error,
and I have no idea how to work with the code, to configure the buttons or knobs, can you give me an example?
The best video tutorials I have found on this subject are these.
(515) Arduino MIDI Controller: Part 1 - Potentiometers - YouTube
(515) Arduino MIDI Controller: Part 2 - Buttons - YouTube
(515) Arduino MIDI Controller: Part 3 - Multiplexers - YouTube
I have successfully built projects following these and using the supplied code (for an UNO). Not sure if it will work with a Leonardo though. Might be worth a try.
I am pretty sure there are examples included in the library.
Have a look at,
Examples -> Control Surface -> Midi Output -> Potentiometers & Faders -> Control-Change-Potentiometer
Example.
/**
* This example demonstrates the use of MIDI Control Change potentiometers that
* can be used for changing effect parameters, volumes, pan and balance
* controls, etc. It can control almost any knob in your DAW software.
*
* @boards AVR, AVR USB, Nano Every, Due, Nano 33, Teensy 3.x, ESP32
*
* Connections
* -----------
*
* - A0: wiper of a potentiometer
*
* Connect the left terminal of the potentiometer to ground, and the right one
* to V<sub>CC</sub>.
*
* Behavior
* --------
*
* - When you turn the potentiometer, you should receive MIDI Control Change
* events, with a value between 0 and 127.
* - The analog input is filtered, so there shouldn't be any noise on the
* position. If there is, check your wiring, and make sure that the resistance
* of the potentiometer isn't too high (10 kΩ is ideal).
*
* Mapping
* -------
*
* Select the Arduino as a custom MIDI controller in your DAW, and use the
* MIDI learn option to assign the potentiometer to a function.
* It will send the MIDI Control Change Channel Volume parameter for channel 1.
*
* Written by PieterP, 2019-08-13
* https://github.com/tttapa/Control-Surface
*/
#include <Control_Surface.h> // Include the Control Surface library
// Instantiate a MIDI over USB interface.
USBMIDI_Interface midi;
// Instantiate a CCPotentiometer object
CCPotentiometer potentiometer = {
A0, // Analog pin connected to potentiometer
{MIDI_CC::Channel_Volume, CHANNEL_1}, // Channel volume of channel 1
};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}
Contol surface has many examples, and if you intent to use a lot of faders in your project, it has control through multiplexers built in.
thanks friend, it worked perfectly, now I just have to put a freezer, why are the buttons giving commands, when you press and when you release
there is also a buttonLatch class i think.
The library is rather extensive but have a look through the SRC
or contact the author @PieterP
Please post code within </> code-tags (and modify the code you posted already)
The answer to you question is in the First-Output Example you need to create an array of objects and fill the fields of the array. It is a lot of curly braces, but it should look like this
#include <Control_Surface.h> // Include the Control Surface library
// Instantiate a MIDI over USB interface.
USBMIDI_Interface midi;
// Instantiate a CCButton object
CCButtonLatched button[] = {
{2, {MIDI_CC::General_Purpose_Controller_1, CHANNEL_1}},
{3, {MIDI_CC::General_Purpose_Controller_2, CHANNEL_1}},
};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}
If you only need the first channel, you can eliminate some braces:
// Instantiate a CCButton object
CCButtonLatched button[] {
{2, MIDI_CC::General_Purpose_Controller_1},
{3, MIDI_CC::General_Purpose_Controller_2},
};
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.