Last active
May 12, 2016 18:38
-
-
Save chrisamaphone/53f83395953bc171b5a9becd12586851 to your computer and use it in GitHub Desktop.
Twelf description of music harmony presented in http://dreixel.net/research/pdf/fmmh.pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root : type. | |
i : root. | |
ii : root. | |
iii : root. | |
iv : root. | |
v : root. | |
vi : root. | |
vii : root. | |
v/ : root -> root -> type. | |
v/i : v/ i v. | |
v/ii : v/ ii vi. | |
v/iii : v/ iii vii. | |
v/iv : v/ iv i. | |
v/v : v/ v ii. | |
v/vi : v/ vi iii. | |
v/vii : v/ vii iv. | |
class : type. | |
maj : class. | |
min : class. | |
dom7 : class. | |
nat : type. | |
z : nat. | |
s : nat -> nat. | |
degree : root -> class -> nat -> type. | |
base : {R} {C} degree R C z. | |
cons : {R} {C} | |
v/ R R' -> degree R' dom7 N -> degree R C z | |
-> degree R C (s N). | |
dominant : nat -> type. | |
fin : degree v maj _ -> dominant z. | |
sub : degree iv maj _ -> dominant N -> dominant (s N). | |
phrase : nat -> type. | |
ton : phrase z. | |
dom : dominant N -> phrase (s N). | |
piece : type. | |
nil : piece. | |
; : piece -> phrase _ -> piece. | |
%infix left 1 ;. | |
%solve chord : degree v maj (s z). | |
foo : piece = | |
nil ; ton ; (dom (fin chord)) ; ton. | |
%solve x : dominant (s (s z)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment