/mptsh-cpp

ANSI color code syntax highlighting for OpenMPT pattern data (C++ version, ported by @Sightem)

Primary LanguageC++GNU General Public License v3.0GPL-3.0

OpenMPT ANSI Syntax Highlighting

Info

This program adds syntax highlighting to your clipboard (using ANSI color codes) when copying pattern data in OpenMPT.

The main purpose of this program is to paste syntax-highlighted OpenMPT pattern data in Discord, using ansi Markdown code blocks.

Demo

Discord screenshot, showing a section of an OpenMPT pattern, with and without syntax highlighting. Screenshot

Command-line usage

[EXEC] [OPTIONS] [COLORS]

Options:

  • -h or --help: Help (show all available options)
  • -i or --stdin: Read input from STDIN instead of clipboard
  • -o or --stdout: Write output to STDOUT instead of clipboard
  • -d or --markdown: Wrap output in ansi Markdown code block (for Discord)
  • -r or --reverse: Reverse mode (removes syntax highlighting instead of adding)

Using -d (--markdown) does nothing if -r (--reverse) is also enabled.

Colors: X,X,X,X,X,X,X,X - Each value from 0 to 15 (Discord only supports 0 to 7)
format: Default,Note,Instrument,Volume,Panning,Pitch,Global,ChannelSeparator
if not provided: 7,5,4,2,6,3,1,7

Example color schemes

Color scheme Preview Command-line argument
Console (dark) Console (bright) Discord (dark)
Default Dark:
7,5,4,2,6,3,1,7
Bright:
15,13,12,10,14,11,9,15
OpenMPT Dark:
7,4,6,2,6,3,1,7
Bright:
15,12,14,10,14,11,9,15
Impulse Tracker Dark:
2,2,2,6,7,2,2,3
Bright:
10,10,10,14,15,10,10,11
FastTracker 2 Dark:
3,3,3,3,3,3,3,6
Bright:
11,11,11,11,11,11,11,14