CsoundUnity 3.4.0
https://github.com/rorywalsh/CsoundUnity
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: 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...
 
int LoadPlugins (string dir)
 Loads all plugins from a given directory 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 SetChannel (CsoundChannelController channelController)
 Sets a Csound channel. Useful for setting presets at runtime. Used in connection with a chnget opcode in your Csound instrument. More...
 
void SetChannels (List< CsoundChannelController > channelControllers, bool excludeButtons=true)
 Sets a list of Csound channels. 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...
 
CsoundChannelController GetChannelController (string channel)
 Get a serialized CsoundChannelController More...
 
IDictionary< string, CsoundUnityBridge.ChannelInfoGetChannelList ()
 Blocking method to get a list of the channels from Csound, not from the serialized list of this instance. Provides a dictionary of all currently defined channels resulting from compilation of an orchestra containing channel definitions. Entries, keyed by name, are polymorphically assigned to their correct data type: control, audio, string, pvc.

Returns
A dictionary of all currently defined channels keyed by their name to its ChannelInfo
More...
 
MYFLT[] GetAudioChannel (string channel)
 Gets a Csound Audio channel. Used in connection with a chnset opcode in your Csound instrument. More...
 
int CreateFloatTable (int tableNumber, float[] samples)
 Creates a table with the supplied float samples. Can be called during performance. 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 CopyFloatTableIn (int table, float[] source)
 Same as CopyTableIn but passing a float array. 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 CopyTableIn 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 ()
 Fills in a provided raw CSOUND_PARAMS object with csounds current parameter settings. This method is used internally to manage this class and is not expected to be used directly by a host program. More...
 
void SetParams (CsoundUnityBridge.CSOUND_PARAMS parms)
 Transfers the contents of the provided raw CSOUND_PARAMS object into csound's internal data structues (chiefly its OPARMS structure). This method is used internally to manage this class and is not expected to be used directly by a host program. Most values are used and reflected in CSOUND_PARAMS. Internally to csound, as of release 6.0.0, Heartbeat and IsComputingOpcodeWeights are ignored and IsUsingCsdLineCounts can only be set and never reset once set. More...
 
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...
 
void SavePresetAsScriptableObject (string presetName, string path=null)
 Save a CsoundUnityPreset of this CsoundUnity instance at the specified path, using the specified presetName. The current csoundFileName and list of CsoundChannelControllers will be saved in the preset. If no presetName is given, a default one will be used. More...
 
void SavePresetAsJSON (string presetName, string path=null, bool overwriteIfExisting=false)
 Save a preset as JSON using CsoundChannelControllers and CsoundFileName from this CsoundUnity instance. See SavePresetAsJSON(CsoundUnityPreset, string, bool) More...
 
void SaveGlobalPreset (string presetName, string path=null, bool overwriteIfExisting=false)
 Save a serialized copy of this CsoundUnity instance. Similar behaviour as saving a Unity Preset from the inspector of the CsoundUnity component, but this can be used at runtime. More...
 
void ConvertPresetToScriptableObject (string path, string destination)
 Convert a JSON preset into a Scriptable Object preset to be written at the specified path. If path is empty the converted preset will be saved inside the Assets folder. More...
 
CsoundUnityPreset SetPreset (string presetName, string presetData)
 Set a CsoundUnityPreset to this CsoundUnity instance using a presetName and presetData. The set preset will be returned. More...
 
CsoundUnityPreset SetPreset (string presetData)
 Set a CsoundUnityPreset to this CsoundUnity instance using presetData. More...
 
void SetPreset (CsoundUnityPreset preset)
 Set a CsoundUnityPreset to this CsoundUnity instance. More...
 
CsoundUnity SetGlobalPreset (string presetName, string presetData)
 Set a global preset to this CsoundUnity instance using a presetName and presetData. More...
 
void LoadPreset (string path, Action< CsoundUnityPreset > onPresetLoaded=null)
 Loads a preset from a JSON file. The JSON file should represent a CsoundUnityPreset. More...
 
