1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
Appellation: triad <module>
Created At: 2025.12.20:11:38:53
Contrib: @FL03
*/
//! this module defines the [`Triad`] struct along with additional types and traits supporting
//! the representation of triads and their operations w.r.t. the neo-riemannian theory.
//!
//! # Overview
//!
//! A triad is defined to be a chord, composed of three notes, each of which maintain certain
//! intervallic relationships with one another. More specifically, the distance between the
//! first and second as well as the second and third notes is defined to be a major or minor
//! third, whilst the distance between the first and third notes is some variant of a _fifth_.
//!
//! These compositional contraints lead to four possible triadic chord types, namely: major,
//! minor, augmented, and diminished. Each of these chord types can be represented as a 3-tuple
//! containing the pitch classes of each note within the chord. For example, a C-major triad
//! can be represented as the tuple (0, 4, 7), where `0` represents the root note C, `4` the
//! major third E, and `7` as the perfect fifth G.
//!
//! Additionally, triads may be transformed using any one of three transformations defined as:
//! leading, parallel, and relative. The behavior of these transformations is determined by the
//! interval between the first two notes of the triad, i.e. a major or minor third. Each of
//! these transformations is capable of being chained together into discrete and continuous
//! sequences or spaces and is its own inverse. This means that any consecutive applications of
//! any one particular transformation simply reverts the object back into its original state.
//!
//! That being said, augmented and diminished traids _can_ be transformed, however, the exact
//! nature of their responses is not as predictable as with major / minor triads.
//!
//! ## Examples
//!
//! ### _Basic Usage_
//!
//! Initialize a C-major triad and verify its composition
//!
//! ```rust
//! use rstmt_nrt::Triad;
//! // create new triad
//! let c_major = Triad::major(0);
//! // verify the composition
//! assert_eq! { c_major, [0, 4, 7] }
//! ```
//!
//! ### _Transformations_
//!
//! Initialize a C-major triad before applying each of the three transformations:
//!
//! ```rust
//! use rstmt_nrt::Triad;
//! // create new triad
//! let c_major = Triad::major(0);
//! // apply leading transformation
//! assert_eq! { c_major.leading(), Triad::minor(4) }
//! // apply parallel transformation
//! assert_eq! { c_major.parallel(), Triad::minor(0) }
//! // apply relative transformation
//! assert_eq! { c_major.relative(), Triad::minor(9) }
//! // confirm inverses
//! assert_eq! { c_major.leading().leading(), c_major }
//! assert_eq! { c_major.parallel().parallel(), c_major }
//! assert_eq! { c_major.relative().relative(), c_major }
//! ```
//!
//! # References
//!
//! - [Continuous Transformations](https://www.mtosmt.org/issues/mto.04.10.3/mto.04.10.3.callender.pdf)
//! - [Neo-Riemannian Theory](https://en.wikipedia.org/wiki/Neo-Riemannian_theory)
use crate;
use crateTriads;
use RawSpace;
use ;
/// The default representation of a triadic chord
pub type TriChord<T = isize> = ;
/// A type alias for a [`TriadBase`] instance configured to use the [`TriChord`] as
/// its storage
pub type Triad<K = Triads, T = usize> = ;
/// A type alias for a [`Triad`] using a dynamic classifier of type [`Triads`]
pub type DynTriad<T = usize> = ;
/// The [`TriadBase`] is an implementation of a triad generic over the chord, or storage, its
/// classification, and the element type used to represent a note within the triadic chord.