R/analyze_current.R

Defines functions analyze_current

Documented in analyze_current

#' Produce analyses of each counterpoint choice
#'
#' @param i the index of the current note
#' @param cpt_targets the set of vectors of possible counterpoint targets
#' @param cpt the vector of counterpoint notes
#' @param cf the vector of cantus firmus notes
#' @param voice above or below
#'
#' @description {Produce analyses of each counterpoint choice}
#' @return data.frame
#' @export analyze_current
analyze_current <- function(i, cpt_targets, cpt, cf, voice = "above")
{
  # Analyze each target with up to the current note being written
  analyses <- list()
  for(j in 1:length(cpt_targets))
  {
    analyses[[j]] <- analyze_exercise(c(cpt[1:(i-1)], cpt_targets[j]), cf[1:i], voice)
  }
  return(analyses)
}
shill1729/synthesizer documentation built on July 9, 2020, 12:52 a.m.