humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

RFC: Filter to automatically calculate figured bass numbers #658

Closed WolfgangDrescher closed 1 year ago

WolfgangDrescher commented 2 years ago

I'm sure that I'm not the first one with the idea to add automated basso continuo numbers as **fb spines to a Humdrum score. But I could not find anything here in the GitHub issues nor on **HUG. So i just wanted to ask if something like this is already existing?

If no, I prepared a repository to showcase some examples, ideas and questions about this feature: https://github.com/WolfgangDrescher/humdrum-figured-bass-filter-demo

Ideally this should be implemented similar to the current cint filter. So this could be calculated on the fly and displayed directly in Verovio.

craigsapp commented 2 years ago

I have been thinking about this and will work on a VHV filter related to it (it is the last week of classes here at Stanford, so keeping busy).

WolfgangDrescher commented 2 years ago

Very nice. Keep me up to date on this. I was almost beginning to start the implementation myself and open a WIP PR. But since im not yet familiar with humdrum development (and C++) I thought it would be better if someone how knows the code would do the base setup. I guess cint.cpp would be a starting point and it would be best to add it to humextra? Initially I have been played around with hint.awk.

Let me know if there is anything I can do to help. With programming, or testing.

craigsapp commented 2 years ago

Initially I have been played around with hint.awk.

Using awk would not be useful for running on the web (unless someone has implemented an emscripten-compiled version of the awk interpreter): https://github.com/agordon/webawk

But in general awk programs are much slower than C++ programs.

One minor complication is that the Humdrum Toolkit tools such as hint have a shell script interface: https://github.com/humdrum-tools/humdrum/blob/master/toolkit-source/shell-scripts/hint


I am thinking of using a C++ class called NoteGrid for implementing automatic figured base:

https://github.com/craigsapp/humlib/blob/master/include/NoteGrid.h

This class is a simplification of the Humdrum score for working with harmonic analyses. This is used in the dissonant tool: https://github.com/craigsapp/humlib/blob/master/src/tool-dissonant.cpp

WolfgangDrescher commented 1 year ago

The fb filter is now merged into humlib and the develop-humdrum branch in verovio.