Skip to contents

Reading and Summarizing Data

These tools allow you to import, validate, and abstractly summarize the content of humdrum data.

Reading and Writing

validateHumdrum()
Validate humdrum files
knownInterpretations findHumdrum() readHumdrum()
Find and read humdrum files into R
writeHumdrum()
Write humdrumR data to humdrum files

Summarizing

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.

Manipulating Humdrum Data

Musical Tools

These pages describe the classes and functions that directly represent or engage musical/music-theoretic concepts.

Pitch overviews

These pages overview general concepts in humdrumR pitch:

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
diatonicSet() dset() is.diatonicSet() order.diatonicSet() `==`(<diatonicSet>,<diatonicSet>) Compare(<diatonicSet>,<diatonicSet>) `==`(<tertianSet>,<tertianSet>)
Tonal (diatonic) sets

Pitch functions

These functions translate between pitch representations:

pitch()
Scientific pitch representation
degree() deg()
Tonal scale degree representation (absolute)
interval()
Tonal (pitch) interval representation
kern()
Kern pitch representation
solfa()
Relative-do Solfege representation
solfg()
Fixed-do Solfege 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.
int() mint() hint()
Calculate intervals between pitches
is.simple() is.generic()
Test the properties of tonal information
gamut()
Make a pitch gamut

Key and chord functions

These functions translate between diatonic and tertian representations:

romanNumerals
Roman Numeral
key()
Humdrum key interpretation
signature()
Humdrum key signature
romanKey()
Roman numeral key areas
harm() roman()
Roman numeral representations of harmony
chord() harte()
"Pop/Jazz" chord symbols
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.

Rhythm overviews

These pages overview general concepts in humdrumR pitch:

rhythmFunctions
Translate between rhythm representations.
rhythmInterval()
Parsing rhythm information
rhythmDeparsing
Generating ("deparsing") rhythm representations
humMeter
Tools for analyzing rhythm and meter.

Duration and Time functions

These functions translate between rhythm representations:

bpm2sec() sec2bpm() bpm2ms() ms2bpm()
Translate between durations and tempos
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
seconds() ms() dur()
Clock-time representations of duration
ioi() sumTies()
Sum "connected" durations
timeline() timestamp()
Rhythmic timeline of a piece
timebase()
Represent time on a regular grid
recordDuration()
Calculate duration of each record in a corpus

Beats and Meter

Rhythm and meter analysis functions.

meter()
Musical Meter in humdrumR
duple()
Generate duple meters
tactus() measure()
Extract levels from 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

Lyrics

Lyrics and text functions.

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

Other Functions

Other useful tools.

Information theory

pdist()
Tabulate and cross proportions
entropy() H() mutualInfo()
Calculate Entropy or Information Content of variables

Numeric values

Manipulating Vectors

delta()
Lagged differences
ditto()
Propagate data points to "fill" null data.
lag() lead()
Shift data within a vector/matrix/data.frame
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.

`%~l%` `%~i%` `%~n%` `%~m%` `%~%` `%!~%` `%!~l%` `%!~i%`
Match strings against regular expression
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

Miscallaneus

humdrumRroot humdrumR()
humdrumR
partialMatching
What is "partial matching"?

Some R basics lessons

Concise descriptions of some important concepts in R coding.

evaluatingExpressions
"Evaluating" "Expressions" in "Environments"?
groupingFactors
What are "grouping factors"?
partialMatching
What is "partial matching"?
recycling padding
What are "recycling" or "padding"?
vectorization
What is "vectorization"?