Skip to content

A library can enable to talk to your Launchpad Mini device in .NET Core. You can light buttons, listen pressed keys

License

Notifications You must be signed in to change notification settings

net-core-audio/launchpad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Launchpad

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

Getting Started

  1. You have to install "PortMidi" library on your computer

Linux (Ubuntu)

$ apt-get install libportmidi0

Mac OS

$ brew install portmidi

Windows

choco install portmidi
  1. Install launchpad library on your project
$ dotnet add package launchpad

Example

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]++;
            }
        }

Contributing

  • If you want to contribute to codes, create pull request
  • If you find any bugs or error, create an issue

License

This project is licensed under the MIT License

About

A library can enable to talk to your Launchpad Mini device in .NET Core. You can light buttons, listen pressed keys

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages