# INSTRUMENT DEFINITIONS are a fast and easy way to setup a track to work with a given instrument.
# These files must be UTF-8 encoded, with the ".txt" file extension.
# Supports all alphanumeric ASCII, and ' ', '_', '-', '+'
# The file is broken up into several sections, e.g. one for naming CCs, one for setting up drum lanes, etc. 
# Each section contains keywords, known as commands, followed by values to set a given property.
# Inside sections, each line will define a new command and its value
# Almost all commands are optional, and most values can be set to NULL (to not overwrite the current state of the track).
# All text to the right of a '#' character are comments, and have no effect.
# They should be stored in the HAPAX folder of the SD card, alongside the projects.
VERSION 1 # Currently, this should only be 1

# Remane the Hapax track name after loading this Instrument Definition file (NULL = don't rename)
TRACKNAME NULL

# Set the Track Type (can be POLY, DRUM, MPE, POLYAT or AFTR - both name the poly
# aftertouch type, AFTR being the label shown on screen - or NULL)
TYPE NULL

# Can be A, B, C, D, USBD, USBH, CVGx, CVx, Gx (x between 1-4) or NULL
# When using Virtual Ports: can also be USBDx or USBHx (x between 1-16) (e.g. USBD1 for USB Device port 1, USBH16 for USB Host port 16)
OUTPORT NULL

# Can be x (between 1-16), or NULL (note: this is ignored if OUTPORT is not a MIDI port)
OUTCHAN NULL

# Can be NONE, ALLACTIVE, A, B, USBH, USBD, USBDx, USBHx (x between 1-16), CVG, or NULL
# When using Virtual Ports: can also be USBDx or USBHx (x between 1-16)
INPORT NULL

# Can be x (between 1-16), ALL, or NULL (note: this is ignored if INPORT is NONE, ALLACTIVE or CVG)
INCHAN NULL

# This defines the default 'MAX RATE' for automation lanes
# Can be NULL, 192, 96, 64, 48, 32, 24, 16, 12, 8, 6, 4, 3, 2, 1
MAXRATE NULL

# DRUMLANES CONFIG AND CUSTOM NAMES
# Syntax: ROW:TRIG:CHAN:NOTENUMBER NAME_OF_LANE
# ROW must be between 1 and 16
# TRIG can be between 0 and 127, or NULL
# CHAN can be a number between 1 and 16, Gx, CVx, CVGx (x between 1-4), or NULL
# NOTENUMBER can be between 0 and 127, or NULL
# NAME supports all alphanumeric ASCII, and ' ', '_', '-', '+' (can also be NULL)
# Example: 1:NULL:2:60 KICK
# Please note this section will be discarded for tracks which are not set to DRUM tracks
[DRUMLANES]
[/DRUMLANES]

# PROGRAM CHANGE (PC) CUSTOM NAMES
# Syntax: PC NAME_OF_PROGRAM_CHANGE or PC:MSB:LSB NAME_OF_PROGRAM_CHANGE (PC must be between 1-128 and MSB/LSB between 0-127) 
# You can also put 'NULL' to not set the MSB/LSB.
# Example: 3 FAT LEAD
# Example: 123:34:NULL HARMONICA
# Note: You can declare maximum 128 PC names (including PC/MSB/LSB names)
[PC]
[/PC]

# CONTROL MESSAGES (CC) CUSTOM NAMES
# Syntax: CC_NUMBER CC_NAME or CC_NUMBER:DEFAULT=xx CC_NAME
# DEFAULT_VALUE must be between 0-127, NAME is supports all alphanumeric ASCII, and ' ', '_', '-', '+'
# Example: 12 FILTER RES
[CC]
[/CC]

# CC Pair
# Syntax: CC_MSB:CC_LSB NAME or CC_MSB:CC_LSB:DEFAULT=xx NAME
# DEFAULT_VALUE must between 0 and 16383
[CC_PAIR]
[/CC_PAIR]

# NRPN
# Syntax: MSB:LSB:DEPTH NAME or MSB:LSB:DEPTH:DEFAULT=xx NAME
# LSB & MSB should be between 0 and 127
  # Note: LSB can be over 127 only if MSB is 0 or omitted (e.g. "0:1026:7 FOO" or ":2000:7 BAR")
  # The examples above would be equivalent to '8:2:7 FOO' and '15:80:7 BAR' respectively
# DEPTH can be 7 or 14
# For NRPN: DEFAULT_VALUE must be a valid number, between 0-127 (for 7-bit NRPNs) or between 0-16383 (for 14-bit NRPNs)
[NRPN]
[/NRPN]

# ASSIGN
# Syntax: POT_NUMBER TYPE:VALUE or POT_NUMBER TYPE:VALUE DEFAULT=DEFAULT_VALUE
# POT_NUMBER must be between 1-8
# TYPE can be CC, PB (pitchbend), AT (aftertouch), CV, NRPN, or NULL (this won't assign the pot).
# Non explicitly-defined pots will be considered "NULL"
# VALUE VALIDATION
  # For CC: Value must be a valid number between 0-119
  # For PB and AT, any value after the TYPE will be ignored
  # For CV, value must be between 1-4
  # For NRPN, value must be MSB:LSB:DEPTH, with both LSB and MSB bebtween 0-127, and DEPTH being either 7 or 14
# DEFAULT VALUE
  # For CC: DEFAULT_VALUE must be a valid number between 0-127
  # For PB: DEFAULT_VALUE must be a valid number between 0-16383
  # For NRPN: DEFAULT_VALUE must be a valid number, between 0-127 (for 7-bit NRPNs) or between 0-16383 (for 14-bit NRPNs)
  # For CV: DEFAULT_VALUE must be either a valid number between 0 and 65535, or a voltage between -5V and 5V (e.g. "-4.25V" or "1.7V")
  # Please note default values will be ignored for PB and AT messages.
[ASSIGN]
[/ASSIGN]

# AUTOMATION
# Syntax: TYPE:VALUE
# TYPE can be CC, PB (pitchbend), AT (aftertouch), CV, or NRPN
# VALUE VALIDATION
  # For CC: Value must be a valid number between 0-119
  # For PB and AT, any text after the TYPE will be ignored
  # For CV, value must be between 1-4
  # For NRPN, value must be MSB:LSB:DEPTH, with both LSB and MSB bebtween 0-127, and DEPTH being either 7 or 14
# NOTE: You are limited to 64 automation lanes
[AUTOMATION]
[/AUTOMATION]

# INFO
# Once this file is loaded on Hapax, hold the 2ND-TRACK INSTRUMENT DEF encoder to display this a popup with your custom comments
# Supports all alphanumeric ASCII, and ' ', '_', '-', '+' (and also line break) 
[COMMENT]
[/COMMENT]