Validates base-64 encoded Internet Drum Pattern data and, if valid, return a formatted pattern.
To build the binary for your system, you need a Go distribution.
To install the validator, do:
go install github.com/internetofdrums/internet-drum-pattern-validator
To validate a drum pattern, run the internet-drum-pattern-validator
command with the drum pattern as its only
argument, e.g.:
internet-drum-pattern-validator fwAAAH8AAAB/AAAAfwAAAAAAQAAAAEAAAABAAAAAQAAAAAAAfwAAAAAAAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
The program should return successfully and print the decoded pattern, for example:
The drum pattern is valid!
After decoding, the pattern looks like this, where 0xXX is one note with a velocity of XX:
0x7F 0x00 0x00 0x00 0x7F 0x00 0x00 0x00 0x7F 0x00 0x00 0x00 0x7F 0x00 0x00 0x00
0x00 0x00 0x40 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x40 0x00 0x00 0x00 0x40 0x00
0x00 0x00 0x00 0x00 0x7F 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7F 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
If the drum pattern is missing or incorrect, the program exits with a non-zero exit code and some helpful instructions, for example:
Could not decode drum pattern: illegal base64 data at input byte 0.
or:
Usage: internet-drum-pattern-validator <pattern>
where <pattern> is a standard Base64 (see RFC 4648) encoded byte array
following the Internet Drum Pattern Specification, see:
https://github.com/internetofdrums/internet-drum-pattern-spec#readme
If the pattern is valid, the pattern data is formatted and written to stdout.