Giter VIP home page Giter VIP logo

harmalysis's People

Contributors

napulen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

harmalysis's Issues

Add default function

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.

Write equivalent function _descriptive_chord() as done for tertian and special chords

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

handle incorrect labels with a friendly message

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.

Display key in interpreter

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 pitches to interpreter

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}

Fully-diminished sevenths in major keys

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.

Make tests

Make a simple test set that checks common combinations of chords in different keys.

Add ";" notation for indicating phrase endings

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.

Cad64 is not always major

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.

Generate syntax diagrams for documentation

It would be really helpful to visualize the lark grammar in syntax diagrams.

I ran into this example for URIs:

image

Something like that would make a really nice documentation resource for this project.

default_minor should not propagate above internal logic

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.