christofmuc / KnobKraft-orm

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian
GNU Affero General Public License v3.0
207 stars 27 forks source link

Need more control over name-based rules #167

Closed christofmuc closed 1 year ago

christofmuc commented 2 years ago

@christofmuc BTW, I suspect that the automatic assignment of categories using regular expressions is still in effect. A couple of percussive sounds called STRPDX and RAPDRM, for example, are being classed as pads on the grounds that they have PD in the name. They are as unlike pads as can be. I wonder if there is some way to disable the automatic categorisation? I hardly need it, after all.

Originally posted by @Mostelin in https://github.com/christofmuc/KnobKraft-orm/issues/135#issuecomment-1197949178

Mostelin commented 2 years ago

@christofmuc There still appears to be some memory of previous auto-categorisation, even after I have stripped out all references to categories in both mapping_categories.jsonc and automatic_categories.jsonc, deleted every program in the database and then reimported them. Approximately 3% of all programs have what appears to be an automatically assigned category in addition to those set in my PIF file.

christofmuc commented 2 years ago

@Mostelin Funky. What you can do is to restart the program and then run the menu item "Re-run autocategorize". It will delete auto tags and replace them with those from the json rules file (it will not touch manually assigned categories).

I need to look at the merge on import logic again, I remember it was pretty complex given that we have manually assignd categories, and automatic categories, and imported categories.

christofmuc commented 2 years ago

Note to myself: All Categories loaded via PatchInterchangeFormat are considered user decisions, i.e. are not overridden by auto-categorize and are not deleted by re-run autocategorize.

Mostelin commented 2 years ago

@Mostelin Funky. What you can do is to restart the program and then run the menu item "Re-run autocategorize". It will delete auto tags and replace them with those from the json rules file (it will not touch manually assigned categories).

I am not sure whether I don't understand, or the program just doesn't function this way. I just quit and restarted, ran Rerun autocategorise (the autocategories are mine, but include standards like Pad and Organ). The import mapping file is now empty. Nothing changed: additional categories are still applied many times according to program name, and possibly other reasons I do not understand.

I suspect that the rules are still present somewhere, not accessible to me to do anything about.

christofmuc commented 2 years ago

@Mostelin I am building a 1.16.0 with some fixes right now, we can try again with that version. But you do see the "overriding" warning indicating you own (empty) naming rules file is loaded on startup?

Mostelin commented 2 years ago

@christofmuc Yes, I do. This is the log on startup:

22:22:30: Overriding built-in import category rules with file C:\Users\Mark\AppData\Roaming\KnobKraft\mapping_categories.jsonc 22:22:30: Overriding built-in adaptation Ensoniq ESQ-1 (found in user directory C:\Users\Mark\KnobKraft-Adaptations) 22:22:31: Lost communication with Ensoniq ESQ-1 on channel 1 of device Studio 24c MIDI Out - please rerun auto-detect synths! 22:22:31: Turning off USB input Electra Controller

christofmuc commented 2 years ago

@Mostelin Naming is hard - you are looking at the mapping_categories.jsonc, which is the file to map synth-specific categories to user categories (think like Virus Access which has a fixed list of categories you can use). You want to be looking at the file automatic_categories.jsonc, which contains the regexes. The new release 1.16.0 has a menu item to expose/open an editor for the jsonc file with the rules, that should make it easier now.

Mostelin commented 2 years ago

@christofmuc I am looking forward to 1.16.0.

Meanwhile, just to satisfy my curiosity, where is automatic_categories.jsonc kept? I cannot find it, and vaguely presumed it had become embedded in 1.15.1.

Andy2No commented 2 years ago

@Mostelin On the Categories menu, choose Edit category import mapping

It will then either open the .jsonc file, in some application or other, or prompt you to specify one - the wording of the dialog box confused me, when I first saw it (in a previous version), but it's a standard part of Windows, apparently.

I didn't work out what to do with it, but I gather that's still a work in progress.

I set it to open in a text editor, which also means I can see where it came from by using File->Save As. Mine is in:

C:\Users\andy\AppData\Roaming\KnobKraft

[EDIT : Sorry, I somehow missed seeing the automatic_ part. I can't find that one either]

Andy2No commented 2 years ago

@christofmuc I am looking forward to 1.16.0.

It's out. If you click on the Code tab of the repo, you should see Releases on the right, if you scroll down a bit.

Andy2No commented 2 years ago

@Mostelin I found it, but I'm not entirely clear how.

I searched the repo and found a commit referencing it, which says it's now created on demand:

https://github.com/christofmuc/KnobKraft-orm/commit/4bb768470902352ad9cb1dd806be37d49c12f5ba

I may have caused that to happen by using Edit categories on the Categories menu, because when I looked again, the Categories menu seemed to have different options.

I then chose Show category naming rules file which opened automatic_categories.jsonc, which is now in C:\Users\andy\AppData\Roaming\KnobKraft but wasn't earlier.

This was in 1.16.0.

Mostelin commented 2 years ago

@Andy2No @christofmuc Thanks to both of you for trying to help me.

I have 1.16.0 working and I must say I am very happy with the changes. I've managed to create my own set of automatic categorisation (none whatsoever!) and subsequently reimported my data. Works perfectly!

I had been meaning to suggest separate X and Y settings for the patch grid, but now I don't have to, I like it, and it helps a lot.

The skipping of programs also seems to work properly.

christofmuc commented 1 year ago

I fixed quite a couple of bugs in the category mechanisms for the 2.0.0 release, so I close this ticket now and wait for new ones to pop up ;-) Haven't tested that much yet, so expect somehow hiccups.