Crate rstmt_nrt

Crate rstmt_nrt 

Source
Expand description

This crate works to establish a solid foundation fo exploring the neo-riemannian theory, providing implementations of the Triad, its transformations LPR, and the generalized tonnetz (HyperTonnetz).

§Background

The neo-riemannian theory is a loose collection of musical theories focused on the triad. Research in the field has been ongoing for over a century, culminating in the successful generalization of the tonnetz, a geometric representation of the triad and its transformations, into a single topological entity composed of individual simplices.

§Examples

§Basic Usage

Create a C major triad and perform some basic operations.

use rstmt_nrt::Triad;
// initialize a c-major triad: (0, 4, 7)
let triad = Triad::major(0);
// verify the composition
assert_eq! { triad.is_major(), triad == [0, 4, 7] }
// apply a single, parallel transformation and verify
assert_eq! { triad.parallel(), [0, 3, 7] }
// chain together two parallel transformations to confirm inversion
assert_eq! { triad.parallel().parallel(), triad }

Re-exports§

pub use super::walker::*;

Modules§

error
this module defines the standard error type, TriadError, for the crate custom error types for the nrt crate
iter
this module defines various iterators for traversing a tonnetz, chaining transformations and more.
motion
this module focuses on implementing the motion planning algorithm for finding paths along the surface of the tonnetz.
tonnetz
The tonnetz is a conceptual lattice representation of tonal space first proposed in 1739 by Leonhard Euler as a means of visualizing relationships between triads. Over the centuries, researchers have expanded upon Euler’s initial concept, eventually culminating in the development of the long-awaited generalized tonnetz.
triad
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.

Structs§

FactorsIter
An iterator over the variants of Factors
HyperTonnetz
The HyperTonnetz implementation relies on a hypergraph to define the relationships between various notes and triads within the tonal space. Hypergraphs generalize the concept of a graph by allowing edges to connect any number of vertices, making them well-suited for modeling complex relationships and topologies such as those found in music theory.
LPRIter
An iterator over the variants of LPR
TriadBase
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.
TriadsIter
An iterator over the variants of Triads

Enums§

ChordFactor
The ChordFactor implementation enumerates the various notes within a triad, essentially providing an index for each of the chord’s components.
Factors
LPR
The LPR implementation enumerates the primary transformations considered within the Neo-Riemannian theory. Each transformation is its own inverse (meaning consecutive applications of the same transformation will return the original triad) and may be chained together in both disctrete and continuous space to explore relationships between triads. These transformation act on the given triad based on the quality of the interval between the first and second notes (i.e., the root and third chord factors) meaning the effect of the transformation is dictated by whether the triad starts with a major or minor third.
TriadError
the TriadError type enumerates the various errors that one can expect to encounter within the crate.
Triads
The Triads implementation enumerates the allowed triad classifications determined by the intervals between the chord factors.

Traits§

RelTriad
Relative
The Relative trait is used to define a relationship between two distinct triad classifications
TriadRepr
TriadRepr is a sealed trait extending the RawSpace trait to establish basic behaviors of compatible representations of a triad.
TriadReprMut
The TriadReprMut trait is used to extend the TriadRepr trait to provide mutable access to the elements of a triad.
TriadType
The TriadType trait is used to represent the various classifications of a triad considered by the Neo-Riemannian theory.

Type Aliases§

DynTriad
A type alias for a Triad using a dynamic classifier of type Triads
TriChord
The default representation of a triadic chord
Triad
A type alias for a TriadBase instance configured to use the TriChord as its storage