From a6d2006b7ab237d550708c5c3171ca09726ac92e Mon Sep 17 00:00:00 2001 From: leonawicz Date: Fri, 19 Feb 2021 12:03:45 -0700 Subject: [PATCH] Update documentation. --- README.Rmd | 1 + docs/pkgdown.yml | 2 +- docs/reference/append_phrases.html | 12 +-- docs/reference/as_music_df.html | 128 +++++++++++++-------------- docs/reference/chord-compare.html | 6 +- docs/reference/chord-filter.html | 30 +++---- docs/reference/chord-mapping.html | 94 ++++++++++---------- docs/reference/chord_arpeggiate.html | 24 ++--- docs/reference/chord_break.html | 6 +- docs/reference/chord_def.html | 34 +++---- docs/reference/chord_invert.html | 6 +- docs/reference/chords.html | 30 +++---- docs/reference/double-bracket.html | 18 ++-- docs/reference/dyad.html | 42 ++++----- docs/reference/freq_ratio.html | 58 ++++++------ docs/reference/lyrics.html | 32 +++---- docs/reference/mode-helpers.html | 18 ++-- docs/reference/music-helpers.html | 48 +++++----- docs/reference/music.html | 32 +++---- docs/reference/n_measures.html | 14 +-- docs/reference/notate.html | 4 +- docs/reference/note-coerce.html | 48 +++++----- docs/reference/note-metadata.html | 6 +- docs/reference/note-summaries.html | 48 +++++----- docs/reference/note_ngram.html | 54 +++++------ docs/reference/note_slice.html | 72 +++++++-------- docs/reference/phrase-checks.html | 46 +++++----- docs/reference/phrase.html | 32 +++---- docs/reference/pitch_freq.html | 12 +-- docs/reference/pitch_seq.html | 42 ++++----- docs/reference/repeats.html | 52 +++++------ docs/reference/scale-deg.html | 12 +-- docs/reference/scale-helpers.html | 48 +++++----- docs/reference/scale_chords.html | 48 +++++----- docs/reference/score.html | 6 +- docs/reference/sf_phrase.html | 12 +-- docs/reference/simplify_phrase.html | 16 ++-- docs/reference/single-bracket.html | 60 ++++++------- docs/reference/tabr-c.html | 22 ++--- docs/reference/tabr-head.html | 36 ++++---- docs/reference/tabr-methods.html | 108 +++++++++++----------- docs/reference/tabr-rep.html | 22 ++--- docs/reference/tabr-rev.html | 18 ++-- docs/reference/tabr_options.html | 2 +- docs/reference/tie.html | 6 +- docs/reference/to_tabr.html | 48 +++++----- docs/reference/track.html | 24 ++--- docs/reference/trackbind.html | 16 ++-- docs/reference/transpose.html | 48 +++++----- docs/reference/tuplet.html | 16 ++-- docs/reference/valid-noteinfo.html | 14 +-- docs/reference/valid-notes.html | 36 ++++---- man/tabr_options.Rd | 2 +- 53 files changed, 836 insertions(+), 835 deletions(-) diff --git a/README.Rmd b/README.Rmd index 7e598dd..21a9681 100644 --- a/README.Rmd +++ b/README.Rmd @@ -9,6 +9,7 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", message = FALSE, warning = FALSE, error = FALSE, tidy = FALSE, out.width = "100%" ) +library(tabr) ``` # tabr diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index bcd701a..b094cad 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -24,7 +24,7 @@ articles: tabr-snippets: tabr-snippets.html tabr-tracks-scores: tabr-tracks-scores.html tabr-tunings: tabr-tunings.html -last_built: 2021-02-01T17:37Z +last_built: 2021-02-19T19:01Z urls: reference: https://leonawicz.github.io/tabr/reference article: https://leonawicz.github.io/tabr/articles diff --git a/docs/reference/append_phrases.html b/docs/reference/append_phrases.html index da27d7f..53e924e 100644 --- a/docs/reference/append_phrases.html +++ b/docs/reference/append_phrases.html @@ -273,12 +273,12 @@

Examp
#> [1] "1 1"
x <- phrase("c ec'g' ec'g'", "4 4 2", "5 432 432") y <- phrase("a", 1, 5) pc(x, y) -
#> <Musical phrase> -#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 <a\5>1
pc(x, pn(y, 2)) -
#> <Musical phrase> -#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 <a\5>1 <a\5>1
pc(x, "r1") # add a simple rest instance -
#> <Musical phrase> -#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 r1
class(pc(x, y)) +
#> <Musical phrase> +#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 <a\5>1
pc(x, pn(y, 2)) +
#> <Musical phrase> +#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 <a\5>1 <a\5>1
pc(x, "r1") # add a simple rest instance +
#> <Musical phrase> +#> <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 r1
class(pc(x, y))
#> [1] "phrase" "character"
class(pn(y, 2))
#> [1] "phrase" "character"
class(pc(x, "r1"))
#> [1] "phrase" "character"
class(pn("r1", 2)) diff --git a/docs/reference/as_music_df.html b/docs/reference/as_music_df.html index 1cd5f89..55a8b0a 100644 --- a/docs/reference/as_music_df.html +++ b/docs/reference/as_music_df.html @@ -289,77 +289,77 @@

Details

Examples

x <- "a, b, c d e f g# a r ac'e' a c' e' c' r r r a" as_music_df(x, key = "c", scale = "major") -
#> # A tibble: 18 x 11 +
#> # A tibble: 18 x 11 #> duration pitch note semitone octave freq key scale scale_deg pitch_int -#> <chr> <chr> <chr> <int> <int> <dbl> <chr> <chr> <int> <int> -#> 1 NA a, a 57 2 110. c major 6 NA -#> 2 NA b, b 59 2 123. c major 7 2 -#> 3 NA c c 48 3 131. c major 1 1 -#> 4 NA d d 50 3 147. c major 2 2 -#> 5 NA e e 52 3 165. c major 3 2 -#> 6 NA f f 53 3 175. c major 4 1 -#> 7 NA g# g# 56 3 208. c major NA 3 -#> 8 NA a a 57 3 220. c major 6 1 -#> 9 NA r r NA NA NA c major NA NA -#> 10 NA ac'e' ace 57 3 220. c major 1 0 -#> 11 NA a a 57 3 220. c major 6 0 -#> 12 NA c' c 48 4 262. c major 1 3 -#> 13 NA e' e 52 4 330. c major 3 4 -#> 14 NA c' c 48 4 262. c major 1 -4 -#> 15 NA r r NA NA NA c major NA NA -#> 16 NA r r NA NA NA c major NA NA -#> 17 NA r r NA NA NA c major NA NA -#> 18 NA a a 57 3 220. c major 6 -3 -#> # ... with 1 more variable: scale_int <chr>
as_music_df(x, key = "am", scale = "harmonic_minor", si_format = "ad_abb") -
#> # A tibble: 18 x 11 +#> <chr> <chr> <chr> <int> <int> <dbl> <chr> <chr> <int> <int> +#> 1 NA a, a 57 2 110. c major 6 NA +#> 2 NA b, b 59 2 123. c major 7 2 +#> 3 NA c c 48 3 131. c major 1 1 +#> 4 NA d d 50 3 147. c major 2 2 +#> 5 NA e e 52 3 165. c major 3 2 +#> 6 NA f f 53 3 175. c major 4 1 +#> 7 NA g# g# 56 3 208. c major NA 3 +#> 8 NA a a 57 3 220. c major 6 1 +#> 9 NA r r NA NA NA c major NA NA +#> 10 NA ac'e' ace 57 3 220. c major 1 0 +#> 11 NA a a 57 3 220. c major 6 0 +#> 12 NA c' c 48 4 262. c major 1 3 +#> 13 NA e' e 52 4 330. c major 3 4 +#> 14 NA c' c 48 4 262. c major 1 -4 +#> 15 NA r r NA NA NA c major NA NA +#> 16 NA r r NA NA NA c major NA NA +#> 17 NA r r NA NA NA c major NA NA +#> 18 NA a a 57 3 220. c major 6 -3 +#> # ... with 1 more variable: scale_int <chr>
as_music_df(x, key = "am", scale = "harmonic_minor", si_format = "ad_abb") +
#> # A tibble: 18 x 11 #> duration pitch note semitone octave freq key scale scale_deg pitch_int -#> <chr> <chr> <chr> <int> <int> <dbl> <chr> <chr> <int> <int> -#> 1 NA a, a 57 2 110. am harm~ 1 NA -#> 2 NA b, b 59 2 123. am harm~ 2 2 -#> 3 NA c c 48 3 131. am harm~ 3 1 -#> 4 NA d d 50 3 147. am harm~ 4 2 -#> 5 NA e e 52 3 165. am harm~ 5 2 -#> 6 NA f f 53 3 175. am harm~ 6 1 -#> 7 NA g# g# 56 3 208. am harm~ 7 3 -#> 8 NA a a 57 3 220. am harm~ 1 1 -#> 9 NA r r NA NA NA am harm~ NA NA -#> 10 NA ac'e' ace 57 3 220. am harm~ 3 0 -#> 11 NA a a 57 3 220. am harm~ 1 0 -#> 12 NA c' c 48 4 262. am harm~ 3 3 -#> 13 NA e' e 52 4 330. am harm~ 5 4 -#> 14 NA c' c 48 4 262. am harm~ 3 -4 -#> 15 NA r r NA NA NA am harm~ NA NA -#> 16 NA r r NA NA NA am harm~ NA NA -#> 17 NA r r NA NA NA am harm~ NA NA -#> 18 NA a a 57 3 220. am harm~ 1 -3 -#> # ... with 1 more variable: scale_int <chr>
+#> <chr> <chr> <chr> <int> <int> <dbl> <chr> <chr> <int> <int> +#> 1 NA a, a 57 2 110. am harm~ 1 NA +#> 2 NA b, b 59 2 123. am harm~ 2 2 +#> 3 NA c c 48 3 131. am harm~ 3 1 +#> 4 NA d d 50 3 147. am harm~ 4 2 +#> 5 NA e e 52 3 165. am harm~ 5 2 +#> 6 NA f f 53 3 175. am harm~ 6 1 +#> 7 NA g# g# 56 3 208. am harm~ 7 3 +#> 8 NA a a 57 3 220. am harm~ 1 1 +#> 9 NA r r NA NA NA am harm~ NA NA +#> 10 NA ac'e' ace 57 3 220. am harm~ 3 0 +#> 11 NA a a 57 3 220. am harm~ 1 0 +#> 12 NA c' c 48 4 262. am harm~ 3 3 +#> 13 NA e' e 52 4 330. am harm~ 5 4 +#> 14 NA c' c 48 4 262. am harm~ 3 -4 +#> 15 NA r r NA NA NA am harm~ NA NA +#> 16 NA r r NA NA NA am harm~ NA NA +#> 17 NA r r NA NA NA am harm~ NA NA +#> 18 NA a a 57 3 220. am harm~ 1 -3 +#> # ... with 1 more variable: scale_int <chr>
a <- notate("8", "Start here.") time <- paste(a, "8^*2 16-_ 4.. 16( 16)( 2) 2 4. t8- t8 t8- 8[accent]*4 1") d1 <- as_music_df(x, time) d1 -
#> # A tibble: 18 x 14 +
#> # A tibble: 18 x 14 #> duration pitch note semitone octave freq pitch_int scale_int slur slide -#> <chr> <chr> <chr> <int> <int> <dbl> <int> <chr> <chr> <lgl> -#> 1 8 a, a 57 2 110. NA NA NA FALSE -#> 2 8 b, b 59 2 123. 2 M2 NA FALSE -#> 3 8 c c 48 3 131. 1 m2 NA FALSE -#> 4 16 d d 50 3 147. 2 M2 NA FALSE -#> 5 4.. e e 52 3 165. 2 M2 NA FALSE -#> 6 16 f f 53 3 175. 1 m2 on FALSE -#> 7 16 g# g# 56 3 208. 3 m3 hold FALSE -#> 8 2 a a 57 3 220. 1 m2 off FALSE -#> 9 2 r r NA NA NA NA NA NA FALSE -#> 10 4. ac'e' ace 57 3 220. 0 P1 NA FALSE -#> 11 t8 a a 57 3 220. 0 P1 NA TRUE -#> 12 t8 c' c 48 4 262. 3 m3 NA FALSE -#> 13 t8 e' e 52 4 330. 4 M3 NA TRUE -#> 14 8 c' c 48 4 262. -4 M3 NA FALSE -#> 15 8 r r NA NA NA NA NA NA FALSE -#> 16 8 r r NA NA NA NA NA NA FALSE -#> 17 8 r r NA NA NA NA NA NA FALSE -#> 18 1 a a 57 3 220. -3 m3 NA FALSE -#> # ... with 4 more variables: bend <lgl>, dotted <int>, articulation <chr>, -#> # annotation <chr>
+#> <chr> <chr> <chr> <int> <int> <dbl> <int> <chr> <chr> <lgl> +#> 1 8 a, a 57 2 110. NA NA NA FALSE +#> 2 8 b, b 59 2 123. 2 M2 NA FALSE +#> 3 8 c c 48 3 131. 1 m2 NA FALSE +#> 4 16 d d 50 3 147. 2 M2 NA FALSE +#> 5 4.. e e 52 3 165. 2 M2 NA FALSE +#> 6 16 f f 53 3 175. 1 m2 on FALSE +#> 7 16 g# g# 56 3 208. 3 m3 hold FALSE +#> 8 2 a a 57 3 220. 1 m2 off FALSE +#> 9 2 r r NA NA NA NA NA NA FALSE +#> 10 4. ac'e' ace 57 3 220. 0 P1 NA FALSE +#> 11 t8 a a 57 3 220. 0 P1 NA TRUE +#> 12 t8 c' c 48 4 262. 3 m3 NA FALSE +#> 13 t8 e' e 52 4 330. 4 M3 NA TRUE +#> 14 8 c' c 48 4 262. -4 M3 NA FALSE +#> 15 8 r r NA NA NA NA NA NA FALSE +#> 16 8 r r NA NA NA NA NA NA FALSE +#> 17 8 r r NA NA NA NA NA NA FALSE +#> 18 1 a a 57 3 220. -3 m3 NA FALSE +#> # ... with 4 more variables: bend <lgl>, dotted <int>, articulation <chr>, +#> # annotation <chr>
# Go directly from music object to data frame m1 <- as_music(x, time) d2 <- as_music_df(m1) diff --git a/docs/reference/chord-compare.html b/docs/reference/chord-compare.html index 3789af5..5e5cf55 100644 --- a/docs/reference/chord-compare.html +++ b/docs/reference/chord-compare.html @@ -264,9 +264,9 @@

Examp chord_order(x)

#> [1] 1 3 2 4 5 6
chord_order(x, "mean")
#> [1] 1 3 2 5 4 6
chord_sort(x, "mean") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a2 a2 c <ce_g> <ceg> <cea>
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a2 a2 c <ce_g> <ceg> <cea>
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: e e_ c
chord_slice(x, 4) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: g
chord_slice(x, 3:5) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: g# g <egc'>
#> [1] "a" "a" "b_,"
gc_name_mod("a aM b_,m7#5")
#> [1] "M" "M" "m7#5"
gc_info("a") # a major chord, not a single note -
#> # A tibble: 6 x 12 +
#> # A tibble: 6 x 12 #> id lp_name root octave root_fret min_fret bass_string notes frets -#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> -#> 1 M a,:5 a 2 0 0 5 a,ea~ xo22~ -#> 2 M a,:5 a 2 5 5 6 a,ea~ 5776~ -#> 3 M a,:5 a 2 5 2 6 a,d_~ 5422~ -#> 4 M a:5 a 3 7 7 4 ae'a~ xx79~ -#> 5 M a:5 a 3 12 12 5 ae'a~ x(12~ -#> 6 M a:5 a 3 12 9 5 ad_'~ x(12~ -#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
gc_info("ceg a#m7_5") # only second entry is a guitar chord -
#> # A tibble: 6 x 12 +#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> +#> 1 M a,:5 a 2 0 0 5 a,ea~ xo22~ +#> 2 M a,:5 a 2 5 5 6 a,ea~ 5776~ +#> 3 M a,:5 a 2 5 2 6 a,d_~ 5422~ +#> 4 M a:5 a 3 7 7 4 ae'a~ xx79~ +#> 5 M a:5 a 3 12 12 5 ae'a~ x(12~ +#> 6 M a:5 a 3 12 9 5 ad_'~ x(12~ +#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
gc_info("ceg a#m7_5") # only second entry is a guitar chord +
#> # A tibble: 6 x 12 #> id lp_name root octave root_fret min_fret bass_string notes frets -#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> -#> 1 m7_5 b_,:m7~ b_ 2 1 0 5 b_,a~ x1x1~ -#> 2 m7_5 b_,:m7~ b_ 2 1 1 5 b_,e~ x121~ -#> 3 m7_5 b_,:m7~ b_ 2 6 5 6 b_,a~ 6x66~ -#> 4 m7_5 b_:m7_5 b_ 3 8 4 4 b_d_~ xx86~ -#> 5 m7_5 b_:m7_5 b_ 3 8 8 4 b_e'~ xx89~ -#> 6 m7_5 b_:m7_5 b_ 3 13 12 5 b_a_~ x(13~ -#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
gc_info("ceg a#m7_5", key = "f") -
#> # A tibble: 6 x 12 +#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> +#> 1 m7_5 b_,:m7~ b_ 2 1 0 5 b_,a~ x1x1~ +#> 2 m7_5 b_,:m7~ b_ 2 1 1 5 b_,e~ x121~ +#> 3 m7_5 b_,:m7~ b_ 2 6 5 6 b_,a~ 6x66~ +#> 4 m7_5 b_:m7_5 b_ 3 8 4 4 b_d_~ xx86~ +#> 5 m7_5 b_:m7_5 b_ 3 8 8 4 b_e'~ xx89~ +#> 6 m7_5 b_:m7_5 b_ 3 13 12 5 b_a_~ x(13~ +#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
gc_info("ceg a#m7_5", key = "f") +
#> # A tibble: 6 x 12 #> id lp_name root octave root_fret min_fret bass_string notes frets -#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> -#> 1 m7_5 b_,:m7~ b_ 2 1 0 5 b_,a~ x1x1~ -#> 2 m7_5 b_,:m7~ b_ 2 1 1 5 b_,e~ x121~ -#> 3 m7_5 b_,:m7~ b_ 2 6 5 6 b_,a~ 6x66~ -#> 4 m7_5 b_:m7_5 b_ 3 8 4 4 b_d_~ xx86~ -#> 5 m7_5 b_:m7_5 b_ 3 8 8 4 b_e'~ xx89~ -#> 6 m7_5 b_:m7_5 b_ 3 13 12 5 b_a_~ x(13~ -#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
+#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> +#> 1 m7_5 b_,:m7~ b_ 2 1 0 5 b_,a~ x1x1~ +#> 2 m7_5 b_,:m7~ b_ 2 1 1 5 b_,e~ x121~ +#> 3 m7_5 b_,:m7~ b_ 2 6 5 6 b_,a~ 6x66~ +#> 4 m7_5 b_:m7_5 b_ 3 8 4 4 b_d_~ xx86~ +#> 5 m7_5 b_:m7_5 b_ 3 8 8 4 b_e'~ xx89~ +#> 6 m7_5 b_:m7_5 b_ 3 13 12 5 b_a_~ x(13~ +#> # ... with 3 more variables: semitones <list>, fretboard <chr>, open <lgl>
gc_info("a,m c d f,") -
#> # A tibble: 23 x 12 +
#> # A tibble: 23 x 12 #> id lp_name root octave root_fret min_fret bass_string notes frets -#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> -#> 1 m a,:m a 2 0 0 5 a,ea~ xo22~ -#> 2 m a,:m a 2 5 5 6 a,ea~ 5775~ -#> 3 m a,:m a 2 5 2 6 a,cea 5322~ -#> 4 m a:m a 3 7 7 4 ae'a~ xx79~ -#> 5 m a:m a 3 12 12 5 ae'a~ x(12~ -#> 6 m a:m a 3 12 9 5 ac'e~ x(12~ -#> 7 M c:5 c 3 3 3 5 cgc'~ x355~ -#> 8 M c:5 c 3 3 0 5 cegc~ x32o~ -#> 9 M c:5 c 3 8 8 6 cgc'~ 8(10~ -#> 10 M c:5 c 3 8 5 6 cegc~ 8755~ -#> # ... with 13 more rows, and 3 more variables: semitones <list>, -#> # fretboard <chr>, open <lgl>
gc_fretboard("a,m c d f,", root_fret = 0:3) +#> <fct> <chr> <chr> <dbl> <dbl> <dbl> <int> <chr> <chr> +#> 1 m a,:m a 2 0 0 5 a,ea~ xo22~ +#> 2 m a,:m a 2 5 5 6 a,ea~ 5775~ +#> 3 m a,:m a 2 5 2 6 a,cea 5322~ +#> 4 m a:m a 3 7 7 4 ae'a~ xx79~ +#> 5 m a:m a 3 12 12 5 ae'a~ x(12~ +#> 6 m a:m a 3 12 9 5 ac'e~ x(12~ +#> 7 M c:5 c 3 3 3 5 cgc'~ x355~ +#> 8 M c:5 c 3 3 0 5 cegc~ x32o~ +#> 9 M c:5 c 3 8 8 6 cgc'~ 8(10~ +#> 10 M c:5 c 3 8 5 6 cegc~ 8755~ +#> # ... with 13 more rows, and 3 more variables: semitones <list>, +#> # fretboard <chr>, open <lgl>
gc_fretboard("a,m c d f,", root_fret = 0:3)
#> a,:m c:5 c:5 d:5 f,:5 #> "x;o;2;2;1;o;" "x;3;5;5;5;3;" "x;3;2;o;1;o;" "x;x;o;2;3;2;" "1;3;3;2;1;1;" #> f:5 @@ -407,12 +407,12 @@

Examp #> "x;o;2;2;1;o;" "x;3;5;5;5;3;"

x <- gc_notes("a, b,", root_fret = 0:2) summary(x) -
#> <Noteworthy string> -#> Timesteps: 2 (0 notes, 2 chords) -#> Octaves: tick -#> Accidentals: flat -#> Format: space-delimited time -#> Values: <a,ead_'e'> <b,g_be_'g_'>
+
#> <Noteworthy string> +#> Timesteps: 2 (0 notes, 2 chords) +#> Octaves: tick +#> Accidentals: flat +#> Format: space-delimited time +#> Values: <a,ead_'e'> <b,g_be_'g_'>
#> <Noteworthy string> +#> Format: vectorized time +#> Values: <ce_gb_> <e_gb_c4> <gb_c4e_4>
chord_arpeggiate("ce_gb_", -2) +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: <ce_gb_> <b_2ce_g> <g2b_2ce_>
chord_arpeggiate("ce_gb_", 2, by = "chord") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: <ce_gb_> <c4e_4g4b_4> <c5e_5g5b_5>
chord_arpeggiate("ce_gb_", 1, broken = TRUE, collapse = TRUE) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c e_ g b_ e_ g b_ c4
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c e g c e g c e g
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <b_c4e_4g4>
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <dfa>
chord_maj("d") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <dg_a>
xM("d") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <dg_a>
xm("c f g") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <ce_g> <fa_c'> <gb_d'>
xm("c, f, g,", key = "e_") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <c,e_,g,> <f,a_,c> <g,b_,d>
#> [1] "c"
x[[2]] <- paste0(transpose(x[2], 1), "~") x -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a, c~ c <ce_g>
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a, c~ c <ce_g>
# noteinfo class examples x <- as_noteinfo(c("4-", "t8(", "t8)", "t8x")) x[[3]]
#> [1] "t8)"
x[[3]] <- c("t8]") x -
#> <Note info string> -#> Format: vectorized time -#> Values: 4- t8( t8] t8x
+
#> <Note info string> +#> Format: vectorized time +#> Values: 4- t8( t8] t8x
# music class examples x <- as_music("c,~4 c,1 c'e_'g'4-.*2") x[[3]]
#> [1] "c'e_'g'4-."
x[[3]] <- "c'e'g'8" x -
#> <Music string> -#> Format: space-delimited time -#> Values: c,~4 c,1 <c'e'g'>8 <c'e_'g'>4-.
+
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,1 <c'e'g'>8 <c'e_'g'>4-.
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c <ce_> <ce> <cf> <cg> <cc'> <cd'>
dyad("c", x, reverse = TRUE) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c <a,c> <a_,c> <g,c> <f,c> <c,c> <b_,,c>
dyad("d e", "m3") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <df> <eg>
#> [1] FALSE
lyrical(x)
#> [1] TRUE
as_lyrics(x) -
#> <Lyrics string> -#> Format: space-delimited time -#> Values: These are the ly- rics . . . to this song
+
#> <Lyrics string> +#> Format: space-delimited time +#> Values: These are the ly- rics . . . to this song
# character vector; empty, period or NA for no lyric x <- c("These", "are", "the", "ly-", "rics", "", ".", NA, "to", "this", "song") # as_lyrics(x) -
#> <Lyrics string> -#> Format: vectorized time -#> Values: These are the ly- rics . . . to this song
+
#> <Lyrics string> +#> Format: vectorized time +#> Values: These are the ly- rics . . . to this song
# generate empty lyrics object from noteworthy, noteinfo or music object notes <- as_noteworthy("c d e d c r*3 e g c'") x <- lyrics_template(notes) x -
#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . . . . . . . . . .
+
#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . . . . . . . . . .
x[1:5] <- strsplit("These are the ly- rics", " ")[[1]] x[9:11] <- c("to", "this", "song") x -
#> <Lyrics string> -#> Format: space-delimited time -#> Values: These are the ly- rics . . . to this song
+
#> <Lyrics string> +#> Format: space-delimited time +#> Values: These are the ly- rics . . . to this song
summary(x) -
#> <Lyrics string> -#> Timesteps: 11 (8 lyrics, 3 pauses) -#> Format: space-delimited time -#> Values: These are the ly- rics . . . to this song
+
#> <Lyrics string> +#> Timesteps: 11 (8 lyrics, 3 pauses) +#> Format: space-delimited time +#> Values: These are the ly- rics . . . to this song
#> $steps #> [1] 11 diff --git a/docs/reference/mode-helpers.html b/docs/reference/mode-helpers.html index 5369992..4f1816e 100644 --- a/docs/reference/mode-helpers.html +++ b/docs/reference/mode-helpers.html @@ -297,15 +297,15 @@

