The mc.midiplayer~ object generates note-on and note-off messages from audio signals representing triggers, note numbers, and velocity values. Typically you'll connect mc.midiplayer~ to vst~ which allows sample-accurate MIDI events at audio rates (assuming the hosted plug-in supports it).
Each incoming audio channel to mc.midiplayer~ can only generate one MIDI event at a time. The chanmod attribute determines how multiple audio channels map to MIDI channels. The minimum value of chanmod is 1, which means all audio channels generate note events on MIDI channel 1. The maximum value of chanmod is 16, where mc.midiplayer~ uses all 16 available MIDI channels. When mpemode is enabled, the maximum value of chanmod is 15, since MPE uses channel 1 for global MIDI events.
When triggermode is set to Phasor, mc.midiplayer~ sends a note-on at the beginning of a phasor ramp and a note-off when the phasor resets. The defaultdur sets the point in the ramp that triggers the note-off event. For example, if defaultdur is set to 0.5, a note-off is sent when the input phasor reaches 0.5. To set a duration proportion for each channel, use the message with the selector. When defaultdur is changed, it does not override any channel-specific duration values set. To cause a channel to use the value of defaultdur for note durations, set its channel-specific dutation to zero.
Sets the note number to use for all future note events. It has the same effect as sending a number to the middle inlet of the object. This setting is ignored if a signal is connected to the middle (note number) inlet of mc.midiplayer~. To set a note number for each channel, send the message with a number argument to the middle inlet. When defaultnote is changed, it does not override any channel-specific note number values set. To cause a channel to use the value of defaultnote for note number, set its channel-specific note number to zero.
Sets the velocity to use for all future note-on events. It has the same effect as sending a number to the middle inlet of the object. This setting is ignored if a signal is connected to the right (velocity) inlet of mc.midiplayer~. To set a velocity value for each channel, send the message with a number argument to the right inlet. When defaultvelocity is changed, it does not override any channel-specific note number values set. To cause a channel to use the value of defaultvelocity for its velocity, set its channel-specific velocity to zero.
When mpemode is enabled, note events are not sent on MIDI channel 1 and the chanmod attribute has a maximum value of 15.
When playzero is enabled, MIDI note events play even if the note number is zero. Disabling playzero is useful when using the same signal for triggering and assigning note numbers when triggermode is set to Edge or Change. Note: input velocity values of 0 disable note events irrespective of the setting of playzero.
Determines how the input trigger signal (connected to the left inlet) generates note events
0 = 'Phasor' ( Trigger notes based on phasor ramps )
When triggermode is set to Phasor, the first rising sample value of the ramp triggers a note-on and the first descending (reset) sample triggers a note-off. If the duration proportion (via the message or defaaultdur attribute) is less than 1.0, the note-off will be triggered when the ramp value reaches the specified value.
1 = 'Edge' ( Trigger notes based on logical sample value transitions )
When triggermode is set to Edge, a note-on is triggered by a zero to non-zero transition in the input signal, and a note-off is triggered by a non-zero to zero transition.
2 = 'Change' ( Trigger notes based on sample value changes )
When triggermode is set to Change, a note-on is triggered whenever the sample value changes. If a note is already playing, the note-off for the playing event is sent first. If you don't want notes playing continuously, disabling the playzero attribute is useful, since a note number value of zero will trigger a note-off (if necessary) without playing another note.
The velcurve attribute introduces a non-linearity into the velocity values of MIDI events. For a more traditional curve, use a negative value (the default is -0.75). A value of 0 means there is no non-linearity, and positive values introduce a less traditional non-linearity where lower input values rise more quickly relative to higher input values. The built-in non-linear function is based on a simple Bezier curve; for more options scaling the input before it arrives at the right inlet of mc.midiplayer~ refer to the Ease package.
Common Box Attributes