pub struct KeyDetector;Expand description
Key detector using Krumhansl-Schmuckler profiles.
§Examples
use resonant_analysis::key::KeyDetector;
use resonant_analysis::chroma::ChromaVector;
// All-A chroma (strong A, C#, E — A major triad)
let mut cv = ChromaVector { bins: [0.0; 12] };
cv.bins[9] = 1.0; // A
cv.bins[1] = 0.8; // C#
cv.bins[4] = 0.6; // E
let result = KeyDetector::new().detect(&[cv]);
assert!(result.is_some());Implementations§
Source§impl KeyDetector
impl KeyDetector
Sourcepub fn detect(&self, chroma_frames: &[ChromaVector]) -> Option<KeyEstimate>
pub fn detect(&self, chroma_frames: &[ChromaVector]) -> Option<KeyEstimate>
Classifies a sequence of chroma frames and returns the best-matching key.
Returns None if chroma_frames is empty.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyDetector
impl RefUnwindSafe for KeyDetector
impl Send for KeyDetector
impl Sync for KeyDetector
impl Unpin for KeyDetector
impl UnsafeUnpin for KeyDetector
impl UnwindSafe for KeyDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more