Table of Contents

Class Synthesizer

Namespace
SunSharp
Assembly
SunSharp.dll

Project synthesizer, containing all the existing modules.

public class Synthesizer : ISynthesizer
Inheritance
object
Synthesizer
Implements

Properties

Output

public OutputModuleHandle Output { get; }

Property Value

OutputModuleHandle

Slot

Gets the slot this synthesizer belongs to.

public Slot Slot { get; }

Property Value

Slot

Methods

ConnectModule(SynthModuleHandle, SynthModuleHandle)

Connect the source module to the destination module.

public void ConnectModule(SynthModuleHandle source, SynthModuleHandle destination)

Parameters

source SynthModuleHandle

Source module number (0-based).

destination SynthModuleHandle

Destination module number (0-based).

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

ConnectModule(int, int)

Connect the source module to the destination module.

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

public SynthModuleHandle 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

SynthModuleHandle

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(SynthModuleHandle, SynthModuleHandle)

Disconnect the source module from the destination module.

public void DisconnectModule(SynthModuleHandle source, SynthModuleHandle destination)

Parameters

source SynthModuleHandle

Source module number (0-based).

destination SynthModuleHandle

Destination module number (0-based).

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

DisconnectModule(int, int)

Disconnect the source module from the destination module.

public void DisconnectModule(int sourceId, int destinationId)

Parameters

sourceId int
destinationId int

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<SynthModuleHandle> GetEnumerator()

Returns

IEnumerator<SynthModuleHandle>

An enumerator that can be used to iterate through the collection.

GetModule(int)

Returns a handle to the module with the specified ID. The underlying module may not exist.

public SynthModuleHandle GetModule(int moduleId)

Parameters

moduleId int

Returns

SynthModuleHandle

GetModuleExists(int)

Check if a module exists.

public bool GetModuleExists(int moduleId)

Parameters

moduleId int

module number (0-based).

Returns

bool

true if module exists.

Remarks

GetModuleFlags(int)

Get the module flags.

public 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).

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

public SynthModuleHandle 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

SynthModuleHandle

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.

public SynthModuleHandle 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

SynthModuleHandle

The number of the loaded module.

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

ArgumentNullException

Thrown if path is null.

RemoveModule(SynthModuleHandle)

Remove (delete) a module.

public void RemoveModule(SynthModuleHandle moduleHandle)

Parameters

moduleHandle SynthModuleHandle

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

RemoveModule(int)

Remove (delete) a module.

public void RemoveModule(int moduleId)

Parameters

moduleId int

module number (0-based).

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

TryGetModule(int, out SynthModuleHandle?)

Returns a handle to the module with the specified ID, if it exists.

public bool TryGetModule(int moduleId, out SynthModuleHandle? moduleHandle)

Parameters

moduleId int

module number (0-based).

moduleHandle SynthModuleHandle?

Returns

bool

true if module exists.

Remarks

TryGetModule(string, out SynthModuleHandle?)

Find a module by name.

public bool TryGetModule(string name, out SynthModuleHandle? moduleHandle)

Parameters

name string

Module name to search for.

moduleHandle SynthModuleHandle?

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.