Plot a observed melody and (optional) an expected melody, as well as corresponding energy values (corresponding to the loudness of the sound).
melodyplot(object, observed, expected = NULL, bars = NULL,
main = NULL, xlab = NULL, ylab = "note", xlim = NULL, ylim = NULL,
observedtype = "l", observedcol = "red", expectedcol = "grey",
gridcol = "grey", lwd = 2, las = 1, cex.axis = 0.9,
mar = c(5, 4, 4, 4) + 0.1, notenames = NULL, thin = 1,
silence = "silence", plotenergy = TRUE, ...,
axispar = list(ax1 = list(side=1),
ax2 = list(side=2),
ax4 = list(side=4)),
boxpar = list(),
energylabel = list(text="energy", side=4, line=2.5, at=rg.s-0.25, las=3),
energypar = list(),
expectedpar = list(),
gridpar = list(col=gridcol),
observedpar = list(col=observedcol, type=observedtype, lwd=2, pch=15))
An object of class Wspec
.
Observed notes, probably as a result from noteFromFF
(or a smoothed version).
This should correspond to the Wspec
object
.
It can also be a matrix of k
columns where those k
notes in the same row
are displayed at the same timepoint.
Expected notes (optional; in order to compare results), same format as observed
.
Number of bars to be plotted (a virtual static segmentation takes place).
If NULL
(default), time rather than bars are used.
Main title of the plot.
Annotation of -/y-axes.
Range of x-/y-axis, where ylim
must be an integer
that represents the range of note heights that should be displayed.
Type (either "p"
for points or "l"
for lines)
used for representing observed notes.
"l"
(the default) is not sensible for polyphonic representations.
Colour for the observed melody.
Colour for the expected melody.
Colour of the grid.
Line width, see par
for details.
Orientation of axis labels, see par
for details.
Size of tick mark labels, see par
for details.
Margins of the plot, see par
for details.
Optionally specify other notenames (character) for the y axis.
Amount of thinning of notenames, i.e. only each thin
th notename is displayed on the y-axis.
Character string for label of the ‘silence’ (default) axis.
Logical (default: TRUE
),
whether to plot energy values in the bottom part of the plot.
Additional graphical parameters to be passed to underlying plot
function.
A named list of three other lists (ax1
, ax2
, and ax4
)
containing parameters passed to the corresponding axis
calls for the three axis
time (ax1
), notes (ax2
), and energy (ax4
).
A list of parameters to be passed to the box generating functions.
A list of parameters to be passed to the energy-label
generating mtext
call.
A list of parameters to be passed to the lines
function that draws the energy curve.
A list of parameters to be passed to the rect
function that draws the rectangles for expected values.
A list of parameters to be passed to the abline
function that draws the grid lines.
A list of parameters to be passed to the lines
function that draws the observed values.
Uwe Ligges ligges@statistik.tu-dortmund.de
noteFromFF
, FF
, quantplot
;
for an example, see the help in tuneR.