Extract accidental from pitch.
accidental.RdUse this if you want to extract only the accidentals from pitch data,
discarding octave and step information.
Set explicitNaturals = FALSE if you don't want explicit naturals.
Arguments
- x
Input data to parse as pitch information.
The
xargument can be any (atomic) vector, or a tonalInterval, orNULL.- ...
Arguments passed to the pitch deparser.
There are also two hidden (advanced) arguments you can specify:
memoizeanddeparse(see the details below).- generic
Should "specific" pitch information (accidentals and qualites) be discarded?
Defaults to
FALSE.Must be a singleton
logicalvalue: an on/off switch.- simple
Should "compound" pitch information (octave/contour) be discarded?
Defaults to
FALSE.Must be a singleton
logicalvalue: an on/off switch.- Key
The input
Keyused by the parser, deparser, and transposer.Defaults to
NULL.Must be a
diatonicSetor something coercable todiatonicSet; must be either length1orlength(x)- transposeArgs
An optional list of arguments passed to a special
transpose()call.Defaults to an empty
list().Must be a
listof named arguments totranspose().- parseArgs
An optional list of arguments passed to the pitch parser.
Defaults to an empty
list().Must be a
listof named arguments to the pitch parser.- inPlace
Should non-pitch information be retained in the output string.
Defaults to
FALSE.Must be a singleton
logicalvalue: an on/off switch.This argument only has an effect if the input (the
xargument) ischaracterstrings, and there is extra, non-pitch information in the input strings "besides" the pitch information. If so, andinPlace = TRUE, the output will be placed into an output string beside the original non-pitch information. IfinPlace = FALSE, only the pitch output information will be returned (details below).
Examples
chorale <- readHumdrum(humdrumRroot, 'HumdrumData/BachChorales/chor001.krn')
#> Finding and reading files...
#> REpath-pattern '/home/nat/.tmp/RtmpBDgnJw/temp_libpath28db92437ebb13/humdrumR/HumdrumData/BachChorales/chor001.krn' matches 1 text files in 1 directory.
#> One file read from disk.
#> Validating one file...
#> all valid.
#> Parsing one file...
#> Assembling corpus...
#> Done!
chorale[[100:110, ]]
#> ######################## vvv chor001.krn vvv #########################
#> 8: **kern **kern **kern **kern
#> 12: *>[A,A,B] *>[A,A,B] *>[A,A,B] *>[A,A,B]
#> 13: *>norep[A,B] *>norep[A,B] *>norep[A,B] *>norep[A,B]
#> 14: *>A *>A *>A *>A
#> 52: *>B *>B *>B *>B
#> 100: =17 =17 =17 =17
#> 101: 8EL 4B 8f#L] 4.g
#> 102: 8D . 8eJ .
#> 103: 8C 4c 8eL .
#> 104: 8BB . 8f#J 8a
#> 105: 8AA 4d 4g 4b
#> 106: 8GGJ . . .
#> 107: =18 =18 =18 =18
#> 108: 2D; 2d; 2f#; 2a;
#> 109: [4G 4d 4g 4b
#> 110: =19 =19 =19 =19
#> 124: *- *- *- *-
#> ######################## ^^^ chor001.krn ^^^ #########################
#>
#> Data fields:
#> *Token :: character
#>
within(chorale[[100:110, ]], accidental(Token))
#> ######################## vvv chor001.krn vvv #########################
#> 8: **accidental **accidental **accidental **accidental
#> 12: *>[A,A,B] *>[A,A,B] *>[A,A,B] *>[A,A,B]
#> 13: *>norep[A,B] *>norep[A,B] *>norep[A,B] *>norep[A,B]
#> 14: *>A *>A *>A *>A
#> 52: *>B *>B *>B *>B
#> 100: =17 =17 =17 =17
#> 101: n n n n
#> 102: n . n .
#> 103: n n n .
#> 104: n . n n
#> 105: n n n n
#> 106: n . . .
#> 107: =18 =18 =18 =18
#> 108: n n n n
#> 109: n n n n
#> 110: =19 =19 =19 =19
#> 124: *- *- *- *-
#> ######################## ^^^ chor001.krn ^^^ #########################
#>
#> Data fields:
#> Token :: character
#> *humdrumR:::accidental(Token) :: character (**accidental tokens)
#>