Create a music track from a collection of musical phrases.
track(phrase, tuning = "standard", voice = 1L,
music_staff = "treble_8", ms_transpose = 0, ms_key = NA,
no_tab = FALSE)
a phrase object.
character, space-delimited pitches describing the instrument
string tuning or a predefined tuning ID (see tunings
).
Defaults to standard guitar tuning. Tick or integer octave numbering
accepted for custom tuning entries.
integer, ID indicating the unique voice phrase
belongs
to within a single track (another track may share the same tab/music staff
but have a different voice ID).
add a standard sheet music staff above the tablature staff. See details.
integer, positive or negative number of semitones to transpose an included music staff relative to the tablature staff. See details.
character, specify the new key signature for a transposed music staff. See details.
logical, suppress the default guitar tablature so that only a
standard music staff is associated with the track. Ignored if
music_staff = NA
.
a track table.
Musical phrases generated by phrase
are fortified in a track
table. All tracks are stored as track tables, one per row, even if that
table consists of a single track.
track
creates a single-entry track table.
See trackbind
for merging single tracks into a multi-track
table. This is simply row binding that properly preserves phrase and track
classes.
The default for an additional music staff is "treble_8"
for 8va
treble clef, which is commonly displayed in quality guitar tablature above
the tablature staff to include precise rhythm and timing information.
Note that guitar is a transposing instrument. For this reason, the default
ID is "treble_8"
, not "treble"
.
Set music_staff = NA
to suppress the additional music staff above
the tablature staff.
This is appropriate for simple patterns where there are already multiple
tracks and the additional space required for two staves per instrument is
unnecessary and wasteful.
The arguments ms_transpose
and ms_key
pertain to the
transposition of the music staff relative to the tab staff if
music_staff
is not NA
. These arguments default to 0 and
NA
, respectively.
The transposition and new key are simply stored in the ms_transpose
and ms_key
columns in the resulting track table.
This information is used by lilypond
or tab
to transpose the
music staff relative to the tab staff at the time of LilyPond file
generation.
Non-zero semitone transposition works without providing an explicit new key
signature, but it is recommended to specify because it helps ensure the
correct selection of accidentals in the output.
As with the transpose
function, you can simply specify
key = "flat"
or key = "sharp"
. The exact key signature is not
required; it is merely more clear and informative for the user.
# NOT RUN {
x <- phrase("c ec'g' ec'g'", "4 4 2", "5 432 432")
track(x)
# }
Run the code above in your browser using DataLab