Skip to main content

PatternGenerator

Struct PatternGenerator 

Source
pub struct PatternGenerator {
    pub settings_: [PatternGeneratorSettings; 3],
    pub options_: Options,
    /* private fields */
}

Fields§

§settings_: [PatternGeneratorSettings; 3]§options_: Options

Implementations§

Source§

impl PatternGenerator

Source

pub fn new() -> Self

Initializes with default settings

Source

pub fn get_step(&self) -> u8

Returns step in current sequence 0 - 31

Source

pub fn get_sequencer_state(&self) -> SequencerState

Returns internal generator seqauencer state to be stored in an app’s ManagedStorage so it can be restored later after a re-spwan

Source

pub fn is_gate_mode_active(&self) -> bool

Source

pub fn get_current_output_mode(&self) -> OutputMode

Source

pub fn set_output_mode(&mut self, mode: OutputMode)

Source

pub fn set_gate_mode(&mut self, active: bool)

Source

pub fn set_global_chaos(&mut self, enabled: bool)

Source

pub fn get_trigger_state(&self) -> u8

Provides the current trigger state for all parts (and accent). Bit 0: Part 1 (BD/EUC1), Bit 1: Part 2 (SD/EUC2), Bit 2: Part 3 (HH/EUC3) Bit 3: Accent (in Drum mode or chaotic Euclidean)

Source

pub fn is_on_first_beat(&self) -> bool

Source

pub fn is_on_beat(&self) -> bool

Source

pub fn set_seed(&mut self, seed: u16)

Sets internal random number generator seed

Source

pub fn queue_dnb_pattern_change(&mut self, new_pattern: u8)

Queue up DnB pattern change on next bar (ie when first_beat_ = true)

Source

pub fn reset_dnb_pattern_to_base(&mut self)

Reset DnB pattern to default

Source

pub fn get_dnb_24ppqn_pattern_division(&self) -> u32

Required per-step 24ppqn clock division for current DnB pattern

Source

pub fn reset(&mut self)

Reset a running generator, but doesn’t change pattern

Source

pub fn restore(&mut self, sequencer_state: SequencerState)

Restore the internal state of a running generator with supplied sequencer state

Source

pub fn retrigger(&mut self)

Source

pub fn tick(&mut self, clkn: u32, div: u32)

Called on each tick of external clock.

For Drums Mode, this should be fixed to 1/32nd steps For Euclidean mode, should be in 1/16th steps by default For DnB mode, it depends on the selected DnB pattern #steps

Source

pub fn set_length(&mut self, channel: usize, length: u8)

Set Euclidean sequence length 1 - 32 steps

Source

pub fn set_offset(&mut self, channel: usize, offset: u8)

Set Euclidean sequence offset for one channel (phase rotation)

Source

pub fn set_fill(&mut self, channel: usize, fill_param_value: u8)

fill_param_value is 0-255 from app

Source§

impl PatternGenerator

Source

pub fn generate_dnb_variation(&mut self)

Generates a random variation of the current dnb pattern, mutates the self.current_dnb_pattern

Trait Implementations§

Source§

impl Clone for PatternGenerator

Source§

fn clone(&self) -> PatternGenerator

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 PatternGenerator

Source§

impl Debug for PatternGenerator

Source§

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

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

impl Default for PatternGenerator

Source§

fn default() -> Self

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

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