Coder Social home page Coder Social logo

chris-topherw / unitymidiplayer Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 3.0 1.27 MB

Midi file player for unity. Allows import of type zero and one midi files and playing them via midi outputs. Also provides code for creating procedural music using midi.

License: MIT License

C# 100.00%
midi unity audio midi-files midi-outputs game-audio game-development portmidi

unitymidiplayer's Introduction

UnityMidiPlayer

Midi file player for unity. Allows import of type zero and one midi files and playing them via midi outputs. Also provides code for creating procedural music using midi.

Some older midi features such as embedded lyrics in midi tracks are not supported by this tool, and trying to import them will often cause an error. (I'll get around to supporting the weirder bits of the standard at some point)

How to use:

  1. Drag type 0 or type 1 midi file somewhere into asset folder
  2. Change file extension from .mid to .txt
  3. Drag .txt midi file into MidiFile input box in MidiSource component
  4. Set midi output via Output devices section of MidiEngine component
  5. Press play!

Useful functions: MidiPlayer.PlayTrack(MidiTrack track, MidiSource source); -plays through a midi track

MidiPlayer.PlayNext(MidiMessage message, MidiSource source); -plays a midi note once previous note has finished (calculated via PPQ)

MidiPlayer.PlayScheduled(MidiMessage message, double dsptime); -schedule midi to play at Unity DSPTime (double in seconds)

MidiPlayer.Play(MidiMessage p_message); -Plays midi message as soon as possible

Warning: this code was part of my grad research in 2016 and is a dumpster fire, enter at your own peril.

unitymidiplayer's People

Contributors

chris-topherw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

unitymidiplayer's Issues

MacOS portmidi.dll

Hi @Chris-TopherW I'm trying to get Unity to send Midi Out to a Behringer BCR2000, it sounds like your UnityMidiPlayer might do the trick but I'm on MacOS and the included portmidi.dll seems to be for Windows only, could you give me some pointers on what to do to get this working on a Mac? Thanks, Will

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.