napulen / harmalysis Goto Github PK
View Code? Open in Web Editor NEWA language for harmonic analysis and roman numerals
License: GNU General Public License v3.0
A language for harmonic analysis and roman numerals
License: GNU General Public License v3.0
A chord definition could have a field that specifies the function of the chord (under most circumstances). Even if this is not very precise in every context, it would still be really useful to know that a Db Major is acting as a SubDominant (Neapolitan) of C Major, for example.
Right now it works but code is redundant:
def harmalysis_descriptive_by_degree(self, descriptive):
harmalysis = harmalysis_classes.Harmalysis()
key = harmalysis_classes.Harmalysis.established_key
degree = descriptive.scale_degree
alteration = descriptive.scale_degree_alteration
descriptive.root = key.scale_degree(common.roman_to_int[degree], alteration)
harmalysis.chord = descriptive
return harmalysis
def harmalysis_descriptive_by_degree_with_key(self, key_function, descriptive):
harmalysis = harmalysis_classes.Harmalysis()
key, function = key_function
if function == 'reference':
harmalysis.reference_key = key
elif function == 'established':
harmalysis.established_key = key
degree = descriptive.scale_degree
alteration = descriptive.scale_degree_alteration
descriptive.root = key.scale_degree(common.roman_to_int[degree], alteration)
harmalysis.chord = descriptive
return harmalysis
Adding notation for pedal note, as requested by Laurent
As of v0.2.1
, when the parser fails to interpret a label, the library/program crashes. This should be substituted by a friendly message. Possibly, with useful information line/column information about the error, like the one a compiler would output.
When using the interpreter, let users know what is the current key, for example:
(C major) > I
(C major) > IV
(C major) > V7/IV
(C major) > F=>:I
(F major) > IV
(F major) > V
(F major) > I
Add the pitches that make up a given label in the interpreter
Example:
> C=>:IVM7
Main key: C major
Secondary key: None
Intervallic construction: FM3P5M7
Inversion: 0
Chord label: F major seventh
Pitches (in root position): {F,A,C,E}
Specially in the context of tonicizations, I come up with this kind of problems:
58.0 viio43/V B half-diminished seventh 2 F default_minor C major
This should actually be a fully-diminished seventh. The solution for this is to consider that this harmony with respect to c minor instead of C major, viio43/v
. However, everything else around that annotation is in C Major, so I am not sure if there is a better solution for annotating fully-diminished seventh chords other than assuming that they are a modal mixture of the minor key.
There are multiple layers to chords (descriptive, tertian, special). There should be a systematic way of representing a chord so that a string/dictionary can be returned and given to the user.
They are implemented in the grammar but not on the interpreter.
Make a simple test set that checks common combinations of chords in different keys.
Now that the package is available in PyPI, it would be nice to write instructions about how to install and use the package.
In the annotated chorales from Verovio Humdrum Viewer, there are indications in the roman numerals every time there is a fermata. These are indicated with ;
. It doesn't hurt to add that indication in harmalysis.
At some point in the parsing, I consider that a Cad64
is equivalent to I64
, however, this depends on the key.
For minor key contexts, Cad64
is equivalent to i64
.
In some contexts, when a key gets assigned, the str(key)
shows it as default_minor
.
default_minor
is an internal decision regarding whether a minor key is considered by default to be a harmonic_minor
or natural_minor
. Once this decision is done, however, the right key showing in any user-related context should be either harmonic_minor
or natural_minor
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.