CsoundUnity 3.3.1
Csound wrapper for the Unity game engine.
CsoundUnity Class Reference

Csound Unity Class More...

Inheritance diagram for CsoundUnity:

Public Types

enum  EnvType {
  SFDIR , SSDIR , SADIR , SFOUTYP ,
  INCDIR , OPCODE6DIR , OPCODE6DIR64 , SNAPDIR ,
  CSOUNDRC , CSSTRNGS , CS_LANG , RAWWAVE_PATH ,
  CSNOSTOP , MFDIR , CS_OMIT_LIBS
}
 The enum representing the Csound Environment Variables More...
 
enum  SamplesOrigin { Resources , StreamingAssets , Absolute }
 Where the samples to load come from: the Resources folder the StreamingAssets folder An absolute path, can be external of the Unity Project More...
 

Public Member Functions

delegate void CsoundInitialized ()
 The delegate of the event OnCsoundInitialized More...
 
int GetVersion ()
 Returns the Csound version number times 1000 (5.00.0 = 5000). More...
 
int GetAPIVersion ()
 Returns the Csound API version number times 100 (1.00 = 100). More...
 
bool CompiledWithoutError ()
 Returns true if the csd file was compiled without errors. More...
 
void SetCsd (string guid)
 Sets the csd file More...
 
int CompileOrc (string orcStr)
 Parse, and compile the given orchestra from an ASCII string, also evaluating any global space code (i-time only) this can be called during performance to compile a new orchestra. This sample shows how to use CompileOrc More...
 
void SendScoreEvent (string scoreEvent)
 Send a score event to Csound in the form of "i1 0 10 .... More...
 
void RewindScore ()
 Rewinds a compiled Csound score to the time specified with SetScoreOffsetSeconds(). More...
 
void SetScoreOffsetSeconds (MYFLT value)
 Csound score events prior to the specified time are not performed, and performance begins immediately at the specified time (real-time events will continue to be performed as they are received). Can be used by external software, such as a VST host, to begin score performance midway through a Csound score, for example to repeat a loop in a sequencer, or to synchronize other events with the Csound score. More...
 
MYFLT GetSr ()
 Get the current sample rate More...
 
MYFLT GetKr ()
 Get the current control rate More...
 
int PerformKsmps ()
 Process a ksmps-sized block of samples More...
 
uint GetKsmps ()
 Get the number of audio sample frames per control sample. More...
 
void SetInputSample (int frame, int channel, MYFLT sample)
 Set a sample in Csound's input buffer More...
 
void AddInputSample (int frame, int channel, MYFLT sample)
 Adds the indicated sample into the audio input working buffer (spin); this only ever makes sense before calling PerformKsmps(). The frame and channel must be in bounds relative to ksmps and nchnls. NB: the spin buffer needs to be cleared at every k-cycle by calling ClearSpin(). More...
 
void ClearSpin ()
 Clears the input buffer (spin). More...
 
MYFLT GetOutputSample (int frame, int channel)
 Get a sample from Csound's audio output buffer More...
 
MYFLT[] GetSpin ()
 Get Csound's audio input buffer More...
 
MYFLT[] GetSpout ()
 Get Csound's audio output buffer More...
 
void SetChannel (string channel, MYFLT val)
 Sets a Csound channel. Used in connection with a chnget opcode in your Csound instrument. More...
 
void SetStringChannel (string channel, string val)
 Sets a string channel in Csound. Used in connection with a chnget opcode in your Csound instrument. More...
 
MYFLT GetChannel (string channel)
 Gets a Csound channel. Used in connection with a chnset opcode in your Csound instrument. More...
 
IDictionary< string, CsoundUnityBridge.ChannelInfoGetChannelList ()
 blocking method to get a list of the channels from Csound, not from the serialized list of this instance More...
 
MYFLT[] GetAudioChannel (string channel)
 Gets a Csound Audio channel. Used in connection with a chnset opcode in your Csound instrument. More...
 
int CreateTable (int tableNumber, MYFLT[] samples)
 Creates a table with the supplied samples. Can be called during performance. More...
 
