pub enum Rule {
Show 20 variants
PitchSet {
offsets: Vec<u8>,
colour: Vec<u8>,
giveaway: Vec<u8>,
},
Tonic {},
ChordTones {
offsets: Vec<u8>,
choose: Option<Choose>,
},
Voicing(Box<VoicingRule>),
Cycle {
roots: Vec<u8>,
chords: Vec<String>,
bars_per_chord: Option<f64>,
},
OnsetSet {
parts: Vec<PartSlots>,
},
OnsetShare {
slots: Vec<u8>,
min_share: f64,
},
CountPerBar {
min: u8,
max: u8,
},
Length {
unit: LengthUnit,
min: Option<f64>,
max: Option<f64>,
},
Velocity {
min: u8,
max: u8,
},
Overlap {
min_ms: f64,
},
Swing {
note: u8,
min_pct: f64,
max_pct: f64,
},
Shift {
min_ms: f64,
max_ms: f64,
},
Jitter {
max_ms: f64,
velocity: u8,
},
Register {
core: [u8; 2],
hard: [u8; 2],
voice: Voice,
},
Pattern {
k: u8,
n: u8,
rotation: u8,
},
Arp {
order: ArpOrder,
rate: f64,
gate: Option<[u8; 2]>,
degrees: Vec<u8>,
},
Repeat {
min_share: Option<f64>,
max_share: Option<f64>,
min_bars: Option<u8>,
},
PhraseLength {
every: Vec<u8>,
},
None {},
}Expand description
The checkable note rule of an entry. The kind list is fixed; free text is rejected.
Variants§
PitchSet
Every pitch class lies in offsets above the root.
Fields
Tonic
The first or last note of a phrase, or the held bass note, is the root.
ChordTones
The chord holds these tones above its root.
Fields
Voicing(Box<VoicingRule>)
The spacing of a chord, or the motion between chords.
Cycle
A chord loop: roots above the tonic and a chord per root.
Fields
OnsetSet
Onsets fall on these slots, per part.
At least min_share of the onsets fall on slots.
CountPerBar
The number of notes per bar.
Length
The sounding length, len times gate.
Fields
unit: LengthUnitBeats, or a share of the grid step.
Velocity
The velocity band.
Overlap
The next note starts before this one ends.
Swing
The second note of each pair starts late.
Fields
Shift
Every onset moves by the same amount, late positive.
Jitter
Onsets and velocities vary at random.
Register
The pitch range and default voice of a role.
Fields
Pattern
A Euclidean pattern: k onsets spread over n steps.
Arp
Chord notes one per step.
Fields
Repeat
Bars identical to an earlier bar.
Fields
The smallest share of identical bars.
The largest share of identical bars.
PhraseLength
Change events fall on bars 1 + k * every.
None
The word names no note rule.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more