Examp
modes()
#> [1] "ionian" "dorian" "phrygian" "lydian" "mixolydian" #> [6] "aeolian" "locrian"
mode_dorian("c") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: c d e_ f g a b_
mode_modern("dorian", "c") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: c d e_ f g a b_
mode_modern("dorian", "c", ignore_octave = TRUE) -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: c d e_ f g a b_
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: c d e_ f g a b_
mode_modern("dorian", "c") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: c d e_ f g a b_
mode_modern("dorian", "c", ignore_octave = TRUE) +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: c d e_ f g a b_
identical(mode_rotate(mode_ionian("c"), 1), mode_dorian("d"))
#> [1] TRUE
identical( mode_rotate(mode_ionian("c", ignore_octave = TRUE), 1), diff --git a/docs/reference/music-helpers.html b/docs/reference/music-helpers.html index b923c39..bb5a9e3 100644 --- a/docs/reference/music-helpers.html +++ b/docs/reference/music-helpers.html @@ -263,9 +263,9 @@

Examp y <- lyrics_template(x) y[3:8] <- strsplit("These are some song ly- rics", " ")[[1]] y -

#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . These are some song ly- rics . . . . . .
+
#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . These are some song ly- rics . . . . . .
x <- as_music(x, lyrics = y) attributes(x) @@ -297,9 +297,9 @@

Examp #> [1] "2 = 60" #> #> $lyrics -#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . These are some song ly- rics . . . . . . +#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . These are some song ly- rics . . . . . . #> #> $string #> [1] "5" "5" "5" "5" "5" "5" "5" "5432" "5432" "2" @@ -310,23 +310,23 @@

Examp #>

#> $notes -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a, a, a, a, a, b, c <cgc'e'~> <cgc'e'> e' c' g c <ce'> +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a, a, a, a, a, b, c <cgc'e'~> <cgc'e'> e' c' g c <ce'> #> #> $info -#> <Note info string> -#> Format: space-delimited time -#> Values: 4 4 4 4 4 4- 4 4 1 4 4 4 4 1 +#> <Note info string> +#> Format: space-delimited time +#> Values: 4 4 4 4 4 4- 4 4 1 4 4 4 4 1 #> #> $string #> [1] "5" "5" "5" "5" "5" "5" "5" "5432" "5432" "2" #> [11] "3" "4" "5" "51" #> #> $lyrics -#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . These are some song ly- rics . . . . . . +#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . These are some song ly- rics . . . . . . #> #> $key #> [1] "c" @@ -338,18 +338,18 @@

Examp #> [1] "2 = 60" #>

music_notes(x) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a, a, a, a, a, b, c <cgc'e'~> <cgc'e'> e' c' g c <ce'>
music_info(x) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 4 4 4 4 4 4- 4 4 1 4 4 4 4 1
music_key(x) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a, a, a, a, a, b, c <cgc'e'~> <cgc'e'> e' c' g c <ce'>
music_info(x) +
#> <Note info string> +#> Format: space-delimited time +#> Values: 4 4 4 4 4 4- 4 4 1 4 4 4 4 1
music_key(x)
#> [1] "c"
music_time(x)
#> [1] "4/4"
music_tempo(x)
#> [1] "2 = 60"
music_lyrics(x) -
#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . These are some song ly- rics . . . . . .
music_strings(x) +
#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . These are some song ly- rics . . . . . .
music_strings(x)
#> [1] "5" "5" "5" "5" "5" "5" "5" "5432" "5432" "2" #> [11] "3" "4" "5" "51"

diff --git a/docs/reference/music.html b/docs/reference/music.html index 5249679..5591dfe 100644 --- a/docs/reference/music.html +++ b/docs/reference/music.html @@ -354,27 +354,27 @@

Examp
#> [1] TRUE
x <- as_music(x) is_music(x)
#> [1] TRUE
x -
#> <Music string> -#> Format: space-delimited time -#> Values: b_4-+ b_4[staccato] c,4x d''t8( et8)( g_'t8)- a4 <c,e_,g,>4 <ce_g>4. a~8 a1
+
#> <Music string> +#> Format: space-delimited time +#> Values: b_4-+ b_4[staccato] c,4x d''t8( et8)( g_'t8)- a4 <c,e_,g,>4 <ce_g>4. a~8 a1
y <- lyrics_template(x) y[3:8] <- strsplit("These are some song ly- rics", " ")[[1]] y -
#> <Lyrics string> -#> Format: space-delimited time -#> Values: . . These are some song ly- rics . . .
+
#> <Lyrics string> +#> Format: space-delimited time +#> Values: . . These are some song ly- rics . . .
x <- as_music(x, lyrics = y, accidentals = "sharp") summary(x) -
#> <Music string> -#> Timesteps: 11 (9 notes, 2 chords) -#> Octaves: tick -#> Accidentals: sharp -#> Key signature: c -#> Time signature: 4/4 -#> Tempo: 2 = 60 -#> Lyrics: . . These are some song ly- rics . ... -#> Format: space-delimited time -#> Values: a#4-+ a#4[staccato] c,4x d''t8( et8)( f#'t8)- a4 <c,d#,g,>4 <cd#g>4. a~8 a1
+
#> <Music string> +#> Timesteps: 11 (9 notes, 2 chords) +#> Octaves: tick +#> Accidentals: sharp +#> Key signature: c +#> Time signature: 4/4 +#> Tempo: 2 = 60 +#> Lyrics: . . These are some song ly- rics . ... +#> Format: space-delimited time +#> Values: a#4-+ a#4[staccato] c,4x d''t8( et8)( f#'t8)- a4 <c,d#,g,>4 <cd#g>4. a~8 a1
# Starting string = 5: use ';5'. Carries over until an explicit change. x <- "a,4;5*5 b,4-+ c4[staccato] cgc'e'~4 cgc'e'1 e'4;2 c';3 g;4 c;5 ce'1;51" x <- as_music_df(as_music(x)) diff --git a/docs/reference/n_measures.html b/docs/reference/n_measures.html index 5cd5ac1..a259e6a 100644 --- a/docs/reference/n_measures.html +++ b/docs/reference/n_measures.html @@ -297,14 +297,14 @@

Examp

#> [1] 10.75
seconds(x, "4 = 100")
#> [1] 12.9
steps_per_measure(x) -
#> # A tibble: 5 x 2 +
#> # A tibble: 5 x 2 #> measure steps -#> <int> <int> -#> 1 1 8 -#> 2 2 2 -#> 3 3 4 -#> 4 4 4 -#> 5 5 1
seconds_per_measure(x) +#> <int> <int> +#> 1 1 8 +#> 2 2 2 +#> 3 3 4 +#> 4 4 4 +#> 5 5 1
seconds_per_measure(x)
#> [1] 2
seconds_per_step(x)
#> [1] 0.1666667 0.1666667 0.1666667 0.1250000 0.8750000 0.1250000 0.1250000 #> [8] 1.0000000 1.0000000 0.7500000 0.2500000 0.5000000 0.5000000 0.2500000 diff --git a/docs/reference/notate.html b/docs/reference/notate.html index 5989ca4..7b5080c 100644 --- a/docs/reference/notate.html +++ b/docs/reference/notate.html @@ -253,8 +253,8 @@

Details

Examples

notate("8", "Solo")
#> [1] "8;^\"Solo\""
phrase("c'~ c' d' e'", pc(notate(8, "First solo"), "8 8 4."), "5 5 5 5") -
#> <Musical phrase> -#> <c'~\5>8^"First solo" <c'\5>8 <d'\5>8 <e'\5>4.
+
#> <Musical phrase> +#> <c'~\5>8^"First solo" <c'\5>8 <d'\5>8 <e'\5>4.
#> [1] "tick"
accidental_type(x)
#> [1] "flat"
# The default is tick octaves and flats as_noteworthy(x) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: e_, a_, <d_g_b_>
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: e_, a_, <d_g_b_>
time_format(x)
#> [1] "space-delimited time"
is_space_time(x)
#> [1] TRUE
is_vector_time(x) diff --git a/docs/reference/note-summaries.html b/docs/reference/note-summaries.html index a456e03..ed74c6e 100644 --- a/docs/reference/note-summaries.html +++ b/docs/reference/note-summaries.html @@ -281,22 +281,22 @@

See a

Examples

x <- "r s e_2 a_, c#f#a#" tally_notes(x) -
#> # A tibble: 5 x 2 +
#> # A tibble: 5 x 2 #> note n -#> <chr> <int> -#> 1 c# 1 -#> 2 e_ 1 -#> 3 f# 1 -#> 4 a_ 1 -#> 5 a# 1
tally_pitches(x) -
#> # A tibble: 5 x 2 +#> <chr> <int> +#> 1 c# 1 +#> 2 e_ 1 +#> 3 f# 1 +#> 4 a_ 1 +#> 5 a# 1
tally_pitches(x) +
#> # A tibble: 5 x 2 #> pitch n -#> <chr> <int> -#> 1 e_2 1 -#> 2 a_, 1 -#> 3 c# 1 -#> 4 f# 1 -#> 5 a# 1
octaves(x) +#> <chr> <int> +#> 1 e_2 1 +#> 2 a_, 1 +#> 3 c# 1 +#> 4 f# 1 +#> 5 a# 1
octaves(x)
#> [[1]] #> [1] NA #> @@ -312,17 +312,17 @@

Examp #> [[5]] #> [1] 3 3 3 #>

tally_octaves(x) -
#> # A tibble: 2 x 2 +
#> # A tibble: 2 x 2 #> octave n -#> <int> <int> -#> 1 2 2 -#> 2 3 3
distinct_notes(x) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: d_ e_ g_ a_ b_
distinct_pitches(x) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: e_, a_, d_ g_ b_
distinct_octaves(x) +#> <int> <int> +#> 1 2 2 +#> 2 3 3
distinct_notes(x) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: d_ e_ g_ a_ b_
distinct_pitches(x) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: e_, a_, d_ g_ b_
distinct_octaves(x)
#> [1] 2 3
pitch_range(x)
#> [1] "e_," "b_"
semitone_range(x) diff --git a/docs/reference/note_ngram.html b/docs/reference/note_ngram.html index fed6c0b..458ec25 100644 --- a/docs/reference/note_ngram.html +++ b/docs/reference/note_ngram.html @@ -250,45 +250,45 @@

Examp
x <- as_noteworthy("c r ceg dfa ceg dfa") note_ngram(x)
#> [[1]] -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c #> #> [[2]] -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c <ceg> +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c <ceg> #> #> [[3]] -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: <ceg> <dfa> +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <ceg> <dfa> #> #> [[4]] -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: <dfa> <ceg> +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <dfa> <ceg> #> #> [[5]] -#> <Noteworthy string> -#> Format: space-delimited time -#> Values: <ceg> <dfa> +#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <ceg> <dfa> #>
(x <- note_ngram(x, tally = TRUE)) -
#> # A tibble: 4 x 2 +
#> # A tibble: 4 x 2 #> ngram n -#> <list> <int> -#> 1 <notwrthy [1]> 1 -#> 2 <notwrthy [1]> 1 -#> 3 <notwrthy [1]> 2 -#> 4 <notwrthy [1]> 1
x$ngram <- as.character(x$ngram) +#> <list> <int> +#> 1 <notwrthy [1]> 1 +#> 2 <notwrthy [1]> 1 +#> 3 <notwrthy [1]> 2 +#> 4 <notwrthy [1]> 1
x$ngram <- as.character(x$ngram) x -
#> # A tibble: 4 x 2 +
#> # A tibble: 4 x 2 #> ngram n -#> <chr> <int> -#> 1 c 1 -#> 2 c ceg 1 -#> 3 ceg dfa 2 -#> 4 dfa ceg 1
+#> <chr> <int> +#> 1 c 1 +#> 2 c ceg 1 +#> 3 ceg dfa 2 +#> 4 dfa ceg 1

#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c e g <ceg> c' e' g' <c'e'g'> c'' e'' g'' <c''e''g''> c''' e''' g''' <c'''e'''g'''>
note_arpeggiate("c e g", 3, step = -12) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c e g c, e, g, c,, e,, g,, c,,, e,,, g,,,
note_arpeggiate("g e c", 3, step = -12) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: g e c g, e, c, g,, e,, c,, g,,, e,,, c,,,
note_arpeggiate("c e_ g_ a", 3, step = 3) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c e_ g_ a e_ g_ a c' g_ a c' e_' a c' e_' g_'
note_arpeggiate("c a g_ e_", 3, step = -3) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c a g_ e_ a, g_ e_ c g_, e_ c a, e_, c a, g_,
#> # A tibble: 15 x 3 +
#> # A tibble: 15 x 3 #> notes info string -#> <chr> <chr> <chr> -#> 1 c 4 NA -#> 2 ec'g' 4 NA -#> 3 ec'g' 2 NA -#> 4 c 4 NA -#> 5 ec'g' 4 NA -#> 6 ec'g' 2 NA -#> 7 c 4. 5 -#> 8 b, 8( 5 -#> 9 c 8) 5 -#> 10 b, 4( 5 -#> 11 c 4)- 5 -#> 12 d 2 5 -#> 13 c 1 5 -#> 14 e~c'~g'~ 1 432 -#> 15 ec'g' 1 432
+#> <chr> <chr> <chr> +#> 1 c 4 NA +#> 2 ec'g' 4 NA +#> 3 ec'g' 2 NA +#> 4 c 4 NA +#> 5 ec'g' 4 NA +#> 6 ec'g' 2 NA +#> 7 c 4. 5 +#> 8 b, 8( 5 +#> 9 c 8) 5 +#> 10 b, 4( 5 +#> 11 c 4)- 5 +#> 12 d 2 5 +#> 13 c 1 5 +#> 14 e~c'~g'~ 1 432 +#> 15 ec'g' 1 432
# Wrappers around notify extract components, default to collapsed strings phrase_notes(p5) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c <e~c'~g'~> <ec'g'>
phrase_info(p5) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 1 1 1
phrase_strings(p5) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c <e~c'~g'~> <ec'g'>
phrase_info(p5) +
#> <Note info string> +#> Format: space-delimited time +#> Values: 1 1 1
phrase_strings(p5)
#> [1] "5" "432" "432"
# If phrase decomposition works well, coercion is one to one x2 <- lapply(x, diff --git a/docs/reference/phrase.html b/docs/reference/phrase.html index d2abbf5..f0bfebb 100644 --- a/docs/reference/phrase.html +++ b/docs/reference/phrase.html @@ -280,19 +280,19 @@

See a

Examples

phrase("c ec'g' ec'g'", "4- 4 2") # no string arg (not recommended for tabs) -
#> <Musical phrase> -#> <c>4\glissando <e c' g'>4 <e c' g'>2
phrase("c ec4g4 ec4g4", "4 4 2") # same as above -
#> <Musical phrase> -#> <c>4 <e c' g'>4 <e c' g'>2
phrase("c b, c", "4. 8( 8)", "5 5 5") # direction implies hammer on -
#> <Musical phrase> -#> <c\5>4. <b,\5>8( <c\5>8)
phrase("b2 c d", "4( 4)- 2", "5 5 5") # hammer and slide -
#> <Musical phrase> -#> <b,\5>4( <c\5>4)\glissando <d\5>2
+
#> <Musical phrase> +#> <c>4\glissando <e c' g'>4 <e c' g'>2
phrase("c ec4g4 ec4g4", "4 4 2") # same as above +
#> <Musical phrase> +#> <c>4 <e c' g'>4 <e c' g'>2
phrase("c b, c", "4. 8( 8)", "5 5 5") # direction implies hammer on +
#> <Musical phrase> +#> <c\5>4. <b,\5>8( <c\5>8)
phrase("b2 c d", "4( 4)- 2", "5 5 5") # hammer and slide +
#> <Musical phrase> +#> <b,\5>4( <c\5>4)\glissando <d\5>2
phrase("c ec'g' ec'g'", "1 1 1", "5 432 432") -
#> <Musical phrase> -#> <c\5>1 <e\4 c'\3 g'\2>1 <e\4 c'\3 g'\2>1
p("c ec'g' ec'g'", 1, "5 4 4") # same as above -
#> <Musical phrase> -#> <c\5>1 <e\4 c'\3 g'\2>1 <e\4 c'\3 g'\2>1
+
#> <Musical phrase> +#> <c\5>1 <e\4 c'\3 g'\2>1 <e\4 c'\3 g'\2>1
p("c ec'g' ec'g'", 1, "5 4 4") # same as above +
#> <Musical phrase> +#> <c\5>1 <e\4 c'\3 g'\2>1 <e\4 c'\3 g'\2>1
n <- "a, b, c d e f g e f g a~ a" i <- "8- 8 8 8-. t8( t8)( t8) t16( t16)( t16) 8 1" @@ -300,13 +300,13 @@

Examp x <- p(n, i) x -

#> <Musical phrase> -#> <a,>8\glissando <b,>8 <c>8 <d>8-. \tuplet 3/2 4 { <e>8( <f>8)( <g>8) } \tuplet 3/2 8 { <e>16( <f>16)( <g>16) } <a~>8 <a>1
identical(x, p(m)) +
#> <Musical phrase> +#> <a,>8\glissando <b,>8 <c>8 <d>8-. \tuplet 3/2 4 { <e>8( <f>8)( <g>8) } \tuplet 3/2 8 { <e>16( <f>16)( <g>16) } <a~>8 <a>1
identical(x, p(m))
#> [1] TRUE
x <- "a,4;5*5 b,4- c4 cgc'e'~4 cgc'e'1 e'4;2 c';3 g;4 c;5 ce'1;51" p(x) -
#> <Musical phrase> -#> <a,\5>4 <a,\5>4 <a,\5>4 <a,\5>4 <a,\5>4 <b,\5>4\glissando <c\5>4 <c~\5 g~\4 c'~\3 e'~\2>4 <c\5 g\4 c'\3 e'\2>1 <e'\2>4 <c'\3>4 <g\4>4 <c\5>4 <c\5 e'\1>1
identical(p(x), p(as_music(x))) +
#> <Musical phrase> +#> <a,\5>4 <a,\5>4 <a,\5>4 <a,\5>4 <a,\5>4 <b,\5>4\glissando <c\5>4 <c~\5 g~\4 c'~\3 e'~\2>4 <c\5 g\4 c'\3 e'\2>1 <e'\2>4 <c'\3>4 <g\4>4 <c\5>4 <c\5 e'\1>1
identical(p(x), p(as_music(x)))
#> [1] TRUE
x <- p("a b", 2, bar = "|.") x2 <- pc(p("a b", 2), '\\bar "|."') diff --git a/docs/reference/pitch_freq.html b/docs/reference/pitch_freq.html index dd256d5..59f4e61 100644 --- a/docs/reference/pitch_freq.html +++ b/docs/reference/pitch_freq.html @@ -303,17 +303,17 @@

Examp

#> [1] 220.0000 329.6276 440.0000 659.2551 880.0000
freq_semitones(y)
#> [1] 57 64 69 76 81
freq_pitch(y) -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a e' a' e'' a''
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a e' a' e'' a''
identical(as_noteworthy(x), freq_pitch(y, "integer", collapse = TRUE))
#> [1] TRUE
s <- pitch_semitones(x) s
#> [1] 57 64 69 76 81
semitone_pitch(s) -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a e' a' e'' a''
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a e' a' e'' a''
x <- "a, a,c#e" chord_semitones(x)
#> $`a,` diff --git a/docs/reference/pitch_seq.html b/docs/reference/pitch_seq.html index 2dde406..6ebb99e 100644 --- a/docs/reference/pitch_seq.html +++ b/docs/reference/pitch_seq.html @@ -268,31 +268,31 @@

Details

Examples

# chromatic sequence (default) pitch_seq("a,", 13) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a, b_, b, c d_ d e_ e f g_ g a_ a
pitch_seq("c5", -2) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c5 b4
pitch_seq("c", "b") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c d_ d e_ e f g_ g a_ a b_ b
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a, b_, b, c d_ d e_ e f g_ g a_ a
pitch_seq("c5", -2) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c5 b4
pitch_seq("c", "b") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c d_ d e_ e f g_ g a_ a b_ b
# diatonic sequence pitch_seq("c", 8, key = "c") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c d e f g a b c'
pitch_seq("c", 8, "am") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c d e f g a b c'
pitch_seq("c#,", "a#'", "am") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: d, e, f, g, a, b, c d e f g a b c' d' e' f' g' a'
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c d e f g a b c'
pitch_seq("c", 8, "am") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c d e f g a b c'
pitch_seq("c#,", "a#'", "am") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: d, e, f, g, a, b, c d e f g a b c' d' e' f' g' a'
# combine with alternative scale pitch_seq("a", 8, "am", "harmonic minor") -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a b c' d' e' f' g#' a'
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a b c' d' e' f' g#' a'
#> <Musical phrase> -#> \repeat unfold 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } +
#> <Musical phrase> +#> \repeat unfold 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } #>
rp(x, 3) # three repeats or four plays -
#> <Musical phrase> -#> \repeat unfold 4 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } +
#> <Musical phrase> +#> \repeat unfold 4 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } #>
pct(x) # one repeat or two plays -
#> <Musical phrase> -#> \repeat percent 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } +
#> <Musical phrase> +#> \repeat percent 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } #>
pct(x, 9, TRUE, 5) # 10 plays, add counter every 5 steps -
#> <Musical phrase> -#> \set countPercentRepeats = ##t +
#> <Musical phrase> +#> \set countPercentRepeats = ##t #> \set repeatCountVisibility = #(every-nth-repeat-count-visible 5) -#> \repeat percent 10 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } +#> \repeat percent 10 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } #> \set countPercentRepeats = ##f #> \set repeatCountVisibility = #(every-nth-repeat-count-visible 1) #>
pct(x, 9, TRUE, 5, FALSE) # as above, but do not reset counter settings -
#> <Musical phrase> -#> \set countPercentRepeats = ##t +
#> <Musical phrase> +#> \set countPercentRepeats = ##t #> \set repeatCountVisibility = #(every-nth-repeat-count-visible 5) -#> \repeat percent 10 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } +#> \repeat percent 10 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 } #>
volta(x) # one repeat or two plays -
#> <Musical phrase> -#> \repeat volta 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } +
#> <Musical phrase> +#> \repeat volta 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } #>
volta(x, 1, list(e1, e2)) # one repeat with alternate ending -
#> <Musical phrase> -#> \repeat volta 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } +
#> <Musical phrase> +#> \repeat volta 2 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } #> \alternative { -#> { <a\5>1 | } -#> { <b\5>1 | } -#> }
volta(x, 4, list(e1, e2)) # multiple repeats with only one alternate ending -
#> <Musical phrase> -#> \repeat volta 5 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } +#> { <a\5>1 | } +#> { <b\5>1 | } +#> }
volta(x, 4, list(e1, e2)) # multiple repeats with only one alternate ending +
#> <Musical phrase> +#> \repeat volta 5 { <c\5>4 <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } #> \alternative { -#> { <a\5>1 | } -#> { <b\5>1 | } -#> }
volta(x, 4) # no alternates, more than one repeat -
#> <Musical phrase> -#> \repeat volta 5 { <c\5>4^"Play 5 times." <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } +#> { <a\5>1 | } +#> { <b\5>1 | } +#> }
volta(x, 4) # no alternates, more than one repeat +
#> <Musical phrase> +#> \repeat volta 5 { <c\5>4^"Play 5 times." <e\4 c'\3 g'\2>4 <e\4 c'\3 g'\2>2 | } #>
#> [1] 1 1 3 4 5 6 7
scale_note(1:3, key = "am") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a b c
scale_note(c(1, 3, 8), "d", collapse = TRUE) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: d f# d
all(sapply(list(4, "IV", as.roman(4)), scale_note) == "f") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a b c
scale_note(c(1, 3, 8), "d", collapse = TRUE) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: d f# d
all(sapply(list(4, "IV", as.roman(4)), scale_note) == "f")
#> [1] TRUE
x <- "d dfa df#a f#ac#" chord_degree(x, "d") diff --git a/docs/reference/scale-helpers.html b/docs/reference/scale-helpers.html index 9249841..d84df0f 100644 --- a/docs/reference/scale-helpers.html +++ b/docs/reference/scale-helpers.html @@ -290,34 +290,34 @@

See a

Examples

scale_diatonic(key = "dm") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: d e f g a b_ c'
scale_minor(key = "dm") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: d e f g a b_ c'
scale_major(key = "d") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: d e f# g a b c#'
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: d e f g a b_ c'
scale_minor(key = "dm") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: d e f g a b_ c'
scale_major(key = "d") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: d e f# g a b c#'
scale_chromatic(root = "a") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a, a#, b, c c# d d# e f f# g g#
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a, a#, b, c c# d d# e f f# g g#
scale_harmonic_minor("am") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a, b, c d e f g#
scale_hungarian_minor("am") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a, b, c d# e f g#
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a, b, c d e f g#
scale_hungarian_minor("am") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a, b, c d# e f g#
identical(scale_melodic_minor("am"), scale_jazz_minor("am"))
#> [1] TRUE
rev(scale_melodic_minor("am", descending = TRUE)) -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a, b, c d e f g
scale_jazz_minor("am") -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: a, b, c d e f# g#
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a, b, c d e f g
scale_jazz_minor("am") +
#> <Noteworthy string> +#> Format: vectorized time +#> Values: a, b, c d e f# g#
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <cegb> <dfac'> <egbd'> <fac'e'> <gbd'f'> <ac'e'g'> <bd'f'a'>
scale_chords("a", "minor", "seventh", collapse = TRUE) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <a,ceg> <b,dfa> <cegb> <dfac'> <egbd'> <fac'e'> <gbd'f'>
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,1 <c'e'g'>8 <c'e'g'>8 <c'e'g'>8 <c'e'g'>8
#> [1] "a b c" "a b c"
c(as_noteworthy(x), x) -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a b c a b c
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a b c a b c
# noteinfo class examples x <- "4- t8( t8)( t8) 4*2" c(as_noteinfo(x), x) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 4- t8( t8)( t8) 4 4 4- t8( t8)( t8) 4 4
+
#> <Note info string> +#> Format: space-delimited time +#> Values: 4- t8( t8)( t8) 4 4 4- t8( t8)( t8) 4 4
# music class examples x <- "c,~4 c,1 c'e_'g'4-.*2" c(as_music(x), x) -
#> <Music string> -#> Format: space-delimited time -#> Values: c,~4 c,1 <c'e_'g'>4-. <c'e_'g'>4-. c,~4 c,1 <c'e_'g'>4-. <c'e_'g'>4-.
+
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,1 <c'e_'g'>4-. <c'e_'g'>4-. c,~4 c,1 <c'e_'g'>4-. <c'e_'g'>4-.
# phrase class examples c(phrase(x), x) -
#> <Musical phrase> -#> <c,~>4 <c,>1 <c' es' g'>4-. <c' es' g'>4-. <c,~>4 <c,>1 <c' es' g'>4-. <c' es' g'>4-.
+
#> <Musical phrase> +#> <c,~>4 <c,>1 <c' es' g'>4-. <c' es' g'>4-. <c,~>4 <c,>1 <c' es' g'>4-. <c' es' g'>4-.
#> [1] "a b c d e f g"
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a b
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: f g
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a b
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: f g
# noteinfo class examples x <- "4x 4-.*8 2 4" head(as_noteinfo(x)) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 4x 4-. 4-. 4-. 4-. 4-.
#> <Note info string> -#> Format: space-delimited time -#> Values: 4-. 4-. 4-. 4-. 2 4
+
#> <Note info string> +#> Format: space-delimited time +#> Values: 4x 4-. 4-. 4-. 4-. 4-.
#> <Note info string> +#> Format: space-delimited time +#> Values: 4-. 4-. 4-. 4-. 2 4
# music class examples x <- "c,~4 c,1 c'e_'g'4-." head(as_music(x), 2) -
#> <Music string> -#> Format: space-delimited time -#> Values: c,~4 c,1
tail(as_music(x), 2) -
#> <Music string> -#> Format: space-delimited time -#> Values: c,1 <c'e_'g'>4-.
+
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,1
tail(as_music(x), 2) +
#> <Music string> +#> Format: space-delimited time +#> Values: c,1 <c'e_'g'>4-.
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,1 b_t8 <c'e'g'>8 <c'e'g'>8 <c'e'g'>8
#> [1] "a b c" "a b c"
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: a b c a b c
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a b c a b c
# noteinfo class examples x <- "4x 4-.*2 2" rep(as_noteinfo(x), times = c(2, 1, 1, 2)) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 4x 4x 4-. 4-. 2 2
+
#> <Note info string> +#> Format: space-delimited time +#> Values: 4x 4x 4-. 4-. 2 2
# music class examples x <- "c,~4 c,1 c'e_'g'4-." rep(as_music(x), each = 2) -
#> <Music string> -#> Format: space-delimited time -#> Values: c,~4 c,~4 c,1 c,1 <c'e_'g'>4-. <c'e_'g'>4-.
+
#> <Music string> +#> Format: space-delimited time +#> Values: c,~4 c,~4 c,1 c,1 <c'e_'g'>4-. <c'e_'g'>4-.
# phrase class examples rep(phrase(x), 2) -
#> <Musical phrase> -#> <c,~>4 <c,>1 <c' es' g'>4-. <c,~>4 <c,>1 <c' es' g'>4-.
+
#> <Musical phrase> +#> <c,~>4 <c,>1 <c' es' g'>4-. <c,~>4 <c,>1 <c' es' g'>4-.
#> [1] "a b c"
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: c b a
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: c b a
# noteinfo class examples x <- "4x 4-.*2 2" rev(as_noteinfo(x)) -
#> <Note info string> -#> Format: space-delimited time -#> Values: 2 4-. 4-. 4x
+
#> <Note info string> +#> Format: space-delimited time +#> Values: 2 4-. 4-. 4x
# music class examples x <- "c,~4 c,1 c'e_'g'4-." rev(as_music(x)) -
#> <Music string> -#> Format: space-delimited time -#> Values: <c'e_'g'>4-. c,1 c,~4
+
#> <Music string> +#> Format: space-delimited time +#> Values: <c'e_'g'>4-. c,1 c,~4
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: <e,~b,~e~g~b~e'~>
#> # A tibble: 2 x 8 +
#> # A tibble: 2 x 8 #> phrase clef key tab tuning voice lyrics id -#> <list> <chr> <chr> <lgl> <chr> <int> <chr> <int> -#> 1 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 1 -#> 2 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 2
trackbind(x1, x2, id = c(1, 1)) -
#> # A tibble: 2 x 8 +#> <list> <chr> <chr> <lgl> <chr> <int> <chr> <int> +#> 1 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 1 +#> 2 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 2
trackbind(x1, x2, id = c(1, 1)) +
#> # A tibble: 2 x 8 #> phrase clef key tab tuning voice lyrics id -#> <list> <chr> <chr> <lgl> <chr> <int> <chr> <int> -#> 1 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 1 -#> 2 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 2 NA 1
+#> <list> <chr> <chr> <lgl> <chr> <int> <chr> <int> +#> 1 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 1 NA 1 +#> 2 <phrase [1]> treble_8 NA TRUE e,a,dgbe' 2 NA 1
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a_ b_4 c5
tp("a_3 b_4 c5", -1) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: g a4 b4
tp("a_3 b_4 c5", 1) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a b4 d_5
tp("a#3 b4 c#5", 11) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a4 a#5 c6
tp("a#3 b4 c#5", 12) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: a#4 b5 c#6
tp("r s a#3 b4 c#5", 13) +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: r s b4 c6 d6
tp("a b' c#''", 2, "integer", "flat") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: b d_5 e_5
tp("a, b ceg", 2, "tick", "sharp") +
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: b, c#' <df#a>
#> <Musical phrase> +#> \tuplet 3/2 4 { <c\5>8-. <cis\5>8( <d\5>8) }
#> [1] TRUE
x <- as_noteinfo(x) # coerce to 'noteinfo' class is_noteinfo(x) # check for 'noteinfo' class
#> [1] TRUE
x -
#> <Note info string> -#> Format: space-delimited time -#> Values: 8x;^"Start_here" 8[stacatto] 8-. 16 4.. 16- 16 2^ 2 4. 8( 4)( 4) 8 8 8 8 1 1
+
#> <Note info string> +#> Format: space-delimited time +#> Values: 8x;^"Start_here" 8[stacatto] 8-. 16 4.. 16- 16 2^ 2 4. 8( 4)( 4) 8 8 8 8 1 1
summary(x) -
#> <Note info string> -#> Timesteps: 19 -#> Format: space-delimited time -#> Values: 8x;^"Start_here" 8[stacatto] 8-. 16 4.. 16- 16 2^ 2 4. 8( 4)( 4) 8 8 8 8 1 1
+
#> <Note info string> +#> Timesteps: 19 +#> Format: space-delimited time +#> Values: 8x;^"Start_here" 8[stacatto] 8-. 16 4.. 16- 16 2^ 2 4. 8( 4)( 4) 8 8 8 8 1 1
#> [1] TRUE
x <- as_noteworthy(x) # coerce to 'noteworthy' class, conform formatting is_noteworthy(x) # check for 'noteworthy' class
#> [1] TRUE
x -
#> <Noteworthy string> -#> Format: space-delimited time -#> Values: b_ b_ c,~ c, d'' e g_' <c,e_,g,>
+
#> <Noteworthy string> +#> Format: space-delimited time +#> Values: b_ b_ c,~ c, d'' e g_' <c,e_,g,>
summary(x) -
#> <Noteworthy string> -#> Timesteps: 8 (7 notes, 1 chord) -#> Octaves: tick -#> Accidentals: flat -#> Format: space-delimited time -#> Values: b_ b_ c,~ c, d'' e g_' <c,e_,g,>
+
#> <Noteworthy string> +#> Timesteps: 8 (7 notes, 1 chord) +#> Octaves: tick +#> Accidentals: flat +#> Format: space-delimited time +#> Values: b_ b_ c,~ c, d'' e g_' <c,e_,g,>
x <- as_noteworthy(x, format = "vector", octaves = "integer", accidentals = "flat") x -
#> <Noteworthy string> -#> Format: vectorized time -#> Values: b_ b_ c2~ c2 d5 e g_4 <c2e_2g2>
+
#> <Noteworthy string> +#> Format: vectorized time +#> Values: b_ b_ c2~ c2 d5 e g_4 <c2e_2g2>
summary(x) -
#> <Noteworthy string> -#> Timesteps: 8 (7 notes, 1 chord) -#> Octaves: integer -#> Accidentals: flat -#> Format: vectorized time -#> Values: b_ b_ c2~ c2 d5 e g_4 <c2e_2g2>
+
#> <Noteworthy string> +#> Timesteps: 8 (7 notes, 1 chord) +#> Octaves: integer +#> Accidentals: flat +#> Format: vectorized time +#> Values: b_ b_ c2~ c2 d5 e g_4 <c2e_2g2>