H.PlaySound (info about mml in Aion 7.0)

78 views
Skip to first unread message

AionMusic

unread,
Jan 21, 2020, 11:16:14 PM1/21/20
to aion...@googlegroups.com
In that post I'll try to collect some information about mml in Aion which not obvious and some part of that nuances can be changed in next versions. Not all of them was same in past as well.
Firstly list of all tags with short description:
t - set tempo, range 32 - 255
l - set default length for notes and silence, but not for percussions, range 64 - 1. point at end means plus half.
o - octave, range 1 - 9. If you dont put any value after this tag, octave will not changed. But if you put incorrect value, it's will reseted to default 4.
r - silence
a b с d e f g - notes, adding # after note make it major(sharp)
x - percussion
v - set volume, range 0 - 10
- - it's minus, and it's a bit weird tag which I'm found not long ago, perhaps it's just a bug in current version of Aion. But right now it's affects previous r tag, and nullifying it. For example "ar2-b" it's same as "ab", as you can see really weird tag.
> - decrease current octave by 1
< - increase current octave by 1
[ - label

Ok, it's perhaps not full list of tags, but it's enough and you know about them long ago, except maybe - (minus).
Now let's talk about how aion parsing them and when they applying.
I'm seperated them on 3 categories: prefix, triggers, postfix.
prefix: l, o, <, >
postfix: v, [, t
triggers: o, r, x, abcdefg

Firstly you usually should set prefix tags, and they set values for rest of triggers until you change them again. After that you use some triggers and after triggers you can use postfix which will applyed to previous trigger and rest of them until you change it again. 

Example: "t120 v10 o5 l16 a v1 b t60", here we have two notes, a and b. How they will played? Note a will have length 16 and will played with volume 1 and tempo 120. Next note b will have same length 16, volume 1 and tempo 60. Some of you thoght note a should played with volume 10, but as I mentioned before v it's postfix and only lastest will applyed. 
Lets change same example a bit: "t120 v10 o5 l16 a v1 v2 l8 o v3 b t60". Same notes again but how they'll played now? Shortly, a16 with volume 2 and b8 with volume 3, tempo will same as in previous example. So what happened here? Why note a with volume 2? Cause postfix tags overwrite self until next trigger, and after note a you can see o tag which separate commands for parser in aion (all triggers doing same).

Also it's a reason why you can't put labels without triggers between them.

Labels it's another weird thing in Aion's mml. Any triggers except "o" produce OnSoundPlay event and by default all of them using label 0, so if you type "r2[0]" it's will same as "r2", And if you expect what your label 0 will works... nope it's will not. Any commands which using labels ignore label 0. And all commsnds with negative label run immediately. H.SayAll(-10, "Hello World") will print "Hello World" without any delays and you no need to put labels in H.PlaySound for that.

Next thing about labels, It's can be overflow. What it's means? Any number have limits, and for labels aion using 32 bit signed integers, when you type number which more than 32 bit can contain it's overflow.
Example: "r[1000000000000]" In OnSoundPlay you will recieve -727379968 and for "r[4294967295]" you will recieve -1. It's can be used if you want make conditions for negative numbers in OnSoundPlay but I don't recommend it, just keep in mind. Also parser looking only for digits after [ and when it's meets not digit it's returning to usual way.
Example: "a[x]r" will play a and x, and actually you can skip tag ] cause parser dont care about it. 
Example: "r[10501qb[12]", will play r with label 10501 and b with label 12.
Example: "r[10-1]a[10-1]", will play a with label 10. Why? Remember I'm mentioned about -(minus)? Yeap, here -(minus) just erase r but not a.

Also, any tags in upper case it's legal, so "T120", and "t120" it's same. But in OnSoundPlay event you will recieve all notes in lower case.

I'm sure a lot of weird things hiding under hood which I'm not mentioned and perhaps they change them in future versions as they changed label 0 which was pretty legal before.

If you know about any other strange things in Aion's mml let us know here.
Reply all
Reply to author
Forward
0 new messages