use crate::pitch::Accidental;
use rstmt_traits::PitchMod;
pub trait RawPitchClass
where
Self: Send
+ Sync
+ AsRef<str>
+ AsRef<isize>
+ PartialEq<isize>
+ PartialEq<str>
+ core::borrow::Borrow<isize>
+ core::fmt::Debug
+ core::fmt::Display,
{
type Tag: Accidental;
private! {}
fn new() -> Self
where
Self: Sized;
fn name(&self) -> &str;
fn index(&self) -> isize;
}
pub trait PitchClassRepr: RawPitchClass
where
Self: Default + core::str::FromStr<Err = crate::error::Error> + TryFrom<isize>,
{
const IDX: isize;
fn is(value: isize) -> bool
where
Self: Sized,
{
value.pmod() == Self::IDX
}
}