cherchord icon indicating copy to clipboard operation
cherchord copied to clipboard

Load instruments from a configuration file

Open Morwenn opened this issue 5 years ago • 3 comments

Hi, and thanks for the awesome project!

Would it be possible to extract the list of instruments to a configuration file instead of having them raw in the code? I would like to be able to easily add and remove instruments between invocations without having to recompile the program every time. That would also make it easier to share instrument configuration files directly with other members from my band.

Thanks in advance :)

Morwenn avatar Nov 03 '19 23:11 Morwenn

Not a full solution to the issue, but with since 1.1.0 you should be able to supply a custom instrument configuration with the -i/--instrument command line param.

$ cherchord -i E12,B12 C
found 7 unique fingerings for the chord C ([C,E,G])
printing out 7 of them...

E B   E B   E B   E B
0 1   3 1   0 5   3 5
- -   - -   - -   | |
| o   | o   | |   o |
| |   | |   | |   | |
| |   o |   | |   | o
      | |   | |   | |
            | o
            | |

E B   E B   E B
0 8   8 5   8 8
- -   | |   | |
| |   | o   o o
| |   | |   | |
| |   | |   | |
| |   o |
| |   | |
| |
| |
| o
| |

You should then be able to use a shell alias along these lines:

$ alias cc_bottleguitar="cherchord -i E12,B12"
$ cc_bottleguitar Cmin
found 4 unique fingerings for the chord Cmin ([C,Eb,G])
printing out 4 of them...

E B   E B   E B   E B
3 1   3 4   8 8   118
- -   | |   | |   | |
| o   o |   o o   | o
| |   | o   | |   | |
o |   | |   | |   | |
| |               o |
                  | |

DataKinds avatar Jan 27 '23 07:01 DataKinds

Well yeah, --instrument was what I was already using back when I opened this issue. To give a context: we used cherchord with my band when we wanted to find chords quickly and it was embedded in a custom Discord bot to make it easier to use everyone (to be clear, the band members wouldn't have used that part of the bot at all if they had had to pass the letters by hand).

Since we used a variety of guitar-like instruments back then, having a bunch of corresponding shortcuts was useful, hence the need for a configuration file that we could complete whenever another instrument was needed. We eventually added such a command to our bot with a custom implementation, along with an equivalent of what I asked in #5 around the same time 😅

Morwenn avatar Jan 28 '23 13:01 Morwenn

I see now!

I'm keeping this issue open in favor of the other issue: if a config file system were to be implemented, it'd have an option to print out the current config, including printing out the default config listing the default instruments. I now understand the use case for having a single portable config file for the app, and I will try to get this into the next version I push out. Thank you for your input!

DataKinds avatar Feb 03 '23 20:02 DataKinds