johnameyer / harmony-ts

This library generates four-part chorales in the style of Bach given any number of constraints and enabled features. However, it also can be used as a general music-theory library.
https://johnameyer.github.io/harmony-ts/
Apache License 2.0
3 stars 0 forks source link

Make Rules Smarter About Sharing Results #106

Open johnameyer opened 4 months ago

johnameyer commented 4 months ago

Toda, we run the rules as we build the chords (i.e. with 2 voices, 3 voices, 4 voices) which helps to catch issues and avoid spending compute cycles generating all the remaining voices if the first two already break the rules.

However, these tend to re-compute Intervals and check assertions that are already handled by these earlier checks.

Few routes:

  1. Allow for providing context to share this data between rules for a given set of chords
    • How do we encourage / force rules to use?
  2. Combine rules together / perform checks in joint?
    • How do we disable portions of rules easily? (i.e. web UI)
  3. Make them smarter about detecting issues early