Class SampleProviderBase
Implements
Namespace: InsaneScatterbrain.RetroKit.Editor
Syntax
public abstract class SampleProviderBase : ISampleProvider
Properties
Name
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
SamplesPerWave
The number of samples that a completed wave consisted of during the last GetSamples call.
Declaration
protected float SamplesPerWave { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
GetSample(Int32, Int32)
Generates samples based on the given sample and tone indices.
Declaration
protected abstract float GetSample(int toneIndex, int sampleIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | toneIndex | The index of the tone in a sequence. |
System.Int32 | sampleIndex | The index of the sample within a tone. |
Returns
Type | Description |
---|---|
System.Single | The sample. |
GetSamples(SoundEffect)
Generates samples based on the given sound effect object.
Declaration
public float[] GetSamples(SoundEffect soundEffect)
Parameters
Type | Name | Description |
---|---|---|
SoundEffect | soundEffect | The sound effect. |
Returns
Type | Description |
---|---|
System.Single[] | The samples. |
GetSamples(Single, Single, Single, Int32)
Returns samples generated by the sample provider, based on the given pitch, duration, volume and tone index.
Declaration
public virtual float[] GetSamples(float pitch, float volume, float duration, int toneIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pitch | The pitch in Hertz. |
System.Single | volume | The volume. Where 0 is 0% and 1 is 100%. |
System.Single | duration | The length in seconds if the samples are played. |
System.Int32 | toneIndex | The index of the tone in a sequence of tones. |
Returns
Type | Description |
---|---|
System.Single[] | The samples. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()