int CreateTableInstrument (int tableNumber, int tableLength)
 Creates an empty table, to be filled with samples later. Please note that trying to read the samples from an empty folder will produce a crash. Can be called during performance. More...
 
int GetTableLength (int table)
 Returns the length of a function table (not including the guard point), or -1 if the table does not exist. More...
 
MYFLT GetTableSample (int tableNumber, int index)
 Retrieves a single sample from a Csound function table. More...
 
int GetTable (out MYFLT[] tableValues, int numTable)
 Stores values to function table 'numTable' in tableValues, and returns the table length (not including the guard point). If the table does not exist, tableValues is set to NULL and -1 is returned. More...
 
int GetTableArgs (out MYFLT[] args, int index)
 Stores the arguments used to generate function table 'tableNum' in args, and returns the number of arguments used. If the table does not exist, args is set to NULL and -1 is returned. NB: the argument list starts with the GEN number and is followed by its parameters. eg. f 1 0 1024 10 1 0.5 yields the list {10.0,1.0,0.5} More...
 
void SetTable (int table, int index, MYFLT value)
 Sets the value of a slot in a function table. The table number and index are assumed to be valid. More...
 
void CopyTableOut (int table, out MYFLT[] dest)
 Copy the contents of a function table into a supplied array dest The table number is assumed to be valid, and the destination needs to have sufficient space to receive all the function table contents. More...
 
void CopyTableOutAsync (int table, out MYFLT[] dest)
 Asynchronous version of copyTableOut More...
 
void CopyTableIn (int table, MYFLT[] source)
 Copy the contents of a supplied array into a function table The table number is assumed to be valid, and the destination needs to have sufficient space to receive all the function table contents. More...
 
void CopyTableInAsync (int table, MYFLT[] source)
 Asynchronous version of copyTableOut More...
 
int IsNamedGEN (int num)
 Checks if a given GEN number num is a named GEN if so, it returns the string length (excluding terminating NULL char) Otherwise it returns 0. More...
 
void GetNamedGEN (int num, out string name, int len)
 Gets the GEN name from a number num, if this is a named GEN The final parameter is the max len of the string (excluding termination) More...
 
IDictionary< string, int > GetNamedGens ()
 Returns a Dictionary keyed by the names of all named table generators. Each name is paired with its internal function number. More...
 
CsoundUnityBridge.CSOUND_PARAMS GetParams ()
 
void SetParams (CsoundUnityBridge.CSOUND_PARAMS parms)
 
string GetEnv (EnvType envType)
 Get Environment path More...
 
int SetGlobalEnv (string name, string value)
 Set the global value of environment variable 'name' to 'value', or delete variable if 'value' is NULL. It is not safe to call this function while any Csound instances are active. See https://csound.com/docs/manual/CommandEnvironment.html for a list of the variables that can be used. More...
 
IDictionary< string, IList< CsoundUnityBridge.OpcodeArgumentTypes > > GetOpcodeList ()
 Get the Opcode List, blocking More...
 
uint GetNchnlsInputs ()
 Get the number of input channels More...
 
uint GetNchnls ()
 Get the number of output channels More...
 
MYFLT Get0dbfs ()
 Get 0 dbfs More...
 
long GetCurrentTimeSamples ()
 Returns the current performance time in samples More...
 
void CsoundReset ()
 Resets all internal memory and state in preparation for a new performance. Enables external software to run successive Csound performances without reloading Csound. Implies csoundCleanup(), unless already called. More...
 
void Cleanup ()
 Prints information about the end of a performance, and closes audio and MIDI devices. Note: after calling csoundCleanup(), the operation of the perform functions is undefined. More...
 

Static Public Member Functions

