ArrangeRow

Enum ArrangeRow 

Source
pub enum ArrangeRow {
    PatternRow {
        pattern_id: u8,
        repetitions: u8,
        mute_mask: u8,
        tempo_1: u8,
        tempo_2: u8,
        scene_a: u8,
        scene_b: u8,
        offset: u8,
        length: u8,
        midi_transpose: [u8; 8],
    },
    LoopOrJumpOrHaltRow {
        loop_count: u8,
        row_target: u8,
    },
    ReminderRow(String),
    EmptyRow(),
}
Expand description

Base model for an arranger row within an arrangement block.

Variants§

§

PatternRow

pattern choice and playback

Fields

§pattern_id: u8

Which Pattern should be played at this point. Patterns are indexed from 0 (A01) -> 256 (P16).

§repetitions: u8

How many times to play this arrangement row.

§mute_mask: u8

How track muting is applied during this arrangement row.

§tempo_1: u8

First part of the Tempo mask for this row. Needs to be combined with tempo_2 to work out the actual tempo (not sure how it works yet).

§tempo_2: u8

Second part of the Tempo mask for this row. Needs to be combined with tempo_1 to work out the actual tempo (not sure how it works yet).

§scene_a: u8

Which scene is assigned to Scene slot A when this arrangement row is playing.

§scene_b: u8

Which scene is assigned to Scene slot B when this arrangement row is playing.

§offset: u8

Which trig to start Playing the pattern on.

§length: u8

How many trigs to play the pattern for. Note that this value always has offset added to it. So a length on the machine display of 64 when the offset is 32 will result in a value of 96 in the file data.

§midi_transpose: [u8; 8]

MIDI Track transposes for all 8 midi channels. 1 -> 48 values are positive transpose settings. 255 (-1) -> 207 (-48) values are negative transpose settings.

§

LoopOrJumpOrHaltRow

Loop/Jump/Halt rows are all essentially just loops. Example: Jumps are an infinite loop. So these are bundled into one type.

Loops are loop_count = 0 -> 65 and the row_target is any row before this one (loop_count=0 is infinite looping). Halts are loop_count = 0 and the row_target is this row. Jumps are loop_count = 0 and the row_target is any row after this one.

Fields

§loop_count: u8

How many times to loop to the row_target. Only applies to loops.

§row_target: u8

The row number to loop back to, jump to, or end at.

§

ReminderRow(String)

A row of ASCII text data with 15 maximum length.

§

EmptyRow()

Row is not in use. Only used in an ArrangementBlock as a placeholder for null basically.

Trait Implementations§

Source§

impl Clone for ArrangeRow

Source§

fn clone(&self) -> ArrangeRow

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ArrangeRow

Source§

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

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

impl Default for ArrangeRow

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const N: usize> Defaults<[ArrangeRow; N]> for ArrangeRow

Source§

fn defaults() -> [Self; N]
where Self: Default,

Create an default container type T containing N default instances of Self.
Source§

impl<const N: usize> Defaults<Box<Array<ArrangeRow, N>>> for ArrangeRow

Source§

fn defaults() -> Box<Array<Self, N>>
where Self: Defaults<[Self; N]>,

Create an default container type T containing N default instances of Self.
Source§

impl<'de> Deserialize<'de> for ArrangeRow

Custom Deserialize trait for ArrangeRow variants. Ensures we can do

  • conditional/dynamic deserialization for binary data based on the row type byte
  • deserialize from both human-readable and raw binary formats

The variant of an ArrangeRow is determined by

  • the row’s index in the ArrangementBlock.rows array versus number of rows in the arrangement ArrangementBlock.n_rows
  • The value of the first byte for an ArrangeRow. See the table below:
ArrangeRow VariantFirst Byte
PatternRow0
ReminderRow0
LoopOrJumpOrHaltRow0
PatternRow0
EmptyRown/a
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 ArrangeRow

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ArrangeRow

Custom serialization to ensure we can serialize both bytes and human-readable data formats correctly. Please note this currently abuses the serialize_struct pattern for writing binary/bytes to ensure we get the correct number of bytes in the correct positions.

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 Eq for ArrangeRow

Source§

impl StructuralPartialEq for ArrangeRow

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

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