use super::program::{Accidental, NoteLetter, Ramp};
#[derive(Debug, Clone, PartialEq)]
pub struct Solo {
pub low: i32,
pub high: i32,
pub steps: Ramp<u32>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct MiniNotation {
pub sequence: Sequence,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Sequence {
pub steps: Vec<Step>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Step {
pub atom: Atom,
pub modifiers: Vec<Modifier>,
pub velocity: Option<Ramp<f64>>,
}
impl Step {
pub fn bare(atom: Atom) -> Self {
Self {
atom,
modifiers: Vec::new(),
velocity: None,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Atom {
Note(Note),
Degree(i32),
Trigger,
Rest,
Hold,
Group(Group),
Alternation(Alternation),
Solo(Solo),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Note {
pub letter: NoteLetter,
pub accidental: Accidental,
pub octave: u8,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GroupMode {
Subdivide,
Chord,
Random,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Group {
pub mode: GroupMode,
pub layers: Vec<Sequence>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Alternation {
pub sequence: Sequence,
}
#[derive(Debug, Clone, PartialEq)]
pub enum Modifier {
Repeat(Ramp<u32>),
Slow(u32),
Replicate(u32),
Euclidean(Ramp<u32>, Ramp<u32>, Option<u32>),
Drop(Option<Ramp<f64>>),
Weight(u32),
}