pitchFunctions | R Documentation |
These functions are used to extract and translate between different representations of pitch information. The functions can also do things like transposing and simplifying pitches.
x |
Input data to parse as pitch information. The |
... |
Arguments passed to the pitch deparser. There are also two hidden (advanced) arguments you can specify: |
generic |
Should "specific" pitch information (accidentals and qualites) be discarded? Defaults to Must be a singleton |
simple |
Should "compound" pitch information (octave/contour) be discarded? Defaults to Must be a singleton |
Key |
The input Defaults to Must be a |
parseArgs |
An optional list of arguments passed to the pitch parser. Defaults to an empty Must be a |
transposeArgs |
An optional list of arguments passed to a special Defaults to an empty Must be a |
inPlace |
Should non-pitch information be retained in the output string. Defaults to Must be a singleton This argument only has an effect if the input (the |
The full list of pitch functions is:
Tonal pitch representations
Absolute pitch representations
kern()
pitch()
lilypond()
helmholtz()
tonh()
(German-style notation)
Relative pitch representations
interval()
solfa()
(relative-do solfege)
solfg()
(French-style fixed-do solfege)
degree()
(absolute scale degrees)
deg()
(melodic scale degrees)
bhatk()
(hindustani swara)
Partial pitch representations
step()
accidental()
quality()
octave()
Atonal pitch representations
Musical pitch representations
semits()
midi()
cents()
pc()
(pitch classes)
Physical pitch representations
freq()
These pitch functions all work in similar ways, with similar arguments and functionality.
Each function takes an input pitch representation (which can be anything) and outputs
its own pitch representation.
For example, kern()
takes any input representation and outputs **kern
(pitch) data.
Underneath the hood, the full processing of each function looks like this:
Input representation (e.g., **pitch
or **semits
) |>
Parsing (done by tonalInterval()
) |>
Intermediate (tonalInterval) representation |>
Transformation (e.g., transpose()
) |>
Deparsing |>
Output representation (e.g. **kern
or **solfa
)
To read the details of the parsing step, read this.
To read the details of the "deparsing" step, read this.
To read more details about each specific function, click on the links in the list above,
or type ?func
in the R command line: for example, ?kern
.
The "partial" pitch functions octave()
, step()
, accidental()
, and quality()
are so-called
because they each only return one part/aspect of pitch information, and only that part.
For example, accidental()
only returns he accidentals (if any) of pitches.
NULL
inputs (x
argument) return a NULL
output.
Otherwise, returns a vector/matrix of the same length/dimension as x
.
NA
values in the input x
are propagated to the output.
To better understand how these functions work, read about how pitches are parsed and deparsed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.