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() reference() 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:

Pitch functions

These functions translate between pitch representations:

pitch() pitch() pitch() pitch()
Scientific pitch representation
degree() degree() degree() degree() deg() deg() deg() deg()
Tonal scale degree representation (absolute)
interval() interval() interval() interval()
Tonal (pitch) interval representation
kern() kern() kern() kern()
Kern pitch representation
solfa() solfa() solfa() solfa()
Relative-do Solfege representation
solfg() solfg() solfg() solfg()
Fixed-do Solfege representation
lilypond() lilypond() lilypond() lilypond()
Lilypond pitch representation
helmholtz() helmholtz() helmholtz() helmholtz()
Helmholtz pitch representation
tonh() tonh() tonh() tonh()
German-style pitch notation.
octave()
Extract octave.
step()
Extract scale step.
accidental()
Extract accidental from pitch.
quality()
Extract quality from pitch
bhatk() bhatk() bhatk() bhatk()
Swara representation
semits() semits() semits() midi() midi() midi() midi() cents(<default>)
Atonal pitch representations
pc() pc() pc() pc()
Representation of atonal pitch classes
cents() cents() cents() cents()
Apply to humdrumR data
freq() freq() freq() freq()
Translate pitches to frequency (Hz)
LO5th()
Line of Fifths
transpose()
Transpose pitches and keys
invert()
Invert or transpose pitches.
int() mint() mint() mint() mint() hint() hint() hint() 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.
rhythmParsing rhythmInterval rhythmInterval.default rhythmInterval.integer rhythmInterval.NULL rhythmInterval.numeric rhythmInterval.character rhythmInterval.factor rhythmInterval.token
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() recip() recip() recip()
Reciprocal representation of duration
duration() duration() duration() duration() quarters() quarters() quarters() quarters()
Numeric (double) representation of durations
grid() grid() grid() togrid() fromgrid()
Drum-machine grid representation of rhythmic durations.
notehead() notehead() notehead() notehead()
Note value representation of duration
seconds() seconds() seconds() ms() ms() ms() dur() dur() dur()
Clock-time representations of duration
ioi() ioi() ioi() sumTies() sumTies() sumTies()
Sum "connected" durations
timeline() timeline() timeline() timestamp() timestamp() 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 tactus.meter tactus.character tactus.NULL measure measure.meter measure.character measure.NULL
Extract levels from meters
nbeats nbeats.meter nbeats.character nbeats.NULL
Counting beats
tatum tatum.meter tatum.character tatum.numeric tatum.rational tatum.token tatum.NULL
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() wort() wort()
Paste sylllables 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.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"?