Function reference
Reading and Summarizing Data
These tools allow you to import, validate, and abstractly summarize the content of humdrum data.
-
validateHumdrum()
- Validate humdrum files
-
knownInterpretations
findHumdrum()
readHumdrum()
- Find and read humdrum files into R
-
writeHumdrum()
- Write humdrumR data to humdrum files
-
summary(<humdrumR>)
- Summarize humdrumR corpora
-
census()
`[`
print(<humCensus>)
- Tabulate records and tokens in a humdrumR corpus
-
interpretations()
`[`(<humInterpretations>)
print(<humInterpretations>)
- Summarize humdrum corpus interpretations.
-
reference()
`[`(<humReference>)
- Summarize reference records in a humdrumR corpus
-
spines()
`[`(<humSpines>)
print(<humSpines>)
- Summarize spines in humdrum dataset.
Working with Data
These pages describe tools used to manipulate the musical data ensconced within humdrumR data structures.
-
with(<humdrumR>)
within(<humdrumR>)
mutate(<humdrumR>)
summarise(<humdrumR>)
reframe(<humdrumR>)
ggplot(<humdrumR>)
- Working with humdrum data fields
-
subset(<humdrumR>)
filter(<humdrumR>)
removeEmptyFiles()
removeEmptyPieces()
removeEmptySpines()
removeEmptyPaths()
removeEmptyRecords()
removeEmptyStops()
removeSubset()
unfilter()
complement()
- Filter humdrum data
-
group_by(<humdrumR>)
ungroup(<humdrumR>)
groups()
- Divide humdrumR data into groups
-
context()
uncontext()
windows()
- Group vectors into contextual windows
Musical Tools
These pages describe the classes and functions that directly represent or engage musical/music-theoretic concepts.
-
humdrumPitch
- humdrumR and pitch
-
pitchFunctions
- Translate between pitch representations.
-
tonalInterval()
- Parsing pitch information
-
pitchDeparsing
- Generating ("deparsing") pitch representations
-
chordFunctions
- Parsing and deparsing chord information
-
tertianSet()
- Parsing chord information
-
chordDeparsing
- Generating ("deparsing") chord representations
-
keyFunctions
- Parsing and deparsing key information
-
diatonicSet()
- Parsing key information
-
keyDeparsing
- Generating ("deparsing") key representations
-
tint()
is.tonalInterval()
order.tonalInterval()
- Representation of tonal pitch information
-
tset()
is.tertianSet()
- Tertian set
-
pitch()
- Scientific pitch representation
-
degree()
deg()
- Tonal scale degree representation (absolute)
-
interval()
- Tonal (pitch) interval representation
-
kern()
- Kern pitch representation
-
lilypond()
- Lilypond pitch representation
-
helmholtz()
- Helmholtz pitch representation
-
tonh()
- German-style pitch notation.
-
octave()
- Extract octave.
-
step()
- Extract scale step.
-
accidental()
- Extract accidental from pitch.
-
quality()
- Extract quality from pitch
-
bhatk()
- Swara representation
-
semits()
midi()
cents(<default>)
- Atonal pitch representations
-
pc()
- Representation of atonal pitch classes
-
cents()
- Apply to humdrumR data
-
freq()
- Translate pitches to frequency (Hz)
-
LO5th()
- Line of Fifths
-
transpose()
- Transpose pitches and keys
-
invert()
- Invert or transpose pitches.
-
is.simple()
is.generic()
- Test the properties of tonal information
-
gamut()
- Make a pitch gamut
-
romanNumerals
- Roman Numeral
-
key()
- Humdrum key interpretation
-
signature()
- Humdrum key signature
-
romanKey()
- Roman numeral key areas
-
tertian()
- Tertian quality chord representation
-
figuredBass()
- Figured bass representation of harmony
-
is.major()
is.minor()
- Test the major/minor modality of a set
-
sonority()
- Interpret tertian sonorities from set(s) of notes.
-
rhythmFunctions
- Translate between rhythm representations.
-
rhythmInterval()
- Parsing rhythm information
-
rhythmDeparsing
- Generating ("deparsing") rhythm representations
-
humMeter
- Tools for analyzing rhythm and meter.
-
recip()
- Reciprocal representation of duration
-
duration()
quarters()
- Numeric (double) representation of durations
-
grid()
togrid()
fromgrid()
- Drum-machine grid representation of rhythmic durations.
-
notehead()
- Note value representation of duration
-
timeline()
timestamp()
- Rhythmic timeline of a piece
-
timebase()
- Represent time on a regular grid
-
recordDuration()
- Calculate duration of each record in a corpus
-
meter()
- Musical Meter in humdrumR
-
duple()
- Generate duple meters
-
nbeats()
- Counting beats
-
tatum()
- Find common denominator of beats
-
timecount()
subpos()
onbeat()
- Count beats or measures
-
metlev()
metcount()
metsubpos()
- Count or measure metric position
-
syncopation()
- Identify syncopated rhythms
-
wort()
- Paste syllables together into words
Data Structures
These pages describe the data structures of humdrumR, and how to query or manipulate them.
-
is.humdrumR()
print(<humdrumR>)
humdrumR
class
-
tandem()
- Get tandem interpretation information from humdrum data
-
pull_data.table()
pull_data.frame()
pull_tibble()
pull(<humdrumR>)
`$`(<humdrumR>)
- Extract field(s) from humdrumR data
-
selectedFields()
select(<humdrumR>)
- The "selected" fields of a humdrumR object
-
as.vector(<humdrumR>)
as.lines()
as.matrix(<humdrumR>)
as.data.frame(<humdrumR>)
as.matrices()
as.data.frames()
- humdrumR coercion
-
mergeHumdrum()
- Merge two (or more) humdrumR datasets
-
collapseHumdrum()
collapseStops()
collapsePaths()
collapseRecords()
- "Collapse" humdrumR data into a field
-
expandPaths()
- Expand paths into new spines
-
cleave()
pivot_wider(<humdrumR>)
cleaveSpines()
cleavePaths()
cleaveStops()
- Align data from separate spines into new fields.
-
rend()
pivot_longer(<humdrumR>)
- Separate data fields into new spines.
-
combineFields()
- Combine one or more fields into a new field
-
cleaveGraceNotes()
- "Fold" grace notes into neighbos
-
unfoldStops()
- "Unfold" data into multiple stops
-
nrecord()
nrow(<humdrumR>)
ntoken()
npieces()
nfiles()
length(<humdrumR>)
ncol(<humdrumR>)
dim(<humdrumR>)
is.empty()
anyMultiPieceFiles()
anyPaths()
anyStops()
anySubcorpora()
namesSubcorpora()
- humdrumR data size and shape
-
getHumtab()
fields()
names(<humdrumR>)
- Humdrum tables (and their "fields")
-
is.struct()
- struct
-
draw()
- Visualize data
-
pdist()
- Tabulate and cross proportions
-
entropy()
H()
mutualInfo()
- Calculate Entropy or Information Content of variables
-
rational()
`%R%`
numerator()
denominator()
is.rational()
is.numeric(<rational>)
rank(<rational>)
Compare(<rational>,<rational>)
Compare(<rational>,<ANY>)
Compare(<ANY>,<rational>)
Summary(<rational>)
prod(<rational>)
abs(<rational>)
sign(<rational>)
max(<rational>)
min(<rational>)
mean(<rational>)
round(<rational>)
floor(<rational>)
ceiling(<rational>)
trunc(<rational>)
expand(<rational>)
sum(<rational>)
cumsum(<rational>)
as.rational()
fraction()
as.fraction()
as.double(<fraction>)
as.integer(<fraction>)
- Rational numbers
-
expand()
- Expand numbers outwards from zero
-
delta()
- Lagged differences
-
ditto()
- Propagate data points to "fill" null data.
-
segments()
changes()
- Identify contiguous segments of data in a vector
-
sigma()
- Cumulative sum of numeric vector
-
hop()
- Generate regular sequence "along" input
-
enum()
- Enumerate vector
Regular Expressions
Regular Expressions are essential tools for working with humdrum data. These functions provide functionality for working with regular expressions.
-
humdrumDispatch()
exclusiveDispatch()
makeDispatchDF()
makeHumdrumDispatcher()
print(<humdrumDispatch>)
- Regular expression method dispatch and function application
-
captureRE()
captureUniq()
orRE()
- Making Regular Expressions
-
REparser()
REparse()
- Parse String Using Regular expressions
-
humdrumRroot
humdrumR()
- humdrumR
-
partialMatching
- What is "partial matching"?
-
evaluatingExpressions
- "Evaluating" "Expressions" in "Environments"?
-
groupingFactors
- What are "grouping factors"?
-
partialMatching
- What is "partial matching"?
-
vectorization
- What is "vectorization"?