Skip to main content

Rule

Enum Rule 

Source
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

§offsets: Vec<u8>

Semitones above the root.

§colour: Vec<u8>

Offsets a line shows at least once per 4 bars to claim the scale.

§giveaway: Vec<u8>

Offsets that name a neighbouring scale instead.

§

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

§offsets: Vec<u8>

Semitones above the chord root; 14 is a ninth.

§choose: Option<Choose>

Tones of which at least some must also sound.

§

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

§roots: Vec<u8>

Semitones above the tonic, one per chord.

§chords: Vec<String>

Chord entry ids, one per root.

§bars_per_chord: Option<f64>

Bars per chord, when the entry fixes it.

§

OnsetSet

Onsets fall on these slots, per part.

Fields

§parts: Vec<PartSlots>

The slots of each part.

§

OnsetShare

At least min_share of the onsets fall on slots.

Fields

§slots: Vec<u8>

The slots that count.

§min_share: f64

The smallest share, 0 to 1.

§

CountPerBar

The number of notes per bar.

Fields

§min: u8

The fewest notes.

§max: u8

The most notes.

§

Length

The sounding length, len times gate.

Fields

§unit: LengthUnit

Beats, or a share of the grid step.

§min: Option<f64>

The shortest length.

§max: Option<f64>

The longest length.

§

Velocity

The velocity band.

Fields

§min: u8

The lowest velocity.

§max: u8

The highest velocity.

§

Overlap

The next note starts before this one ends.

Fields

§min_ms: f64

The smallest overlap in ms.

§

Swing

The second note of each pair starts late.

Fields

§note: u8

16 for a pair of sixteenths, 8 for a pair of eighths.

§min_pct: f64

The lowest pair percent.

§max_pct: f64

The highest pair percent.

§

Shift

Every onset moves by the same amount, late positive.

Fields

§min_ms: f64

The smallest shift in ms.

§max_ms: f64

The largest shift in ms.

§

Jitter

Onsets and velocities vary at random.

Fields

§max_ms: f64

The largest onset deviation in ms.

§velocity: u8

The largest velocity deviation.

§

Register

The pitch range and default voice of a role.

Fields

§core: [u8; 2]

Where most notes sit, inclusive.

§hard: [u8; 2]

The limits outside which a note is rejected, inclusive.

§voice: Voice

Mono, poly or either.

§

Pattern

A Euclidean pattern: k onsets spread over n steps.

Fields

§k: u8

Onsets.

§n: u8

Steps.

§rotation: u8

Steps the pattern is turned by.

§

Arp

Chord notes one per step.

Fields

§order: ArpOrder

The play order.

§rate: f64

Beats per step.

§gate: Option<[u8; 2]>

The gate range in percent of the step.

§degrees: Vec<u8>

sequence: chord degrees in play order.

§

Repeat

Bars identical to an earlier bar.

Fields

§min_share: Option<f64>

The smallest share of identical bars.

§max_share: Option<f64>

The largest share of identical bars.

§min_bars: Option<u8>

The fewest bars the repetition lasts.

§

PhraseLength

Change events fall on bars 1 + k * every.

Fields

§every: Vec<u8>

The bar counts between changes.

§

None

The word names no note rule.

Implementations§

Source§

impl Rule

Source

pub fn kind(&self) -> &'static str

The kind name, as in the data.

Trait Implementations§

Source§

impl Clone for Rule

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Rule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Rule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Rule

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Rule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.