TriuneCadence/THES/CLASCOMP.PP

94 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PROGRAM classical_composition (Input,Output);
{
This program composes note sequences in a manner designed to conform as
far as possible to a set of example sequences.
}
{
Copyright 1989 by Wesley R. Elsberry. All rights reserved.
Commercial use of this software is prohibited without written consent of
the author.
For information, bug reports, and updates contact
Wesley R. Elsberry
528 Chambers Creek Drive South
Everman, Texas 76140
Telephone: (817) 551-7018
}
USES
DOS, misc1, ANSI_Z, globals, clasinst;
{General}
VAR
ii, jj, kk : INTEGER;
notes : notes_;
sinch : CHAR;
scon, outfname : STRING;
outf : TEXT;
cnt,success : INTEGER;
ana : ARRAY[1..8] OF INTEGER;
ana_cnt : INTEGER;
PROCEDURE fill_ana (notes : notes_);
VAR
ii, tr : INTEGER;
BEGIN
ana_cnt := 0;
FOR ii := 1 TO 8 DO BEGIN
notes[5] := ii;
ana[ii] := classical_instructor(notes);
END;
FOR ii := 1 TO 8 DO BEGIN
IF ana[ii] = 1 THEN BEGIN
INC(ana_cnt);
ana[ana_cnt] := ii;
END;
END;
END;
BEGIN
Randomize;
FOR ii := 1 TO 5 DO BEGIN
notes[ii] := 0;
END;
{Get filename to test}
Write('Name of file to process: ');
Readln(outfname);
{Open for input}
Assign(outf,outfname);
Rewrite(outf);
FOR ii := 1 TO 10000 DO BEGIN
fill_ana(notes);
IF ana_cnt <> 0 THEN BEGIN
notes[5] := ana[(Random(ana_cnt) + 1)];
END
ELSE BEGIN
notes[5] := Random(8) + 1;
END;
FOR jj := 1 TO 4 DO BEGIN
notes[jj] := notes[jj+1];
END;
Writeln(outf,notes[5]);
END;
Close(outf);
END.