Skip to main content

composer_paths

Function composer_paths 

Source
pub fn composer_paths(name: &str, paths: &[PathBuf]) -> Vec<PathBuf>
Expand description

The paths that belong to a composer or collection: those with a part, or a part’s name before its last dot, of that name, ignoring case. Sorted, as music21’s getComposer answers them.

use std::path::PathBuf;
use music21::corpus::work::composer_paths;

let paths = [PathBuf::from("/c/bach/bwv66.6.mxl"), PathBuf::from("/c/beach/x.mxl")];
assert_eq!(composer_paths("Bach", &paths), [PathBuf::from("/c/bach/bwv66.6.mxl")]);