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.
MessageHolder.addToTimestamp(int deltaSamples)
clone
Returns a copy of this message holder object.
MessageHolder.clone()
dump
Creates a info string for debugging.
MessageHolder.dump()
getChannel
Returns the MIDI Channel from 1 to 16.
MessageHolder.getChannel()
getCoarseDetune
Returns the coarse detune amount in semitones.
MessageHolder.getCoarseDetune()
getControllerNumber
returns the controller number or 'undefined', if the message is neither controller nor pitch wheel nor aftertouch.
MessageHolder.getControllerNumber()
getControllerValue
Returns the value of the controller.
MessageHolder.getControllerValue()
getEventId
Returns the event id of the current message.
MessageHolder.getEventId()
getFineDetune
Returns the fine detune amount int cents.
MessageHolder.getFineDetune()
getGain
Returns the volume of the note.
MessageHolder.getGain()
getMonophonicAftertouchPressure
Returns the aftertouch value of the monophonic aftertouch message.
MessageHolder.getMonophonicAftertouchPressure()
getNoteNumber
Return the note number. This can be called only on midi event callbacks.
MessageHolder.getNoteNumber()
getPolyAfterTouchNoteNumber
Returns the polyphonic aftertouch note number.
MessageHolder.getPolyAfterTouchNoteNumber()
getPolyAfterTouchPressureValue
Checks if the message is a POLYPHONIC aftertouch message (Use isChannelPressure() for monophonic aftertouch).
MessageHolder.getPolyAfterTouchPressureValue()
getTimestamp
Returns the current timestamp.
MessageHolder.getTimestamp()
getTransposeAmount
Gets the tranpose value.
MessageHolder.getTransposeAmount()
getVelocity
Returns the Velocity.
MessageHolder.getVelocity()
ignoreEvent
Ignores the event.
MessageHolder.ignoreEvent(bool shouldBeIgnored=true)
isController
Returns true if the event is a CC controller event.
MessageHolder.isController()
isMonophonicAfterTouch
Checks if the message is a MONOPHONIC aftertouch message.
MessageHolder.isMonophonicAfterTouch()
isNoteOff
Returns true if the event is a note-off event.
MessageHolder.isNoteOff()
isNoteOn
Returns true if the event is a note-on event.
MessageHolder.isNoteOn()
isPolyAftertouch
Checks if the message is a POLYPHONIC aftertouch message (Use isChannelPressure() for monophonic aftertouch).
MessageHolder.isPolyAftertouch()
setChannel
Changes the MIDI channel from 1 to 16.
MessageHolder.setChannel(int newChannel)
setCoarseDetune
Sets the coarse detune amount in semitones.
MessageHolder.setCoarseDetune(int semiToneDetune)
setControllerNumber
Changes the ControllerNumber.
MessageHolder.setControllerNumber(int newControllerNumber)
setControllerValue
Changes the controller value (range 0 - 127).
MessageHolder.setControllerValue(int newControllerValue)
setFineDetune
Sets the fine detune amount in cents.
MessageHolder.setFineDetune(int cents)
setGain
Sets the volume of the note (-100 = silence).
MessageHolder.setGain(int gainInDecibels)
setMonophonicAfterTouchPressure
Sets the pressure value of the monophonic aftertouch message
MessageHolder.setMonophonicAfterTouchPressure(int pressure)
setNoteNumber
Changes the note number.
MessageHolder.setNoteNumber(int newNoteNumber)
setPolyAfterTouchNoteNumberAndPressureValue
Copied from MidiMessage.
MessageHolder.setPolyAfterTouchNoteNumberAndPressureValue(int noteNumber, int aftertouchAmount)
setStartOffset
Sets the start offset.
MessageHolder.setStartOffset(int offset)
setTimestamp
Sets the timestamp in samples.
MessageHolder.setTimestamp(int timestampSamples)
setTransposeAmount
Transposes the note on.
MessageHolder.setTransposeAmount(int tranposeValue)
setType
Sets the type of the event.
MessageHolder.setType(int type)
setVelocity
Changes the velocity (range 1 - 127).
MessageHolder.setVelocity(int newVelocity)