⌚
Timeflow
  • ⌚Introduction
  • 📗User Guide
    • â–ļī¸Getting Started
      • ✅Requirements
      • âŦ‡ī¸Installation
      • 🚀Quick Start
      • âœī¸Workflow
      • đŸŽŦRender Pipeline
      • â¯ī¸Editor vs Runtime
      • đŸĻŋHow it Works
      • â›‘ī¸Potential Issues
      • ⚡Optimization
      • 🔨3rd Party Tools
      • đŸ”ĸUpgrading Guide
    • â„šī¸Timeflow Editor
      • đŸŽ›ī¸Menu Bar
      • â˛ī¸Time
      • Local Time Scope
      • 🧰Work Area
      • âš™ī¸Settings
      • âŗUpdate Settings
      • đŸ“ēDisplay Lists
      • đŸ”ģMarkers
      • đŸ”ĩObject
      • 🏭Managed Objects
      • ⚡Quick Select Objects
      • âš’ī¸Tools
    • đŸŽŦTimeflow View
      • 🔩Toolbar
        • 🔑Auto Keyframing
        • â¯ī¸Play Controls
        • đŸĨ…Work Area
        • â¯ī¸Current Time
        • đŸŽŧMusical Timing
        • 🌐Grid and Snap
        • 🔸Keyframe Values
        • đŸ”ģMarkers
      • â˛ī¸Timeline
      • 📐Time Navigation
      • Local Time Scope
      • 🎏Track View
      • â†˜ī¸Selection
      • 📰Object Panel
      • đŸ“ēDisplay Lists
      • 🍱Channels
      • đŸŖProperties
      • 🔗Channel Link
      • đŸšĨSwitches
      • 📅Values Column
      • đŸ›¤ī¸Tracks
      • 🔸Keyframes
      • đŸ“ļAlignment Tools
      • ⌛Time Offset
      • đŸ”ĸInfo Panel
      • 📉Graph View
      • âœ‚ī¸Keyframe Tools
    • 🍰Menus & Shortcuts
      • 📃Context Menus
        • â†–ī¸Select Menu
        • 📰Object Menu
        • 🍱Channel Menu
        • đŸ›¤ī¸Tracks Menu
        • 🔸Keyframes Menu
        • đŸ”ģMarkers Menu
        • 📰View Menu
        • 📰Events Menu
        • đŸĨ…Work Area Menu
      • đŸ—ƒī¸File Menu
      • âš’ī¸Timeflow Menu
        • đŸ•ēAdd Behavior
        • đŸ”ļAnimation
        • 🍱Composition
        • đŸ“ēDisplay
        • ⏊Jump To
        • 👨‍đŸ‘Ļ‍đŸ‘ĻHierarchy
        • 🌐Mesh
        • 👉Select
        • 📚Tracks
        • 🌈Track Colors
        • â†”ī¸Transform
        • đŸ‘ī¸Visibility
        • đŸ› ī¸Editor
      • đŸ”ĩGame Objects Menu
      • đŸŽ›ī¸Presets
      • âš™ī¸Preferences
        • Assets
        • ⌛Time
        • đŸŗī¸â€đŸŒˆTracks
        • âšĒObjects
        • 🧮Channels
        • đŸ”ļKeyframes
        • 🔠Input
        • đŸ“ĨImport
        • đŸ–ŧī¸Rendering
        • đŸŽ›ī¸Overrides
        • 🍱Extras
      • *ī¸âƒŖKeyboard Shortcuts
        • Managing Shortcuts
      • âœ´ī¸Quick Menu
  • Reference
    • đŸ”ĩTimeflow Object
      • đŸĸTracks
      • 🏭Behaviors
      • ⏰Events
      • đŸ—ƒī¸Channels
    • 💃Timeflow Controller
      • đŸŽžī¸Timeflow Playback
    • đŸĒ„Behaviors
      • đŸŽžī¸Animation
        • 🔸Keyframer
        • â†”ī¸Tween
        • 🔀Blend
        • đŸŽĸMotion Path
        • đŸ‘¯Animation Clips
        • 🌴Animator Blend Trees
        • 😁Blend Shapes
      • 🤖Automation
        • 🛸Auto Bank
        • 🧭Auto Rotate
        • 📐Distance
        • ⏰Event
        • đŸ›Šī¸Flyby
        • 🏃Follow
        • 👀Look At
        • đŸŽ¯Look At Target
        • 🎲Noise
        • 🚊Place On Path
        • đŸī¸Place On Surface
      • 🔊Audio
        • 🔊Audio Track
        • đŸŽŧAudio Spectrum
        • đŸŽĩAudio Sample
        • đŸŽ™ī¸Audio Reactive
      • 🎹MIDI
        • 🎹Midi File
        • đŸĨMidi Tween
        • 📡Midi Receiver
          • đŸŽ›ī¸Minis Setup (New Input System)
          • đŸšĨMidiJack Setup (Legacy Input)
      • 🏁Rendering
        • đŸŽžī¸Render To Disk
        • 📋Render Queue
        • đŸ“Ŋī¸Video Encoding
        • 💡Tips & Optimizations
        • âēī¸Unity Recorder
      • 🔧Tools
        • â„šī¸Animator Info
        • 🧮Align Children
        • đŸ’ŦComment
        • #ī¸âƒŖFPS Counter
        • 📈Graph
        • 🔗Property Link
        • 🔄Rotator
        • ✨Particle System Update
        • 🌈Trail Renderer Update
        • đŸ“ēVideo Player Update
    • đŸ—ƒī¸Precomposing
    • 🏭Prefabs
    • đŸŽ›ī¸Editor Overrides
      • 🏹Transform Editor Override
    • 🔌Integrations
      • đŸ§™â€â™‚ī¸Adventure Creator
      • đŸŽ›ī¸MIDI Jack | Minis
      • đŸ¤ēSpine Animation
      • đŸ“Ŋī¸Unity Timeline
      • ➰Unity Splines
    • đŸĒSamples
      • đŸ•šī¸Demo App
      • đŸŽžī¸Cutscenes
      • 🏓Physics
      • 🍧Shader Properties
      • ⚡Visual Effect Graph (VFX)
    • 📖Glossary
    • 📗Scripting
    • đŸ“ŖPublished Works
    • âš ī¸Known Issues
    • 🆘Support
    • đŸ§ĒBeta
    • Roadmap
    • đŸ”ĸVersion History
    • ÂŠī¸Terms & Privacy
