Trait tune::pitch::Pitched [−][src]
Objects which have a Pitch
assigned.
Required methods
Loading content...Provided methods
fn find_in_tuning<K, T: Tuning<K>>(&self, tuning: T) -> Approximation<K>
[src]
Finds a key or note for any Pitched
object in the given tuning
.
Examples
use tune::pitch::Pitched; let a4 = NoteLetter::A.in_octave(4); let tuning = ConcertPitch::from_a4_pitch(Pitch::from_hz(432.0)); let approximation = a4.find_in_tuning(tuning); assert_eq!(approximation.approx_value, a4); assert_approx_eq!(approximation.deviation.as_cents(), 31.766654);
Implementations on Foreign Types
impl<K: Copy, T: Tuning<K> + ?Sized> Pitched for (K, T)
[src]
A key or note K
paired with an appropriate Tuning<K>
is considered Pitched
.
Examples
use tune::pitch::Pitched; let concert_pitch = ConcertPitch::from_a4_pitch(Pitch::from_hz(432.0)); assert_approx_eq!((NoteLetter::A.in_octave(5), concert_pitch).pitch().as_hz(), 864.0);