RtMidi Class

 

About RtMidi Functions

 

RtMidi functions have different features, performance and limitations but they are cross-platform and work on both Windows and Mac OS X.

RtMidi functions can handle one MIDI Input and one MIDI Output device at a time.

The MIDI Input Buffer for receiving MIDI Messages has a limit of 1024 bytes.

The MIDI Output Buffer for sending MIDI Messages has no limits.

 

About RtMidi Class

 

RtMidi class is mainly used for initializing and deinitializing RtMidi library.

 

RtMidi Class Methods

 

RtMidi.Initialize() method initializes RtMidi library. This function should be called before any other function (usually inside Awake() or Start() methods).

 

RtMidi.Deinitialize() method deinitializes RtMidi library. This function should be called for freeing memory used (usually inside OnApplicationQuit() method).

 

Code Example

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Giavapps.MIDI;

public class CodeExample : MonoBehaviour
{

void Awake()
{
RtMidi.Initialize();//Initializes RtMidi
}

void Update()
{
//Other function calls could be here or you can start a Coroutine for best performance!
}

void OnApplicationQuit()
{
RtMidi.Deinitialize();//Deinitializes RtMidi
}

}

 

RtMidi Class Members

 

RtMidi.Version member contains a string which determines the current RtMidi version.

 

Code Example

Debug.Log(“RTMIDI VERSION: “+RtMidi.Version);

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Comments are closed.