Audio Helm  1.0
Live audio synthesis, sequencing and sampling for Unity
AudioHelm.Sampler Class Reference

Switch to Manual

The Sampler is a type of instrument that has a collection of audio samples to play and will play them at different rates to change the pitch for different notes. A list of keyzones define what samples play when what notes are hit. More...

Inheritance diagram for AudioHelm.Sampler:
AudioHelm.NoteHandler

Public Member Functions

Keyzone AddKeyzone ()
 Adds an empty keyzone to the Sampler. More...
 
int RemoveKeyzone (Keyzone keyzone)
 Removes a keyzone from the Sampler. More...
 
int GetMinKey ()
 Gets the lowest midi key that the sampler responds to. More...
 
int GetMaxKey ()
 Gets the highest midi key that the sampler responds to. More...
 
void AllNotesOff ()
 Triggers note off events for all notes currently on in the sampler. More...
 
void NoteOn (int note, float velocity=1.0f)
 Triggers a note on event for the Sampler. If the AudioSource is set to loop, you must trigger a note off event later for this note by calling NoteOff. More...
 
void NoteOnScheduled (int note, float velocity, double timeToStart, double timeToEnd)
 Triggers a note on event for the Sampler at the givent time and turns it off at the given time. More...
 
void NoteOff (int note)
 Triggers a note off event for the Sampler. More...
 

Public Attributes

List< Keyzonekeyzones = new List<Keyzone>() { new Keyzone() }
 List of all the keyzones in the sampler. More...
 
float velocityTracking = 1.0f
 How much the velocity of a note on event affects the volume of the samples. 0.0 for no effect and 1.0 for full effect. More...
 
int numVoices = 8
 Total number of concurrently playing sounds from this Sampler (polyphony). Increase this if your voices are cutting out from new voices coming in. More...
 

Properties

bool useNoteOff [get, set]
 Does a voice silence when it gets a note off event? More...
 

Detailed Description

Switch to Manual

The Sampler is a type of instrument that has a collection of audio samples to play and will play them at different rates to change the pitch for different notes. A list of keyzones define what samples play when what notes are hit.

Member Function Documentation

◆ AddKeyzone()

Keyzone AudioHelm.Sampler.AddKeyzone ( )

Adds an empty keyzone to the Sampler.

Returns
The keyzone created.

◆ AllNotesOff()

void AudioHelm.Sampler.AllNotesOff ( )

Triggers note off events for all notes currently on in the sampler.

Implements AudioHelm.NoteHandler.

◆ GetMaxKey()

int AudioHelm.Sampler.GetMaxKey ( )

Gets the highest midi key that the sampler responds to.

Returns
The highest valid midi key.

◆ GetMinKey()

int AudioHelm.Sampler.GetMinKey ( )

Gets the lowest midi key that the sampler responds to.

Returns
The lowest valid midi key.

◆ NoteOff()

void AudioHelm.Sampler.NoteOff ( int  note)

Triggers a note off event for the Sampler.

Parameters
noteThe MIDI keyboard note to turn off. [0, 127]

Implements AudioHelm.NoteHandler.

◆ NoteOn()

void AudioHelm.Sampler.NoteOn ( int  note,
float  velocity = 1.0f 
)

Triggers a note on event for the Sampler. If the AudioSource is set to loop, you must trigger a note off event later for this note by calling NoteOff.

Parameters
noteThe MIDI keyboard note to play. [0, 127]
velocityHow hard you hit the key. [0.0, 1.0]

Implements AudioHelm.NoteHandler.

◆ NoteOnScheduled()

void AudioHelm.Sampler.NoteOnScheduled ( int  note,
float  velocity,
double  timeToStart,
double  timeToEnd 
)

Triggers a note on event for the Sampler at the givent time and turns it off at the given time.

Parameters
noteThe MIDI keyboard note to play. [0, 127]
velocityHow hard you hit the key. [0.0, 1.0]
timeToStartDSP time to start the note.
timeToEndDSP time to end the note.

◆ RemoveKeyzone()

int AudioHelm.Sampler.RemoveKeyzone ( Keyzone  keyzone)

Removes a keyzone from the Sampler.

Returns
The removed keyzones index. -1 if it doesnt exist.
Parameters
keyzoneThe keyzone to remove.

Member Data Documentation

◆ keyzones

List<Keyzone> AudioHelm.Sampler.keyzones = new List<Keyzone>() { new Keyzone() }

List of all the keyzones in the sampler.

◆ numVoices

int AudioHelm.Sampler.numVoices = 8

Total number of concurrently playing sounds from this Sampler (polyphony). Increase this if your voices are cutting out from new voices coming in.

◆ velocityTracking

float AudioHelm.Sampler.velocityTracking = 1.0f

How much the velocity of a note on event affects the volume of the samples. 0.0 for no effect and 1.0 for full effect.

Property Documentation

◆ useNoteOff

bool AudioHelm.Sampler.useNoteOff
getset

Does a voice silence when it gets a note off event?


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