Powered by GitBook
On this page
  • Setup Instructions
  • Midi Receiver Editor
  • Menu Bar
  • Save
  • Load
  • Auto
  • Map
  • Configuration
  • Input
  • Note
  • All Octaves
  • Program Button
  • PlayerPrefs Name
  • Erase Configuration
  • QWERTY Input
  • Note Processing (ADSR)
  • Instant
  • Property Mapping
  • Map To
  • Property
  • Tween / Midi Tween
  • Trigger Only
  • Events
  • Troubleshooting
  1. Reference
  2. Behaviors
  3. MIDI

Midi Receiver

Live input from a computer keyboard or MIDI device

PreviousMidi TweenNextMinis Setup (New Input System)

Last updated 1 year ago

Midi Receiver listens for midi input from an external device. This can be used to synchronize visuals with live played music or using a midi controller.

Please be advised that for MIDI device support, this behavior requires one of the 3rd party plugins for Unity, either or . Timeflow is not affiliated in any way with these plugins other than implementing the input that it provides. Axon Genesis is not responsible for its performance or any issues that may occur while using it.

Live MIDI input varies by platform. Please refer to the documentation for the MIDI plugin you choose to use for a list of supported platforms and devices.

To add a Midi Receiver, select from the main menu:

Tools > Timeflow > Add > Midi Receiver

Or right-click an object in the Timeflow view and select:

Add > Midi > Receiver

Setup Instructions

Please refer to the following pages for step-by-step instructions to install and configure either Minis or MidiJack. Minis is the newest and preferred solution, while MidiJack is offered for legacy support.

Midi Receiver Editor

Select the object to view its settings in the Inspector.

Menu Bar

MIDI Jack only works during runtime so it is necessary to enter play mode to receive any midi input. Click 'Enter play mode for input' to enter play mode in the editor.

Save

Saves the current configuration to the PlayerPrefs.

Load

Loads the configuration from the PlayerPrefs.

Auto

If enabled, the configuration is automatically loaded and saved on Awake and Destroy, respectively. Changes are not saved until unloaded or the Save button is pressed.

If Auto is enabled, new midi mappings assigned at runtime are automatically saved and restored the next session. This option is preferred when custom mappings are allowed.

Map

You must enter play mode to use the Map feature.

Upon entering play mode, the current configuration is loaded and Midi Receiver is awaiting midi input to react to the control it is currently mapped to.

To assign a new midi input, press Map to enter listening mode.

The first input detected from any key, knob, or fader is captured and mapping mode ends.

The last received midi note is displayed in the menu bar, as shown above. This can be useful to see which note is being played currently (regardless of mapping). However, please note that the Inspector window does not always repaint. A simple workaround is to move the mouse over the menu bar to make it update.

Mapping Using Scripts or Events

MIDI mapping can be set at runtime by using a UnityEvent (using a UI Button or other input) as well as controlled by custom script. There are 3 methods in MidiReceiver:

  • StartMapping() : Begins listening for the first MIDI input, which when detected is assigned and automatically stops listening.

  • StopMapping() : Cancels or interrupts the listening process, making no change to the existing/prior mapping.

  • ToggleMapping() : Starts or stops the mapping process. This method is best used with buttons or toggle switches.

Configuration

Input

Select the input channel (1-16) to receive midi signals.

To see data being received via a midi device, select from the main menu:

Window > MIDI Jack

