Instrument playing is one of those things that's pretty unique to Mabi, especially with the ability to write, trade, and even sell your own music. But there's a lot more to being a Maestro of Mabi than meets the eye.
[SIZE="4"]The Basics of the MML format:[/SIZE]
Music in Mabinogi, even default songs, is encoded in a custom format known as "MML". The format of MML is well documented on the wiki, so I won't spend much time on it.
MML is really just a text-based MIDI subset. MIDI (Musical Instrument Digital Interface) is a way for computers to control instruments. Ever seen a self-playing piano? If there was an electronic box near it, that box was using a MIDI file to "play" the piano.
MIDI is a computer-readable encoding of traditional sheet music. It tells the computer which note to play, how long to play it, the volume, etcetc. A computer then passes this information on to a synthesizer, which does whatever it needs to do to create the appropriate sound. Some synthesizers, like the piano we mentioned before, physically manipulate an instrument. Others, called software synthesizers, play a sound file that corresponds to the correct note. Obviously, one sound bite cannot reproduce all possible sounds of an instrument (think about how many ways you can sing a note), so you sacrifice some quality in exchange for a small, easily edited file.
[SIZE="4"]Composing:[/SIZE]
A major draw of Mabi is the ability to write your own MML, and have it play for everyone who cares to hear. When you use the compose skill, your game sends the MML to the server. The server inspects it for length (sadly), sets the difficulty level, possibly applies an effect, and then compresses the MML. The compression is done via a text-based Z-Lib implementation. (Z-Lib is the same algorithm used in Zip files and PNG files, among others.)
This compression was probably supposed to reduce the size of the then-largest packet in the game. (Nowadays, your character information packet takes that crown. Mine routinely exceeds 100kb.)
All the information above is written to the score scroll, which means it's recoverable with the right tools.
The server limits the length of the MML, so you can't endlessly serenade poor victims. However, the client supports much longer scrolls. I believe I've tested up to 10,000 characters per track. Here is a (poor, I think I forgot a tempo somewhere) rendition of "Through the Fire and Flames" as an example.
[video=youtube;qi-dYh7hj3U]https://www.youtube.com/watch?v=qi-dYh7hj3U[/video]
[SIZE="4"]Playing Music in Mabi:[/SIZE]
Mabi takes MML and passes it to a software synthesizer that has been loaded with the sounds we know and love, like lutes. More recently, they recorded humans singing various pitches in order to support microphones and such. This synthesizer plays back audio through your speakers. However, it appears to be rather limited.
Testing reveals it supports only 15 "tracks" (a track is one line in a score scroll). Even mediocre midi files have many, many more. 15 tracks means that a single client can only play five people at a time. In all the videos you see with more, they have used multiple (sometimes invisible) characters to "listen" to different parts, or rendered the MML outside the client totally. They also severely chopped the ranges of some instruments. I'm looking at you, violin!
[SPOILER="Example MIDI"]Check out this MIDI version of "Radioactive" played on a free, modern software synthesizer. Mabi couldn't come anywhere near this, even if you hacked at it for a very long time. Remember, each simultaneously playing note needs its own track.
[video=youtube;4P1wJ48foL4]https://www.youtube.com/watch?v=4P1wJ48foL4[/video][/SPOILER]
Playing a scroll sends the MML to your computer. A quality level (VeryGood, Good, Bad, VeryBad) determines how much the game mangles the MML before passing it to the synthesizer.
Playing a scroll takes 0.1 durability. Scrolls have a durability of 10, and the client calculates how many uses you have left by using the durability. Sad.
[SIZE="4"]Special skills:[/SIZE]
The special bard skills always play MML with the highest quality. They roll a random number to determine the level of the effect (normal/inspiring/haunting). If you're not playing a scroll, this random number controls the default music played. I gotta believe this is intentional, as Ferghus's theme is always the one that plays for a haunting Harvest Song.
Enthralling Performance had to be hacked. Ordinarily, you can't move while playing music, due to the presence of a "Lock" on your character. Disabling this lock would thus allow you to move. Simple, right? (Longtime readers of this section can probably guess what's coming.)
Well apparently, devCat couldn't figure out their own system, because they didn't do this. Instead, they added a special character state, called "HamelinSong" internally, to enable walking. Astute readers will notice that Hamelin was the setting for the story of the Pied Piper. Also, some instruments, like the microphone, don't know how to handle this state and will glitch.
Jam band is little more than a skill that makes everyone use playing instrument at the same time. This leads the the possibility of individual failures, which literally every other bard skill doesn't have. Its implementation also paves the way for unique issues like one person's part getting delayed due to network lag. Nowadays, if you want to jam music, you use the disappearance of a chat bubble as a sync-cue for everyone in the band to use a bard skill.
[SIZE="4"]Special effects:[/SIZE]
The unique graphics associated with various music skills, like the haunting performances, or magical music, are "pasted" on top of the basic music playing animation by the server. This means that much, much more involved effects are possible. See the following examples:
[video=youtube;T_62J2ZF1rY]https://www.youtube.com/watch?v=T_62J2ZF1rY[/video]
[video=youtube;U9zywnGnYx8]https://www.youtube.com/watch?v=U9zywnGnYx8[/video]