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

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]);

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]);

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]);

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]);

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]);

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]);

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