akseong / datagoboop Goto Github PK
View Code? Open in Web Editor NEWListen to the data
License: GNU General Public License v3.0
Listen to the data
License: GNU General Public License v3.0
Made some changes to wplay
and cplay
in dev branch.
eval_entry = TRUE
any (single-line) input other than 'p' or 's' is also executed.try:
bp2 <- bach()
wplay_controls <- TRUE
wplay(bp2)
eval_entry <- TRUE
wplay(bp2)
test <- 5^2
test
Q1: Should we get rid of the system wait, and just default to console controls?
Q2: Should eval_entry
be TRUE
by default? (have it on FALSE
for now b/c it just seems a bit dodgy to execute commands entered somewhat by mistake)
Use \dontshow{wplayback <- FALSE}
at the top of each example, then have the remaining code shown normally. That way, when the user tries the example verbatim, they will hear the result, but we won't have to listen to it when calling devtools::check()
some refs:
https://cran.r-project.org/web/packages/roxygen2/vignettes/rd.html
https://stackoverflow.com/questions/12038160/how-to-not-run-an-example-using-roxygen2#comment89039795_44997778
We gotta... figure what functions to test and how to test them.
Basically set up automatic tests to verify functionality before packaging.
check functions for inclusion of progbar
option (used by notes()
)
functions needing progbar
option:
bach()
a few functions need NA handling, e.g.
# doesn't work
wplay(sonify_hist(data=airquality, var=Ozone))
#works
wplay(sonify_hist(data=na.omit(airquality), var=Ozone))
not sure which other ones; this one just popped up when I was writing that blogpost.
Host a higher quality sound library on github and have a function that downloads it / portions of it
Let's make it sound like this!
http://stanford.edu/~sawe/alaskanyellowcedarsonification.wav
Use .Rmds, not word docs :)
essentially, it would scan the data for a user-defined event (might just need to be a new column in a data frame), and play a pre-defined sound when the event occurs (e.g. moving average in a time series experiences a large drop, or voltage spikes in neuronal recordings)
(copied from https://github.com/stats295r-fa20/package-group3/issues)
Hi, I am very impressed by the work and trying to use the library on my project. Do you have a way to export the wplay audio into an audio file? The type of the wave is a num array. Thanks in advance!
Just had a thought about incorporating samples. Since the piano sample is so long, can we find a way to create a function where we specify our desired length and pitch, the function will then stretch the piano sample appropriately and then crop it afterwards?
add_inst
can be changed to create_inst
which creates new instruments locally. Sound functions will look for these when playing sounds with unrecognized inst names.Example implementations from JooYoung:
SAS Graphics Accelerator. Examples below require installation of this chrome extension.
bach()
function could be a kind of built-in code tutorial if variable names were friendlier and code were commented
As used currently, seewave::savewav() will save only one ear of sound given a stereo input
I've worked around this for the shiny app using code like this, but such a fix should probably be implemented within the datagoboop package itself
wave_fname <- here::here("scatter", "www", "testwave.wav")
w <- sonify_mod(lm(as.formula("mpg ~ cyl"), data = mtcars))
tuneR::writeWave(tuneR::normalize(tuneR::Wave(left = w[1, ], right = w[2, ], samp.rate = 44100, bit = 16), unit = "16"), filename = wave_fname)
checking top-level files ... NOTE
Non-standard files/directories found at top level:
'example.Rmd' 'experiments' 'sounds'
checking R code for possible problems ... NOTE
notes: no visible global function definition for 'txtProgressBar'
notes: no visible binding for global variable 'progbar_title'
notes: no visible global function definition for 'setTxtProgressBar'
sonify_box: no visible global function definition for 'txtProgressBar'
sonify_box: no visible binding for global variable 'progbar_title'
sonify_box: no visible global function definition for
'setTxtProgressBar'
Undefined global functions or variables:
progbar_title setTxtProgressBar txtProgressBar
Consider adding
importFrom("utils", "setTxtProgressBar", "txtProgressBar")
to your NAMESPACE file.
checking Rd line widths ... NOTE
Rd file 'add_inst.Rd':
\examples lines wider than 100 characters:
# Generate a 250 Hz sawtooth wave and save it in the local folder using the save.wave() function from library(audio)
# Open the newly saved sound file and use it to specify a new synthesizer sound under the label "saw".
Rd file 'resynth.Rd':
\examples lines wider than 100 characters:
w <- resynth(hz = 360, dur = 1, env = c(1, 0), amp = rev(seq(0, 1, length.out = 6)), phi = rep(0, 6))
any input besides s
or p
should just stop playback.
wplay()
knit behavior:
file_path
specified
file_path
existsremake
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.