pub enum PitchRemap {
Chromatic(i32),
ScaleDegree {
scale: Scale,
steps: i32,
},
PitchClass {
from: PitchClass,
to: PitchClass,
},
DrumKey(BTreeMap<u8, u8>),
ChordTone {
scale: Scale,
degree: usize,
},
Tuning(TuningRemap),
Vector {
scale: Scale,
offsets: Vec<i32>,
},
Matrix {
scale: Scale,
matrix: IntMatrix,
},
Callable(CallablePitchMap),
}Expand description
A pitch remapping strategy applied note by note across material.
Variants§
Chromatic(i32)
Shift every pitch by a fixed number of semitones.
ScaleDegree
Transpose by scale degrees within scale.
Fields
PitchClass
Replace one pitch class with another, keeping the octave.
DrumKey(BTreeMap<u8, u8>)
Remap MIDI drum keys via an explicit key-to-key table.
ChordTone
Snap each pitch to the nearest tone of a chord built on scale.
Tuning(TuningRemap)
Apply a microtonal tuning offset.
Vector
Offset each pitch by a per-degree vector of semitone offsets.
Fields
Matrix
Apply an integer affine IntMatrix over (degree, octave).
Callable(CallablePitchMap)
Apply a named CallablePitchMap.
Implementations§
Source§impl PitchRemap
impl PitchRemap
Sourcepub fn apply(&self, object: &dyn MusicObject) -> Music
pub fn apply(&self, object: &dyn MusicObject) -> Music
Applies the remap and returns just the music, discarding diagnostics.
Sourcepub fn apply_report(&self, object: &dyn MusicObject) -> TransformReport
pub fn apply_report(&self, object: &dyn MusicObject) -> TransformReport
Applies the remap, returning the music together with any diagnostics.
Trait Implementations§
Source§impl Clone for PitchRemap
impl Clone for PitchRemap
Source§fn clone(&self) -> PitchRemap
fn clone(&self) -> PitchRemap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PitchRemap
impl Debug for PitchRemap
impl Eq for PitchRemap
Source§impl PartialEq for PitchRemap
impl PartialEq for PitchRemap
Source§fn eq(&self, other: &PitchRemap) -> bool
fn eq(&self, other: &PitchRemap) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PitchRemap
Auto Trait Implementations§
impl Freeze for PitchRemap
impl RefUnwindSafe for PitchRemap
impl Send for PitchRemap
impl Sync for PitchRemap
impl Unpin for PitchRemap
impl UnsafeUnpin for PitchRemap
impl UnwindSafe for PitchRemap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more