Trait lipsi::Fundamentals
[−]
[src]
pub trait Fundamentals { fn invert(&self) -> Self; fn transpose(&self, _: i8) -> Self; fn i(&self) -> Self; fn t(&self, _: i8) -> Self; fn tni(&self, _: i8) -> Self; fn ixy(&self, _: i8, _: i8) -> Self; fn chroma(&self) -> u16; }
Required Methods
fn invert(&self) -> Self
Returns the inversion of the pitch-class set.
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.invert(), vec![11,10,9]);
fn transpose(&self, _: i8) -> Self
Returns the transposition of the pitch-class set by n semitones.
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.transpose(4), vec![5,6,7]);
fn i(&self) -> Self
Alias of invert()
. Returns the inversion of the pitch-class set.
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.i(), vec![11,10,9]);
fn t(&self, _: i8) -> Self
Alias of transpose()
. Returns the transposition of the pitch-class
set by n semitones.
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.t(4), vec![5,6,7]);
fn tni(&self, _: i8) -> Self
Inverts the pitch-class set, then returns the transposition by n semitones.
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.tni(4), vec![3,2,1]);
fn ixy(&self, _: i8, _: i8) -> Self
Returns the transposition of the pitch-class set by y semitones around the axis x
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.ixy(4, 5), vec![8,7,6]);
fn chroma(&self) -> u16
Returns the binary representation of the pitch-class chroma feature
Examples
use lipsi::*; let pcset: PcSet = vec![1,2,3]; assert_eq!(pcset.chroma(), 14);
Implementors
impl Fundamentals for PcSet