Note

Select whether the input control is a Note (key on a keyboard) or a Knob (a fader or twist knob).

When using a knob or fader as input, it's range is mapped to the output value for full manual control using the device. Using a note for input, on the other hand, plays and holds the note according to the ADSR settings.

All Octaves

This option is available for note types only. When enabled, notes played are treated the same across all octaves. For example, if you map the note C, it will be triggered when C is played in any octave.

Program Button

This is an optional UI button to allow users to map midi input during runtime. When the button is pressed, it puts Midi Receiver into listening mode and captures the first midi note or knob touched.

PlayerPrefs Name

This defines the basename for PlayerPrefs values to store and retrieve the midi input configuration for this Midi Receiver. By default this name matches the game object name but may be changed if desired. This saves several values into the PlayerPrefs starting with the basename.

Erase Configuration

This removes the values from the PlayerPrefs based on the current name entered. Use this to clear out old settings before renaming a setting.

QWERTY Input

When this option enabled, standard keyboard input can be used to trigger events in lieu of MIDI.

Key Code

The key code can be selected manually in the inspector by using the dropdown menu, or in play mode you can enter mapping mode (press the Map button) to listen for the first key pressed.

Each mapping can have both MIDI and keyboard input. Mapping mode is automatically stopped with each input detected, but you can run Map twice: once to set a MIDI note, and again to set its keyboard equivalent.

Use Any Key

If enabled, no mapping is required and any key on the keyboard will cause MidiReceiver to trigger.

Using the keyboard as input allows MidiReceiver to be used without any MIDI devices and does not require MidiJack or Minis.

Note Processing (ADSR)

of these settings.

Instant

If enabled, the midi note immediately triggers this behavior when pressed.

For any effect that comes on gradually, turn off Instant and set the Attack (time in seconds) desired. This could be good for lighting or anything that fades on.

Property Mapping

Map To

Midi input may be mapped directly to a property or to control Midi Tween, Tween

Property

Maps directly to a property.

Tween / Midi Tween

Assign an instance of Tween or Midi Tween to control. Use the Amount slider to blend the influence of the live received midi over the current behavior.

Trigger Only

When this mode is selected, midi input only triggers the Events (registered below) and does not apply directly to any property. Use this mode to pass live midi note values to a custom script.

Events

Unity Events may be used to propagate note on/off events to drive other behaviors. This could be used to trigger particles, animations, or custom scripts. The value passed to these events is the note intensity (velocity), which may be used or ignored by the registered event listeners.

Troubleshooting

Is Midi Supported?

Please be aware that midi support may vary depending on your computer or device.

No Midi Received?

Most often, only 1 program may receive midi messages, blocking other applications from receiving messages. If you are running Unity with MIDI Jack while also running audio software that uses midi, it may block MIDI Jack from receiving signals. This is something that will need to be tested on your setup, however to test midi input it is advised to close other applications that might interfere with receiving midi signals.

Still No Midi Input?

To verify that your device and computer are communicating, you may want to try using a 3rd party application to diagnose midi signals, such as Midi View:

Be sure to close Unity and all other applications to test midi input.

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.

If you see this error message during play mode, it means you are using the wrong type of Event System for the current input configuration. To fix this please refer to the example scene for the correct setup:

Assets/AxonGenesis/Timeflow/Examples/Scenes/AudioMidi/MidiReceiver_InputSystem

If neither or are installed, Midi Receiver displays a warning in the Inspector.

For common features, please see and .

If a configuration is saved and then the PlayerPrefs Name is changed, the configuration will need to be saved again under the new name. This also may result in the old settings remaining in PlayerPrefs. This doesn't hurt anything but you may want to clear the settings with the old name first before setting a new name, using .

To inspect and edit PlayerPrefs, get the free Unity plugin .

Notes are processed using an ADSR envelope (Attack, Delay, Sustain, Release). Please refer to the glossary for an explanation of .

Please refer to the documentation for for

Unlike Midi Tween which has the ability to the note attack, with live midi input there is no possibility to predict when a note will be played. To avoid introducing latency (a delay from the note being played to seeing it visually) it is recommended to use Instant mode.

This works identically to , replicated in Midi Receiver to simplify the setup for basic use. However, either Tween or Midi Tween may be used for additional control.

Using , it is possible to combine input from a with live midi input using Midi Receiver, essentially adding the live signal in with the prerecorded midi. This depends on the Remote Control setting of Midi Tween.

đŸĒ„
🎹
📡
MIDI Jack
Minis
đŸŽ›ī¸Minis Setup (New Input System)
đŸšĨMidiJack Setup (Legacy Input)
Menu Bar
Update Settings
PlayerPrefs Editor
Midi Tween
https://hautetechnique.com/midi/midiview/
Erase Configuration
Minis
MIDI Jack
Midi Tween
Midi File
As displayed in the PlayerPrefs Editor
ADSR
Midi Tween
anticipate
Pass Thru