tabr tabr-package

tabr: Music notation syntax, manipulation, analysis and transcription in R.

Class methods

S3 methods implemented for tabr classes


Summary of implemented S3 generic methods

`[`(<noteworthy>) `[`(<noteinfo>) `[`(<music>) `[`(<lyrics>) `[<-`(<noteworthy>) `[<-`(<noteinfo>) `[<-`(<music>) `[<-`(<lyrics>)

Single bracket methods for tabr classes

`[[`(<noteworthy>) `[[`(<noteinfo>) `[[`(<music>) `[[`(<lyrics>) `[[<-`(<noteworthy>) `[[<-`(<noteinfo>) `[[<-`(<music>) `[[<-`(<lyrics>)

Double bracket methods for tabr classes

length(<noteworthy>) length(<noteinfo>) length(<music>) length(<lyrics>)

Length for tabr classes

c(<noteworthy>) c(<noteinfo>) c(<music>) c(<lyrics>) c(<phrase>)

Concatenate for tabr classes

rep(<noteworthy>) rep(<noteinfo>) rep(<music>) rep(<lyrics>) rep(<phrase>)

Repeat for tabr classes

rev(<noteworthy>) rev(<noteinfo>) rev(<music>) rev(<lyrics>)

Reverse for tabr classes

head(<noteworthy>) head(<noteinfo>) head(<music>) head(<lyrics>) tail(<noteworthy>) tail(<noteinfo>) tail(<music>) tail(<lyrics>)

Head and tail for tabr classes

`==`(<noteworthy>) `!=`(<noteworthy>) `<`(<noteworthy>) `<=`(<noteworthy>) `>`(<noteworthy>) `>=`(<noteworthy>)

Relational operators for noteworthy class

Working with noteworthy strings

Create, inspect and manipulate noteworthy strings

is_note() is_chord() noteworthy() as_noteworthy() is_noteworthy()

Check note and chord validity

note_is_accidental() note_is_natural() note_is_flat() note_is_sharp() note_has_accidental() note_has_natural() note_has_flat() note_has_sharp()

Basic noteworthy string checks

n_steps() n_notes() n_chords() n_octaves() chord_size() octave_type() accidental_type() time_format() is_space_time() is_vector_time() note_is_tick() note_is_integer() note_has_tick() note_has_integer() note_is_rest() note_has_rest()

Noteworthy string metadata

tally_notes() tally_pitches() octaves() tally_octaves() distinct_notes() distinct_pitches() distinct_octaves() pitch_range() semitone_range() semitone_span() octave_range() octave_span()

Noteworthy string summaries

naturalize() sharpen_flat() flatten_sharp() note_set_key() as_tick_octaves() as_integer_octaves() as_space_time() as_vector_time() pretty_notes()

Basic noteworthy strings formatting and coercion helpers


Create a sequence from pitch notation

note_slice() note_sort() note_rotate() note_shift() note_arpeggiate()

Slice, sort, rotate, shift and arpeggiate notes

note_is_equal() note_is_identical() pitch_is_equal() pitch_is_identical() octave_is_equal() octave_is_identical()

Note, pitch and chord equivalence

transpose() tp()

Transpose pitch


Note/chord n-gram

Time and other information: noteinfo objects

Create, inspect and manipulate note info strings

informable() as_noteinfo() is_noteinfo()

Check note info validity

info_duration() info_slur_on() info_slur_off() info_slide() info_bend() info_dotted() info_single_dotted() info_double_dotted() info_annotation() info_articulation()

Note info helpers

Combine time and sound: music objects

Create, inspect and manipulate music strings

musical() as_music() is_music() music_split()

Create music objects and check music string validity

music_notes() music_info() music_strings() music_key() music_time() music_tempo() music_lyrics()

Accessing music object values and attributes

n_measures() n_beats() steps_per_measure() bpm() seconds() seconds_per_measure() seconds_per_step() steps_start_time()

Summarize rhythm and time of music objects

Sheet music snippets

Transcription shortcuts for music objects

render_music() render_music_tc() render_music_bc() render_music_tab() render_music_guitar() render_music_bass()

Render sheet music snippet with LilyPond

plot_music() plot_music_tc() plot_music_bc() plot_music_tab() plot_music_guitar() plot_music_bass()

Plot sheet music snippet with LilyPond

Song lyrics: lyrics objects

Functions for aligning lyrics with other objects by timestep

lyrical() as_lyrics() is_lyrics() lyrics_template()

Create lyrics and check lyrics string validity

Syntax conversion

Syntax converters for mapping other music notation syntax to tabr

to_tabr() from_chorrrds() from_music21()

Music notation syntax converters

