[Rd] R sings
Fri, 29 Dec 2000 19:45:16 +0100
i have created a package which allows R to play sounds
the package is available from
both as zipped binary for windows and as installable tar.gz
you have to install csound on yout machine.
the necessary links are at http://www.csound.org
csound is a very portable program for creating sounds,
and using it as out sound creation tool we remain portable.
i am interested in getting feedback.
csound is NOT easy to use.
but for the purposes of our package,
it is only necessary to install it.
my package is vert preliminary,
so i would like feedback.
here is the README
This is a VERY preliminary version of an R package
for playing sounds.
To install, unzip the complete archive in the library directory of R.
You have to install CSOUND,
a very powerful sound generation program.
Information is avalaible at http://www.csound.org
You also can find most version on
You have to find the command line parameters
needed to run csound on your platform.
You need at least verson 4.0,
current version at design time of this package is 4.08.
our package has been tested with
"Canonical" Csound on Linux
and DirectCsound on Win32.
have to contain the command line needed to run
csound in normal mode and in debugging mode
(debugging mode means you want to see a window with csound's messages)
The package as is is configured for windows,
a comment contains the command line for Linux.
At the moment, we have only 2 instruments,
instrument 1 is a sine wave,
instrument 11 is a simple plucked string.
currently, the library contains 4 functions
all these function play sequences of notes with given frequencies,
starting times, durations, and volume levels.
Basic interface functions:
csndPlayMono (instr=NULL, start=NULL, dur=NULL, vol=NULL, freq=NULL,
csndPlayStereo(instr=NULL, start=NULL, dur=NULL, vol=NULL, freq=NULL,
pos = 0,
instr instrument number
start vector of starting times for single notes
dur vector of duration of single notes
vol vector of volume of single notes
freq vector of volume of single notes
pos vector of positions of notes (extreme values -1 left channel, 1
file name of temporary file to be used as input for csound
if TRUE csound window will remain visible
Attempt at "statistical" sound functions
csndCorrphone(instr, freq1, freq2, dur, vol=8000,
instr instrument number
vector of frequencies to be played simultaneously on left and right
dur should be a single value, used for duraion of all notes
csndFourierTones(fourcoeffs, freq=264, dur=1, vol=8000,
fourcoeffs matrix, each row is interpreted as fourier coefficients,
and the correspronding tone is played for each row
freq frequency of the tones (should be equal for all tones)
dur duration in seconds
vol volume for tones
Here are some example to try:
Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com