MessageHolder
This object mirrors the functionality of the Message
class, but operates on an arbitrary event (while the Message
class will only work inside a MIDI callback and operates on the current event that caused the callback).
This can be useful for one of these occasions:
- MIDI file processing (MidiPlayer.getEventList() will return an array of objects of this type.
- Storing MIDI messages for later processing using Message.store()
- Send previously stored messages using Synth.addMessageFromHolder()
- Debugging (dump() prints out a nice string that contains useful information)
You can create an object using the API call Engine.createMessageHolder()
Class methods
addToTimestamp
Adds the given sample amount to the current timestamp. Edit on GitHub
MessageHolder.addToTimestamp(int deltaSamples)
clone
Returns a copy of this message holder object. Edit on GitHub
MessageHolder.clone()
dump
Creates a info string for debugging. Edit on GitHub
MessageHolder.dump()
getChannel
Returns the MIDI Channel from 1 to 16. Edit on GitHub
MessageHolder.getChannel()
getCoarseDetune
Returns the coarse detune amount in semitones. Edit on GitHub
MessageHolder.getCoarseDetune()
getControllerNumber
returns the controller number or 'undefined', if the message is neither controller nor pitch wheel nor aftertouch. Edit on GitHub
MessageHolder.getControllerNumber()
getControllerValue
Returns the value of the controller. Edit on GitHub
MessageHolder.getControllerValue()
getEventId
Returns the event id of the current message. Edit on GitHub
MessageHolder.getEventId()
getFineDetune
Returns the fine detune amount int cents. Edit on GitHub
MessageHolder.getFineDetune()
getGain
Returns the volume of the note. Edit on GitHub
MessageHolder.getGain()
getMonophonicAftertouchPressure
Returns the aftertouch value of the monophonic aftertouch message. Edit on GitHub
MessageHolder.getMonophonicAftertouchPressure()
getNoteNumber
Return the note number. This can be called only on midi event callbacks. Edit on GitHub
MessageHolder.getNoteNumber()
getPolyAfterTouchNoteNumber
Returns the polyphonic aftertouch note number. Edit on GitHub
MessageHolder.getPolyAfterTouchNoteNumber()
getPolyAfterTouchPressureValue
Checks if the message is a POLYPHONIC aftertouch message (Use isChannelPressure() for monophonic aftertouch). Edit on GitHub
MessageHolder.getPolyAfterTouchPressureValue()
getTimestamp
Returns the current timestamp. Edit on GitHub
MessageHolder.getTimestamp()
getTransposeAmount
Gets the tranpose value. Edit on GitHub
MessageHolder.getTransposeAmount()
getVelocity
Returns the Velocity. Edit on GitHub
MessageHolder.getVelocity()
ignoreEvent
Ignores the event. Edit on GitHub
MessageHolder.ignoreEvent(bool shouldBeIgnored=true)
isController
Returns true if the event is a CC controller event. Edit on GitHub
MessageHolder.isController()
isMonophonicAfterTouch
Checks if the message is a MONOPHONIC aftertouch message. Edit on GitHub
MessageHolder.isMonophonicAfterTouch()
isNoteOff
Returns true if the event is a note-off event. Edit on GitHub
MessageHolder.isNoteOff()
isNoteOn
Returns true if the event is a note-on event. Edit on GitHub
MessageHolder.isNoteOn()
isPolyAftertouch
Checks if the message is a POLYPHONIC aftertouch message (Use isChannelPressure() for monophonic aftertouch). Edit on GitHub
MessageHolder.isPolyAftertouch()
setChannel
Changes the MIDI channel from 1 to 16. Edit on GitHub
MessageHolder.setChannel(int newChannel)
setCoarseDetune
Sets the coarse detune amount in semitones. Edit on GitHub
MessageHolder.setCoarseDetune(int semiToneDetune)
setControllerNumber
Changes the ControllerNumber. Edit on GitHub
MessageHolder.setControllerNumber(int newControllerNumber)
setControllerValue
Changes the controller value (range 0 - 127). Edit on GitHub
MessageHolder.setControllerValue(int newControllerValue)
setFineDetune
Sets the fine detune amount in cents. Edit on GitHub
MessageHolder.setFineDetune(int cents)
setGain
Sets the volume of the note (-100 = silence). Edit on GitHub
MessageHolder.setGain(int gainInDecibels)
setMonophonicAfterTouchPressure
Sets the pressure value of the monophonic aftertouch message Edit on GitHub
MessageHolder.setMonophonicAfterTouchPressure(int pressure)
setNoteNumber
Changes the note number. Edit on GitHub
MessageHolder.setNoteNumber(int newNoteNumber)
setPolyAfterTouchNoteNumberAndPressureValue
Copied from MidiMessage. Edit on GitHub
MessageHolder.setPolyAfterTouchNoteNumberAndPressureValue(int noteNumber, int aftertouchAmount)
setStartOffset
Sets the start offset. Edit on GitHub
MessageHolder.setStartOffset(int offset)
setTimestamp
Sets the timestamp in samples. Edit on GitHub
MessageHolder.setTimestamp(int timestampSamples)
setTransposeAmount
Transposes the note on. Edit on GitHub
MessageHolder.setTransposeAmount(int tranposeValue)
setType
Sets the type of the event. Edit on GitHub
MessageHolder.setType(int type)
setVelocity
Changes the velocity (range 1 - 127). Edit on GitHub
MessageHolder.setVelocity(int newVelocity)