Skip to main content

Step

Struct Step 

Source
pub struct Step {
    pub atom: Atom,
    pub modifiers: Vec<Modifier>,
    pub velocity: Option<Ramp<f64>>,
    pub source: Source,
}
Expand description

A single step in a sequence: an atom, zero or more modifiers, and an optional velocity.

Modifiers stack and are applied left-to-right in written order, so x*8? first expands into eight slots and then gives each of them a drop chance.

Velocity is a field rather than a Modifier because it is a property of the step, not a transformation of the slots a modifier produced. The slot-generating modifiers (*N, !N, (k,n)) run first and build the slots; a velocity written anywhere in the run — x:0.6*4 or x*4:0.6 — therefore applies to every slot the step generates, and cannot be read as applying to only the slots that existed when it was written. It also makes “at most one velocity per step” a type invariant instead of a check.

Fields§

§atom: Atom§modifiers: Vec<Modifier>§velocity: Option<Ramp<f64>>

:v, or 1.0 for the accent spelling X — an absolute velocity in 0.0..=1.0 that overrides the line’s vel for this step. None takes the line’s vel. May travel across the line’s ramp span, which is how a per-step swell (x:0.3..0.9) is written.

On a group or an alternation this is the velocity of everything the step sounds, except where an inner step names its own.

§source: Source

Where the step was written — atom, modifiers and velocity — as a byte range in the notation string between the quotes. An editor uses it to point from a sounding note back to the text that made it.

Implementations§

Source§

impl Step

Source

pub fn bare(atom: Atom) -> Self

A step with no modifiers and no velocity.

Trait Implementations§

Source§

impl Clone for Step

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 Step

Source§

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

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

impl PartialEq for Step

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 StructuralPartialEq for Step

Auto Trait Implementations§

§

impl Freeze for Step

§

impl RefUnwindSafe for Step

§

impl Send for Step

§

impl Sync for Step

§

impl Unpin for Step

§

impl UnsafeUnpin for Step

§

impl UnwindSafe for Step

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