Close

MIDI In CHOP

Summary

The MIDI In CHOP reads Note events, Controller events, Program Change events, System Exclusive messages and Timing events from both MIDI devices and files. See also MIDI In Map CHOP.

The MIDI In CHOP receives MIDI events from MIDI devices connected to the serial port, reads MIDI events internal to the workstation (i.e. the built-in software synth), and interprets musical scores in MIDI files. Supported MIDI events are:

Note On, Note Off
Polyphonic Aftertouch
Channel Pressure
Program Change
Control Change (MIDI controller devices)
Pitch Wheel
Timer Events including beat pulses
Bar Messages
Start, Stop, Continue
Song Position Pointer
System Exclusive Messages

MIDI events arriving on separate MIDI channels may be recorded on separate CHOP channels. Also, any number of MIDI CHOPs can read from the same or different sources. TouchDesigner can be configured such that MIDI Start, Stop, or Continue events can control the Timeline and Beat Dialog.

The 'Simplified Output' option creates a channel for every type of MIDI event received, so number of channels expands while the devices is being used. No need to specify name, channel and index patterns.

Note: The values of the MIDI inputs are saved into the TouchDesigner .toe file, and are restored when the file is reloaded. The physical controllers may be in a different position when the .toe is restarted, causing the values to jump when the controllers are moved. This is unavoidable.

See also the MIDI In DAT, MIDI Event DAT, MIDI In Map CHOP, MIDI Out CHOP.

PythonIcon.pngmidiinCHOP_Class


Parameters - Source Page

Active active -  

MIDI Source source - - Get MIDI input from a device or a file.

  • Device device -
  • File file -

Device Table device - Path to the MIDI device Table DAT  

Device ID id - Specify the id of which device to use.  

MIDI File file - If MIDI file is selected as the MIDI source use this field to specify the name of the MIDI file to read. The file can be read in from disk or from the web. Use http:// when specifying a URL.  

Read Entire MIDI File entire - If enabled, the entire MIDI file is read. Otherwise, the Start and End parameters on the Channel page determine the segment of the file to read.  

Reset Channels resetchannels - Deletes all channels when set to On, new channels will not be added until Reset Channels is turned Off.  

Reset Channels Pulse resetchannelspulse - Instantly deletes all channels.  

Reset Values resetvalues - Resets all channel values to 0 when On, channel values will not be updated until Reset Values is turned Off.  

Reset Channels Pulse resetchannelspulse - Instantly resets all channels to 0.  

Simplified Output simplified - When this is on channels are automatically created when MIDI signal is detected from the selected MIDI device.  

1 Based Index onebased - Make the index 1 based instead of the default 0 based.  

MIDI Channels channel - The CHOP may read from any number of MIDI channels, numbered 1-16. Ranges and multiple entries are supported (i.e. "1 4 6", "1-7 12", "1-5:2").

If Channel Prefix is left blank, then the input streams from multiple MIDI channels will be combined into one set of CHOP channels (i.e., a "note 64 on" event on channel 12 followed by a "note 64 off" event on channel 8 appears in the note 64 CHOP channel as a single note).

 

Channel Prefix prefix - When recording from multiple MIDI channels, putting a string like "ch" in this parameter causes the MIDI channel to be split into separate CHOP channels per MIDI channel. Otherwise the MIDI channels are all merged into one set of CHOP channels.  

