Comments in .vcv files

(Patman / NYSTHI Manual) #1

Hey @Vortico (and everyone else obvs), is there a proper method to add comments in a .vcv(x) file? (ie. a method that won’t be parsed on load or cause errors)?

(David O'Rourke) #2

I think the short answer is no.

If I remember, .vcv files are JSON files, and Json does not support comments, which was a deliberate decision by its designer.

Some json parsers will let you get away with it, but not the one used in vcv.

The jansson library that vcv uses to parse json doesn’t support comments, despite many requests, largely because then people might use it to write json which would not be compliant or compatible.

2 Likes
(gc) #3

@Patman–what’s your use case? When are you looking at .vcv files directly?

If you absolutely had to have this you could create a 1U version of Notes that didn’t actually display text but which overrode toJson() and fromJson() to save and load a comment parameter. (Here’s the v0.6 blueprint). You could then hand-edit the comment string in the vcv file and it would be loaded and saved unchanged.

I can not imagine why you would want to do this, though (hence my question :slight_smile: )

(Andrew Belt) #4

I recommend using Core Notes, since the comments would also be displayed to the user when loading.

1 Like
(Patman / NYSTHI Manual) #5

. @carbon14 thanks, that’s exactly what I was looking for.

@Vortico Sadly, that’s not useful to me when it comes to managing the file.

@gc3 my usage case is in trying to manage sample patches for the NYSTHI Manual, where there may be months between a file being procured, and actually going back to it to link it into the manpage.

(gc) #6

@Patman–aha, I think I understand, thanks. You basically want embedded metadata that’s not visible to the user but which survives load/save?

(Patman / NYSTHI Manual) #7

Something like that.

I want to be able to build in a reference, but if I forget to remove it, or if for some reason the project management changes custody, it’s also one less piece of info to remember to convey.

I was also hoping to not need to add more files just to label the other ones.

(gc) #8

Do you need it to be completely invisible to the user, or would having a 1U blank panel in the patch work? (I think you could actually do this with a 0U (no-geometry) module, but that might have some bad side effects and you’d have to remove it manually from the .vcv file).

To be clear: we are discussing ugly, ugly hacks here :slight_smile:

(Patman / NYSTHI Manual) #9

Eh, if we’re going that far (really ugly hacks), then I think I’ll just go for either external tracking files(ie a .Txt), a more nuanced folder structure, or one of @carbon14’s Vertical Text Displays…

(gc) #10

Cool. I think external tracking or Notes[-like] modules are both better ideas than hiding something in the JSON.

If you go with external tracking: have you considered spinning up a small SQLite database? You could do simple automation in Python (or whatever’s most comfortable to you).

(Patman / NYSTHI Manual) #11

i’d at most just keep a quick google spreadsheet… where things are, where they should go, who authored the patch for attribution