Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fb] Determine harmonic intervals with interval quality #80

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

WolfgangDrescher
Copy link
Contributor

This PR implements the a new --hint option to display harmonic intervals with interval quality in a **hint spine instead of a **fb and figured bass intervals (without interval quality but accidentals).

The original hint humdrum tool is not able to handle intervals when a null token is involved, which is not ideal for analytical purposes.

Note that this new option can be combined with -c to always display non-compound intervals (compare with the original humdrum tool hint -c flag).

Also note that the difference between two pitches is calculated as an absolute number so always the lowest pitch will be the base note. Otherwise augmented and diminished interval qualities will be wrong.

Click to show examples

Example 1

Input:

**kern	**kern
4c	4A--
4c	4A-
4c	4A
4c	4A#
4c	4A##
=	=
4c	4B--
4c	4B-
4c	4B
4c	4B#
4c	4B##
=	=
4c	4c--
4c	4c-
4c	4c
4c	4c#
4c	4c##
=	=
4c	4d--
4c	4d-
4c	4d
4c	4d#
4c	4d##
=	=
4c	4e--
4c	4e-
4c	4e
4c	4e#
4c	4e##
=	=
4c	4f--
4c	4f-
4c	4f
4c	4f#
4c	4f##
=	=
4c	4g--
4c	4g-
4c	4g
4c	4g#
4c	4g##
=	=
4c	4a--
4c	4a-
4c	4a
4c	4a#
4c	4a##
=	=
4c	4b--
4c	4b-
4c	4b
4c	4b#
4c	4b##
=	=
4c	4cc--
4c	4cc-
4c	4cc
4c	4cc#
4c	4cc##
=	=
4c	4dd--
4c	4dd-
4c	4dd
4c	4dd#
4c	4dd##
=	=
4c	4ee--
4c	4ee-
4c	4ee
4c	4ee#
4c	4ee##
=	=
*-	*-

open in VHV

Output:

**kern	**hint	**kern
4c	A3	4A--
4c	M3	4A-
4c	m3	4A
4c	d3	4A#
4c	dd3	4A##
=	=	=
4c	A2	4B--
4c	M2	4B-
4c	m2	4B
4c	d2	4B#
4c	dd2	4B##
=	=	=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	4b	.
4c	P11 A7	4b#	.
4c	P11 AA7	4b##	.
=	=	=	=
4c	P12 dd8	4cc--	4%5gg
4c	P12 d8	4cc-	.
4c	P12 P8	4cc	.
4c	P12 A8	4cc#	.
4c	P12 AA8	4cc##	.
=	=	=	=
4c	P12 d9	4dd--	4%5gg
4c	P12 m9	4dd-	.
4c	P12 M9	4dd	.
4c	P12 A9	4dd#	.
4c	P12 AA9	4dd##	.
=	=	=	=
4c	P12 d10	4ee--	4%5gg
4c	P12 m10	4ee-	.
4c	P12 M10	4ee	.
4c	P12 A10	4ee#	.
4c	P12 AA10	4ee##	.
=	=	=	=
*-	*-	*-	*-

@craigsapp
Copy link
Owner

One long-term thought would be to use base-600 rather than base-40. This would allow triple-flats/sharp, and all of the way up to 42 sharps/flats on a note (I choose 600 arbitrarily as a round number).

There is already a class implemented in verovio that can/will be copied over (after removing verovio-specific code):

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

This would allow using either base-40 (with a limit of double/sharps flats) or base-600 for more theoretical interval alterations (when needed).

@craigsapp craigsapp merged commit a948680 into craigsapp:master Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants