get_corpus_features: Get corpus features

Description Usage Arguments Value

View source: R/get-corpus-features.R

Description

Analyzes a musical corpus to return a tibble describing feature values for all possible voicings of a series of chord sequences.

Usage

1
2
get_corpus_features(x, revoice_from, min_octave, max_octave, min_notes,
  max_notes, features = voice_features(), verbose = TRUE)

Arguments

x

The corpus to analyze, expressed as a list of chord sequences, where each chord sequence is expressed as a list of chords, and each chord is expressed as a numeric vector of non-duplicated MIDI note numbers in ascending order. The corpus may also be expressed as a corpus object from the hrep package, and chords may be expressed as pi_chord objects from the hrep package.

revoice_from

(Character scalar) Determines the representation to which each chord is reduced before generating candidate revoicings. Currently supported values are "pc_chord" and "pc_set", corresponding to pc_chord and pc_set from the hrep package respectively. In the former case, bass pitch classes are preserved, but in the latter they are not.

min_octave

(Numeric scalar) The minimum octave from which the candidate voicings should be drawn, expressed relative to middle C. For example, min_octave = -1 means that all voicings will be drawn from C3 (MIDI note number 48) or above (see also voice_opt). An error will be thrown if the corpus contains chords that span lower than permitted by this argument.

max_octave

(Numeric scalar) The maximum octave from which the candidate voicings should be drawn, expressed relative to middle C. For example, min_octave = 0 means that all voicings will be drawn from the octave beginning on middle C or lower, corresponding to pitch heights strictly less than C5 (MIDI note number 72) (see also voice_opt). An error will be thrown if the corpus contains chords that span higher than permitted by this argument.

min_notes

(Integer scalar) The minimum number of unique notes permitted in each candidate voicing. An error will be thrown if the corpus contains chords with fewer notes than this number.

max_notes

(Integer scalar) The maximum number of unique notes permitted in each candidate voicing. An error will be thrown if the corpus contains chords with more notes than this number.

features

A list of features to compute for each chord voicing (see voice_opt).

verbose

(Logical scalar) Whether or not to print progress messages.

Value

A tibble where each row describes a candidate voicing for a particular chord in the corpus, along with its computed features, with the following columns:


pmcharrison/voicer documentation built on Dec. 17, 2020, 1:09 p.m.