A library can enable to talk to your Launchpad Mini device in .NET & .NET Core. You can light buttons, listen pressed keys
Developed this library on Novation Launchpad Mini But you can contribute to extend library for another launchpads
- You have to install "PortMidi" library on your computer
$ apt-get install libportmidi0
$ brew install portmidi
choco install portmidi
- Install launchpad library on your project
$ dotnet add package launchpad
Basic example usage of launchpad library
static readonly LaunchpadManager LaunchpadManager = new LaunchpadManager();
static readonly Dictionary<string, int> Histories = new Dictionary<string, int>();
static void Main(string[] args)
{
if (!LaunchpadManager.FindDevice())
{
Console.WriteLine("Cannot find any Launchpad Device");
return;
}
if (!LaunchpadManager.Open())
{
Console.WriteLine("Cannot open Launchpad device");
return;
}
LaunchpadManager.Clear();
LaunchpadManager.ListenStart(KeyPressed);
Console.ReadKey();
LaunchpadManager.ListenStop();
}
static void KeyPressed(LaunchpadEventArgs e)
{
string key = $"X:{e.Hit.X} Y:{e.Hit.Y}";
if (!Histories.ContainsKey(key))
{
Histories.Add(key, 1);
}
Console.WriteLine($"Pressed: {key}");
LaunchpadManager.Light(e.Hit, (LaunchpadColor) Histories[key]);
if ((LaunchpadColor) Histories[key] == LaunchpadColor.Red)
{
Histories[key] = 0;
}
else
{
Histories[key]++;
}
}
- If you want to contribute to codes, create pull request
- If you find any bugs or error, create an issue
This project is licensed under the MIT License