{{ParameterPage |opFamily=CHOP |pageName=Record |items= Record Method recordtype - - Determine what to record.

  • Single Frame single - This only outputs the current value of notes, controllers, etc. It does not retain prior values. It creates a CHOP at frame 1 always, so the CHOP causes cooking only when MIDI events come in.
  • Current Frame current - Same as "Single Frame", but the CHOP frame is always at the current frame, so the CHOP changes every frame, causing other CHOPs to recook every frame.
  • Current Time Slice ind - The CHOP frame is always at the current Time Slice.
  • Full Length timeline - The entire length of the timeline is recorded.

Record record - This parameter is used as a button to start and stop recording into the CHOP channels.  

Parameters - Note Page

Note Name notename - Put an "n" in here to generate channels for note events. It is the base name of the CHOP channel used to record notes. If blank, notes are ignored. If the Note Output parameter is set to Separate Channels, then CHOP channels will be created for each note in the Note Scope, of the form: notename  

Note Scope notescope - The scope of notes to record. Multiple ranges and notes can be recorded (i.e., "50-60", "64 65 66 70-80").  

Note Output notemeth - -

  • One Multiplexed Channel mult - One CHOP channel per MIDI channel is used for all notes. The value in the note channel is the number of the note currently playing (in the case of multiple notes playing, the most recent note is selected).
  • Separate Channels sep - Each note number gets its own CHOP channel.

Velocity velocity - -

  • Off veloff - Velocity is not recorded.
  • Note Amplitude velencode - The velocity is recorded as the amplitude of the note. Only valid when Note Output is set to Separate Channels.
  • Separate Channels velsep - Velocity is recorded in separate CHOP channels. Each note channel will have a corresponding velocity channel.

Velocity Name velname - When Velocity is set to Separate Channels, this parameter is the base name of the Velocity CHOP channel (try "v"). If blank, no velocity channels will be recorded.  

Aftertouch Name aftername - The base name of the polyphonic Aftertouch CHOP channels. One aftertouch channel is created for each note in the Note Scope. If blank, no aftertouch channels will be created.  

Pressure Name pressname - The name of the Channel Pressure channel. If multiple channels are being recorded, all channel pressure changes of interest will be recording on this CHOP channel. If blank, this channel will not be created.  

Normalize notenorm - - Note values can be normalized for convenience:

  • None off - When Normalize is Off, 7 bit controllers will return values in the range 0-127 and 14 bit controllers will return values in the range 0-16383.
  • 0 to 1 0to1 - These values are normalized to lie in the range 0 to 1.

Pitch Wheel Name pitchname - The name of the Pitch Wheel CHOP channel. Pitch wheel values range from -1 to +1. If blank, this channel will not be created. Put "p" in here to generate a channel.  


Parameters - Control Page

Controller Name controlname - The base name of the Control Change CHOP channels. The channel names are appended with the controller index (0-127). If blank, control changes will not be recorded. It typically contains "c".  

Controller Type controltype - - There are 128 different controllers available. By choosing By Index Only, you can specify any number of controllers in the Control Index parameter. Otherwise, you can select a controller from the list from this menu. Some controllers have multiple instances, such as Sound Controllers 1-10. Selecting a controller with multiple instances allows you to use the Control Index parameter to select which instances you want. Any invalid control indices will be ignored.

  • By Index Only index -
  • Bank Select n0 -
  • Modulation Wheel n1 -
  • Breath Control n2 -
  • Foot Controller n3 -
  • Portamento Time n4 -
  • Data Entry n5 -
  • Channel Volume n6 -
  • Balance n7 -
  • Pan n8 -
  • Expression Control n9 -
  • Effect Control 1-2 n10 -
  • 14 bit General Purpose 1-4 n11 -
  • Sustain on/off n12 -
  • Portamento on/off n13 -
  • Sustenuto on/off n14 -
  • Soft Pedal on/off n15 -
  • Legato Footswitch on/off n16 -
  • Hold 2 on/off n17 -
  • Sound Controller 1-10 n18 -
  • 7 bit General Purpose 5-8 n19 -
  • Portamento Control n20 -
  • Effect Depth 1-5 n21 -
  • Non-Registered Parameter n22 -
  • Registered Parameter n23 -

Controller Index controlind - Used to select controllers by number, or multiple controllers by ranges. When in By Index Only Controller Type mode, you can select up to the full 128 controllers or sub-ranges thereof (i.e. "1-10", "2 34 70", "1-32 70-80:2").  

Controller Format format - - Some controllers can be paired together to form 14 bit controllers, rather than the normal 7 bit controllers (controller indices 0-31, 98 and 100). Selecting 14 bit Controllers interprets a pair as one 14 bit controller. Otherwise, they are interpreted as separate 7 bit Controllers.

  • 7 bit Controllers 7bit -
  • 14 bit Controllers 14bit -

Normalize norm - - Controller values can be normalized for convenience:

  • None off - When Normalize is Off, 7 bit controllers will return values in the range 0-127 and 14 bit controllers will return values in the range 0-16383.
  • 0 to 1 0to1 - These values are normalized to lie in the range 0 to 1.
  • -1 to 1 -1to1 - These values are normalized to lie in the range -1 to +1.
  • On/Off onoff - Several of the controllers are simply on/off states. When Convert to On/Off is enabled, values greater than or equal to 64 will be interpreted as "1" and all values less than 64 will be interpreted as "0".

Unwrap unwrap -  

Program Change progname - The name of the Program Change CHOP channel. All program change messages will be recorded onto this channel. If blank, this channel will not be created.  


Parameters - Timer Page

Timer Pulse Name pulsename -  

Timer Ramp Name rampname -  

Timer Period timerperiod -  

Timer Start timerstart -  

Ticks per Beat ticks -  

Bar Ramp Name barname -  

Bar Period barperiod -  

Bar Start barstart -  

Bar Message barmsg -  

Song Pos Name songpos -  


Parameters - Sys Page

Channel Name 1 exname1 -  

Message 1 exmsg1 -  


Parameters - Chan Page

This is similar to other generators' Channel page. However, there are a few points to consider on how they affect the Midi In CHOP.

Start start - Defines where recording begins. In "Tie to Time Line" mode, any events received before the start time will be ignored. In "Time Line Independent" mode, recording will start at this point and continue on (not looping back). If reading from a MIDI File, Start/End will determine the start of the segment to read.  

Start Unit startunit - -

  • I samples -
  • F frames -
  • S seconds -

End end - Defines the end of the segment to read for MIDI Files.  

End Unit endunit - -

  • I samples -
  • F frames -
  • S seconds -

Sample Rate rate - Defines the sample rate of this CHOP. If the sample rate is too low, a rapidly changing input may be misrepresented.

Note: If the sample rate is too low, you may miss MIDI events. A note event may set a sample value to 1, and then the next note event less than 1/30 second later can set it to 0 on the same sample in the CHOP channel. So the event will be missed. Make the sample rate higher, like 600, to catch these events, or make sure that your on-off events coming in are a minimum time separation, as can be achieved through Opcode's MAX.  

Extend Left left - -

  • Hold hold -
  • Slope slope -
  • Cycle cycle -
  • Mirror mirror -
  • Default Value default -

Extend Right right - -

  • Hold hold -
  • Slope slope -
  • Cycle cycle -
  • Mirror mirror -
  • Default Value default -

Default Value defval -  


Parameters - Common Page

Time Slice timeslice - Turning this on forces the channels to be "Time Sliced". A Time Slice is the time between the last cook frame and the current cook frame.  

Scope scope - To determine which channels get affected, some CHOPs use a Scope string on the Common page.  

Sample Rate Match srselect - - Handle cases where multiple input CHOPs' sample rates are different. When Resampling occurs, the curves are interpolated according to the Interpolation Method Option, or "Linear" if the Interpolate Options are not available.

  • Resample At First Input's Rate first - Use rate of first input to resample others.
  • Resample At Maximum Rate max - Resample to the highest sample rate.
  • Resample At Minimum Rate min - Resample to the lowest sample rate.
  • Error If Rates Differ err - Doesn't accept conflicting sample rates.

Export Method exportmethod - - This will determine how to connect the CHOP channel to the parameter. Refer to the Export article for more information.

  • DAT Table by Index datindex - Uses the docked DAT table and references the channel via the index of the channel in the CHOP.
  • DAT Table by Name datname - Uses the docked DAT table and references the channel via the name of the channel in the CHOP.
  • Channel Name is Path:Parameter autoname - The channel is the full destination of where to export to, such has geo1/transform1:tx.

Export Root autoexportroot - This path points to the root node where all of the paths that exporting by Channel Name is Path:Parameter are relative to.  

Export Table exporttable - The DAT used to hold the export information when using the DAT Table Export Methods (See above).  

TouchDesigner Build: