rstmt_core/notes/
note_base.rs

1/*
2    Appellation: aspn <module>
3    Contrib: @FL03
4*/
5
6use crate::octave::Octave;
7use crate::pitch::{self, Accidental, PitchClass, RawPitchClass};
8
9/// The [`NoteBase`] is a generic representation of a musical note
10#[derive(Clone, Copy, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
11#[cfg_attr(
12    feature = "serde",
13    derive(serde::Deserialize, serde::Serialize),
14    serde(rename_all = "snake_case")
15)]
16#[repr(C)]
17pub struct NoteBase<P = pitch::CNote, K = <P as RawPitchClass>::Tag>
18where
19    P: RawPitchClass<Tag = K>,
20    K: Accidental,
21{
22    pub(crate) class: PitchClass<P, K>,
23    pub(crate) octave: Octave,
24}