Skip to main content

AcidChunk

Struct AcidChunk 

Source
pub struct AcidChunk {
    pub flags: u32,
    pub root_note: u16,
    pub reserved: [u8; 6],
    pub num_beats: u32,
    pub meter: u32,
    pub tempo: f32,
}
Expand description

Typed view of the Acidizer acid chunk body (loop/tempo metadata written by loop-authoring tools). Field offsets and flag-bit semantics per docs/container/riff/metadata/exiftool-riff-tags.html § “RIFF Acidizer Tags” (byte-indexed table: flags at 0, root note at 4, beats at 12, meter at 16, tempo at 20):

<acid-ck> -> acid( <Flags:u32> <RootNote:u16> <Reserved:[u8;6]>
                   <Beats:u32> <Meter:u32> <Tempo:f32> )   // 24 bytes

All integer fields are little-endian. The staged reference enumerates the field offsets; the widths follow from the offset deltas (flags 0..4, beats 12..16, meter 16..20, tempo 20..24). Within the 8-byte span between the root-note offset (4) and the beats offset (12) only the leading 16 bits are enumerated (root note, value range 48..=71 per the table) — the remaining 6 bytes are not described, so they are carried verbatim in Self::reserved and round-trip losslessly. tempo is the 32-bit field at offset 20, interpreted as an IEEE-754 little-endian beats-per-minute value (the only 32-bit reading under which musically plausible tempos are representable with fractional precision).

Fields§

§flags: u32

Bit-field at offset 0 — see the ACID_FLAG_* constants.

§root_note: u16

Root note at offset 4. 48 = C up to 71 = High B per the staged table; meaningful only when Self::root_note_set is true.

§reserved: [u8; 6]

Bytes 6..12 — not enumerated by the staged reference; preserved verbatim so a read→write pass is byte-lossless.

§num_beats: u32

Number of beats in the clip (offset 12).

§meter: u32

Meter field at offset 16 (single 32-bit field in the staged table; carried raw).

§tempo: f32

Tempo in beats per minute (offset 20).

Implementations§

Source§

impl AcidChunk

Source

pub const BODY_LEN: usize = 24

Fixed body length of the acid chunk in bytes.

Source

pub fn one_shot(&self) -> bool

Bit 0 — one-shot clip.

Source

pub fn root_note_set(&self) -> bool

Bit 1 — root_note carries a meaningful value.

Source

pub fn stretch(&self) -> bool

Bit 2 — time-stretch enabled.

Source

pub fn disk_based(&self) -> bool

Bit 3 — disk-based (streamed).

Source

pub fn high_octave(&self) -> bool

Bit 4 — high-octave root-note interpretation.

Source

pub fn root_note_name(&self) -> Option<&'static str>

Note name for Self::root_note per the staged value table (48 = C … 59 = B, 60 = High C … 71 = High B). None outside the enumerated 48..=71 range.

Source

pub fn parse(buf: &[u8]) -> Option<AcidChunk>

Decode an acid chunk body. Returns None when the body is shorter than the 24-byte fixed struct (treated as opaque, same policy as the other fixed-layout metadata chunks). Trailing bytes past offset 24 are tolerated and ignored.

Source

pub fn to_bytes(&self) -> [u8; 24]

Serialize the 24-byte acid chunk body (little-endian, layout per the struct-level documentation).

Trait Implementations§

Source§

impl Clone for AcidChunk

Source§

fn clone(&self) -> AcidChunk

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 Copy for AcidChunk

Source§

impl Debug for AcidChunk

Source§

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

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

impl PartialEq for AcidChunk

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for AcidChunk

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