pub fn linear_context<T: Clone>(
source: &[T],
index: usize,
) -> Result<Context<T>>Expand description
music21’s _getLinearContext: the items before, at, after and two after
index.
use music21::abc::step::linear_context;
let chars: Vec<char> = "12345".chars().collect();
assert_eq!(linear_context(&chars, 3)?, (Some('3'), '4', Some('5'), None));