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

Switch to Manual

A sequencer of notes over time that will send its note on/off events to a Sampler instance that is attatched to the same object. More...

Inheritance diagram for AudioHelm.SampleSequencer:
AudioHelm.Sequencer AudioHelm.NoteHandler

Public Member Functions

override void AllNotesOff ()
 Triggers note off events for all notes currently on in the referenced Sampler. More...
 
override void NoteOn (int note, float velocity=1.0f)
 Triggers a note on event for the referenced sampler. If the AudioSource is set to loop, you must trigger a note off event later for this note by calling NoteOff. More...
 
override void NoteOff (int note)
 Triggers a note off event for the referenced Sampler. More...
 
override void StartOnNextCycle ()
 Starts the sequencer on the start next cycle. This is useful if you have multiple synced sequencers and you want to start this one on the next go around. More...
 
- Public Member Functions inherited from AudioHelm.Sequencer
delegate void NoteAction (Note note)
 A note event. More...
 
delegate void BeatAction (int index)
 A beat event. More...
 
void StartScheduled (double dspTime)
 
void OnBeforeSerialize ()
 
void OnAfterDeserialize ()
 
virtual IntPtr Reference ()
 Reference to the native sequencer instance memory (if any). More...
 
float GetDivisionLength ()
 Gets the length of the division measured in sixteenth notes. More...
 
void NotifyNoteKeyChanged (Note note, int oldKey)
 Notifies the sequencer of a change to the key of one of the notes. More...
 
void NotifyNoteStartChanged (Note note, float oldStart)
 Notifies the sequencer of a change to one of the note start positions. More...
 
void NotifyNoteEndChanged (Note note, float oldEnd)
 Notifies the sequencer of a change to one of the note end positions. More...
 
void RemoveNote (Note note)
 Removes a note from the sequencer. More...
 
bool NoteExistsInRange (int note, float start, float end)
 Check if a note exists within a given range in the sequencer. More...
 
Note GetNoteInRange (int note, float start, float end, Note ignore=null)
 Gets the first note in a given range in the sequencer. More...
 
List< NoteGetAllNoteOnsInRange (float start, float end)
 Get all Note objects that have a note on in the given range in this sequencer. More...
 
List< NoteGetAllNoteOffsInRange (float start, float end)
 Get all Note objects that have a note off in the given range in this sequencer. More...
 
void RemoveNotesInRange (int note, float start, float end)
 Removes all notes that overlap a given range. More...
 
void RemoveNotesContainedInRange (int note, float start, float end, Note ignore=null)
 Removes all notes that are fully contained in a given range. More...
 
void ClampNotesInRange (int note, float start, float end, Note ignore=null)
 Removes all notes that are fully contained and trim notes that partially overlap range by removing the time inside the range. More...
 
Note AddNote (int note, float start, float end, float velocity=1.0f)
 Add a note to the sequencer. More...
 
void ReadMidiFile (Stream midiStream)
 Read a MIDI file's tracks into this sequencer. Currently in Beta. This may not work for all MIDI files or as expected. More...
 
void ReadMidiFile (MidiFile midiFile)
 Read a MIDI file object into this sequencer. Currently in Beta. This may not work for all MIDI files or as expected. More...
 
void Clear ()
 Clear the sequencer of all notes. More...
 
float GetSixteenthTime ()
 Gets the time in seconds of a single sixteenth note in the sequencer. More...
 
double GetSequencerPosition ()
 Gets the current position of the sequencer measured in sixteenth notes. More...
 

Protected Member Functions

override void OnEnable ()
 
override void OnDisable ()
 
- Protected Member Functions inherited from AudioHelm.Sequencer
void RemoveSortedNoteEvents (Note note)
 
void AddSortedNoteEvents (Note note)
 
void InitNoteRows ()
 
double GetSequencerTime ()
 
void UpdateBeatTime ()
 
void UpdatePosition ()
 Update the position of the sequencer and fire any events that have occurred. More...
 

Additional Inherited Members

- Public Types inherited from AudioHelm.Sequencer
enum  Division { kEighth, kSixteenth, kTriplet, kThirtySecond }
 Possible divisions of the sequencer UI. More...
 
- Public Attributes inherited from AudioHelm.Sequencer
NoteEvent noteOnEvent
 UnityEvent hook for a note on. More...
 
NoteEvent noteOffEvent
 UnityEvent hook for a note off. More...
 
BeatEvent beatEvent
 UnityEvent hook for a beat. Depends on the division setting of the seqeuncer. More...
 
int length = 16
 The length of the sequence measured in sixteenth notes. More...
 
int currentIndex = -1
 The current index position measured in the division of the sequencer. More...
 
NoteRow [] allNotes = new NoteRow[Utils.kMidiSize]
 All notes in the seqeuncer. More...
 
Vector2 scrollPosition = Vector2.zero
 The x/y scroll position of the inspector sequencer piano roll. More...
 
bool autoScroll = false
 Should the inspector window scroll with playback. More...
 
Division division = Division.kSixteenth
 How often a bar or a division is placed in the sequencer inspector view. More...
 
float zoom = 0.3f
 The smallest width to draw a sequencer beat in the inspector More...
 
- Protected Attributes inherited from AudioHelm.Sequencer
double beatTime = 0.0
 
- Events inherited from AudioHelm.Sequencer
NoteAction OnNoteOn
 Event hook for a note on event. More...
 
NoteAction OnNoteOff
 Event hook for a note off event. More...
 
BeatAction OnBeat
 Event hook for a beat event. More...
 

Detailed Description

Switch to Manual

A sequencer of notes over time that will send its note on/off events to a Sampler instance that is attatched to the same object.

Member Function Documentation

◆ AllNotesOff()

override void AudioHelm.SampleSequencer.AllNotesOff ( )
virtual

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

Implements AudioHelm.Sequencer.

◆ NoteOff()

override void AudioHelm.SampleSequencer.NoteOff ( int  note)
virtual

Triggers a note off event for the referenced Sampler.

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

Implements AudioHelm.Sequencer.

◆ NoteOn()

override void AudioHelm.SampleSequencer.NoteOn ( int  note,
float  velocity = 1.0f 
)
virtual

Triggers a note on event for the referenced 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.Sequencer.

◆ StartOnNextCycle()

override void AudioHelm.SampleSequencer.StartOnNextCycle ( )
virtual

Starts the sequencer on the start next cycle. This is useful if you have multiple synced sequencers and you want to start this one on the next go around.

Implements AudioHelm.Sequencer.


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