Skip to content

Commit

Permalink
add DAW Controller support for various Arturia controllers
Browse files Browse the repository at this point in the history
MiniLab 3
Keylab Essential
KeyLab Essential mk3
KeyLab mkII

based on https://github.com/PrzemekBarski/arturia-keylab-essential-mk3-programming-guide

Tested on a Arturia MiniLab 3 and KeyLab mkII

Keylab Essential and Keylab Essential mk3 is not tested
  • Loading branch information
soyersoyer committed Dec 21, 2024
1 parent d4ab9ed commit 9cf9ea7
Show file tree
Hide file tree
Showing 16 changed files with 1,371 additions and 116 deletions.
3 changes: 2 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ CMSIS_DIR = ../CMSIS_5/CMSIS
OBJS = main.o kernel.o minidexed.o config.o userinterface.o uimenu.o \
mididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
sysexfileloader.o performanceconfig.o perftimer.o \
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o \
dawcontroller.o

OPTIMIZE = -O3

Expand Down
64 changes: 63 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ void CConfig::Load (void)
m_MIDIButtonActionBankDown = m_Properties.GetString ("MIDIButtonActionBankDown", "");
m_MIDIButtonActionTGUp = m_Properties.GetString ("MIDIButtonActionTGUp", "");
m_MIDIButtonActionTGDown = m_Properties.GetString ("MIDIButtonActionTGDown", "");


m_bDAWControllerEnabled = m_Properties.GetNumber ("DAWControllerEnabled", 0) != 0;

m_bEncoderEnabled = m_Properties.GetNumber ("EncoderEnabled", 0) != 0;
m_nEncoderPinClock = m_Properties.GetNumber ("EncoderPinClock", 10);
m_nEncoderPinData = m_Properties.GetNumber ("EncoderPinData", 9);
Expand Down Expand Up @@ -666,6 +668,36 @@ unsigned CConfig::GetMIDIButtonHome (void) const
return m_nMIDIButtonHome;
}

void CConfig::SetMIDIButtonCh (unsigned v)
{
m_nMIDIButtonCh = v;
}

void CConfig::SetMIDIButtonPrev (unsigned v)
{
m_nMIDIButtonPrev = v;
}

void CConfig::SetMIDIButtonNext (unsigned v)
{
m_nMIDIButtonNext = v;
}

void CConfig::SetMIDIButtonBack (unsigned v)
{
m_nMIDIButtonBack = v;
}

void CConfig::SetMIDIButtonSelect (unsigned v)
{
m_nMIDIButtonSelect = v;
}

void CConfig::SetMIDIButtonHome (unsigned v)
{
m_nMIDIButtonHome = v;
}

const char *CConfig::GetMIDIButtonActionPrev (void) const
{
return m_MIDIButtonActionPrev.c_str();
Expand All @@ -691,6 +723,31 @@ const char *CConfig::GetMIDIButtonActionHome (void) const
return m_MIDIButtonActionHome.c_str();
}

void CConfig::SetMIDIButtonActionPrev (const char *v)
{
m_MIDIButtonActionPrev = v;
}

void CConfig::SetMIDIButtonActionNext (const char *v)
{
m_MIDIButtonActionNext = v;
}

void CConfig::SetMIDIButtonActionBack (const char *v)
{
m_MIDIButtonActionBack = v;
}

void CConfig::SetMIDIButtonActionSelect (const char *v)
{
m_MIDIButtonActionSelect = v;
}

void CConfig::SetMIDIButtonActionHome (const char *v)
{
m_MIDIButtonActionHome = v;
}

unsigned CConfig::GetMIDIButtonPgmUp (void) const
{
return m_nMIDIButtonPgmUp;
Expand Down Expand Up @@ -751,6 +808,11 @@ const char *CConfig::GetMIDIButtonActionTGDown (void) const
return m_MIDIButtonActionTGDown.c_str();
}

bool CConfig::GetDAWControllerEnabled (void) const
{
return m_bDAWControllerEnabled;
}

bool CConfig::GetEncoderEnabled (void) const
{
return m_bEncoderEnabled;
Expand Down
42 changes: 30 additions & 12 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,27 @@ class CConfig // Configuration for MiniDexed
unsigned GetMIDIButtonSelect (void) const;
unsigned GetMIDIButtonHome (void) const;

void SetMIDIButtonCh (unsigned v);

void SetMIDIButtonPrev (unsigned v);
void SetMIDIButtonNext (unsigned v);
void SetMIDIButtonBack (unsigned v);
void SetMIDIButtonSelect (unsigned v);
void SetMIDIButtonHome (unsigned v);

// Action type for Midi buttons: "click", "doubleclick", "longpress", "dec", "inc", ""
const char *GetMIDIButtonActionPrev (void) const;
const char *GetMIDIButtonActionNext (void) const;
const char *GetMIDIButtonActionBack (void) const;
const char *GetMIDIButtonActionSelect (void) const;
const char *GetMIDIButtonActionHome (void) const;

void SetMIDIButtonActionPrev (const char *v);
void SetMIDIButtonActionNext (const char *v);
void SetMIDIButtonActionBack (const char *v);
void SetMIDIButtonActionSelect (const char *v);
void SetMIDIButtonActionHome (const char *v);

// MIDI Button Program and TG Selection
unsigned GetMIDIButtonPgmUp (void) const;
unsigned GetMIDIButtonPgmDown (void) const;
Expand All @@ -240,6 +254,8 @@ class CConfig // Configuration for MiniDexed
const char *GetMIDIButtonActionTGUp (void) const;
const char *GetMIDIButtonActionTGDown (void) const;

bool GetDAWControllerEnabled (void) const;

// KY-040 Rotary Encoder
// GPIO pin numbers are chip numbers, not header positions
bool GetEncoderEnabled (void) const;
Expand Down Expand Up @@ -341,18 +357,6 @@ class CConfig // Configuration for MiniDexed
std::string m_ButtonActionBankDown;
std::string m_ButtonActionTGUp;
std::string m_ButtonActionTGDown;

std::string m_MIDIButtonActionPrev;
std::string m_MIDIButtonActionNext;
std::string m_MIDIButtonActionBack;
std::string m_MIDIButtonActionSelect;
std::string m_MIDIButtonActionHome;
std::string m_MIDIButtonActionPgmUp;
std::string m_MIDIButtonActionPgmDown;
std::string m_MIDIButtonActionBankUp;
std::string m_MIDIButtonActionBankDown;
std::string m_MIDIButtonActionTGUp;
std::string m_MIDIButtonActionTGDown;

unsigned m_nDoubleClickTimeout;
unsigned m_nLongPressTimeout;
Expand All @@ -371,6 +375,20 @@ class CConfig // Configuration for MiniDexed
unsigned m_nMIDIButtonTGUp;
unsigned m_nMIDIButtonTGDown;

std::string m_MIDIButtonActionPrev;
std::string m_MIDIButtonActionNext;
std::string m_MIDIButtonActionBack;
std::string m_MIDIButtonActionSelect;
std::string m_MIDIButtonActionHome;
std::string m_MIDIButtonActionPgmUp;
std::string m_MIDIButtonActionPgmDown;
std::string m_MIDIButtonActionBankUp;
std::string m_MIDIButtonActionBankDown;
std::string m_MIDIButtonActionTGUp;
std::string m_MIDIButtonActionTGDown;

bool m_bDAWControllerEnabled;

bool m_bEncoderEnabled;
unsigned m_nEncoderPinClock;
unsigned m_nEncoderPinData;
Expand Down
Loading

0 comments on commit 9cf9ea7

Please sign in to comment.