Table of Contents

Interface IVirtualPattern

Namespace
SunSharp
Assembly
SunSharp.dll

Virtual, 16-track pattern for sending events to the engine.

public interface IVirtualPattern

Properties

Slot

Gets the slot this virtual pattern belongs to.

ISlot Slot { get; }

Property Value

ISlot

Methods

GetTicks()

Get the current system tick counter.

uint GetTicks()

Returns

uint

Remarks

SunVox engine uses system-provided time space, measured in system ticks (don't confuse it with the project ticks). System ticks are used for timing in functions like AudioCallback(float[], AudioChannels, int, uint) and SetEventTiming(int, int).

Calls sv_get_ticks().

GetTicksPerSecond()

Get the number of system ticks per second.

uint GetTicksPerSecond()

Returns

uint

Remarks

ResetEventTiming()

Reset the timestamp of events sent by SendEvent(int, int, PatternEvent). If timestamp is zero: event is heard as quickly as possible.

void ResetEventTiming()

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.

SendEvent(int, PatternEvent)

Send an event to the SunVox engine. Sends the specified pattern event to the given track. The event will be processed according to the last set timing.

void SendEvent(int track, PatternEvent e)

Parameters

track int

Track number within the virtual pattern.

e PatternEvent

Remarks

See Also

SendEvent(int, int, int, int, int, int)

Send an event to the SunVox engine. Sends the specified pattern event to the given track. The event will be processed according to the last set timing.

void SendEvent(int track, int nn = 0, int vv = 0, int mm = 0, int ccee = 0, int xxyy = 0)

Parameters

track int

Track number within the virtual pattern.

nn int

Note.

vv int

Velocity.

mm int

Module.

ccee int

Controller and effect.

xxyy int

Value.

Remarks

Consider using PatternEvent and the overload that accepts it for better readability.

Calls sv_send_event(int, int, int, int, int, int, int).

Exceptions

SunVoxException

Thrown when the operation fails.

SetEventTiming(int)

Set the timestamp of events sent by SendEvent(int, int, PatternEvent). Every event has a timestamp (when it was generated, e.g., key press time). If nonzero: event is heard at timestamp + sound latency * 2.

void SetEventTiming(int timestamp)

Parameters

timestamp int

Timestamp (in system ticks) for future events. If not zero, must be ≥ previous value for same slot. See GetTicks() and GetTicksPerSecond().

Remarks

Exceptions

SunVoxException

Thrown when the operation fails.