mml2mid
Program converting MML music to MIDI file
- Active · last change 10-28-2026
- ★ 1 on GitHub
README
mml2mid
Convert QBasic-style MML to MIDI file.
Pascal version of a FreeBASIC program by angros47.
Usage
./mml2mid sarabande.txt sarabande.midLines starting with ; are comments. Voices are separated by commas; each voice is written to its own track and MIDI channel (channel 9, used for percussion, is skipped), up to 15 voices. The tempo (T) is taken from the first voice.
; Three voices
T90 O4 L4 C E G >C,
O3 L2 C G,
O2 L1 CThere are beautiful Bach transcriptions in samples-beepy folder (coming from the beepy project).
Compilation
makeTPlay2Mid class
uses
SysUtils, Play2Mid;
(*
========================================================================
Johann Sebastian Bach
Sarabande from C Minor Cello Suite (BWV 1011)
FreeBASIC version 20.09.2020
========================================================================
*)
const
A = 'O4 L8MLGE-<BMN>CL4<A- L8ML>>C<A-EMNFL4<B L8ML>>D<A-EMNFML<GMN>G MLFE-<BMN>CL4<C';
B = 'O4 L8MLCE-A-MNGML>D-MNC ML<DFB-MNA-ML>CMN<B- MLA-GDMNE-ML<B-MN>D L2ML<E-.';
C = 'O4 L8MLB-GDMNE-L4<D- L8ML>B-GEMNFL4<G L8ML>>D-<B-EMNFML<CMN>>C ML<B-A-EMNFL4<F';
D = 'O3 L8MLE->CFMNE-MLB-MNA ML<D>DGMNFML>CMN<B ML>C<A-F+MNGML<BMN>C ML<G>DGMNF+ML>CMN<B';
E = 'O5 MLE-C<F+MNGML<AMN>>E- MLL64DE-L16D.L8<A-EMNFML<BMN>G MLFE-<BMN>CML<GMN>B ML<CG>FMNE-L4ML>C';
var
p2m: TPlay2Mid;
begin
p2m := TPlay2Mid.Create('sarabande.mid');
p2m.Play('T48' + A + B + A + B + C + D + E + C + D + E + 'P2.');
p2m.Free;
end.
