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),
Map(PitchMap),
}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.
Map(PitchMap)
Apply a first-class partial pitch map.
Implementations§
Source§impl PitchRemap
impl PitchRemap
Sourcepub fn apply(&self, object: &dyn MusicObject) -> Result<Music, TransformError>
pub fn apply(&self, object: &dyn MusicObject) -> Result<Music, TransformError>
Applies the remap and returns just the music, discarding diagnostics.
Sourcepub fn apply_report(
&self,
object: &dyn MusicObject,
) -> Result<TransformReport, TransformError>
pub fn apply_report( &self, object: &dyn MusicObject, ) -> Result<TransformReport, TransformError>
Applies the remap, returning the music together with any diagnostics.
Sourcepub fn as_pitch_map(&self) -> Option<PitchMap>
pub fn as_pitch_map(&self) -> Option<PitchMap>
Returns this remap as a composable pitch map when it is static and expressible in the integer pitch-map domain.
Trait Implementations§
Source§impl Clone for PitchRemap
impl Clone for PitchRemap
Source§fn clone(&self) -> PitchRemap
fn clone(&self) -> PitchRemap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more