A control can have multiple MIDI messages configured. Messages can be both sent and received on multiple connections.
When a message is enabled to send, it will be sent on the configured connections when any of the control's values enabled as trigger change, and if the change matches the change condition of the trigger.
Message matching depends on the type of MIDI message. TouchOSC defines part of a MIDI message as the address part, used for routing to determine the target controls, and another part as the payload.
The type of the message and the address part will be used to determine if the incoming message matches the control's message, and the payload part will then be processed to extract values and properties to update (if so configured).
See the message matching section for details on address/payload for each message type.
The enabled state of the message.
If a message is not enabled, it will neither be sent or matched to received messages.
The send enable flag of the message.
Only if the send flag is set to on for the message, it will be considered for sending when any of the values enabled as triggers change, and the trigger's change condition is met.
The receive enable flag of the message.
Only if the receive flag is set to on for the message, it will be considered for being matched against any incoming MIDI messages received on any of the connections enabled for the message.
The feedback enable flag of the message.
The feedback flag controls the processing of the message in situations where both the send and receive flags are enabled and a received MIDI message changes a value that is also enabled in the list of send triggers for the message.
If a received MIDI message, and subsequent change of value, would also cause the same message to be sent again immediately, this could cause an undesirable feedback loop in the interaction with another application, hence this flag controls if the message should be sent again in this case.
The feedback enable flag is set to off by default because of the potential problems this behavior could cause. Please handle with care.
The connections that the message should be sent and received on. The numbers refer to the numbered MIDI connections configured in the MIDI connections configuration.
If the message is enabled to be sent, it will be sent only on the connections enabled here.
If the message is enabled to be received, any received MIDI messages will only be considered to be matched to this message if received on one of the connections enabled here.
The special connection labelled '∞' enables sending/receiving messages on all connections.
The trigger conditions for the message to be sent.
If the message send flag is set to on, it will be sent only if any of the value objects enabled here change, and only if the configured change condition is being met.
Any of the control's values can be enabled individually here, with one of the possible change conditions of:
The type of MIDI message.
TouchOSC supports the following types of MIDI messages:
Depending on the type of message selected, the configuration of the message fields will change. For any of the possible parts of any given MIDI message type, the source value used can be any of:
A constant value.
The current index of the control in its parent list of child controls.
The current value of any of the control's value objects.
The current value of any of the control's properties.
All values will be converted to integer types, and all source value types except for CONSTANT can optionally be scaled before sending (and in reverse after reception). Scaling is applied using following calculation:
out = min + in * (max - min)
If the receive flag is set to on for a message, it will be considered as the target of any received MIDI message if its configuration matches the incoming message.
The type of message will determine how an incoming message will be matched, and then possibly routed, to be received and processed according to this message's configuration. Only if an incoming message's type and address part match the configured message will it be received and processed according to this message's description.
If the message configuration uses a control value or property for any of the address parts of the message type, the received message has to also match current values of these at the time of reception.
If the message configuration uses a control value or property for the payload part of the message type, the value or property will be updated using the received payload value.
The following table lists the parts of a MIDI message TouchOSC considers address and payload for each of the supported message types:
|Note Off/On||Channel + Note||Velocity|
|Poly pressure||Channel + Note||Velocity|
|Control change||Channel + Controller||Value|
NOTE: Received messages of type System exclusive can only be processed using scripting and only at the document root level.