WebAudio Csound

CsoundScriptProcessorNode(context, options) → {object}

A ScriptProcessorNode class containing a Csound engine

Constructor

new CsoundScriptProcessorNode(context, options) → {object}

Parameters:
Name Type Description
context AudioContext AudioContext in which this node will run
options object Configuration options, holding numberOfInputs, numberOfOutputs
Mixes In:
Source:
Returns:
A new CsoundScriptProcessorNode
Type
object

Methods

compileCSD(csd)

Compiles a CSD, which may be given as a filename in the WASM filesystem or a string containing the code
Parameters:
Name Type Description
csd string A string containing the CSD filename or the CSD code.
Mixes In:
Source:

compileOrc(orcString)

Compiles Csound orchestra code.
Parameters:
Name Type Description
orcString string A string containing the orchestra code.
Mixes In:
Source:

evaluateCode(codeString)

Evaluates Csound orchestra code.
Parameters:
Name Type Description
codeString string A string containing the orchestra code.
Mixes In:
Source:

midiMessage(byte1, byte2, byte1)

Sends a MIDI channel message to Csound
Parameters:
Name Type Description
byte1 number MIDI status byte
byte2 number MIDI data byte 1
byte1 number MIDI data byte 2
Mixes In:
Source:

play()

Starts performance, same as start()
Mixes In:
Source:

readScore(scoreString)

Reads a numeric score string.
Parameters:
Name Type Description
scoreString string A string containing a numeric score.
Mixes In:
Source:

render(csd)

Renders a CSD, which may be given as a filename in the WASM filesystem or a string containing the code. This is used for disk rendering only.
Parameters:
Name Type Description
csd string A string containing the CSD filename or the CSD code.
Mixes In:
Source:

reset()

Resets the Csound engine.
Mixes In:
Source:

setControlChannel(channelName, value)

Sets the value of a control channel in the software bus
Parameters:
Name Type Description
channelName string A string containing the channel name.
value number The value to be set.
Mixes In:
Source:

setMessageCallback(msgCallback)

Sets a callback to process Csound console messages.
Parameters:
Name Type Description
msgCallback function A callback to process messages with signature function(message), where message is a string from Csound.
Mixes In:
Source:

setOption(option)

Sets a Csound engine option (flag)
Parameters:
Name Type Description
option string The Csound engine option to set. This should not contain any whitespace.
Mixes In:
Source:

setStringChannel(channelName, stringValue)

Sets the value of a string channel in the software bus
Parameters:
Name Type Description
channelName string A string containing the channel name.
stringValue string The string to be set.
Mixes In:
Source:

start()

Starts processing in this node
Mixes In:
Source:

stop()

Stops (pauses) performance
Mixes In:
Source:

writeToFS(filePath, blobData)

Writes data to a file in the WASM filesystem for use with csound.
Parameters:
Name Type Description
filePath string A string containing the path to write to.
blobData blob The data to write to file.
Mixes In:
Source: