Skip to content

Creating Plugins

George Wu edited this page Sep 28, 2017 · 8 revisions

MilliSim is designed to support extensions, or, in a more common word, plugins. The program itself provides some core features, and all the rest is up to plugins.

MilliSim supports these kinds of plugins:

Kind Wiki Page Information
Score format Creating Score Format Plugins This kind of plugin provides the ability to read and/or write different score formats.
Audio format Creating Audio Format Plugins This kind of plugin enables MilliSim to play various audio file formats as background music or sound effects.
Note animation Creating Note Animation Plugins This kind of plugin lets you control note movements during playing, simulating different games.

General Programming

Extensibility of MilliSim is provided by Managed Extensibility Framework (MEF). More accurately, MEF 2 (System.Composition). For its basic usage, please read this ASP.NET Blog post and this tutorial.

To develop a plugin project, you should add the System.Composition NuGet package and reference the assemblies. To declare a class as a plugin, you should mark the class with an ExportAttribute. Please refer to the wiki pages in each kind of plugins for more details.

Please remember that every plugin class will be instantiated by its public, parameterless constructor. Each class will be instantiated only once.

The compiled plugin assemblies should be placed at:

  • $WORK_DIR, or
  • $WORK_DIR/plugins,

where $WORK_DIR is MilliSim's working directory. They will be automatically discovered by MEF. Exact case naming ("plugins", not "Plugins") is suggested.

Choosing the Right Version

As MilliSim updates, its version number increases, and its APIs subject to change. MilliSim uses the version format major.minor.revision.build. Please note that this format is similar to semver, but different from System.Version class in the order of Build and Revision.

Every minor version release will have its own branch. For example, this branch is for version 0.1. Please checkout the branch after cloning the repository, and develop your plugins based on the code of that branch.

Since MilliSim is still in its alpha stage (v0.x), the APIs may be incompatible between versions. Currently please use your plugin only for the minor version you are targeting to. However, in the worst case, it is guaranteed that the APIs will stay the same in every revision update.

Clone this wiki locally