Public Types | Public Member Functions | Static Public Member Functions | List of all members
HiseEvent Class Reference

The event type of HISE. More...

Public Types

enum  Type : uint8 {
  Empty = 0, NoteOn, NoteOff, Controller,
  PitchBend, Aftertouch, AllNotesOff, SongPosition,
  MidiStart, MidiStop, VolumeFade, PitchFade,
  TimerEvent, ProgramChange
}
 The type of the event. More...
 

Public Member Functions

void addToTimeStamp (int16 delta) noexcept
 Adds the delta value to the timestamp. More...
 
int getAfterTouchValue () const noexcept
 Copied from MidiMessage. More...
 
int getChannel () const noexcept
 Returns the MIDI channel. More...
 
int getChannelPressureValue () const noexcept
 Copied from MidiMessage. More...
 
int getCoarseDetune () const noexcept
 Returns the coarse detune amount in semitones. More...
 
int getControllerNumber () const noexcept
 Copied from MidiMessage. More...
 
int getControllerValue () const noexcept
 Copied from MidiMessage. More...
 
uint16 getEventId () const noexcept
 Returns the event ID of the message. More...
 
int getFadeTime () const noexcept
 Returns the fade time for both pitch and volume fades. More...
 
int getFineDetune () const noexcept
 Returns the fine detune amount int cents. More...
 
float getFloatVelocity () const noexcept
 Copied from MidiMessage. More...
 
int getGain () const noexcept
 returns the gain in decibels. More...
 
float getGainFactor () const noexcept
 Returns the gain factor (from 0...1) for the given event. More...
 
int getNoteNumber () const noexcept
 Copied from MidiMessage. More...
 
