Skip to content

ChickChicky/lpm3-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Launchpad Mini Mk3 Scripts

A little collection of scripts designed for the Launchpad Mini Mk3

They were designed and tested on Windows 10/11 and are likely to not work as expected on other systems

Quick words

Quick start

Installing the dependencies

pip install -r requirements.txt

Setting up the environment variables

Use this command to figure out the ID of your MIDI inputs/outputs

py probe.py

Then you can set your environment variables, e.g.

(powershell)

[Environment]::SetEnvironmentVariable("LPM3S_INPUT", "1", "Machine")

(batch / command line)

setx LPM3S_INPUT "1" /M

Putting the launchpad in programmer mode

The scripts need the launchpad to be put in programmer mode, which can easily be toggled with mode.py

  • It can easily be disabled through unplugging and plugging back the device
  • It is not necessary at the moment to use it with Wirtual, as it currently only supports programmer mode
$ py mode.py p # Enters programmer mode
$ py mode.py l # Exits programmer mode

About Wirtual

If you don't own a Launchpad Mini Mk3, Wirtual is a small program that emulates more or less its programmer mode, and is plenty enough for the scripts in this project
You will also need to set up its environment variables (setting up, environment variables list)
Furthermore, it requires some kind of software to create virtual MIDI ports:

  • If you want to run it on the same machine, you can use tools like loopMIDI
  • If you want to run it on a separate machine, you can use tools like rtpMIDI (which can be useful if you have a laptop with a touchscreen)

Environment Variables

Name Default Value Usage
LPM3S_INPUT 0 Sets the input MIDI port for the project
LPM3S_OUTPUT 1 Sets the output MIDI port for the project
WIRTUAL_MIDI_INPUT 0 Sets the input MIDI port for Wirtual
WIRTUAL_MIDI_OUTPUT 1 Sets the output MIDI port for Wirtual
WIRTUAL_KEY_SIZE 100 Sets the overall size of the pads in Wirtual
WIRTUAL_KEY_WIDTH 100 Overrides the width of the pads in Wirtual
WIRTUAL_KEY_HEIGHT 100 Overrides the height of the pads in Wirtual

mode.py

Changes the mode of the launchpad (currently not working for Wirtual)

Argument Description
l Puts the launchpad into live mode (default mode when it starts)
p Puts the launchpad into programmer mode (all scripts rely on it)
L<int> Sends a layout command with the provided value (refer to Launchpad Mini Mk3 Programmer's Manual)
P<int> Sends a programmer mode command with the provided value (should be 0-1 to disable/enable)

probe.py

Probes MIDI ports, useful to set up the ports

paint.py

A paint program made by @Wolfuri

animator.py

An app to create animations

Argument Description
-r Performs a clean start, doesn't load the previously saved state
-s Prevents saving new state

play.py

Plays 8x8 RGB24 video files on the launchpad

You can use gen.py to convert videos to the right format

  • You might also need to download ffmpeg

Or you can use this command:
ffmpeg -y -i SOURCE -filter_complex "fps=FPS,scale=8x8:flags=neighbor" -r FPS -f rawvideo -pix_fmt rgb24 OUTPUT

  • Replace SOURCE, FPS and OUTPUT with the desired values
Argument Description
video The video file to play
-f <fps> The FPS (default 40)
-l Make the video loop

gen.py

Converts video files into RGB24 video files

Argument Description
input The input video path
output The output video path
-f <fps> The FPS (default 40)
-p Enables the nearest neighbour flag (can improve renders on some videos)
-c <contrast> Adds a contrast filter
-b <brightness> Adds a brightness filter
-s <saturation> Adds a saturation filter
-e <name=value> Adds an eq filter
--filter <name=value> Adds a filter
-a [value] Enables hardware acceleration (defaults to CUDA if present but no value is provided)

wirtual

An attempt at emulating the launchpad
To use it, you will need a program to create virtual MIDI ports, such as loopMIDI or rtpMIDI

It currently is quite limited and only supports programmer mode (custom modes probably won't be implemented unless I figure out how to parse custom mode files)

About

A little collection of scripts designed for the Launchpad Mini Mk3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages