<s>
Music	B-Application
Macro	I-Application
Language	I-Application
(	O
MML	O
)	O
is	O
a	O
music	B-Language
description	I-Language
language	I-Language
used	O
in	O
sequencing	O
music	O
on	O
computer	O
and	O
video	O
game	O
systems	O
.	O
</s>
<s>
An	O
example	O
of	O
an	O
early	O
popular	O
Arcade	O
game	O
with	O
music	O
is	O
The	O
Circus	B-Application
from	O
Exidy	O
Corporation	O
in	O
1977	O
.	O
</s>
<s>
The	O
boom	O
in	O
Japanese	O
video	O
games	O
was	O
heralded	O
in	O
1978	O
by	O
the	O
appearance	O
in	O
Japanese	O
game	O
centers	O
(	O
Amusement	O
arcades	O
)	O
of	O
Space	B-Application
Invaders	I-Application
by	O
Taito	O
.	O
</s>
<s>
The	O
music	O
was	O
all	O
proprietary	B-Application
(	O
closed	B-Application
source	I-Application
)	O
.	O
</s>
<s>
The	O
1978	O
release	O
of	O
the	O
Programmable	B-Device
interval	I-Device
timer	I-Device
by	O
Intel	O
was	O
significant	O
.	O
</s>
<s>
The	O
Intel	B-Device
8253	I-Device
Mode	O
3	O
Square	O
Wave	O
generator	O
was	O
used	O
for	O
music	O
,	O
in	O
the	O
Kit	O
computer	O
MZ-40K	B-Operating_System
(	O
)	O
by	O
SHARP	O
Corporation	O
,	O
made	O
in	O
Japan	O
at	O
May	O
1978	O
.	O
</s>
<s>
The	O
MZ-40K	B-Operating_System
featured	O
an	O
open	B-Architecture
architecture	I-Architecture
and	O
program	O
sources	O
,	O
was	O
therefore	O
a	O
kind	O
of	O
open	B-Application
source	I-Application
software	I-Application
.	O
</s>
<s>
The	O
first	O
commands	O
for	O
classical	O
MML	O
appeared	O
in	O
the	O
internal	O
architecture	B-General_Concept
of	O
the	O
SP-1002	O
MONITOR	O
IOCS	B-Application
and	O
SP-5001	O
BASIC	O
Operating	O
Systems	O
on	O
the	O
MZ-80K	B-Operating_System
8-bit	O
computer	O
.	O
</s>
<s>
It	O
incorporated	O
Intel	B-Device
8253	I-Device
hardware	O
and	O
memory	O
mapped	O
I/O	O
.	O
</s>
<s>
The	O
sound-related	O
BASIC	O
Statements	O
were	O
MUSIC	O
,	O
TEMPO	B-Application
,	O
and	O
BEEP	O
.	O
</s>
<s>
Notes	O
are	O
specified	O
in	O
a	O
three-octave	O
range	O
.	O
</s>
<s>
"	O
+	O
"	O
(	O
or	O
in	O
some	O
old	O
code	O
,	O
"	O
￣	O
"	O
)	O
indicates	O
upper	O
octave	B-Language
,	O
"	O
-	O
"	O
(	O
or	O
in	O
some	O
old	O
code	O
,	O
"	O
＿	O
"	O
)	O
indicates	O
the	O
lower	O
octave	B-Language
.	O
</s>
<s>
Sound	O
length	O
Internal	O
value	O
×	O
TEMPO	B-Application
values.Tone	O
length	O
Demisemiquaver	O
is	O
0	O
(	O
SP-1002	O
Internal	O
value	O
is	O
1	O
)	O
-	O
Whole	O
note	O
is	O
9	O
(	O
SP-1002	O
Internal	O
value	O
is	O
32	O
)	O
.	O
</s>
<s>
Music	O
played	O
on	O
Call	O
to	O
$0030	O
SP-1002	O
IOCS	B-Application
program	O
routine	O
.	O
</s>
<s>
Statements	O
TEMPO	B-Application
n	O
is	O
1	O
–	O
9	O
,	O
the	O
slowest	O
1.TEMPO	O
4	O
is	O
similar	O
T	O
=	O
120	O
.	O
</s>
<s>
Modern	O
MML	O
originally	O
appeared	O
in	O
Microsoft	B-Language
BASIC	I-Language
and	O
was	O
common	O
in	O
the	O
early	O
1970s	O
and	O
1980s	O
on	O
8-bit	O
and	O
16-bit	B-Device
era	O
Japanese	O
personal	B-Device
computers	I-Device
.	O
</s>
<s>
The	O
NEC	B-Device
PC-6001	I-Device
included	O
Microsoft	B-Language
BASIC	I-Language
and	O
the	O
Programmable	O
Sound	O
Generator	O
in	O
1981	O
.	O
</s>
<s>
The	O
MML	O
was	O
especially	O
popular	O
on	O
NEC	O
's	O
personal	B-Device
computers	I-Device
,	O
such	O
as	O
the	O
NEC	B-Device
PC-8801	I-Device
.	O
</s>
<s>
Modern	O
MML	O
originated	O
as	O
a	O
sub-language	O
of	O
BASIC	O
,	O
then	O
generally	O
included	O
in	O
ROM	B-Device
on	O
micro-computers	O
.	O
</s>
<s>
Though	O
many	O
platforms	O
feature	O
custom	O
extensions	O
and	O
letter	O
case	O
requirements	O
and	O
other	O
minor	O
syntactical	O
features	O
vary	O
slightly	O
in	O
some	O
implementations	O
,	O
the	O
fundamental	O
syntax	B-Application
rules	O
,	O
commands	O
and	O
features	O
that	O
define	O
MML	O
and	O
are	O
present	O
in	O
whole	O
or	O
in	O
part	O
in	O
all	O
implementations	O
are	O
as	O
follows	O
:	O
</s>
<s>
Sometimes	O
also	O
r	O
,	O
although	O
the	O
original	O
IBM	O
and	O
Microsoft	B-Language
BASIC	I-Language
used	O
p	O
,	O
as	O
do	O
all	O
clones	O
(	O
e.g.	O
</s>
<s>
the	O
Linux	O
and	O
BSD	B-Operating_System
speaker	O
devices	O
)	O
.	O
</s>
<s>
o	O
—	O
Followed	O
by	O
a	O
number	O
,	O
o	O
selects	O
the	O
octave	B-Language
the	O
instrument	O
will	O
play	O
in	O
.	O
</s>
<s>
>	O
,	O
<—	O
Used	O
to	O
step	O
up	O
or	O
down	O
one	O
octave	B-Language
.	O
</s>
<s>
v	O
—	O
Followed	O
by	O
a	O
number	O
,	O
sets	O
the	O
volume	B-Application
of	O
the	O
instrument	O
.	O
</s>
<s>
Some	O
implementations	O
also	O
allow	O
an	O
ADSR	O
envelope	O
to	O
be	O
applied	O
to	O
the	O
amplitude	B-Application
of	O
each	O
note	O
.	O
</s>
<s>
t	O
—	O
Followed	O
by	O
a	O
number	O
,	O
sets	O
the	O
tempo	B-Application
in	O
beats	O
per	O
minute	O
.	O
</s>
<s>
On	O
hardware	O
with	O
more	O
than	O
one	O
sound	O
channel	O
,	O
it	O
is	O
often	O
possible	O
to	O
set	O
each	O
channel	O
to	O
a	O
different	O
tempo	B-Application
.	O
</s>
<s>
Standard	O
Musical	O
eXpression	O
(	O
SMX	O
)	O
is	O
a	O
variant	O
of	O
Modern	O
MML	O
provided	O
by	O
Microsoft	O
in	O
QBASIC	B-Language
,	O
BASICA	O
,	O
and	O
GW-BASIC	B-Language
'	O
s	O
statement	O
.	O
</s>
<s>
The	O
version	O
used	O
by	O
GW-BASIC	B-Language
is	O
part	O
of	O
the	O
modern	O
BSDs	B-Operating_System
,	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
OpenBSD	B-Operating_System
,	O
and	O
MirOS	B-Application
;	O
see	O
speaker(4 )	O
for	O
the	O
language	O
.	O
</s>
<s>
Microsoft	O
's	O
QBASIC	B-Language
,	O
BASICA	O
,	O
and	O
GW-BASIC	B-Language
all	O
feature	O
a	O
PLAY	O
statement	O
which	O
takes	O
a	O
string	O
argument	O
in	O
the	O
SMX	O
format	O
.	O
</s>
<s>
The	O
name	O
"	O
Music	B-Application
Macro	I-Application
Language	I-Application
"	O
may	O
originate	O
with	O
GW-BASIC	B-Language
,	O
which	O
provided	O
a	O
facility	O
"	O
to	O
play	O
music	O
by	O
embedding	O
a	O
music	B-Application
macro	I-Application
language	I-Application
into	O
the	O
string	O
data	O
type.	O
"	O
</s>
<s>
Eric	O
S	O
.	O
Raymond	O
wrote	O
a	O
UNIX	O
System	O
V	O
driver	O
that	O
offers	O
/dev/speaker	O
in	O
a	O
GW-BASIC-compatible	O
format	O
.	O
</s>
<s>
It	O
was	O
subsequently	O
ported	O
to	O
386BSD	B-Operating_System
and	O
is	O
present	O
modern	O
BSD	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
The	O
NEC	B-Device
PC-8801	I-Device
'	O
s	O
BASIC	O
dialect	O
,	O
N88-BASIC	O
,	O
used	O
MML	O
in	O
its	O
PLAY	O
statement	O
,	O
as	O
did	O
several	O
other	O
implementations	O
of	O
BASIC	O
produced	O
or	O
sold	O
by	O
NEC	O
.	O
</s>
<s>
According	O
to	O
Koshiro	O
,	O
it	O
"	O
was	O
more	O
a	O
BASIC-style	O
language	O
at	O
first	O
,	O
but	O
I	O
modified	O
it	O
to	O
be	O
something	O
more	O
like	O
Assembly	B-Language
.	O
</s>
<s>
Various	O
MML	O
utilities	O
were	O
written	O
for	O
the	O
NEC	B-Operating_System
PC-9801	I-Operating_System
family	O
of	O
computers	O
,	O
including	O
PMD	O
(	O
Professional	O
Music	O
Driver	O
)	O
by	O
game	O
composer	O
Masahiro	O
Kajihara	O
(	O
most	O
commonly	O
known	O
as	O
KAJA	O
)	O
,	O
which	O
was	O
used	O
by	O
composer	O
Ryu	O
Umemoto	O
for	O
games	O
like	O
EVE	O
Burst	O
Error	O
and	O
Grounseed	O
,	O
as	O
well	O
as	O
by	O
game	O
developer	O
ZUN	O
for	O
most	O
of	O
his	O
first	O
five	O
Touhou	O
Project''	O
games	O
.	O
</s>
<s>
The	O
mck	O
,	O
pmck	O
,	O
and	O
ppmck	O
utilities	O
for	O
creating	O
Nintendo	O
Entertainment	O
System	O
music	O
,	O
and	O
a	O
number	O
of	O
other	O
tools	O
for	O
creating	O
music	O
for	O
other	O
hardware	O
,	O
such	O
as	O
the	O
Bandai	B-Operating_System
WonderSwan	I-Operating_System
,	O
the	O
NEC	B-General_Concept
PC	I-General_Concept
Engine	I-General_Concept
,	O
and	O
the	O
Sega	B-Operating_System
Mega	I-Operating_System
Drive	I-Operating_System
.	O
</s>
<s>
The	O
xpmck	O
utility	O
for	O
creating	O
music	O
for	O
various	O
systems	O
,	O
including	O
the	O
Sega	O
Master	O
System	O
,	O
Sega	O
Game	O
Gear	O
,	O
Sega	B-Operating_System
Mega	I-Operating_System
Drive	I-Operating_System
,	O
Nintendo	B-Device
Game	I-Device
Boy	I-Device
,	O
and	O
Commodore	O
64	O
.	O
</s>
<s>
On	O
the	O
MSX	B-Operating_System
computer	O
system	O
,	O
the	O
built-in	O
MSX	B-Language
BASIC	I-Language
also	O
uses	O
MML	O
with	O
PLAY-command	O
.	O
</s>
<s>
Music	O
hardware	O
expansions	O
such	O
as	O
MSX-Music	O
,	O
MSX-Audio	O
and	O
MSX-MIDI	O
expand	O
PLAY-command	O
so	O
that	O
also	O
FM-chips	O
and	O
external	O
MIDI	O
devices	O
can	O
be	O
controlled	O
through	O
MML	O
.	O
</s>
<s>
It	O
also	O
contains	O
a	O
library	O
and	O
utility	O
,	O
tested	O
with	O
MuseScore	B-Language
,	O
allowing	O
easy	O
debugging	O
of	O
especially	O
mass-parallel	O
MML	O
files	O
,	O
score	O
sheet	O
printing	O
(	O
ideally	O
after	O
some	O
minimal	O
postprocessing	O
,	O
but	O
the	O
defaults	O
are	O
usually	O
legible	O
)	O
,	O
etc	O
.	O
</s>
<s>
Petit	B-Device
Computer	I-Device
and	O
SmileBASIC	O
both	O
offer	O
BGMPLAY	O
functions	O
,	O
which	O
can	O
either	O
take	O
a	O
preset	O
MML	O
track	O
or	O
one	O
provided	O
as	O
a	O
string	O
.	O
</s>
<s>
The	O
game	O
also	O
teaches	O
users	O
the	O
syntax	B-Application
via	O
skill	O
books	O
,	O
which	O
doubled	O
as	O
a	O
way	O
to	O
unlock	O
a	O
higher	O
size	O
limit	O
when	O
writing	O
the	O
code	O
.	O
</s>
<s>
ArcheAge	B-Protocol
MMO	O
provides	O
the	O
same	O
features	O
.	O
</s>