void LoadGlobalPreset (string path)
 Load a global preset on this CsoundUnity instance from a JSON file found at path. The JSON file should represent a Global Preset, ie a complete CsoundUnity instance. 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)
 Linear remap floats within one range to another More...
 
static float RemapTo0to1 (float value, float from, float to, float skew=1f)
 Remap a value to a normalized (0-1) value specifying its expected "from" and "to" values, and the skew of the exponential curve of the remapping. If skew is 1 the remapping is linear, if 0.5 it's exponential. More...
 
static float RemapFrom0to1 (float value, float from, float to, float skew=1f)
 Remap a normalized (0-1) value to a value in another range, specifying its "from" and "to" values, and the skew of the exponential curve of the remapping. If skew is 1 the remapping is linear, if 0.5 it's exponential. More...
 
static MYFLT[] ConvertToMYFLT (float[] samples)
 Utility method to create an array of MYFLTs from an array of floats More...
 
static float[] ConvertToFloat (MYFLT[] samples)
 Utility method to create an array of floats from an array of MYFLTs More...
 
static MYFLT[] GetStereoSamples (string source)
 Get an array of MYFLTs in from the AudioClip source from the Resources folder. The first index in the returned array will have its value set as 2 like the number of channels. See GetSamples More...
 
static float[] GetStereoFloatSamples (string source)
 Get an array of floats from the AudioClip source from the Resources folder. The first index in the returned array will have its value set as 2 like the number of channels. See GetSamples More...
 
static MYFLT[] GetMonoSamples (string source, int channelNumber)
 Get an array of MYFLTs from the AudioClip source from the Resources folder. No information about the channels will be added in the first element of the returned array. See GetSamples More...
 
static float[] GetMonoFloatSamples (string source, int channelNumber)
 Get an array of floats from the AudioClip source from the Resources folder. No information about the channels will be added in the first element of the returned array. See GetSamples More...
 
static MYFLT[] GetSamples (string source, int channelNumber=1, bool writeChannelData=false)
 Get Samples from a "Resources" 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 version to load very large files, or load from external paths 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. More...
 
static float[] GetFloatSamples (string source, int channelNumber=1, bool writeChannelData=false)
 Same as GetSamples but it will return a float array. More...
 
static IEnumerator GetSamples (string source, SamplesOrigin origin, Action< MYFLT[]> onSamplesLoaded)
 Async version of GetSamples More...
 
static MYFLT[] GetSamples (AudioClip audioClip)
 Get samples from an AudioClip as a MYFLT array. More...
 
static CsoundUnityPreset CreatePreset (string presetName, string csoundFileName, List< CsoundChannelController > channels)
 Create a CsoundUnityPreset from a presetName, csoundFileName and a list of CsoundChannelControllers More...
 
static CsoundUnityPreset CreatePreset (string presetName, string presetData)
 Create a CsoundUnityPreset from a presetName and presetData. More...
 
static void WritePreset (CsoundUnityPreset preset, string path)
 Write a CsoundUnityPreset at the specified path inside the Assets folder. You can pass a full path, the Assets folder path will be extracted. More...
 
static void SavePresetAsJSON (CsoundUnityPreset preset, string path=null, bool overwriteIfExisting=false)
 Save the specified CsoundUnityPreset as JSON, at the specified path. If a file exists at the specified path, it will be overwritten if overwriteIfExisting is true. More...
 
static void SavePresetAsJSON (List< CsoundChannelController > channels, string csoundFileName, string presetName, string path=null, bool overwriteIfExisting=false)
 Save a preset as JSON from a list of CsoundChannelController, specifying the related CsoundFileName and the presetName. See SavePresetAsJSON(CsoundUnityPreset, string, bool) More...
 
static List< CsoundUnityPresetParseSnap (string csdPath, string snapPath)
 Parse a Cabbage Snap and return a list of CsoundUnityPresets. 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.4.0"
 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]
 
