Description Usage Arguments Value Author(s) Examples
Play or save musical chords
1 |
pitch |
a character vector or list of notes using the Latin alphabet. Use a list to play multiple notes simultaneously, placing all notes to be played together in a character vector. An element with no characters results in silence. Append:
|
duration |
a numeric vector of each note's duration, in beats. Must be same length as pitch. |
tempo |
integer, tempo to be played in beats per minute. |
sample_rate |
integer, number of samples per second (Hz). |
fade_duration |
number of seconds to fade each note in and out. Can be used to avoid audible pops at the beginning and end of each note. Cannot exceed half of the shortest note's duration. |
output_path |
path to location where wave file will be written. If |
Music played in R console, or saved wave file.
Ariel Fridman
1 2 3 4 5 6 | rechordr(pitch = list(c("A3", "C4", "F4"), c("G3", "C4", "E4"), c("G3", "C4", "E4"), c("F3", "Bb3", "D4"), "", c("A3", "C4", "F4"), c("G3", "C4", "E4"), c("G3", "C4", "E4"), c("A3", "C4", "F4")),
duration = c(1, .75, .75, .5, 1, 1, .75, .75, .5))
rechordr(pitch = list(c("A3", "C4", "F4"), c("G3", "C4", "E4"), c("G3", "C4", "E4"), c("F3", "Bb3", "D4"), "", c("A3", "C4", "F4"), c("G3", "C4", "E4"), c("G3", "C4", "E4"), c("A3", "C4", "F4")),
duration = c(1, .75, .75, .5, 1, 1, .75, .75, .5),
output_path = "You Can Call Me Al.wav")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.