Trait tune::note::PitchedNote [−][src]
Trait for objects that provide Pitch
and Note
information.
A Note
has a unique pitch defined by the 440 Hz standard tuning.
For a note to sound at a different Pitch
the type alias NoteAtConcertPitch
is used.
Required methods
fn note(&self) -> Note
[src]
Retrieves the Note
part of self
.
use tune::note::PitchedNote; let c4 = NoteLetter::C.in_octave(4); assert_eq!(c4.note(), c4); let c4_altered = c4.at_pitch(Pitch::from_hz(256.0)); assert_eq!(c4_altered.note(), c4);
Provided methods
fn alter_pitch_by(&self, delta: Ratio) -> NoteAtConcertPitch
[src]
Returns a new PitchedNote
with the same Note
part but a Pitch
altered by delta
.
Examples
use tune::note::PitchedNote; use tune::pitch::Pitched; let a4 = NoteLetter::A.in_octave(4); let a4_altered = a4.alter_pitch_by(Ratio::from_float(1.01)); assert_eq!(a4_altered.note(), a4); assert_approx_eq!(a4_altered.pitch().as_hz(), 444.4);