string CurrentPreset [get]
 The current preset name. If empty, no preset has been set. More...
 

Events

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

Detailed Description

Csound Unity Class

Definition at line 270 of file CsoundUnity.cs.

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.

Definition at line 2363 of file CsoundUnity.cs.

◆ 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 

Definition at line 2466 of file CsoundUnity.cs.

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

Definition at line 941 of file CsoundUnity.cs.

◆ 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.

Definition at line 1749 of file CsoundUnity.cs.

◆ ClearSpin()

void CsoundUnity.ClearSpin ( )

Clears the input buffer (spin).

Definition at line 949 of file CsoundUnity.cs.

◆ CompiledWithoutError()

bool CsoundUnity.CompiledWithoutError ( )

Returns true if the csd file was compiled without errors.

Returns

Definition at line 578 of file CsoundUnity.cs.

◆ 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

Definition at line 655 of file CsoundUnity.cs.

◆ ConvertPresetToScriptableObject()

void CsoundUnity.ConvertPresetToScriptableObject ( string  path,
string  destination 
)

Convert a JSON preset into a Scriptable Object preset to be written at the specified path. If path is empty the converted preset will be saved inside the Assets folder.

Parameters
path

Definition at line 1998 of file CsoundUnity.cs.

◆ ConvertToFloat()

static float[] CsoundUnity.ConvertToFloat ( MYFLT[]  samples)
static

Utility method to create an array of floats from an array of MYFLTs

Parameters
samples
Returns

Definition at line 1485 of file CsoundUnity.cs.

◆ ConvertToMYFLT()

static MYFLT[] CsoundUnity.ConvertToMYFLT ( float[]  samples)
static

Utility method to create an array of MYFLTs from an array of floats

Parameters
samples
Returns

Definition at line 1469 of file CsoundUnity.cs.

◆ CopyFloatTableIn()

void CsoundUnity.CopyFloatTableIn ( int  table,
float[]  source 
)

Same as CopyTableIn but passing a float array.

Parameters
table
source

Definition at line 1233 of file CsoundUnity.cs.

◆ 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

Definition at line 1245 of file CsoundUnity.cs.

◆ CopyTableInAsync()

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

Asynchronous version of CopyTableIn

Parameters
table
source

Definition at line 1255 of file CsoundUnity.cs.

◆ 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

Definition at line 1213 of file CsoundUnity.cs.

◆ CopyTableOutAsync()

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

Asynchronous version of CopyTableOut.

Parameters
table
dest

Definition at line 1223 of file CsoundUnity.cs.

◆ CreateFloatTable()

int CsoundUnity.CreateFloatTable ( int  tableNumber,
float[]  samples 
)

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

Parameters
tableNumberThe table number
samples
Returns

Definition at line 1109 of file CsoundUnity.cs.

◆ CreatePreset() [1/2]

static CsoundUnityPreset CsoundUnity.CreatePreset ( string  presetName,
string  csoundFileName,
List< CsoundChannelController channels 
)
static

Create a CsoundUnityPreset from a presetName, csoundFileName and a list of CsoundChannelControllers

Parameters
presetName
csoundFileName
channels
Returns

Definition at line 1763 of file CsoundUnity.cs.

◆ CreatePreset() [2/2]

static CsoundUnityPreset CsoundUnity.CreatePreset ( string  presetName,
string  presetData 
)
static

Create a CsoundUnityPreset from a presetName and presetData.

PresetData should be a CsoundUnityPreset in the JSON format.

It will use the presetName parameter if not empty, if presetName is empty it will use preset.presetName, if also preset.presetName is empty it will use "CsoundUnityPreset" as a default name.

Parameters
presetName
presetData
Returns

Definition at line 1788 of file CsoundUnity.cs.

◆ 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

Definition at line 1122 of file CsoundUnity.cs.

◆ 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

Definition at line 1142 of file CsoundUnity.cs.

◆ 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.

Definition at line 1740 of file CsoundUnity.cs.

◆ Get0dbfs()

MYFLT CsoundUnity.Get0dbfs ( )

Get 0 dbfs

Returns

Definition at line 1387 of file CsoundUnity.cs.

◆ GetAPIVersion()

int CsoundUnity.GetAPIVersion ( )

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

Returns

Definition at line 559 of file CsoundUnity.cs.

◆ 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

Definition at line 1093 of file CsoundUnity.cs.

◆ GetChannel()

MYFLT CsoundUnity.GetChannel ( string  channel)

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

Parameters
channel
Returns

Definition at line 1055 of file CsoundUnity.cs.

◆ GetChannelController()

CsoundChannelController CsoundUnity.GetChannelController ( string  channel)

Get a serialized CsoundChannelController

Parameters
channelthe Channel name
Returns

Definition at line 1065 of file CsoundUnity.cs.

◆ 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. Provides a dictionary of all currently defined channels resulting from compilation of an orchestra containing channel definitions. Entries, keyed by name, are polymorphically assigned to their correct data type: control, audio, string, pvc.

Returns
A dictionary of all currently defined channels keyed by their name to its ChannelInfo

Returns

Definition at line 1079 of file CsoundUnity.cs.

◆ GetCurrentTimeSamples()

long CsoundUnity.GetCurrentTimeSamples ( )

Returns the current performance time in samples

Returns

Definition at line 1396 of file CsoundUnity.cs.

◆ GetEnv()

string CsoundUnity.GetEnv ( EnvType  envType)

Get Environment path.

Parameters
envTypethe type of the environment to get
Returns
the corresponding value or an empty string if no such key exists

Definition at line 1338 of file CsoundUnity.cs.

◆ GetFloatSamples()

static float[] CsoundUnity.GetFloatSamples ( string  source,
int  channelNumber = 1,
bool  writeChannelData = false 
)
static

Same as GetSamples but it will return a float array.

Parameters
source
channelNumber
writeChannelData
Returns

Definition at line 1603 of file CsoundUnity.cs.

◆ GetKr()

MYFLT CsoundUnity.GetKr ( )

Get the current control rate

Returns

Definition at line 704 of file CsoundUnity.cs.

◆ GetKsmps()

uint CsoundUnity.GetKsmps ( )

Get the number of audio sample frames per control sample.

Returns

Definition at line 722 of file CsoundUnity.cs.

◆ GetMonoFloatSamples()

static float[] CsoundUnity.GetMonoFloatSamples ( string  source,
int  channelNumber 
)
static

Get an array of floats from the AudioClip source from the Resources folder. No information about the channels will be added in the first element of the returned array. See GetSamples

Parameters
sourceThe name of the source to retrieve
Returns

Definition at line 1539 of file CsoundUnity.cs.

◆ GetMonoSamples()

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

Get an array of MYFLTs from the AudioClip source from the Resources folder. No information about the channels will be added in the first element of the returned array. See GetSamples

Parameters
sourceThe name of the source to retrieve
Returns

Definition at line 1527 of file CsoundUnity.cs.

◆ 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

Definition at line 1278 of file CsoundUnity.cs.

◆ 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

Definition at line 1288 of file CsoundUnity.cs.

◆ GetNchnls()

uint CsoundUnity.GetNchnls ( )

Get the number of output channels

Returns

Definition at line 1378 of file CsoundUnity.cs.

◆ GetNchnlsInputs()

uint CsoundUnity.GetNchnlsInputs ( )

Get the number of input channels

Returns

Definition at line 1369 of file CsoundUnity.cs.

◆ GetOpcodeList()

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

Get the Opcode List, blocking

Returns

Definition at line 1360 of file CsoundUnity.cs.

◆ GetOutputSample()

MYFLT CsoundUnity.GetOutputSample ( int  frame,
int  channel 
)

Get a sample from Csound's audio output buffer

Parameters
frame
channel
Returns

Definition at line 964 of file CsoundUnity.cs.

◆ GetParams()

