auto-musik

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

data.rs (726B)


      1 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
      2 pub enum NoteEvent {
      3     // Note On:
      4     NoteOn { note: u8, velocity: u8 },
      5     // Note Off:
      6     NoteOff { note: u8 },
      7 }
      8 
      9 #[derive(Debug, Clone, PartialEq)]
     10 pub struct Bar {
     11     pub beat: Beat,
     12     pub tonality: Tonality,
     13     pub chord: Chord,
     14     pub events: Vec<(u64, NoteEvent)>,
     15 }
     16 
     17 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
     18 pub enum Beat {
     19     TwoFourth,
     20     ThreeFourth,
     21     FourFourth,
     22 }
     23 
     24 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
     25 pub enum Tonality {
     26     CM,
     27 }
     28 
     29 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
     30 pub enum Chord {
     31     First,
     32     Second,
     33     Third,
     34     Fourth,
     35     Fifth,
     36     Sixth,
     37     Seventh,
     38 }