surge-synthesizer / tuning-library

Micro-tuning format parsing and frequency finding as a header-only C+ library
https://surge-synth-team.org/tuning-library/
MIT License
83 stars 15 forks source link

`Scale::name` returns the full pathname of the scale #41

Open modosc opened 3 years ago

modosc commented 3 years ago

from here i expected scale.name to be the name from the .scl comment: https://github.com/surge-synthesizer/tuning-library/blob/main/include/Tunings.h#L92

but it's actually the full path name to the file when you're parsing a file: https://github.com/surge-synthesizer/tuning-library/blob/main/include/TuningsImpl.h#L177

is this expected? if not i'm happy to put a pr together to fix it. thanks!

baconpaul commented 3 years ago

Pretty sure that's expected. The .scl comment appears in scale.description (or should).

https://github.com/surge-synthesizer/tuning-library/blob/46a58f87e880d70ece0b015e1ef59fbfdc14dea9/tests/alltests.cpp#L701

baconpaul commented 3 years ago

Oh I see what you mean. You mean the convention that the filename is in the first comment line to be parsed. Right. So we can add that but it is different than the name (which is the actual file name nor the purported one). Add a feature like 'firstCommentLineName' or some such and store it on the object would be a great change though! From most of the scl files I've seen that convention is not very reliable but agree it would be nice to expose.