Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

internetofdrums/internet-drum-pattern-validator

Repository files navigation

Internet Drum Pattern Validator

Validates base-64 encoded Internet Drum Pattern data and, if valid, return a formatted pattern.

Build status

Build Status

Requirements

To build the binary for your system, you need a Go distribution.

Installing

To install the validator, do:

go install github.com/internetofdrums/internet-drum-pattern-validator

Running

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

Errors

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.

About

Validates Internet Drum Pattern data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published