craigsapp / humlib

Humdrum data parsing library in C++
http://humlib.humdrum.org
BSD 2-Clause "Simplified" License
31 stars 8 forks source link

[fb] Numbers with more than two accidentals are ignored #62

Open WolfgangDrescher opened 1 year ago

WolfgangDrescher commented 1 year ago
Bildschirm­foto 2023-01-21 um 20 17 28
**kern  **kern
*clefF4 *clefG2
4c  4cc
4c  4b-
4c  4a#
4c  4g--
4c  4f##
4c  4e---
4c  4d###
4c  4c
=   =
*-  *-
craigsapp commented 1 year ago

You have some music with triple sharps/flats? 😉

Obviously you are writing the documentation now...

This is fixable but it takes more work than you might expect to do it correctly: (1) I could count the sharps/flats for each interval and then a sequence of single flat/sharps (or combinations and mixtures with double sharps/flats). (2) I typically calculate intervals and accidentals using the Base-40 system, which is limited to double sharps/flats, so any use of Base-40 for calculations in display of **fb or in fb calculations would have to be changed.

Case (1) is easy to implement, but Case (2) may or may not be easy. Ideally I would steal the Transposer class from verovio:

https://github.com/rism-digital/verovio/blob/develop/include/vrv/transposition.h https://github.com/rism-digital/verovio/blob/develop/src/transposition.cpp

Where this is a high-accidental variant of the Base-40 system called "Base-600" which allows up to 42-sharps/flats. Then this can be an interface to interval transpositions which is easy to switch between base-40 or base-60 (or any other variant of the system depending on how many accidentals you want to handle).