static List< string > ParseCsdFileForAudioChannels (string filename)
 Parse the csd and returns available audio channels (set in csd via: More...
 
static List< CsoundChannelControllerParseCsdFile (string filename)
 Parse the csd file More...
 
static float Remap (float value, float from1, float to1, float from2, float to2, bool clamp=false)
 map MYFLT within one range to another More...
 
static MYFLT[] GetStereoSamples (string source, SamplesOrigin origin)
 Get Samples from a path, specifying the origin of the path. This will return an interleaved array of samples, with the first index used to specify the number of channels. This array can be passed to the CsoundUnity.CreateTable() method for processing by Csound. Use async versions to to load very large files. More...
 
static MYFLT[] GetMonoSamples (string source, SamplesOrigin origin, int channelNumber)
 
static MYFLT[] GetSamples (string source, SamplesOrigin origin, int channelNumber=1, bool writeChannelData=false)
 
static IEnumerator GetSamples (string source, SamplesOrigin origin, Action< MYFLT[]> onSamplesLoaded)
 Async version of GetSamples example of usage: More...
 

Public Attributes

bool logCsoundOutput = false
 If true, all Csound output messages will be sent to the Unity output console. Note that this can slow down performance if there is a lot of information being printed. More...
 
bool mute = false
 If true no audio is sent to output More...
 
bool processClipAudio
 If true Csound uses as an input the AudioClip attached to this AudioSource If false, no processing occurs on the attached AudioClip More...
 
bool loudVolumeWarning = true
 If true it will print warnings in the console when the output volume is too high, and mute all the samples above the loudWarningThreshold value More...
 
float loudWarningThreshold = 10f
 The volume threshold at which a warning is output to the console, and audio output is filtered More...
 
readonly Dictionary< string, MYFLT[]> namedAudioChannelDataDict = new Dictionary<string, MYFLT[]>()
 public named audio Channels shown in CsoundUnityChild inspector More...
 
string csoundScore
 the score to send via editor More...
 
List< EnvironmentSettingsenvironmentSettings = new List<EnvironmentSettings>()
 The list of the Environment Settings that will be set on start, using csoundSetGlobalEnv. Each setting can be used to specify the path of an environment variable. These settings will be applied to this CsoundUnity instance when the CsoundUnityBridge is created. More...
 

Static Public Attributes

const string packageName = "com.csound.csoundunity"
 The name of this package More...
 
const string packageVersion = "3.3.1"
 The version of this package More...
 

Properties

string csoundFileGUID [get]
 the unique guid of the csd file More...
 
string csoundFileName [get]
 The file CsoundUnity will try to load. You can only load one file with each instance of CsoundUnity, but you can use as many instruments within that file as you wish.You may also create as many of CsoundUnity objects as you wish. More...
 
string csoundString [get]
 a string to hold all the csoundFile content More...
 
List< CsoundChannelControllerchannels [get]
 list to hold channel data More...
 
List< string > availableAudioChannels [get]
 list to hold available audioChannels names More...
 
bool IsInitialized [get]
 Is Csound initialized? More...
 
bool PerformanceFinished [get]
 

Events

CsoundInitialized OnCsoundInitialized
 An event that will be executed when Csound is initialized More...
 

Detailed Description

Csound Unity Class

Member Enumeration Documentation

◆ EnvType

The enum representing the Csound Environment Variables

Enumerator
SFDIR 

Default directory for sound files. Used if no full path is given for sound files.

SSDIR 

Default directory for input (source) audio and MIDI files. Used if no full path is given for sound files. May be used in conjunction with SFDIR to set separate input and output directories. Please note that MIDI files as well as audio files are also sought inside SSDIR.

SADIR 

Default directory for analysis files. Used if no full path is given for analysis files.

SFOUTYP 

Sets the default output file type. Currently only 'WAV', 'AIFF' and 'IRCAM' are valid. This flag is checked by the csound executable and the utilities and is used if no file output type is specified.

INCDIR 

Include directory. Specifies the location of files used by #include statements.

OPCODE6DIR 

Defines the location of csound opcode plugins for the single precision float (32-bit) version.

OPCODE6DIR64 

Defines the location of csound opcode plugins for the double precision float (64-bit) version.

SNAPDIR 

Is used by the FLTK widget opcodes when loading and saving snapshots.

CSOUNDRC 

Defines the csound resource (or configuration) file. A full path and filename containing csound flags must be specified. This variable defaults to .csoundrc if not present.

CSSTRNGS 

In Csound 5.00 and later versions, the localisation of messages is controlled by two environment variables CSSTRNGS and CS_LANG, both of which are optional. CSSTRNGS points to a directory containing .xmg files.

CS_LANG 

Selects a language for csound messages.

RAWWAVE_PATH 

Is used by the STK opcodes to find the raw wave files. Only relevant if you are using STK wrapper opcodes like STKBowed or STKBrass.

CSNOSTOP 

If this environment variable is set to "yes", then any graph displays are closed automatically at the end of performance (meaning that you possibly will not see much of them in the case of a short non-realtime render). Otherwise, you need to click "Quit" in the FLTK display window to exit, allowing for viewing the graphs even after the end of score is reached.

MFDIR 

Default directory for MIDI files. Used if no full path is given for MIDI files. Please note that MIDI files are sought in SSDIR and SFDIR as well.

CS_OMIT_LIBS 

Allows defining a list of plugin libraries that should be skipped. Libraries can be separated with commas, and don't require the "lib" prefix.

◆ SamplesOrigin

Where the samples to load come from: the Resources folder the StreamingAssets folder An absolute path, can be external of the Unity Project

Enumerator
Resources 
StreamingAssets 
Absolute 

Member Function Documentation

◆ AddInputSample()

void CsoundUnity.AddInputSample ( int  frame,
int  channel,
MYFLT  sample 
)

Adds the indicated sample into the audio input working buffer (spin); this only ever makes sense before calling PerformKsmps(). The frame and channel must be in bounds relative to ksmps and nchnls. NB: the spin buffer needs to be cleared at every k-cycle by calling ClearSpin().

Parameters
frame
channel
sample

◆ Cleanup()

void CsoundUnity.Cleanup ( )

Prints information about the end of a performance, and closes audio and MIDI devices. Note: after calling csoundCleanup(), the operation of the perform functions is undefined.

◆ ClearSpin()

void CsoundUnity.ClearSpin ( )

Clears the input buffer (spin).

◆ CompiledWithoutError()

bool CsoundUnity.CompiledWithoutError ( )

Returns true if the csd file was compiled without errors.

Returns

◆ CompileOrc()

int CsoundUnity.CompileOrc ( string  orcStr)

Parse, and compile the given orchestra from an ASCII string, also evaluating any global space code (i-time only) this can be called during performance to compile a new orchestra. This sample shows how to use CompileOrc

string orc = "instr 1 \n a1 rand 0dbfs/4 \n out a1 \nendin\n"; CompileOrc(orc);

Parameters
orcStr
Returns

◆ CopyTableIn()

void CsoundUnity.CopyTableIn ( int  table,
MYFLT[]  source 
)

Copy the contents of a supplied array into a function table The table number is assumed to be valid, and the destination needs to have sufficient space to receive all the function table contents.

Parameters
tablethe number of the table
sourcethe supplied array

◆ CopyTableInAsync()

void CsoundUnity.CopyTableInAsync ( int  table,
MYFLT[]  source 
)

Asynchronous version of copyTableOut

Parameters
table
source

◆ CopyTableOut()

void CsoundUnity.CopyTableOut ( int  table,
out MYFLT[]  dest 
)

Copy the contents of a function table into a supplied array dest The table number is assumed to be valid, and the destination needs to have sufficient space to receive all the function table contents.

Parameters
table
dest

◆ CopyTableOutAsync()

void CsoundUnity.CopyTableOutAsync ( int  table,
out MYFLT[]  dest 
)

Asynchronous version of copyTableOut

Parameters
table
dest

◆ CreateTable()

int CsoundUnity.CreateTable ( int  tableNumber,
MYFLT[]  samples 
)

Creates a table with the supplied samples. Can be called during performance.

Parameters
tableNumberThe table number
samples
Returns

◆ CreateTableInstrument()

int CsoundUnity.CreateTableInstrument ( int  tableNumber,
int  tableLength 
)

Creates an empty table, to be filled with samples later. Please note that trying to read the samples from an empty folder will produce a crash. Can be called during performance.

Parameters
tableNumberThe number of the newly created table
tableLengthThe length of the table in samples
Returns
0 If the table could be created

AudioSettings.outputSampleRate

◆ CsoundInitialized()

delegate void CsoundUnity.CsoundInitialized ( )

The delegate of the event OnCsoundInitialized

◆ CsoundReset()

void CsoundUnity.CsoundReset ( )

Resets all internal memory and state in preparation for a new performance. Enables external software to run successive Csound performances without reloading Csound. Implies csoundCleanup(), unless already called.

◆ Get0dbfs()

MYFLT CsoundUnity.Get0dbfs ( )

Get 0 dbfs

Returns

◆ GetAPIVersion()

int CsoundUnity.GetAPIVersion ( )

Returns the Csound API version number times 100 (1.00 = 100).

Returns

◆ GetAudioChannel()

MYFLT[] CsoundUnity.GetAudioChannel ( string  channel)

Gets a Csound Audio channel. Used in connection with a chnset opcode in your Csound instrument.

Parameters
channel
Returns

◆ GetChannel()

MYFLT CsoundUnity.GetChannel ( string  channel)

Gets a Csound channel. Used in connection with a chnset opcode in your Csound instrument.

Parameters
channel
Returns

◆ GetChannelList()

IDictionary< string, CsoundUnityBridge.ChannelInfo > CsoundUnity.GetChannelList ( )

blocking method to get a list of the channels from Csound, not from the serialized list of this instance

Returns

◆ GetCurrentTimeSamples()

long CsoundUnity.GetCurrentTimeSamples ( )

Returns the current performance time in samples

Returns

◆ GetEnv()

string CsoundUnity.GetEnv ( EnvType  envType)

Get Environment path

Parameters
envTypethe type of the environment to get
Returns

◆ GetKr()

MYFLT CsoundUnity.GetKr ( )

Get the current control rate

Returns

◆ GetKsmps()

uint CsoundUnity.GetKsmps ( )

Get the number of audio sample frames per control sample.

Returns

◆ GetMonoSamples()

static MYFLT[] CsoundUnity.GetMonoSamples ( string  source,
SamplesOrigin  origin,
int  channelNumber 
)
static

◆ GetNamedGEN()

void CsoundUnity.GetNamedGEN ( int  num,
out string  name,
int  len 
)

Gets the GEN name from a number num, if this is a named GEN The final parameter is the max len of the string (excluding termination)

Parameters
num
name
len

◆ GetNamedGens()

IDictionary< string, int > CsoundUnity.GetNamedGens ( )

Returns a Dictionary keyed by the names of all named table generators. Each name is paired with its internal function number.

Returns

◆ GetNchnls()

uint CsoundUnity.GetNchnls ( )

Get the number of output channels

Returns

◆ GetNchnlsInputs()

uint CsoundUnity.GetNchnlsInputs ( )

Get the number of input channels

Returns

◆ GetOpcodeList()

IDictionary< string, IList< CsoundUnityBridge.OpcodeArgumentTypes > > CsoundUnity.GetOpcodeList ( )

Get the Opcode List, blocking

Returns

◆ GetOutputSample()

MYFLT CsoundUnity.GetOutputSample ( int  frame,
int  channel 
)

Get a sample from Csound's audio output buffer

Parameters
frame
channel
Returns

◆ GetParams()

CsoundUnityBridge.CSOUND_PARAMS CsoundUnity.GetParams ( )

◆ GetSamples() [1/2]

static IEnumerator CsoundUnity.GetSamples ( string  source,
SamplesOrigin  origin,
Action< MYFLT[]>  onSamplesLoaded 
)
static

Async version of GetSamples example of usage:

yield return CsoundUnity.GetSamples(source.name, CsoundUnity.SamplesOrigin.Resources, (samples) => { Debug.Log("samples loaded: "+samples.Length+", creating table"); csound.CreateTable(100, samples); });

Parameters
sourcethe name of the AudioClip to load
originthe origin of the path
onSamplesLoadedthe callback when samples are loaded
Returns

◆ GetSamples() [2/2]

static MYFLT[] CsoundUnity.GetSamples ( string  source,
SamplesOrigin  origin,
int  channelNumber = 1,
bool  writeChannelData = false 
)
static

◆ GetSpin()

MYFLT[] CsoundUnity.GetSpin ( )

Get Csound's audio input buffer

Returns

◆ GetSpout()

MYFLT[] CsoundUnity.GetSpout ( )

Get Csound's audio output buffer

Returns

◆ GetSr()

MYFLT CsoundUnity.GetSr ( )

Get the current sample rate

Returns

◆ GetStereoSamples()

static MYFLT[] CsoundUnity.GetStereoSamples ( string  source,
SamplesOrigin  origin 
)
static

Get Samples from a path, specifying the origin of the path. This will return an interleaved array of samples, with the first index used to specify the number of channels. This array can be passed to the CsoundUnity.CreateTable() method for processing by Csound. Use async versions to to load very large files.

Note: You need to be careful that your AudioClips match the SR of the project. If not, you will hear some re-pitching issues with your audio when you play it back with a table reader opcode.

Parameters
source
origin
async
Returns

◆ GetTable()

int CsoundUnity.GetTable ( out MYFLT[]  tableValues,
int  numTable 
)

Stores values to function table 'numTable' in tableValues, and returns the table length (not including the guard point). If the table does not exist, tableValues is set to NULL and -1 is returned.

Parameters
tableValues
numTable
Returns

◆ GetTableArgs()

int CsoundUnity.GetTableArgs ( out MYFLT[]  args,
int  index 
)

Stores the arguments used to generate function table 'tableNum' in args, and returns the number of arguments used. If the table does not exist, args is set to NULL and -1 is returned. NB: the argument list starts with the GEN number and is followed by its parameters. eg. f 1 0 1024 10 1 0.5 yields the list {10.0,1.0,0.5}

Parameters
args
index
Returns

◆ GetTableLength()

int CsoundUnity.GetTableLength ( int  table)

Returns the length of a function table (not including the guard point), or -1 if the table does not exist.

Parameters
table
Returns

◆ GetTableSample()

MYFLT CsoundUnity.GetTableSample ( int  tableNumber,
int  index 
)

Retrieves a single sample from a Csound function table.

Parameters
tableNumber
index
Returns

◆ GetVersion()

int CsoundUnity.GetVersion ( )

Returns the Csound version number times 1000 (5.00.0 = 5000).

Returns

◆ IsNamedGEN()

int CsoundUnity.IsNamedGEN ( int  num)

Checks if a given GEN number num is a named GEN if so, it returns the string length (excluding terminating NULL char) Otherwise it returns 0.

Parameters
num
Returns

◆ ParseCsdFile()

static List< CsoundChannelController > CsoundUnity.ParseCsdFile ( string  filename)
static

Parse the csd file

Parameters
filenamethe csd file to parse
Returns

◆ ParseCsdFileForAudioChannels()

static List< string > CsoundUnity.ParseCsdFileForAudioChannels ( string  filename)
static

Parse the csd and returns available audio channels (set in csd via:

chnset avar, "audio channel name")

Parameters
filename
Returns

◆ PerformKsmps()

int CsoundUnity.PerformKsmps ( )

Process a ksmps-sized block of samples

Returns

◆ Remap()

static float CsoundUnity.Remap ( float  value,
float  from1,
float  to1,
float  from2,
float  to2,
bool  clamp = false 
)
static

map MYFLT within one range to another

Parameters
value
from1
to1
from2
to2
Returns

◆ RewindScore()

void CsoundUnity.RewindScore ( )

Rewinds a compiled Csound score to the time specified with SetScoreOffsetSeconds().

◆ SendScoreEvent()

void CsoundUnity.SendScoreEvent ( string  scoreEvent)

Send a score event to Csound in the form of "i1 0 10 ....

Parameters
scoreEventthe score string to send

◆ SetChannel()

void CsoundUnity.SetChannel ( string  channel,
MYFLT  val 
)

Sets a Csound channel. Used in connection with a chnget opcode in your Csound instrument.

Parameters
channel
val

◆ SetCsd()

void CsoundUnity.SetCsd ( string  guid)

Sets the csd file

Parameters
guidthe guid of the csd file asset

◆ SetGlobalEnv()

int CsoundUnity.SetGlobalEnv ( string  name,
string  value 
)

Set the global value of environment variable 'name' to 'value', or delete variable if 'value' is NULL. It is not safe to call this function while any Csound instances are active. See https://csound.com/docs/manual/CommandEnvironment.html for a list of the variables that can be used.

Parameters
nameThe name of the environment variable to set
valueThe value to set, ie a path
Returns
Returns zero on success.

◆ SetInputSample()

void CsoundUnity.SetInputSample ( int  frame,
int  channel,
MYFLT  sample 
)

Set a sample in Csound's input buffer

Parameters
frame
channel
sample

◆ SetParams()

void CsoundUnity.SetParams ( CsoundUnityBridge.CSOUND_PARAMS  parms)

◆ SetScoreOffsetSeconds()

void CsoundUnity.SetScoreOffsetSeconds ( MYFLT  value)

Csound score events prior to the specified time are not performed, and performance begins immediately at the specified time (real-time events will continue to be performed as they are received). Can be used by external software, such as a VST host, to begin score performance midway through a Csound score, for example to repeat a loop in a sequencer, or to synchronize other events with the Csound score.

Parameters
value

◆ SetStringChannel()

void CsoundUnity.SetStringChannel ( string  channel,
string  val 
)

Sets a string channel in Csound. Used in connection with a chnget opcode in your Csound instrument.

Parameters
channel
val

◆ SetTable()

void CsoundUnity.SetTable ( int  table,
int  index,
MYFLT  value 
)

Sets the value of a slot in a function table. The table number and index are assumed to be valid.

Parameters
table
index
value

Member Data Documentation

◆ csoundScore

string CsoundUnity.csoundScore

the score to send via editor

◆ environmentSettings

List<EnvironmentSettings> CsoundUnity.environmentSettings = new List<EnvironmentSettings>()

The list of the Environment Settings that will be set on start, using csoundSetGlobalEnv. Each setting can be used to specify the path of an environment variable. These settings will be applied to this CsoundUnity instance when the CsoundUnityBridge is created.

◆ logCsoundOutput

bool CsoundUnity.logCsoundOutput = false

If true, all Csound output messages will be sent to the Unity output console. Note that this can slow down performance if there is a lot of information being printed.

◆ loudVolumeWarning

bool CsoundUnity.loudVolumeWarning = true

If true it will print warnings in the console when the output volume is too high, and mute all the samples above the loudWarningThreshold value

◆ loudWarningThreshold

float CsoundUnity.loudWarningThreshold = 10f

The volume threshold at which a warning is output to the console, and audio output is filtered

◆ mute

bool CsoundUnity.mute = false

If true no audio is sent to output

◆ namedAudioChannelDataDict

readonly Dictionary<string, MYFLT[]> CsoundUnity.namedAudioChannelDataDict = new Dictionary<string, MYFLT[]>()

public named audio Channels shown in CsoundUnityChild inspector

◆ packageName

const string CsoundUnity.packageName = "com.csound.csoundunity"
static

The name of this package

◆ packageVersion

const string CsoundUnity.packageVersion = "3.3.1"
static

The version of this package

◆ processClipAudio

bool CsoundUnity.processClipAudio

If true Csound uses as an input the AudioClip attached to this AudioSource If false, no processing occurs on the attached AudioClip

Property Documentation

◆ availableAudioChannels

List<string> CsoundUnity.availableAudioChannels
get

list to hold available audioChannels names

◆ channels

List<CsoundChannelController> CsoundUnity.channels
get

list to hold channel data

◆ csoundFileGUID

string CsoundUnity.csoundFileGUID
get

the unique guid of the csd file

◆ csoundFileName

string CsoundUnity.csoundFileName
get

The file CsoundUnity will try to load. You can only load one file with each instance of CsoundUnity, but you can use as many instruments within that file as you wish.You may also create as many of CsoundUnity objects as you wish.

◆ csoundString

string CsoundUnity.csoundString
get

a string to hold all the csoundFile content

◆ IsInitialized

bool CsoundUnity.IsInitialized
get

Is Csound initialized?

◆ PerformanceFinished

bool CsoundUnity.PerformanceFinished
get

Event Documentation

◆ OnCsoundInitialized

CsoundInitialized CsoundUnity.OnCsoundInitialized

An event that will be executed when Csound is initialized


The documentation for this class was generated from the following file: