euphony-units 0.1.1

Core types and traits for music composition
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::pitch::mode::intervals::ModeIntervals;

#[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub struct ModeSystem(pub &'static [ModeIntervals]);

impl ModeSystem {
    pub const fn new(intervals: &'static [ModeIntervals]) -> Self {
        Self(intervals)
    }
}

impl core::ops::Deref for ModeSystem {
    type Target = [ModeIntervals];

    fn deref(&self) -> &Self::Target {
        self.0
    }
}