use crate::pitch::pitch_class::PitchClass;
use crate::pitch::traits::{Accidental, RawPitchClass};
use rstmt_traits::PitchMod;
impl<T1, A1, T2, A2> core::ops::Add<PitchClass<T2, A2>> for PitchClass<T1, A1>
where
T1: RawPitchClass<Tag = A1>,
A1: Accidental,
T2: RawPitchClass<Tag = A2>,
A2: Accidental,
{
type Output = isize;
fn add(self, rhs: PitchClass<T2, A2>) -> Self::Output {
(self.get().index() + rhs.get().index()).pmod()
}
}
impl<T1, A1, T2, A2> core::ops::Sub<PitchClass<T2, A2>> for PitchClass<T1, A1>
where
T1: RawPitchClass<Tag = A1>,
A1: Accidental,
T2: RawPitchClass<Tag = A2>,
A2: Accidental,
{
type Output = isize;
fn sub(self, rhs: PitchClass<T2, A2>) -> Self::Output {
(self.get().index() - rhs.get().index()).pmod()
}
}