Overview
This is a program that reproduces the CMD PLAY command of the old 8-bit PC-8801 computer on the command line of a modern Windows computer. It can reproduce the sound of the nostalgic CMD PLAY command quite well.
- Sample output 1:
cmd_play.exe -reset "CDEFEDC"
- Sample output 2:
cmd_play.exe -reset "@23L8CDE4.DC8R8CDEDCD2" "@30L4CEECCECD"
- Sample output 3:
cmd_play.exe -reset #5 "@3L16FDEFDEFDEFDEFDEF" "@7L4DDD" "@34L4DDD" "@58L16CCCCCDDDDD" "@24O6L2EL16ECBAG"
- Sample output 4:
cmd_play.exe -reset "T140O4@44 EEE EDC C<BA A>CE AAA AGF FED DEF EFE A-FE EDC C<BA BBB B>C<B A&A&A RRR" -DA$="{A>CE<}" -DB$="[A$][A$][A$]" -DC$="{DFA}" -DD$="[C$][C$][C$]" -DE$="{CDA-}" -DF$="[E$][E$][E$]" -DG$="{CFA}" -DH$="[G$][G$][G$]" "T140O3@12[B$][B$][B$][B$][D$][D$][D$][D$][F$][F$][B$][H$][F$][F$][B$]{CDE}{ADE}A" -DX$="RCC" -DY$="RCC" "T140O5@58[X$][X$][X$][X$][Y$][Y$][Y$][Y$][X$][X$][X$][X$][X$][X$][X$]CCL32CCDDEFGAA4"

Usage
Basically, you enter commands into the black command prompt screen.
Usage: cmd_play [Options] [#n] [string1] [string2] [string3] [string4] [string5] [string6]
Options:
-DVAR=VALUE Assign to a variable.
-save-wav output.wav Save as WAV file (except MIDI sound).
-save-mid output.mid Save as MID file (MIDI sound only).
-reset Stop music and reset settings.
-stopm Same as -reset except that the tone is not changed.
-stereo Make sound stereo (default).
-mono Make sound mono.
-voice CH FILE.voi Load a tone from a file to channel CH (FM sound).
-voice CH "CSV" Load a tone from an array to channel CH (FM sound).
-voice-copy TONE FILE.voi Copy the tone to a file (FM sound).
-bgm 0 Wait until the performance is over.
-bgm 1 Don't wait until the performance is over (default).
-help Display this message.
-version Display version info.
Numeric variables can be specified by enclosing them between an equal sign and a semicolon: "L=variable name;".
String variables can be expanded by enclosing them in [ ].
Downloads
cmd_play-2.5-x86.zip
– Windows binary (x86) – 778 KB (797,286 bytes)
CMD PLAY
statement (8801 only) (CMD extension)
- [Function] Plays music.
- [Etymology] Command play
- [Format]
CMD PLAY [#
sound source mode,] [
string 1][,
string 2][,
string 3][,
string 4][,
string 5][,
string 6]
- [Example]
CMD PLAY "CDE"
⇒ Plays Do-Re-Mi - [Explanation] Can play up to 6 chords. string 1, string 2, string 3 correspond to channels 1, 2, 3, string 4, string 5, string 6 correspond to channels 4, 5, 6.
sound source mode is a value between 0
and 5
, and has the following meanings.
#0
… Uses an external SSG sound source. Channels 1 to 6 use the SSG sound source.#1
… Uses an external MIDI sound source. Channels 1 to 6 use the MIDI sound source.#2
… Channels 1 to 3 use the FM sound source, and channels 4 to 6 use the SSG sound source.#3
… Switches OPN to sound effect mode. Sound is produced by theY
statement ofCMD PLAY
.#4
… Switches OPN to CSM (sine wave) mode. Sound is produced by theY
statement ofCMD PLAY
.#5
… Uses FM sound source. Channels 1 to 6 use the FM sound source.
If sound source mode is omitted, #2
is selected. #5
can only be selected on sound board 2.
Normally, use sound source mode at #0
, #1
, #2
, or #5
. Rhythm sound sources are not yet supported.
The character strings for each channel are called MML (Music Macro Language), and have the following meanings:
String | Meaning | Default |
---|---|---|
Mx (SSG only) | Sets the envelope period (1≦x ≦65535). x is optional. | M255 |
Sx (SSG only) | Sets the envelope shape (0≦x ≦15). x is optional. | S1 |
Vx | Sets the volume (0≦x ≦15). x is optional. | V8 |
Lx | Sets the default length of notes and rests (1≦x ≦64). x is optional. | L4 |
Qx | Sets the length ratio of notes (1≦x ≦8). x is optional. | Q8 |
Ox | Sets the octave (1≦x ≦8). x is optional. | O4 |
> | Raises the octave by one. | |
< | Lowers the octave by one. | |
Nx | Plays the note of the height specified by x (0≦x ≦96). x is not optional. | |
Tx | Sets the tempo (32≦x ≦255). x is optional. | T120 |
Rx | Plays a rest (1≦x ≦64). x is the length of the rest. x is optional. | R4 |
C ~B[+/-][x][.] | Plays a note (1≦x ≦64). x is the length of the note. x is optional. | |
+ (# ) | Raises the previous note by a semitone. | |
- | Lowers the previous note by a semitone. | |
. | Adds a dot to the previous note or rest, lengthening it by 1.5 times. | |
& | Connects the preceding and following notes. | |
{ … }x | Plays a tuple of notes equally divided by x in the specified length. x is optional. | |
@x (FM/MIDI only) | Switches to the tone specified by the tone number x . x is not optional. | @0 |
Yr,d (OPN only) | Sets the content of OPN register r to d (0≦r ≦178 and 0≦d ≦255). | |
Zd (MIDI only) | Sends 1-byte data d to MIDI (0≦d ≦255). | |
@M (Soundboard 2, FM/MIDI only) | Sets the output to both left and right channels. | |
@L (Soundboard 2, FM/MIDI only) | Sets the output to the left channel. | |
@R (Soundboard 2, FM/MIDI only) | Sets the output to the right channel. | |
@Vx (FM/MIDI only) | Fine-tunes the volume (0≦x ≦127). x is not optional. | @V106 |
@Wx | Maintains the state for the length specified by x (1≦x ≦64). x is optional and defaults to the value of L . |
- The musical notes
CDEFGAB
correspond to “Do Re Mi Fa So La Si”. - For tone numbers, see the tone list.
@x
cannot be specified in MIDI on the actual machine. Instead, useZd
multiple times to change the program.@M
,@L
, and@R
cannot be specified in MIDI on the actual machine. Instead, useZd
multiple times to set the pan.- For more information about MIDI, see the Wikipedia MIDI page.
- On some models, after you set
@V
,@V
takes precedence over theV
setting. - The
CMD PLAY
statement is an extended CMD command and can only be used on the 8801. Before usingCMD PLAY
, you must executeNEW CMD
(except in unlimited mode). If you specify a string longer than 255 characters, aString too long
error will occur (except in unlimited mode).
Supported platforms
- Windows XP and later
Notice
- BASIC’s CMD PLAY statement is comma-separated, but cmd_play is space-separated for command line convenience.
- If you want to enjoy modern digital music production, try looking for free DTM software. That said, inputting notes in DTM is a pain, and it’s a legacy of the past… (omitted)
Change Log
- See Release notes .
License Agreement
- Use of this software must comply with the terms of use of the “fmgon license” described in LICENSE.txt.
- The source code of this software can be downloaded from
https://github.com/katahiromz/cmd_play
. - Parts of this software are copyrighted by cisc (
cisc@retropc.net
).
Contact
- Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com