CsoundUnityBridge.CSOUND_PARAMS CsoundUnity.GetParams ( )

Fills in a provided raw CSOUND_PARAMS object with csounds current parameter settings. This method is used internally to manage this class and is not expected to be used directly by a host program.

Parameters
oparmsa CSOUND_PARAMS structure to be filled in by csound
Returns
The same parameter structure that was provided but filled in with csounds current internal contents

Definition at line 1314 of file CsoundUnity.cs.

◆ GetSamples() [1/3]

static MYFLT[] CsoundUnity.GetSamples ( AudioClip  audioClip)
static

Get samples from an AudioClip as a MYFLT array.

Parameters
audioClip
Returns

Definition at line 1665 of file CsoundUnity.cs.

◆ GetSamples() [2/3]

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

Get Samples from a "Resources" 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 version to load very large files, or load from external paths 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
sourceThe path of the audio source relative to a "Resources" folder
channelNumberThe channel to read from the source
writeChannelData
Returns

Definition at line 1557 of file CsoundUnity.cs.

◆ GetSamples() [3/3]

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

Definition at line 1625 of file CsoundUnity.cs.

◆ GetSpin()

MYFLT[] CsoundUnity.GetSpin ( )

Get Csound's audio input buffer

Returns

Definition at line 973 of file CsoundUnity.cs.

◆ GetSpout()

MYFLT[] CsoundUnity.GetSpout ( )

Get Csound's audio output buffer

Returns

Definition at line 982 of file CsoundUnity.cs.

◆ GetSr()

MYFLT CsoundUnity.GetSr ( )

Get the current sample rate

Returns

Definition at line 695 of file CsoundUnity.cs.

◆ GetStereoFloatSamples()

static float[] CsoundUnity.GetStereoFloatSamples ( string  source)
static

Get an array of floats from the AudioClip source from the Resources folder. The first index in the returned array will have its value set as 2 like the number of channels. See GetSamples

Parameters
sourceThe name of the source to retrieve
Returns

Definition at line 1515 of file CsoundUnity.cs.

◆ GetStereoSamples()

static MYFLT[] CsoundUnity.GetStereoSamples ( string  source)
static

Get an array of MYFLTs in from the AudioClip source from the Resources folder. The first index in the returned array will have its value set as 2 like the number of channels. See GetSamples

Parameters
sourceThe name of the source to retrieve
Returns

Definition at line 1503 of file CsoundUnity.cs.

◆ 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

Definition at line 1177 of file CsoundUnity.cs.

◆ 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

Definition at line 1191 of file CsoundUnity.cs.

◆ 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

Definition at line 1154 of file CsoundUnity.cs.

◆ GetTableSample()

MYFLT CsoundUnity.GetTableSample ( int  tableNumber,
int  index 
)

Retrieves a single sample from a Csound function table.

Parameters
tableNumber
index
Returns

Definition at line 1165 of file CsoundUnity.cs.

◆ GetVersion()

int CsoundUnity.GetVersion ( )

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

Returns

Definition at line 550 of file CsoundUnity.cs.

◆ 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

Definition at line 1266 of file CsoundUnity.cs.

◆ LoadGlobalPreset()

void CsoundUnity.LoadGlobalPreset ( string  path)

Load a global preset on this CsoundUnity instance from a JSON file found at path. The JSON file should represent a Global Preset, ie a complete CsoundUnity instance.

This also sets the global preset, overriding the current content of this CsoundUnity instance.

This could have unintended consequences in certain situations. You could need to disable this CsoundUnity GameObject and enable it again to restore the Csound internal state.

Parameters
pathThe path must point to an existing JSON file

Definition at line 2145 of file CsoundUnity.cs.

◆ LoadPlugins()

int CsoundUnity.LoadPlugins ( string  dir)

Loads all plugins from a given directory

Parameters
dir
Returns

Definition at line 569 of file CsoundUnity.cs.

◆ LoadPreset()

