Table of Contents

Interface ISynthesizer

Namespace
SunSharp
Assembly
SunSharp.dll

Project synthesizer, containing all the existing modules.

public interface ISynthesizer

Properties

Output

IOutputModuleHandle Output { get; }

Property Value

IOutputModuleHandle

Slot

Gets the slot this synthesizer belongs to.

ISlot Slot { get; }

Property Value

ISlot

Methods

ConnectModule(ISynthModuleHandle, ISynthModuleHandle)

Connect the source module to the destination module.

void ConnectModule(ISynthModuleHandle source, ISynthModuleHandle destination)

Parameters

source ISynthModuleHandle

Source module number (0-based).

destination ISynthModuleHandle

Destination module number (0-based).

Remarks

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

sourceId int
destinationId int

Remarks

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

type SynthModuleType

Type of module to create.

name string

Name of the module.

x int

X coordinate (0 to 1024, center: 512).

y int

Y coordinate (0 to 1024, center: 512).

z int

Layer number (0 to 7).

Returns

ISynthModuleHandle

The identifier of the newly created module (0-based).

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

ArgumentNullException

Thrown if type is 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

source ISynthModuleHandle

Source module number (0-based).

destination ISynthModuleHandle

Destination module number (0-based).

Remarks

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

sourceId int
destinationId int

Remarks

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

moduleId int

Returns

ISynthModuleHandle

GetModuleExists(int)

Check if a module exists.

bool GetModuleExists(int moduleId)

Parameters

moduleId int

module number (0-based).

Returns

bool

true if module exists.

Remarks

GetModuleFlags(int)

Get the module flags.

ModuleFlags GetModuleFlags(int moduleId)

Parameters

moduleId int

module 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

data byte[]

Byte array with module data.

x int

X coordinate (0 to 1024, center: 512).

y int

Y coordinate (0 to 1024, center: 512).

z int

Layer number (0 to 7).

Returns

ISynthModuleHandle

The number of the loaded module.

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

ArgumentNullException

Thrown if data is 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

path string

File path (relative or absolute).

x int

X coordinate (0 to 1024, center: 512).

y int

Y coordinate (0 to 1024, center: 512).

z int

Layer number (0 to 7).

Returns

ISynthModuleHandle

The number of the loaded module.

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

ArgumentNullException

Thrown if path is null.

RemoveModule(ISynthModuleHandle)

Remove (delete) a module.

void RemoveModule(ISynthModuleHandle moduleHandle)

Parameters

moduleHandle ISynthModuleHandle

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

RemoveModule(int)

Remove (delete) a module.

void RemoveModule(int moduleId)

Parameters

moduleId int

module number (0-based).

Remarks

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

moduleId int

module number (0-based).

moduleHandle ISynthModuleHandle

Returns

bool

true if module exists.

Remarks

TryGetModule(string, out ISynthModuleHandle?)

Find a module by name.

bool TryGetModule(string name, out ISynthModuleHandle? moduleHandle)

Parameters

name string

Module name to search for.

moduleHandle ISynthModuleHandle

Returns

bool

module number (0-based) if found.

Remarks

Exceptions

SunVoxException

Thrown when an error occurs during the search.

ArgumentNullException

Thrown if name is null.