ATK-Sharp  1.0
The ATK library for C#.
ATKSharp.Envelopes.BaseEnvelope Class Reference

The BaseEnvelope class. Contains the shared base functionality for envelopes. More...

Inheritance diagram for ATKSharp.Envelopes.BaseEnvelope:
ATKSharp.Generators.IGenerator ATKSharp.Modifiers.IModifier ATKSharp.Envelopes.CREnvelope ATKSharp.Envelopes.CTEnvelope

Public Member Functions

virtual float Generate ()
 Calculates and returns the next the envelope value. More...
 
virtual float Modify (float input)
 Multiplies the input by the envelope value. This may help simplify your code More...
 

Protected Member Functions

 BaseEnvelope (EnvelopeType envelopeType=EnvelopeType.ADSR, double attackTime=200, double decayTime=50, float sustainLevel=.01f, double releaseTime=400, ModeType mode=ModeType.ANALOG)
 Initializes a new instance of the BaseEnvelope class. More...
 

Properties

virtual EnvelopeType Type [get, set]
 Gets or sets the envelope type. (AR, ADSR, etc) More...
 
virtual double AttackTime [get, set]
 Gets or sets the envelope attack time (ms). More...
 
virtual double DecayTime [get, set]
 Gets or sets the envelope decay time (ms). More...
 
virtual float SustainLevel [get, set]
 Gets or sets the envelope sustain level (0 to 1). More...
 
virtual double ReleaseTime [get, set]
 Gets or sets the envelope release time (ms). More...
 
virtual ModeType Mode [get, protected set]
 Gets or sets the envelope mode. More...
 
virtual bool Legato [get, set]
 Gets or sets a value indicating whether this envelope is legato. Envelopes are in Legato mode by default, meaning that the level does not have to reach zero before the attack phase is reentered. When legato mode is false, the envelope will take a moment to reach zero before the next attack phase (In progress) More...
 
virtual int Gate [protected get, set]
 Gets or sets the envelope gate. More...
 
virtual EnvelopeState State [get, protected set]
 Gets or sets the envelope state. More...
 
virtual float CurrentSample [get, protected set]
 Gets or sets the current sample of the envelope. More...
 
- Properties inherited from ATKSharp.Generators.IGenerator
float CurrentSample [get]
 Gets the current sample of this generator. More...
 
- Properties inherited from ATKSharp.Modifiers.IModifier
float CurrentSample [get]
 Gets the current sample. More...
 

Detailed Description

The BaseEnvelope class. Contains the shared base functionality for envelopes.

Constructor & Destructor Documentation

◆ BaseEnvelope()

ATKSharp.Envelopes.BaseEnvelope.BaseEnvelope ( EnvelopeType  envelopeType = EnvelopeType.ADSR,
double  attackTime = 200,
double  decayTime = 50,
float  sustainLevel = .01f,
double  releaseTime = 400,
ModeType  mode = ModeType.ANALOG 
)
protected

Initializes a new instance of the BaseEnvelope class.

Parameters
envelopeTypeThe envelope type.
attackTimeThe envelope attack time (ms).
decayTimeThe envelope decay time (ms).
sustainLevelThe envelope sustain level (0-1).
releaseTimeThe envelope release time (ms).
modeThe envelope mode.

Member Function Documentation

◆ Generate()

virtual float ATKSharp.Envelopes.BaseEnvelope.Generate ( )
virtual

Calculates and returns the next the envelope value.

Returns
The envelope value.

Implements ATKSharp.Generators.IGenerator.

Reimplemented in ATKSharp.Envelopes.CREnvelope, and ATKSharp.Envelopes.CTEnvelope.

◆ Modify()

virtual float ATKSharp.Envelopes.BaseEnvelope.Modify ( float  input)
virtual

Multiplies the input by the envelope value. This may help simplify your code

Parameters
inputThe input.
Returns
The input signal multiplied by the envelope value.

Implements ATKSharp.Modifiers.IModifier.

Property Documentation

◆ AttackTime

virtual double ATKSharp.Envelopes.BaseEnvelope.AttackTime
getset

Gets or sets the envelope attack time (ms).

◆ CurrentSample

virtual float ATKSharp.Envelopes.BaseEnvelope.CurrentSample
getprotected set

Gets or sets the current sample of the envelope.

◆ DecayTime

virtual double ATKSharp.Envelopes.BaseEnvelope.DecayTime
getset

Gets or sets the envelope decay time (ms).

◆ Gate

virtual int ATKSharp.Envelopes.BaseEnvelope.Gate
protected getset

Gets or sets the envelope gate.

◆ Legato

virtual bool ATKSharp.Envelopes.BaseEnvelope.Legato
getset

Gets or sets a value indicating whether this envelope is legato. Envelopes are in Legato mode by default, meaning that the level does not have to reach zero before the attack phase is reentered. When legato mode is false, the envelope will take a moment to reach zero before the next attack phase (In progress)

◆ Mode

virtual ModeType ATKSharp.Envelopes.BaseEnvelope.Mode
getprotected set

Gets or sets the envelope mode.

◆ ReleaseTime

virtual double ATKSharp.Envelopes.BaseEnvelope.ReleaseTime
getset

Gets or sets the envelope release time (ms).

◆ State

virtual EnvelopeState ATKSharp.Envelopes.BaseEnvelope.State
getprotected set

Gets or sets the envelope state.

◆ SustainLevel

virtual float ATKSharp.Envelopes.BaseEnvelope.SustainLevel
getset

Gets or sets the envelope sustain level (0 to 1).

◆ Type

virtual EnvelopeType ATKSharp.Envelopes.BaseEnvelope.Type
getset

Gets or sets the envelope type. (AR, ADSR, etc)


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