Skip to main content

decision_process

Function decision_process 

Source
pub fn decision_process(
    parts: &[(usize, FloatType)],
    note_prediction: FloatType,
    beginning_data: &[FloatType],
    last_note_position: FloatType,
    countdown: usize,
    page: Option<(FloatType, FloatType)>,
) -> Result<(usize, usize)>
Expand description

Which of the parts a score follower is weighing to take as where the player is, and the count of doubtful guesses so far: music21’s decisionProcess. Each part is its index into beginning_data, where it begins, and how well it matched; parts are in order of how well they matched. Of the parts matching within nine tenths of the best and beginning after last_note_position, the one beginning nearest note_prediction is taken; the countdown grows when the guess is doubtful and is otherwise reset.

§Errors

No parts, a part beginning where beginning_data has nothing, or every part beginning before the prediction with none taken instead.