npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jp.keijiro.klak.timeline.midi

v1.0.6

Published

MIDI Animation Track is a custom timeline/playables package that provides functionality to control object properties based on sequence data contained in a standard MIDI file

Downloads

7,576

Readme

MIDI Animation Track for Unity Timeline

Ableton Unity

MIDI Animation Track is a custom timeline/playables package that provides functionality to control object properties based on sequence data contained in a standard MIDI file (.mid file). This allows you to create musically synchronized animation using a DAW (digital audio workstation) that is easy to manage accurately synchronized timings compared to other non-musical timeline editors like Unity's one.

System requirements

  • Unity 2019.1 or later

Installation

This package is distributed via the npmjs registry. You can import it using the scoped registry feature of Unity Package Manager.

To import the package, please add the following sections to the package manifest file (Packages/manifest.json).

To the scopedRegistries section:

{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}

To the dependencies section:

"jp.keijiro.klak.timeline.midi": "1.0.5"

After changes, the manifest file should look like below:

{
  "scopedRegistries": [
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "jp.keijiro.klak.timeline.midi": "1.0.5",
    ...

Importing .mid files

You can import a .mid file as an asset file. Simply drag and drop it to the project view, or navigate to "Assets" - "Import New Asset...".

At the moment, the MIDI file importer doesn't support set-tempo meta events, so the sequence tempo value (BPM) must be manually specified in the inspector.

Inspector

An imported asset may contain multiple tracks that are shown as sub-assets under it.

Sub-assets

To create a MIDI animation track, drag and drop one of these clip assets to a timeline.

Drag and drop

Track controls

You can animate object properties from a MIDI animation track using track controls. To create a new track control, select a MIDI animation track (not a clip) in the Timeline editor. Then track control editor will appear in the inspector.

Track controls

A track control only can animate a single property. You can add multiple controls to animate multiple different properties.

At the moment, a track control only supports float, Vector3, Quaternion and Color properties. Please note that it requires a public property to be animated; Just providing a public variable is not enough.

There are three modes in the track control: Note Envelope, Note Curve and CC.

Note Envelope mode

Inspector

Note Envelope is a mode where a property is animated by a classic ADSR style envelope. This mode is useful when you want to make animation react to key-off events.

You can specify which Note/Octave the control reacts to. Please note that key velocity affects the envelope. It's simply multiplied to the envelope output.

Note Curve mode

Inspector

Note Curve is a mode where a property is animated by an animation curve. It starts playing animation on key-on events and keeps playing until it ends (key-off events will be ignored).

You can specify which Note/Octave the control reacts to. Please note that key velocity affects the animation curve. It's simply multiplied to the curve value.

CC mode

Inspector

CC is a mode where a property is animated by CC (control change) events contained in a MIDI track.

You can specify which CC Number the control reacts to.

MIDI signals

A MIDI animation track also supports sending Timeline Signals on key-on/off events. To receive MIDI events from a track, you can use the MIDI Signal Receiver component.

Inspector

  1. Add the MIDI Signal Receiver component to a game object that receives MIDI signals.
  2. Specify which Note/Octave the receiver reacts to.
  3. Register methods to Note On/Off Events.
  4. Set the receiver game object as the output destination of the track.

Output destination

You can add multiple receiver components to a single game object. It's useful to invoke different methods for each note.