tabr
package provides a music notation syntax and a collection of music programming functions for generating, manipulating, organizing and analyzing musical information in R.tabr
withmusic
class, and no need to repeat consecutive durations until a change.tabr
offers special object classes that facilitate working with music data and notation in ways that are natural to R, robust, tidy, and lend themselves well to transcription as well as analysis.tabr
, consider the concept of a noteworthy string. This is like any other character string, except that what makes a string noteworthy is that its content consists strictly of valid tabr
music notation syntax. It can be parsed unambiguously and meaningfully as input by package functions that inspect and manipulate musical information.'c e g'
, or alternatively as a vector, c('c', 'e', 'g')
, is a noteworthy string. The single lowercase letter 'a'
is noteworthy. So are 'a_'
and 'a#'
(flat and sharp). However, 'A'
is not (case sensitivity), nor is 'z'
. Of course, as seen above, there is more valid syntax than just the lowercase musical note letters a
through g
and sharp and flat notation.c,
or c'
) or integer format (not recommended, more limited utility, e.g. c2
or c4
). Octave 3 is the implicit default; there is no tick and explicitly stating c3
is equivalent to c
.noteworthy
class. This has its own print and summary methods.noteworthy
, not all will and some methods are implemented specifically for the class.tabr
that intuitively operate on noteworthy strings, abstracting the interpretation of relatively simple symbolic text specifications as quantitative and/or structured musical information.noteinfo
class, and a music
class (seen above). You can learn more in the vignettes. The music
class is particularly useful for efficient music data entry and basic transcription tasks.as_music_df
on a noteworthy string.r
) are allowed for timesteps and that functions that compute lagged intervals respect these gaps. Since as_music_df
was only provided with a string of pitches, there are no explicit time variables in the data frame. However, discrete timesteps still exist and they do not have to contain notes.mutate
from dplyr
.as_music_df
is convenient and also offers some additional arguments. Adding key
and scale
allows for scale degrees. scale
is diatonic by default but does not have to be.tabr
offers many functions for manipulating and analyzing music data and working in music notation. See the collection of vignettes for more information on music programming and analysis.tabr
can be used for a variety of purposes, but it also integrates cohesively with the package’s transcription functions. The package also provides API wrapper functions for transcribing music notation in R into basic sheet music and guitar tablature (“tabs”) using LilyPond.tabr
generates LilyPond files from R code and can pass them to LilyPond to be rendered into sheet music pdf files. While LilyPond caters to sheet music in general and tabr
can be used to create basic sheet music, the transcription functions focus on leveraging LilyPond specifically for creating quality guitar tablature. You do not need to use it for guitar tablature, but for vocal or other instrument tracks, you can change settings, such as suppressing a tab staff from your sheet music.tabr
, you can use the package for music analysis without installing LilyPond if you do not intend to render tabs. You can even use the lilypond
function to write LilyPond files to disk without the software installed, since this is only a case of R writing plain text files in the proper format. The only functions in the package that require a LilyPond installation are tab
, midily
, miditab
and any render_*
functions.tabr
offers a useful but limited LilyPond API and is not intended to access all LilyPond functionality from R, nor is transcription via the API the entire scope of tabr
. If you are only creating sheet music on a case by case basis, write your own LilyPond files manually. There is no need to use tabr
or limit yourself to its existing LilyPond API or its guitar tablature focus.tabr
provides the ability to do so in R and offers the added benefit of converting what you write in R code to the LilyPond file format to be rendered as printable sheet music.tabr
will continue to grow much more than the transcription functionality. While transcription represents about half of this introduction, this is only to provide a thorough context and overview of features. Transcription is a wonderful option to have fully integrated into the package, but it is an optional use case, and working with music data is the broader primary thrust of the package.tabr
is the bottleneck in transcription limitations rather than the music engraving software it wraps around.tabr
package offers the following for transcription:phrase
or the shorthand alias p
.track
.score
.tab
.phrase
is a string describing notes of a specific pitch (or rests: “r”), separated in time by spaces. For chords, just remove spaces to indicate simultaneous notes. Integers are appended to indicate the octave number so that the pitch is unambiguous. For example, a rest followed by a sequence of notes might be given by notes = 'r a, c f d a f'
.info = '4 8 8 8 8 8 8'
(or shorten to just info = '4 8*6'
). This basic example does not require specifying additional note information such as dotted notes for different fractions of time, staccato notes, ties/slurs, slides, bends, hammer ons and pull offs, etc. These specifications are covered in the vignette tutorials.string
only applies to fretted string instruments and is always optional. In this example it specifies the strings of a guitar. Providing this information in conjunction with the pitch fixes the frets so that LilyPond does not have to guess them. This only applies for tablature output. Note that the x
shown below is just a placeholder indicating no need to specify a string for the quarter note rest. You can put a string number there but it is ignored.tabr
.tab
should call it successfully. Windows users are recommended to just add LilyPond’s bin
directory to the system path. This will take care of LilyPond as well as its bundled Python and MIDI support. As an example for Windows users, if the LilyPond executable is at C:/Program Files (x86)/LilyPond/usr/bin/lilypond.exe
, then add C:/Program Files (x86)/LilyPond/usr/bin
to the system path.music
class, you can enter notes, note info, and optionally string numbers if applicable, all in a single string. This is not only potentially much more efficient for data entry, but can also be easier to follow because it binds these otherwise separate arguments by timestep. See the vignettes and help documentation relating to music objects for more details on working with these objects.phrase
understands this syntax and interprets the notes
argument as music syntax if the info
argument is not provided (info = NULL
). The phrase above could have been created as follows, with or without the optional explicit string numbering.phrase
.tabr
.tuneR
package to read MIDI files and attempts to structure the MIDI data to integrate as best as possible with the data structures and functionality found throughout tabr
.tabr
Folx go 5 5 – manage and organize downloads. Narrator 2 3 – text to speech utility. website.tabr
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.