Audio Helm
1.0
Live audio synthesis, sequencing and sampling for Unity
|
A series of notes and velocities on a timeline that can be used to trigger synth or sampler notes. More...
Classes | |
class | BeatEvent |
class | NoteEvent |
Public Types | |
enum | Division { kEighth, kSixteenth, kTriplet, kThirtySecond } |
Possible divisions of the sequencer UI. More... | |
Public Member Functions | |
delegate void | NoteAction (Note note) |
A note event. More... | |
delegate void | BeatAction (int index) |
A beat event. More... | |
abstract void | AllNotesOff () |
Triggers note off events for all notes currently on in the instrument. More... | |
abstract void | NoteOn (int note, float velocity=1.0f) |
Triggers a note on event for the instrument. More... | |
abstract void | NoteOff (int note) |
Triggers a note off event for the instrument. More... | |
void | StartScheduled (double dspTime) |
abstract 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... | |
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< Note > | GetAllNoteOnsInRange (float start, float end) |
Get all Note objects that have a note on in the given range in this sequencer. More... | |
List< Note > | GetAllNoteOffsInRange (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... | |
Public Attributes | |
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 Member Functions | |
virtual void | OnEnable () |
virtual void | OnDisable () |
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... | |
Protected Attributes | |
double | beatTime = 0.0 |
Events | |
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... | |
A series of notes and velocities on a timeline that can be used to trigger synth or sampler notes.
|
strong |
Possible divisions of the sequencer UI.
Note AudioHelm.Sequencer.AddNote | ( | int | note, |
float | start, | ||
float | end, | ||
float | velocity = 1.0f |
||
) |
Add a note to the sequencer.
note | The MIDI note. |
start | The start of the note measured in sixteenths. |
end | The end of the note measured in sixteenths. |
velocity | The velocity of the note (how hard the key is hit). |
|
pure virtual |
Triggers note off events for all notes currently on in the instrument.
Implements AudioHelm.NoteHandler.
Implemented in AudioHelm.HelmSequencer, and AudioHelm.SampleSequencer.
delegate void AudioHelm.Sequencer.BeatAction | ( | int | index | ) |
A beat event.
index | The current beat index. |
void AudioHelm.Sequencer.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.
note | The MIDI note to match. |
start | The start of the range measured in sixteenths. |
end | The end of the range measured in sixteenths. |
void AudioHelm.Sequencer.Clear | ( | ) |
Clear the sequencer of all notes.
List<Note> AudioHelm.Sequencer.GetAllNoteOffsInRange | ( | float | start, |
float | end | ||
) |
List<Note> AudioHelm.Sequencer.GetAllNoteOnsInRange | ( | float | start, |
float | end | ||
) |
float AudioHelm.Sequencer.GetDivisionLength | ( | ) |
Gets the length of the division measured in sixteenth notes.
Gets the first note in a given range in the sequencer.
note | The MIDI note to look for. |
start | The start of the range measured in sixteenths. |
end | The end of the range measured in sixteenths. |
ignore | A note to ignore if found. |
double AudioHelm.Sequencer.GetSequencerPosition | ( | ) |
Gets the current position of the sequencer measured in sixteenth notes.
float AudioHelm.Sequencer.GetSixteenthTime | ( | ) |
Gets the time in seconds of a single sixteenth note in the sequencer.
delegate void AudioHelm.Sequencer.NoteAction | ( | Note | note | ) |
A note event.
note | The Note object that triggered the event. |
bool AudioHelm.Sequencer.NoteExistsInRange | ( | int | note, |
float | start, | ||
float | end | ||
) |
Check if a note exists within a given range in the sequencer.
true
, if a note exists in the range, false
otherwise.note | The MIDI note to check the range in. |
start | The start of the range measured in sixteenths. |
end | The end of the range measured in sixteenths. |
|
pure virtual |
Triggers a note off event for the instrument.
note | The MIDI keyboard note to turn off. [0, 127] |
Implements AudioHelm.NoteHandler.
Implemented in AudioHelm.HelmSequencer, and AudioHelm.SampleSequencer.
|
pure virtual |
Triggers a note on event for the instrument.
note | The MIDI keyboard note to play. [0, 127] |
velocity | How hard you hit the key. [0.0, 1.0] |
Implements AudioHelm.NoteHandler.
Implemented in AudioHelm.HelmSequencer, and AudioHelm.SampleSequencer.
void AudioHelm.Sequencer.NotifyNoteEndChanged | ( | Note | note, |
float | oldEnd | ||
) |
Notifies the sequencer of a change to one of the note end positions.
note | The MIDI note that was changed. |
oldEnd | The previous end position of the note. |
void AudioHelm.Sequencer.NotifyNoteKeyChanged | ( | Note | note, |
int | oldKey | ||
) |
Notifies the sequencer of a change to the key of one of the notes.
note | The MIDI note that was changed. |
oldKey | The key the note used to be. |
void AudioHelm.Sequencer.NotifyNoteStartChanged | ( | Note | note, |
float | oldStart | ||
) |
Notifies the sequencer of a change to one of the note start positions.
note | The MIDI note that was changed. |
oldStart | The previous start position of the note. |
void AudioHelm.Sequencer.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.
midiStream | The MIDI file stream. |
void AudioHelm.Sequencer.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.
midiFile | The MIDI file object. |
|
virtual |
Reference to the native sequencer instance memory (if any).
Reimplemented in AudioHelm.HelmSequencer.
void AudioHelm.Sequencer.RemoveNote | ( | Note | note | ) |
Removes a note from the sequencer.
note | Note. |
void AudioHelm.Sequencer.RemoveNotesContainedInRange | ( | int | note, |
float | start, | ||
float | end, | ||
Note | ignore = null |
||
) |
Removes all notes that are fully contained in a given range.
note | The MIDI note to match. |
start | The start of the range measured in sixteenths. |
end | The end of the range measured in sixteenths. |
void AudioHelm.Sequencer.RemoveNotesInRange | ( | int | note, |
float | start, | ||
float | end | ||
) |
Removes all notes that overlap a given range.
note | The MIDI note to match. |
start | The start of the range measured in sixteenths. |
end | The end of the range measured in sixteenths. |
|
pure 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.
Implemented in AudioHelm.HelmSequencer, and AudioHelm.SampleSequencer.
|
protected |
Update the position of the sequencer and fire any events that have occurred.
bool AudioHelm.Sequencer.autoScroll = false |
Should the inspector window scroll with playback.
BeatEvent AudioHelm.Sequencer.beatEvent |
UnityEvent hook for a beat. Depends on the division setting of the seqeuncer.
int AudioHelm.Sequencer.currentIndex = -1 |
The current index position measured in the division of the sequencer.
Division AudioHelm.Sequencer.division = Division.kSixteenth |
How often a bar or a division is placed in the sequencer inspector view.
int AudioHelm.Sequencer.length = 16 |
The length of the sequence measured in sixteenth notes.
NoteEvent AudioHelm.Sequencer.noteOffEvent |
UnityEvent hook for a note off.
NoteEvent AudioHelm.Sequencer.noteOnEvent |
UnityEvent hook for a note on.
Vector2 AudioHelm.Sequencer.scrollPosition = Vector2.zero |
The x/y scroll position of the inspector sequencer piano roll.
float AudioHelm.Sequencer.zoom = 0.3f |
The smallest width to draw a sequencer beat in the inspector
BeatAction AudioHelm.Sequencer.OnBeat |
Event hook for a beat event.
NoteAction AudioHelm.Sequencer.OnNoteOff |
Event hook for a note off event.
NoteAction AudioHelm.Sequencer.OnNoteOn |
Event hook for a note on event.