View source: R/createPerformance.R
createPerformance | R Documentation |
These functions provide a safe, streamlined, and R-friendly interface to Csound's API, allowing users to pass lists of matrices and vectors to use as parameter data for controlling Csound instruments.
createPerformance(i = NULL, f = NULL,
orcfile = "built-in.orc", scorefile = NULL,
out = "dac", realTime = FALSE,
finishPerformance = TRUE, suppressDisplays = TRUE,
moreflags = NULL)
performScoreRealTime(csInstance, i = NULL, f = NULL)
finishPerformance(csInstance)
cleanupCrash()
i |
A list of |
f |
A list of numeric vectors; these create the function tables Csound uses for oscillators and various other uses. |
orcfile |
The path of the orchestra file to be used
for the performance. If this equals
|
scorefile |
The path of the score file, if any, to be used for the performance. The whole purpose of this function is to feed the score statements to Csound and bypass the need for score files, but this option is provided in any case. |
out |
String representing where to send output
sound; the default, |
realTime |
Indicates whether the performance is to
be rendered in real time. If you are rendering to a file,
you probably want this as |
finishPerformance |
Should the performance be closed
after completing the score? If |
suppressDisplays |
Csound by default pops up with annoying graphical widgets. This alloys you to suppress them (the default). |
moreflags |
A character vector of extra command-line flags to pass to Csound upon compilation of the orchestra. See The Csound Manual's page on the Csound command-line options. |
csInstance |
An instance of Csound that can be used to continue or close the current performance. |
createPerformance()
initializes Csound and
compiles the orchestra and allows the rendering of
matrices and vectors as parameter data; it can either
close its instance of Csound or return it, depending on
the value of the argument finishPerformance
.
If finishPerformance = FALSE
, one can use the
object returned by createPerformance()
to control
Csound and subsequently add more control data which
Csound then performs immediately with
performScoreRealTime()
. You can then finish up the
performance and close Csound with
finishPerformance()
.
If you encounter an error and cannot run
finishPerformance()
run cleanupCrash
before
doing anything else. Otherwise you may cause a segfault
and crash R.
scoreMatrices()
for easy creation of the
i
argument to createPerformance
sndcheck <- scoreMatrices(5, 5)
sndcheck$FM[, "start"] <- 0:4
sndcheck$FM[, "dur"] <- 0.5
sndcheck$FM[, "amp"] <- 0.5
sndcheck$FM[, "pan"] <- (0:4)/4
sndcheck$FM[, c("attkp", "decayp")] <- 0.01
sndcheck$FM[, "cps"] <- (1:5)*110
sndcheck$FM[, "mod"] <- (1:5)/2
sndcheck$FM[, "indx"] <- 4:0
sndcheck$subtractive[, "start"] <- 0:4 + 0.5
sndcheck$subtractive[, "dur"] <- 0.1
sndcheck$subtractive[, "amp"] <- 0.05
sndcheck$subtractive[, "pan"] <- (4:0)/4
sndcheck$subtractive[, c("attkp", "decayp")] <- 0.01
sndcheck$subtractive[, "cntr"] <- (5:1)*500
sndcheck$subtractive[, "bw"] <- (5:1)*500
## Not run: createPerformance(sndcheck)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.