double getPitchFactorForEvent () const
 Returns a ready to use pitch factor (from 0.5 ... More...
 
int getPitchWheelValue () const noexcept
 Copied from MidiMessage. More...
 
int getProgramChangeNumber () const noexcept
 Copied from MidiMessage. More...
 
int getSongPositionPointerMidiBeat () const noexcept
 Copied from MidiMessage. More...
 
uint16 getStartOffset () const noexcept
 Returns the start offset of the event. More...
 
int getTimerIndex () const noexcept
 Returns the index of the timer slot. More...
 
uint16 getTimeStamp () const noexcept
 Returns the timestamp of the message. More...
 
int getTransposeAmount () const noexcept
 Returns the transpose amount. More...
 
Type getType () const noexcept
 Returns the Type of the HiseEvent. More...
 
String getTypeAsString () const noexcept
 Returns a String representation of the type. More...
 
uint8 getVelocity () const noexcept
 Copied from MidiMessage. More...
 
 HiseEvent ()
 Creates an empty HiseEvent. More...
 
 HiseEvent (const MidiMessage &message)
 Creates a HiseEvent from a MIDI message. More...
 
 HiseEvent (Type type_, uint8 number_, uint8 value_, uint8 channel_=1)
 Creates a HiseEvent with the given data. More...
 
 HiseEvent (const HiseEvent &other) noexcept
 Creates a bit-wise copy of another event. More...
 
void ignoreEvent (bool shouldBeIgnored) noexcept
 Ignores the event. More...
 
bool isAftertouch () const noexcept
 Copied from MidiMessage. More...
 
bool isAllNotesOff () const noexcept
 Copied from MidiMessage. More...
 
bool isArtificial () const noexcept
 Returns true if this method was created artificially. More...
 
bool isChannelPressure () const noexcept
 Copied from MidiMessage. More...
 
bool isController () const noexcept
 Copied from MidiMessage. More...
 
bool isControllerOfType (int controllerType) const noexcept
 Copied from MidiMessage. More...
 
bool isEmpty () const noexcept
 Returns true if the HiseEvent is empty. More...
 
bool isIgnored () const noexcept
 Checks if the message was marked as ignored (by a script). More...
 
bool isMidiStart () const noexcept
 Copied from MidiMessage. More...
 
bool isMidiStop () const noexcept
 Copied from MidiMessage. More...
 
bool isNoteOff () const noexcept
 Copied from MidiMessage. More...
 
bool isNoteOn (bool returnTrueForVelocity0=false) const noexcept
 Copied from MidiMessage. More...
 
bool isNoteOnOrOff () const noexcept
 Copied from MidiMessage. More...
 
bool isPitchFade () const noexcept
 Returns true if the event is a pitch fade. More...
 
bool isPitchWheel () const noexcept
 Copied from MidiMessage. More...
 
bool isProgramChange () const noexcept
 Copied from MidiMessage. More...
 
bool isSongPositionPointer () const noexcept
 Copied from MidiMessage. More...
 
bool isTimerEvent () const noexcept
 Returns true if the event is a timer event. More...
 
bool isVolumeFade () const noexcept
 Returns true if the event is a volume fade. More...
 
bool operator== (const HiseEvent &other) const
 checks whether the event is equal to another. More...
 
void setAfterTouchValue (int noteNumber, int aftertouchAmount) noexcept
 Copied from MidiMessage. More...
 
void setArtificial () noexcept
 If the event was created artificially by a MIDI Processor, it will call this method. More...
 
void setChannel (int newChannelNumber) noexcept
 Sets the MIDI channel. More...
 
void setChannelPressureValue (int pressure) noexcept
 Copied from MidiMessage. More...
 
void setCoarseDetune (int semiToneDetune) noexcept
 Sets the coarse detune amount in semitones. More...
 
void setControllerNumber (int controllerNumber) noexcept
 Copied from MidiMessage. More...
 
void setControllerValue (int controllerValue) noexcept
 Copied from MidiMessage. More...
 
void setEventId (uint16 newEventId) noexcept
 Sets the event ID of the HiseEvent. More...
 
void setFadeTime (int fadeTime) noexcept
 Sets the fade time for the event type. More...
 
void setFineDetune (int newCents) noexcept
 Sets the fine detune amount in cents. More...
 
void setGain (int decibels) noexcept
 Sets the gain in decibels for this note. More...
 
void setNoteNumber (int newNoteNumber) noexcept
 Copied from MidiMessage. More...
 
void setPitchWheelValue (int position) noexcept
 Copied from MidiMessage. More...
 
void setSongPositionValue (int positionInMidiBeats)
 Copied from MidiMessage. More...
 
void setStartOffset (uint16 startOffset) noexcept
 Adds a offset to the event. More...
 
void setTimeStamp (int newTimestamp) noexcept
 Sets the timestamp to a sample offset in the future. More...
 
void setTransposeAmount (int newTransposeValue) noexcept
 Sets the transpose amount of the given event ID. More...
 
void setType (Type t) noexcept
 Changes the type. More...
 
void setVelocity (uint8 newVelocity) noexcept
 Copied from MidiMessage. More...
 
void swapWith (HiseEvent &other)
 Swaps the event with another. More...
 

Static Public Member Functions

static void clear (HiseEvent *eventToClear, int numEvents=1)
 This clears the events using the fast memset operation. More...
 
static HiseEvent createPitchFade (uint16 eventId, int fadeTimeMilliseconds, int8 coarseTune, int8 fineTune)
 Creates a pitch fade. More...
 
static HiseEvent createTimerEvent (uint8 timerIndex, uint16 offset)
 Creates a timer event. More...
 
static HiseEvent createVolumeFade (uint16 eventId, int fadeTimeMilliseconds, int8 targetValue)
 Creates a volume fade. More...
 

Detailed Description

The event type of HISE.

This is an enhancement of the MIDI Standard and is used for all internal events in the audio path of HISE.

The MIDI standard (and its implementation of JUCE) have a few limitations and misses some convenient data. Therefore, a new event type was introduced, with the following additions:

Most of its methods aim to be fully compatible to the juce::MidiMessage class, so if you're used to this class, you will find your way around this class pretty quickly.

Member Enumeration Documentation

enum Type : uint8
strong

The type of the event.

The most important MIDI types are there, but there are a few more interesting types for internal HISE stuff.

Enumerator
Empty 

an empty event (as created by the default constructor)

NoteOn 

a note on event (which will get a unique EventID upon creation).

NoteOff 

a note-off event (with the same EventID as its corresponding note-on)

Controller 

a MIDI CC message

PitchBend 

a 14-bit pitch-bend message

Aftertouch 

an aftertouch message (both channel aftertouch and polyphonic aftertouch)

AllNotesOff 

an all notes off message.

SongPosition 

the position of the DAW transport

MidiStart 

indicated the start of the playback in the DAW

MidiStop 

indicates the stop of the DAW playback

VolumeFade 

a volume fade that is applied to all voices started with the given EventID

PitchFade 

a pitch fade that is applied to all voices started with the given EventID

TimerEvent 

this event will fire the onTimer callback of MIDI Processors.

ProgramChange 

the MIDI ProgramChange message.

Constructor & Destructor Documentation

HiseEvent ( )
inline

Creates an empty HiseEvent.

HiseEvent ( const MidiMessage &  message)

Creates a HiseEvent from a MIDI message.

HiseEvent ( Type  type_,
uint8  number_,
uint8  value_,
uint8  channel_ = 1 
)

Creates a HiseEvent with the given data.

HiseEvent ( const HiseEvent other)
noexcept

Creates a bit-wise copy of another event.

Member Function Documentation

void addToTimeStamp ( int16  delta)
noexcept

Adds the delta value to the timestamp.

static void clear ( HiseEvent eventToClear,
int  numEvents = 1 
)
inlinestatic

This clears the events using the fast memset operation.

HiseEvent createPitchFade ( uint16  eventId,
int  fadeTimeMilliseconds,
int8  coarseTune,
int8  fineTune 
)
static

Creates a pitch fade.

Parameters
eventIDthe ID of the event that will be changed.
fadeTimeMillisecondsthe length of the fade.
coarseTunethe target pitch in semitones
fineTunethe target pitch detune in cent.
HiseEvent createTimerEvent ( uint8  timerIndex,
uint16  offset 
)
static

Creates a timer event.

Parameters
timerIndexThere are 4 timer slots per sound generator and this will contain the index (0-3).
offsetthe sample offset within the current buffer [0 - buffer size).
HiseEvent createVolumeFade ( uint16  eventId,
int  fadeTimeMilliseconds,
int8  targetValue 
)
static

Creates a volume fade.

Parameters
eventIdthe event ID that this fade should be applied to.
fadeTimeMillisecondsthe fade time (it will be a linear fade). the target gain in decibels.
int getAfterTouchValue ( ) const
inlinenoexcept

Copied from MidiMessage.

int getChannel ( ) const
inlinenoexcept

Returns the MIDI channel.

int getChannelPressureValue ( ) const
inlinenoexcept

Copied from MidiMessage.

int getCoarseDetune ( ) const
inlinenoexcept

Returns the coarse detune amount in semitones.

int getControllerNumber ( ) const
inlinenoexcept

Copied from MidiMessage.

int getControllerValue ( ) const
inlinenoexcept

Copied from MidiMessage.

uint16 getEventId ( ) const
inlinenoexcept

Returns the event ID of the message.

The event IDs will be automatically created by HISE when it is processing the incoming MIDI messages and associates sequentially increasing IDS for each note-on and its corresponding note-off event.

Be aware the the event ID is stored as unsigned 16 bit integer, so it will wrap around

  1. It's highly unlikely that you will hit any collisions, but you can't expect that older notes have a higher event ID.
int getFadeTime ( ) const
inlinenoexcept

Returns the fade time for both pitch and volume fades.

int getFineDetune ( ) const
inlinenoexcept

Returns the fine detune amount int cents.

float getFloatVelocity ( ) const
inlinenoexcept

Copied from MidiMessage.

int getGain ( ) const
inlinenoexcept

returns the gain in decibels.

float getGainFactor ( ) const
inlinenoexcept

Returns the gain factor (from 0...1) for the given event.

int getNoteNumber ( ) const
inlinenoexcept

Copied from MidiMessage.

double getPitchFactorForEvent ( ) const

Returns a ready to use pitch factor (from 0.5 ...

2.0)

int getPitchWheelValue ( ) const
noexcept

Copied from MidiMessage.

int getProgramChangeNumber ( ) const
inlinenoexcept

Copied from MidiMessage.

int getSongPositionPointerMidiBeat ( ) const
inlinenoexcept

Copied from MidiMessage.

uint16 getStartOffset ( ) const
noexcept

Returns the start offset of the event.

int getTimerIndex ( ) const
inlinenoexcept

Returns the index of the timer slot.

uint16 getTimeStamp ( ) const
inlinenoexcept

Returns the timestamp of the message.

The timestamp is the offset from the current buffer start. If the timestamp is bigger than the current buffer size, the message will be delayed until the buffer range contains the time stamp.

int getTransposeAmount ( ) const
inlinenoexcept

Returns the transpose amount.

Be aware that you need to take this into account when you need the actual note-number of an HiseEvent.

Type getType ( ) const
inlinenoexcept

Returns the Type of the HiseEvent.

String getTypeAsString ( ) const
noexcept

Returns a String representation of the type.

uint8 getVelocity ( ) const
inlinenoexcept

Copied from MidiMessage.

void ignoreEvent ( bool  shouldBeIgnored)
inlinenoexcept

Ignores the event.

Ignored events will not be processed, but remain in the buffer (they are not cleared).

bool isAftertouch ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isAllNotesOff ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isArtificial ( ) const
inlinenoexcept

Returns true if this method was created artificially.

Events that come in as MIDI message (no matter if their origin is in an actual key press or if there was a previous MIDI processor (like an arpeggiator) that created it, will be flagged as "non-artificial". Events that are created within HISE are flagged as "artificial".

This information can be useful sometimes in order to prevent endless recursive loops. Also, the HiseEventBuffer::Iterator class can be told to skip artificial events.

bool isChannelPressure ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isController ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isControllerOfType ( int  controllerType) const
inlinenoexcept

Copied from MidiMessage.

bool isEmpty ( ) const
inlinenoexcept

Returns true if the HiseEvent is empty.

bool isIgnored ( ) const
inlinenoexcept

Checks if the message was marked as ignored (by a script).

bool isMidiStart ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isMidiStop ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isNoteOff ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isNoteOn ( bool  returnTrueForVelocity0 = false) const
noexcept

Copied from MidiMessage.

bool isNoteOnOrOff ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isPitchFade ( ) const
inlinenoexcept

Returns true if the event is a pitch fade.

bool isPitchWheel ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isProgramChange ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isSongPositionPointer ( ) const
inlinenoexcept

Copied from MidiMessage.

bool isTimerEvent ( ) const
inlinenoexcept

Returns true if the event is a timer event.

bool isVolumeFade ( ) const
inlinenoexcept

Returns true if the event is a volume fade.

bool operator== ( const HiseEvent other) const

checks whether the event is equal to another.

This checks for bit-equality.

void setAfterTouchValue ( int  noteNumber,
int  aftertouchAmount 
)
inlinenoexcept

Copied from MidiMessage.

void setArtificial ( )
inlinenoexcept

If the event was created artificially by a MIDI Processor, it will call this method.

You don't need to use this yourself.

void setChannel ( int  newChannelNumber)
inlinenoexcept

Sets the MIDI channel.

Note that in HISE you have 256 MIDI channels.

void setChannelPressureValue ( int  pressure)
inlinenoexcept

Copied from MidiMessage.

void setCoarseDetune ( int  semiToneDetune)
inlinenoexcept

Sets the coarse detune amount in semitones.

void setControllerNumber ( int  controllerNumber)
inlinenoexcept

Copied from MidiMessage.

void setControllerValue ( int  controllerValue)
inlinenoexcept

Copied from MidiMessage.

void setEventId ( uint16  newEventId)
inlinenoexcept

Sets the event ID of the HiseEvent.

Normally you don't need to do this because HISE will automatically assign this to note-on / note-off messages, but for all the types that alter an existing event (like volume-fades), this can be used for setting the target event.

void setFadeTime ( int  fadeTime)
inlinenoexcept

Sets the fade time for the event type.

Only valid for VolumeFade and PitchFade types.

void setFineDetune ( int  newCents)
inlinenoexcept

Sets the fine detune amount in cents.

void setGain ( int  decibels)
inlinenoexcept

Sets the gain in decibels for this note.

void setNoteNumber ( int  newNoteNumber)
noexcept

Copied from MidiMessage.

void setPitchWheelValue ( int  position)
noexcept

Copied from MidiMessage.

void setSongPositionValue ( int  positionInMidiBeats)

Copied from MidiMessage.

void setStartOffset ( uint16  startOffset)
noexcept

Adds a offset to the event.

Unlike the timestamp, this will not delay the event to the future, but tell the sound generator to skip the given amount when the voice starts. This can be used for eg. skipping the attack phase of samples.

void setTimeStamp ( int  newTimestamp)
noexcept

Sets the timestamp to a sample offset in the future.

void setTransposeAmount ( int  newTransposeValue)
inlinenoexcept

Sets the transpose amount of the given event ID.

Unlike changing the note-number directly, this method will keep the original note number so that you don't have to process the note-off number to match the note-on.

This is the recommended way of handling all note-number processing in HISE.

void setType ( Type  t)
inlinenoexcept

Changes the type.

Don't use this unless you know why.

void setVelocity ( uint8  newVelocity)
inlinenoexcept

Copied from MidiMessage.

void swapWith ( HiseEvent other)

Swaps the event with another.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.