Interface ISynthesizer
- Namespace
- SunSharp
- Assembly
- SunSharp.dll
Project synthesizer, containing all the existing modules.
public interface ISynthesizer
Properties
Output
IOutputModuleHandle Output { get; }
Property Value
Slot
Gets the slot this synthesizer belongs to.
ISlot Slot { get; }
Property Value
Methods
ConnectModule(ISynthModuleHandle, ISynthModuleHandle)
Connect the source module to the destination module.
void ConnectModule(ISynthModuleHandle source, ISynthModuleHandle destination)
Parameters
sourceISynthModuleHandleSource module number (0-based).
destinationISynthModuleHandleDestination module number (0-based).
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_connect_module(int, int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
ConnectModule(int, int)
Connect the source module to the destination module.
void ConnectModule(int sourceId, int destinationId)
Parameters
sourceIdintdestinationIdint
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_connect_module(int, int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
CreateModule(SynthModuleType, string, int, int, int)
Create a new module.
ISynthModuleHandle CreateModule(SynthModuleType type, string name, int x = 0, int y = 0, int z = 0)
Parameters
typeSynthModuleTypeType of module to create.
namestringName of the module.
xintX coordinate (0 to 1024, center: 512).
yintY coordinate (0 to 1024, center: 512).
zintLayer number (0 to 7).
Returns
- ISynthModuleHandle
The identifier of the newly created module (0-based).
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_new_module(int, IntPtr, IntPtr, int, int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
- ArgumentNullException
Thrown if
typeis null.- ArgumentOutOfRangeException
Thrown when the module type is not valid.
DisconnectModule(ISynthModuleHandle, ISynthModuleHandle)
Disconnect the source module from the destination module.
void DisconnectModule(ISynthModuleHandle source, ISynthModuleHandle destination)
Parameters
sourceISynthModuleHandleSource module number (0-based).
destinationISynthModuleHandleDestination module number (0-based).
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_disconnect_module(int, int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
DisconnectModule(int, int)
Disconnect the source module from the destination module.
void DisconnectModule(int sourceId, int destinationId)
Parameters
sourceIdintdestinationIdint
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_disconnect_module(int, int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
GetModule(int)
Returns a handle to the module with the specified ID. The underlying module may not exist.
ISynthModuleHandle GetModule(int moduleId)
Parameters
moduleIdint
Returns
GetModuleExists(int)
Check if a module exists.
bool GetModuleExists(int moduleId)
Parameters
moduleIdintmodule number (0-based).
Returns
- bool
true if module exists.
Remarks
GetModuleFlags(int)
Get the module flags.
ModuleFlags GetModuleFlags(int moduleId)
Parameters
moduleIdintmodule number (0-based).
Returns
- ModuleFlags
Module flags indicating existence, type, state, and connections.
Remarks
GetUpperModuleCount()
Get the upper limit of module count (one more than the highest module number).
int GetUpperModuleCount()
Returns
- int
Upper limit of module count.
Remarks
Exceptions
- SunVoxException
Thrown when the operation fails.
LoadModule(byte[], int, int, int)
Load a module or sample from memory. Supported file formats: sunsynth, xi, wav, aiff.
ISynthModuleHandle LoadModule(byte[] data, int x = 0, int y = 0, int z = 0)
Parameters
databyte[]Byte array with module data.
xintX coordinate (0 to 1024, center: 512).
yintY coordinate (0 to 1024, center: 512).
zintLayer number (0 to 7).
Returns
- ISynthModuleHandle
The number of the loaded module.
Remarks
Exceptions
- SunVoxException
Thrown when the operation fails.
- ArgumentNullException
Thrown if
datais null.
LoadModule(string, int, int, int)
Load a module or sample from file. Supported file formats: sunsynth, xi, wav, aiff.
ISynthModuleHandle LoadModule(string path, int x = 0, int y = 0, int z = 0)
Parameters
pathstringFile path (relative or absolute).
xintX coordinate (0 to 1024, center: 512).
yintY coordinate (0 to 1024, center: 512).
zintLayer number (0 to 7).
Returns
- ISynthModuleHandle
The number of the loaded module.
Remarks
Exceptions
- SunVoxException
Thrown when the operation fails.
- ArgumentNullException
Thrown if
pathis null.
RemoveModule(ISynthModuleHandle)
Remove (delete) a module.
void RemoveModule(ISynthModuleHandle moduleHandle)
Parameters
moduleHandleISynthModuleHandle
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_remove_module(int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
RemoveModule(int)
Remove (delete) a module.
void RemoveModule(int moduleId)
Parameters
moduleIdintmodule number (0-based).
Remarks
Requires LockSlot(int) / UnlockSlot(int).
Calls sv_remove_module(int, int).Exceptions
- SunVoxException
Thrown when the operation fails.
TryGetModule(int, out ISynthModuleHandle?)
Returns a handle to the module with the specified ID, if it exists.
bool TryGetModule(int moduleId, out ISynthModuleHandle? moduleHandle)
Parameters
moduleIdintmodule number (0-based).
moduleHandleISynthModuleHandle
Returns
- bool
true if module exists.
Remarks
TryGetModule(string, out ISynthModuleHandle?)
Find a module by name.
bool TryGetModule(string name, out ISynthModuleHandle? moduleHandle)
Parameters
namestringModule name to search for.
moduleHandleISynthModuleHandle
Returns
- bool
module number (0-based) if found.
Remarks
Calls sv_find_module(int, IntPtr).
Exceptions
- SunVoxException
Thrown when an error occurs during the search.
- ArgumentNullException
Thrown if
nameis null.