void CsoundUnity.LoadPreset ( string  path,
Action< CsoundUnityPreset onPresetLoaded = null 
)

Loads a preset from a JSON file. The JSON file should represent a CsoundUnityPreset.

This doesn't set the preset.

You should use the Action to get the reference of the loaded preset. This is needed because of the async nature of this method, that uses a WebRequest on Android and iOS.

Example of usage:

LoadPreset("myPath/presetName.json", (loadedPreset) => { SetPreset(loadedPreset); });

Parameters
pathThe path must point to an existing JSON file

Definition at line 2105 of file CsoundUnity.cs.

◆ ParseCsdFile()

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

Parse the csd file

Parameters
filenamethe csd file to parse
Returns

Definition at line 769 of file CsoundUnity.cs.

◆ 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

Definition at line 736 of file CsoundUnity.cs.

◆ ParseSnap()

static List< CsoundUnityPreset > CsoundUnity.ParseSnap ( string  csdPath,
string  snapPath 
)
static

Parse a Cabbage Snap and return a list of CsoundUnityPresets.

Parameters
csdPath
snapPath
Returns

Definition at line 2171 of file CsoundUnity.cs.

◆ PerformKsmps()

int CsoundUnity.PerformKsmps ( )

Process a ksmps-sized block of samples

Returns

Definition at line 713 of file CsoundUnity.cs.

◆ Remap()

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

Linear remap floats within one range to another

Parameters
value
from1
to1
from2
to2
Returns

Definition at line 1410 of file CsoundUnity.cs.

◆ RemapFrom0to1()

static float CsoundUnity.RemapFrom0to1 ( float  value,
float  from,
float  to,
float  skew = 1f 
)
static

Remap a normalized (0-1) value to a value in another range, specifying its "from" and "to" values, and the skew of the exponential curve of the remapping. If skew is 1 the remapping is linear, if 0.5 it's exponential.

Parameters
value
from
to
skew
Returns

Definition at line 1452 of file CsoundUnity.cs.

◆ RemapTo0to1()

static float CsoundUnity.RemapTo0to1 ( float  value,
float  from,
float  to,
float  skew = 1f 
)
static

Remap a value to a normalized (0-1) value specifying its expected "from" and "to" values, and the skew of the exponential curve of the remapping. If skew is 1 the remapping is linear, if 0.5 it's exponential.

Parameters
value
from
to
skew
Returns

Definition at line 1429 of file CsoundUnity.cs.

◆ RewindScore()

void CsoundUnity.RewindScore ( )

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

Definition at line 673 of file CsoundUnity.cs.

◆ SaveGlobalPreset()

void CsoundUnity.SaveGlobalPreset ( string  presetName,
string  path = null,
bool  overwriteIfExisting = false 
)

Save a serialized copy of this CsoundUnity instance. Similar behaviour as saving a Unity Preset from the inspector of the CsoundUnity component, but this can be used at runtime.

Parameters
presetName

Definition at line 1974 of file CsoundUnity.cs.

◆ SavePresetAsJSON() [1/3]

static void CsoundUnity.SavePresetAsJSON ( CsoundUnityPreset  preset,
string  path = null,
bool  overwriteIfExisting = false 
)
static

Save the specified CsoundUnityPreset as JSON, at the specified path. If a file exists at the specified path, it will be overwritten if overwriteIfExisting is true.

Parameters
preset
path
overwriteIfExisting

Definition at line 1915 of file CsoundUnity.cs.

◆ SavePresetAsJSON() [2/3]

static void CsoundUnity.SavePresetAsJSON ( List< CsoundChannelController channels,
string  csoundFileName,
string  presetName,
string  path = null,
bool  overwriteIfExisting = false 
)
static

Save a preset as JSON from a list of CsoundChannelController, specifying the related CsoundFileName and the presetName. See SavePresetAsJSON(CsoundUnityPreset, string, bool)

Parameters
channels
csoundFileName
presetName
path
overwriteIfExisting

Definition at line 1942 of file CsoundUnity.cs.

