Mci Class


About Mci Functions


Mci functions use native Windows API and MCI (Media Control Interface) commands for playing external MIDI (*.mid) files through the default MCI MIDI Sequencer.

Note that Giavapps MIDI also includes an extra feature for executing custom MCI commands: you can do a lot more with it!

You can check the following link for more info about:


About Mci Class


Mci class is mainly used for initializing and deinitializing Mci library but also for sending custom MCI commands.


Mci Class Methods


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


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


Mci.Command( string Command ) sends a command string to an MCI device. You can check the following link for a full list of available commands:

string Command: string that specifies an MCI command string.


Code Example

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

public class CodeExample : MonoBehaviour

void Awake()
Mci.Initialize();//Initializes Mci

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

void OnApplicationQuit()
Mci.Deinitialize();//Deinitializes Mci



Mci Class Members


Mci.Alias member contains a string which determines the current alias prefix name used for internal MCI commands. The full alias name used internally is equal to Mci.Alias+DeviceIndex ("midi1" for example). You can leave this value as it is or you can edit it (manually) for using your own custom alias name. Note that if this value is set to an empty string Giavapps MIDI will use the default alias prefix name (which is "midi").


Code Example

Debug.Log(“MCI ALIAS: “+Mci.Alias);


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.