MidicaPL Tutorial: Preparation

Most parts of this preparation page are valid for all supported music programming languages. The other chapters of this tutorial are only for MidicaPL, the built-in "Midica Programming Language".

If you want to code in MidicaPL and have already gone through the preparation process, use the following links to the tutorial's chapters:

Run Midica

If you already followed the instructions in the Quick Start section, you can skip this section and continue with the Sound.

Install Java

Midica is written in Java, so you need to have the Java Runtime Environment (JRE) installed on your Computer to use Midica.

You can use any JRE of version 1.7 or later. Probably you already have Java installed. If not, you can download it from somewhere on the internet, e.g. from java.com.

Download Midica

Download the file midica.jar from the latest Midica release.

Start Midica

If Java is installed and Midica is downloaded you can start it on the command line with the following command:

java -jar midica.jar

Depending on your operating system, there is a chance that you can start the .jar file with a doubleclick. Then you don't need the command line.

Sound

Before you start playing Music, you should load a soundfont. Otherwise Midica uses the Java default soundfont which is very bad. It calls itself "Emergency GM sound set" and this name makes sense. It produces the worst sound in the world.

For the beginning I suggest to use the FluidR3_GM Soundfont. You can download it e.g. from the Debian server. Download the .tar.gz file and unpack it. Then you find the file FluidR3_GM.sf2. This is the file you need.

If you have this or any other soundfont file on your computer, start Midica like described above. The main window of Midica opens. In the import area under Soundfont click the button select file. Then choose the soundfont file with the extension .sf2.

Check the Remember checkbox next to the Button. Then Midica remembers the soundfont file path. If you close Midica and then start it again, the soundfont will be loaded automatically.

Development Process

In order to develop a MIDI sequence with a Music Programming Language using Midica, you must write the source code into a plain text file with the file extension .midica, .mpl, .alda or .abc, depending on the language you want to use. It doesn't matter which editor you use. Just use your favorite text editor.

If you choose MidicaPL for programming, than the actual language syntax and note naming depends on the chosen configuration. In this tutorial the configuration settings shown in the Configuration table are assumed. This is the default configuration. But it can be changed in the Configuration area in the main window (upper left corner).

For ALDA or ABC, the configuration doesn't matter.

During the development process you will switch from your editor to the Midica player very often. You will change the file and save it in the editor, then switch to the player and hit the Reparse button or press F5. Then the file will be parsed again. When hitting the Play button or pressing p or the space bar, the resulting MIDI sequence will be played.

Configuration
Configuration Setting
Note System International, lower (c, d, e, f, g, a, b, c)
Half Tone Symbols # / b (c#, cb, d#, db, ...)
Default Half Tone sharp (#, -is, -dieses)
Octave Naming +n/-n (c-2, c-, c, c+, c+2, c+3, ...)
Syntax Mixed Case Syntax
Percussion Shortcuts English
Instrument Shortcuts English

First of all you have to create the file. Just create an empty file and call it tutorial.midica or something else with the file extension .midica or .mpl. (Or test.alda or something.abc if you prefer to write in ALDA or ABC.) Then start Midica, if not yet done. In the main window, press the upper right button. It's the select file button in the import area. Switch to the right tab, if not yet done (e.g. MidicaPL if you use MidicaPL). Then choose the empty file that you have just created.

Now you can open the player with the button Start Player. You cannot play anything yet because the file is still empty and so the MIDI sequence is empty as well. But now you can start your development cycle.

Begin with chapter 1 of the MidicaPL tutorial. (Or a different tutorial for ALDA or ABC.) Follow the instructions and change the source file according to the examples. Then switch to the player and press Reparse or F5, then play the sequence. Then change the file again. Try out your own variations of the examples and so on...

Developing with Midica is a bit like developing a website. But the HTML editor is any text editor. And the browser is the player. But F5 works similarly.