Tidy music data analysis

Converting to and from and manipulating music data frames


Noteworthy string to data frame

Chords in noteworthy strings

Functions for constructing and manipulating chords

chord_rank() chord_order() chord_sort()

Rank, order and sort chords and notes


Broken chords


Chord inversion


Arpeggiate a chord

chord_root() chord_top() chord_slice()

Extract notes from chords

chord_is_major() chord_is_minor()

Check if chords are major or minor


Diatonic chords


Construct a dyad

chord_min() chord_maj() chord_min7() chord_dom7() chord_7s5() chord_maj7() chord_min6() chord_maj6() chord_dim() chord_dim7() chord_m7b5() chord_aug() chord_5() chord_sus2() chord_sus4() chord_dom9() chord_7s9() chord_maj9() chord_add9() chord_min9() chord_madd9() chord_min11() chord_7s11() chord_maj7s11() chord_11() chord_maj11() chord_13() chord_min13() chord_maj13() xm() xM() xm7() x7() x7s5() xM7() xm6() xM6() xdim() xdim7() xm7b5() xaug() x5() xs2() xs4() x9() x7s9() xM9() xadd9() xm9() xma9() xm11() x7s11() xM7s11() x_11() xM11() x_13() xm13() xM13()

Chord constructors


Define chords

lp_chord_id() lp_chord_mod()

LilyPond chord notation

gc_info() gc_fretboard() gc_notes_to_fb() gc_notes() gc_is_known() gc_name_split() gc_name_root() gc_name_mod()

Chord mapping

Key signatures, scales and modes

Functions relating to key signatures, scale and modes

keys() key_is_natural() key_is_sharp() key_is_flat() key_n_sharps() key_n_flats() key_is_major() key_is_minor()

Key signatures

scale_degree() scale_note() note_in_scale() chord_degree() is_in_scale()

Scale degrees and mappings

scale_diatonic() scale_major() scale_minor() scale_harmonic_minor() scale_hungarian_minor() scale_melodic_minor() scale_jazz_minor() scale_chromatic()

Scale helpers


Check if notes and chords are diatonic

modes() is_mode() mode_rotate() mode_modern() mode_ionian() mode_dorian() mode_phrygian() mode_lydian() mode_mixolydian() mode_aeolian() mode_locrian()

Mode helpers

Interval helpers

Functions for calculating musical intervals

pitch_interval() pitch_diff() scale_interval() scale_diff() tuning_intervals()

Interval helpers


Interval semitones

Notation-frequency conversion

Map music notation and other quantities like semitones and frequency

pitch_freq() pitch_semitones() chord_freq() chord_semitones() freq_pitch() freq_semitones() semitone_pitch() semitone_freq()

Pitch conversions


Frequency ratios

ratio_to_cents() cents_to_ratio()

Convert between chord frequency ratios and cents

Plots (non-tablature visualizations)

Functions for musical plots and diagrams

plot_fretboard() plot_chord()

Chord and fretboard diagram plots

Phrase validation and coercion

Functions for checking and decomposing phrases objects

as_phrase() phrasey() notify() phrase_notes() phrase_info() phrase_strings() notable()

Phrase validation and coercion


Simplify the LilyPond syntax of a phrase

Transcription: Phrase construction

Functions for describing, assembling and connecting musical phrases

phrase() p()

Create a musical phrase

sf_phrase() sfp() sf_note() sfn()

Create a musical phrase from string/fret combinations

pc() pn()

Concatenate and repeat

string_unfold() string_fold()

Fold and unfold strings


Create rests

tie() untie()

Tied notes


Add text to music staff


Hammer ons and pull offs

tuplet() triplet()


rp() pct() volta()

Repeat phrases

Transcription: Build and render music scores

Functions for building and writing scores and rendering LilyPond files

track() track_guitar() track_tc() track_bc() track_bass()

Create a music track


Bind track tables


Create a music score

tab() render_tab() render_score() render_midi()

Render sheet music with LilyPond


Save score to LilyPond file


Render a chord chart with LilyPond


Generate a chord set



Transcription: MIDI conversion

Functions for converting MIDI files with LilyPond


Convert MIDI to LilyPond file


Convert MIDI to tablature

Other Input/Output

More functions for reading and writing between various formats

read_midi() midi_metadata() midi_notes() midi_time() midi_key() ticks_to_duration() duration_to_ticks()

Read, inspect and convert MIDI file contents


Exported utility functions

lilypond_root() lilypond_version() tabr_lilypond_api()

LilyPond installation information



tabr syntax


Single note articulations and syntax


Predefined instrument tunings


Main musical intervals


Predefined guitar chords