◆ SavePresetAsJSON() [3/3]

void CsoundUnity.SavePresetAsJSON ( string  presetName,
string  path = null,
bool  overwriteIfExisting = false 
)

Save a preset as JSON using CsoundChannelControllers and CsoundFileName from this CsoundUnity instance. See SavePresetAsJSON(CsoundUnityPreset, string, bool)

Parameters
presetName
path
overwriteIfExisting

Definition at line 1959 of file CsoundUnity.cs.

◆ SavePresetAsScriptableObject()

void CsoundUnity.SavePresetAsScriptableObject ( string  presetName,
string  path = null 
)

Save a CsoundUnityPreset of this CsoundUnity instance at the specified path, using the specified presetName. The current csoundFileName and list of CsoundChannelControllers will be saved in the preset. If no presetName is given, a default one will be used.

Parameters
presetName
path

Definition at line 1900 of file CsoundUnity.cs.

◆ 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

Definition at line 664 of file CsoundUnity.cs.

◆ SetChannel() [1/2]

void CsoundUnity.SetChannel ( CsoundChannelController  channelController)

Sets a Csound channel. Useful for setting presets at runtime. Used in connection with a chnget opcode in your Csound instrument.

Parameters
channelController

Definition at line 1017 of file CsoundUnity.cs.

◆ SetChannel() [2/2]

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

Definition at line 995 of file CsoundUnity.cs.

◆ SetChannels()

void CsoundUnity.SetChannels ( List< CsoundChannelController channelControllers,
bool  excludeButtons = true 
)

Sets a list of Csound channels.

Parameters
channelControllers
excludeButtons

Definition at line 1030 of file CsoundUnity.cs.

◆ SetCsd()

void CsoundUnity.SetCsd ( string  guid)

Sets the csd file

Parameters
guidthe guid of the csd file asset

Definition at line 591 of file CsoundUnity.cs.

◆ 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.

Definition at line 1351 of file CsoundUnity.cs.

◆ SetGlobalPreset()

CsoundUnity CsoundUnity.SetGlobalPreset ( string  presetName,
string  presetData 
)

Set a global preset to this CsoundUnity instance using a presetName and presetData.

Preset data should represent a CsoundUnity instance in JSON format.

This overrides the current content of this CsoundUnity instance.

This could have unintended consequences in certain situations. You could need to disable this CsoundUnity GameObject and enable it again to restore the Csound internal state.

This updated CsoundUnity instance will be returned.

Parameters
presetName
presetData
Returns

Definition at line 2077 of file CsoundUnity.cs.

◆ SetInputSample()

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

Set a sample in Csound's input buffer

Parameters
frame
channel
sample

Definition at line 927 of file CsoundUnity.cs.

◆ SetParams()

void CsoundUnity.SetParams ( CsoundUnityBridge.CSOUND_PARAMS  parms)

Transfers the contents of the provided raw CSOUND_PARAMS object into csound's internal data structues (chiefly its OPARMS structure). This method is used internally to manage this class and is not expected to be used directly by a host program. Most values are used and reflected in CSOUND_PARAMS. Internally to csound, as of release 6.0.0, Heartbeat and IsComputingOpcodeWeights are ignored and IsUsingCsdLineCounts can only be set and never reset once set.

Parameters
parmsa

Definition at line 1328 of file CsoundUnity.cs.

◆ SetPreset() [1/3]

void CsoundUnity.SetPreset ( CsoundUnityPreset  preset)

Set a CsoundUnityPreset to this CsoundUnity instance.

If the preset csoundFileName is different from this CsoundUnity instance csoundFileName the preset will not be set and an error will be logged.

Parameters
preset

Definition at line 2049 of file CsoundUnity.cs.

◆ SetPreset() [2/3]

CsoundUnityPreset CsoundUnity.SetPreset ( string  presetData)

Set a CsoundUnityPreset to this CsoundUnity instance using presetData.

The set preset will be returned. The name of the preset will be the one found inside presetData, if not empty. Otherwise a default presetName will be used.

