Troubleshooting faulty Instrument Definitions

Trying to make my own Hapax Definition file for the Microcosm. So far, I’ve only used the work of other, smarter people.
I got an “Error line 52” or something like that.
Is there a way to figure out where my error is?
There are not even 52 lines of anything in the definition file, but I’m assuming it corresponds to one line, somewhere… I went through and removed some parentheses from one line, but that didn’t help.
Any advice on foolproof Definitions?
Thanks!
Steve

So far, when I ran into this the cause was usually some special character that wasn’t allowed. My text editor (TextMate or Sublime) shows me line numbers. Really helpful to have a good editor, also for quick text transforms and regular expressions. Speeds up the creation of def files a lot. Feel free to post it here or DM me the def.

Hi Seteef,
My suggestion would be to copy the code here in your thread. we can probably help you better that way. :wink:

Thanks fellas!

I’ll check out the better editors too, because I’d love to be self-sufficient with these…
But here is the file.
Another question…should I have all the presets named and in order in the PC spot if I want to be able to pull them up on the Hapax? It didn’t seem necessary on some of the files.

Not sure how to insert this so that its in its own little box, so I just copied and pasted.

VERSION 1 # Currently, this should only be 1.

# Supports all alphanumeric ASCII, and ' ', '_', '-', '+' - can also be NULL
TRACKNAME MICROCOSM

# Can be POLY, DRUM, MPE, or NULL
TYPE NULL

# Can be A, B, C, D, USBD, USBH, CVGx (x between 1&4), CVx, Gx, or NULL
OUTPORT B

# Can be x (between 1-16), or NULL -- this is ignored if output port is not MIDI
OUTCHAN 15

# Can be NONE, ALLACTIVE, A, B, USBH, USBD, CVG, or NULL
INPORT NULL

# Can be x (between 1-16), ALL, or NULL. This definition will be ignored if INPORT is NONE, ALLACTIVE or CVG
INCHAN NULL

# DRUMLANES
# Syntax: ROW:TRIG:CHAN:NOTENUMBER NAME
# ROW must be between 1 and 8
# TRIG can be between 0 and 127, or NULL
# CHAN can be a number between 1 and 16, Gx, CVx, CVGx (x between 1 and 4), or NULL
# NOTE NUMBER can be between 0 and 127, or NULL
# NAME supports all alphanumeric ASCII, and ' ', '_', '-', '+' - can also be NULL
# Please note this section will be discarded for tracks which are not DRUM tracks
[DRUMLANES]
[/DRUMLANES]


# PC
# Syntax: NUMBER NAME
# number must be either:
#   - A number (for simple PC)
#   - Three numbers, delimited by ':', which represent PC:MSB:LSB. You can put 'NULL' to not set the MSB/LSB.
# PC must be between 1...128
# MSB/LSB must be between 0...127
[PC]
[/PC]


# CC
# Syntax: CC_NUMBER NAME or CC_NUMBER:DEFAULT=xx NAME
# DEFAULT_VALUE must be a valid number between 0 and 127
[CC]
5 Subdivision
6 Activity
7 Shape
8 Cutoff
9 Mix 10 Time
11 Repeats
12 Space
13 Loop level
14 Frequency 15 Resonance
16 Volume
17 Looper playback speed
18 Looper playback stepped 19 Depth
20 Time 21 Fade time
23 Playback direction
24 Routing 25 Only 26 Burst 27 Quantized 28 Record 29 Play
30 Overdub 31 Stop 34 Erase 35 Undo 47 Reverse effect 93 Tap tempo 102 Bypass [/CC]


# NRPN
# Syntax: "MSB:LSB:DEPTH NAME" or "MSB:LSB:DEPTH:DEFAULT=xx NAME"
# Lsb & msb should be between 0 and 127
# DEPTH can be 7 or 14
# For NRPN: DEFAULT_VALUE must be a valid number, either between 0 and 127 (for 7 bit NRPNs) or between 0 and 16383 (for 14bit NRPNs)
[NRPN]
[/NRPN]


# ASSIGN
# Syntax: POT_NUMBER TYPE:VALUE or POT_NUMBER TYPE:VALUE DEFAULT=DEFAULT_VALUE
# POT_NUMBER must be between 1 and 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 and 119
#### For PB and AT, any text after the TYPE will be ignored
#### For CV, value must be between 1 and 4
#### For NRPN, value must be MSB:LSB:DEPTH, with both lsb & msb bebtween 0 and 127, and DEPTH being either 7 or 14
# DEFAULT VALUE
#### For CC: DEFAULT_VALUE must be a valid number between 0 and 127
#### For PB: DEFAULT_VALUE must be a valid number between 0 and 16383
#### For NRPN: DEFAULT_VALUE must be a valid number, either between 0 and 127 (for 7 bit NRPNs) or between 0 and 16383 (for 14bit 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 value 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 and 119
#### For PB and AT, any text after the TYPE will be ignored
#### For CV, value must be between 1 and 4
#### For NRPN, value must be MSB:LSB:DEPTH, with both lsb & msb bebtween 0 and 127, and DEPTH being either 7 or 14
[AUTOMATION]
[/AUTOMATION]


# This section will be readable from Hapax.
[COMMENT]
[/COMMENT]

MOD EDIT: code block

The program changes can be in any order you want.

To insert something as code click the little </> icon in the editor.

Your definition loads ok here, btw. Which editor are you using? Maybe it’s messing up the linebreaks or something. When saving can you choose a format and/or encoding? Should be UTF-8 in case your editor allows for something like that.

Hi,
Thanks for the feedback!
I’m just using textedit on Mac. I’m making sure to save as plain text and not rtf.
I did just copy and paste an Analog Heat DF because it was the closest thing I could find, and then edited that. So there could be some residual weirdness from that.
I think I’ll get one of those text editors that list lines and see whats happening on the weird line.

Yo!
Just plopped it into Textmate and there was this " <U+2028>" on line 52 and a bunch of lines after. Assuming it’s some kinda of extra space left in there from copy and pasting, messing up the formatting. So I got rid of them all and will see how this looks on the Hapax tonight.
Great tip on a better text editor! thanks!

3 Likes

Thanks. Now I see that I need to change the html setting to put the text in a separate box.

2 Likes