knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(tr808r) # Convert a video to tweetable format # ffmpeg -i drummachine-a.mov -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p -strict experimental -r 30 -t 2:20 -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -ac 2 drum-a.mp4 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Generate the pkgdown documentation #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (FALSE) { pkgdown::build_site(override = list(destination = "../coolbutuseless.github.io/package/tr808r")) }
{tr808r}
is a tiny sound-a-like for
Roland's TR-808 drum machine.
This is a tech demo for how
eventloop}
allows you to
write complex interactive applications using just R.
tr808()
Start an interactive TR-808 session.Note that {tr808r}
relies on the {eventloop}
package for handling the
interactivity on macOS and unix-like platforms.
Windows OS is not supported by {eventloop}
as R on Windows does not
(currently) support the onIdle
callback.
You can install from GitHub with:
# install.package('remotes') remotes::install_github('coolbutuseless/eventloop') # >= v0.1.1 remotes::install_github('coolbutuseless/tr808r')
tr808(state = ...)
tr808(state = ...)
tr808()
Open the drum machine with an existing song.
tr808(state = demo_songs[[1]])
This is an easy, fun(?) way to share patterns on twitter!
Press t
(for twitter) within the application to print a text representation to
your R console.
If you have {clipr}
installed then
the text will also be copied to your clipboard for easy pasting into twitter!
#RStats #tr808r BD xx____xx__x_____ SD ____x_______x___ LT ________________ MT xx______________ HT ______xx__x__x__ RS ________________ CP xx_xx_xx_______x CB xx__x_xx_x_x_xx_ CY ________________ OH ________________ CH x_xxx_xxx_xxx_xx
If you'd like to play a pattern that someone has tweeted, copy the text and pass
it to tr808()
as the initial state
tr808(state = ' #RStats #tr808r BD xx____xx__x_____ SD ____x_______x___ LT ________________ MT xx______________ HT ______xx__x__x__ RS ________________ CP xx_xx_xx_______x CB xx__x_xx_x_x_xx_ CY ________________ OH ________________ CH x_xxx_xxx_xxx_xx')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.