Preset data should represent a CsoundUnityPreset in JSON format.

If the preset csoundFileName is different from this CsoundUnity instance csoundFileName the preset will not be set and an error will be logged.

Parameters
presetData
Returns

Definition at line 2038 of file CsoundUnity.cs.

◆ SetPreset() [3/3]

CsoundUnityPreset CsoundUnity.SetPreset ( string  presetName,
string  presetData 
)

Set a CsoundUnityPreset to this CsoundUnity instance using a presetName and presetData. The set preset will be returned.

Preset data should represent a CsoundUnityPreset in JSON format.

If the preset csoundFileName is different from this CsoundUnity instance csoundFileName the preset will not be set and an error will be logged.

Parameters
presetName
presetData
Returns

Definition at line 2020 of file CsoundUnity.cs.

◆ 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

Definition at line 686 of file CsoundUnity.cs.

◆ 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

Definition at line 1045 of file CsoundUnity.cs.

◆ 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

Definition at line 1202 of file CsoundUnity.cs.

◆ WritePreset()

static void CsoundUnity.WritePreset ( CsoundUnityPreset  preset,
string  path 
)
static

Write a CsoundUnityPreset at the specified path inside the Assets folder. You can pass a full path, the Assets folder path will be extracted.

Parameters
preset
path

Definition at line 1815 of file CsoundUnity.cs.

Member Data Documentation

◆ csoundScore

string CsoundUnity.csoundScore

the score to send via editor

Definition at line 373 of file CsoundUnity.cs.

◆ 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.

Definition at line 382 of file CsoundUnity.cs.

◆ 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.

Definition at line 315 of file CsoundUnity.cs.

◆ 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

Definition at line 332 of file CsoundUnity.cs.

◆ loudWarningThreshold

float CsoundUnity.loudWarningThreshold = 10f

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

Definition at line 338 of file CsoundUnity.cs.

◆ mute

bool CsoundUnity.mute = false

If true no audio is sent to output

Definition at line 320 of file CsoundUnity.cs.

◆ namedAudioChannelDataDict

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

public named audio Channels shown in CsoundUnityChild inspector

Definition at line 353 of file CsoundUnity.cs.

◆ packageName

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

The name of this package

Definition at line 277 of file CsoundUnity.cs.

◆ packageVersion

const string CsoundUnity.packageVersion = "3.4.0"
static

The version of this package

Definition at line 282 of file CsoundUnity.cs.

◆ 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

Definition at line 326 of file CsoundUnity.cs.

Property Documentation

◆ availableAudioChannels

List<string> CsoundUnity.availableAudioChannels
get

list to hold available audioChannels names

Definition at line 348 of file CsoundUnity.cs.

◆ channels

List<CsoundChannelController> CsoundUnity.channels
get

list to hold channel data

Definition at line 343 of file CsoundUnity.cs.

◆ csoundFileGUID

string CsoundUnity.csoundFileGUID
get

the unique guid of the csd file

Definition at line 287 of file CsoundUnity.cs.

◆ 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.

Definition at line 294 of file CsoundUnity.cs.

◆ csoundString

string CsoundUnity.csoundString
get

a string to hold all the csoundFile content

Definition at line 299 of file CsoundUnity.cs.

◆ CurrentPreset

string CsoundUnity.CurrentPreset
get

The current preset name. If empty, no preset has been set.

Definition at line 387 of file CsoundUnity.cs.

◆ IsInitialized

bool CsoundUnity.IsInitialized
get

Is Csound initialized?

Definition at line 358 of file CsoundUnity.cs.

◆ PerformanceFinished

bool CsoundUnity.PerformanceFinished
get

Definition at line 369 of file CsoundUnity.cs.

Event Documentation

◆ OnCsoundInitialized

CsoundInitialized CsoundUnity.OnCsoundInitialized

An event that will be executed when Csound is initialized

Definition at line 367 of file CsoundUnity.cs.


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