home *** CD-ROM | disk | FTP | other *** search
- From: amlovell@phoenix.princeton.edu (Anthony M. Lovell)
- Newsgroups: comp.binaries.ibm.pc
- Subject: v01i065: travesty, text/music style simulator w/C source
- Date: 17 Dec 88 23:01:05 GMT
- Summary: travesty.arc, text/music style simulator w/C source
- Approved: dhesi@bsu-cs.UUCP
-
- Posting-number: Volume 01 Issue 065
- Originally-from: amlovell@phoenix.princeton.edu (Anthony M. Lovell)
- Submitted-by: amlovell@phoenix.princeton.edu (Anthony M. Lovell)
- Archive-name: travesty/travesty.uue
-
- [
- This is Anthony M. Lovell's implementation of a "travesty" algorithm.
- The purpose of travesty is to analyze some text and find statistical
- correlations between characters, then create some text that preserves
- these correlations. The result will stylistically resemble the
- original, though it might make little or no sense.
-
- This could be useful if, for example, you were Bacon and you wanted
- to write a play and pretend that you were Shakespeare. You would
- do something like:
-
- C:\PLAYS> trav 4 < hamlet > macbeth
-
- The output would be stylistically similar to Shakespeare's style in
- Hamlet, though it might not make much sense. Oh what a tangl'd web we
- weave when first we practise to deceive...Of course, I have no evidence
- that the real Bacon actually did this, or that he even owned a
- microcomputer. The parameter "4" to the "trav" program above asks it
- to use a fourth order travesty, which means that it will look for
- correlations of characters in groups of four.
-
- More interestingly, Anthony Lovell points out that it is possible to
- encode a melody into characters, and ask this program to generate new
- melodies from the encoded original. If you were to take a number of
- Chopin waltzes, for example, and do a travesty on them, the output
- might be some fairly decent-sounding music in Chopin's style. This
- makes me wonder if it might not be possible to write a travesty program
- that would take as its input four concurrent streams of data
- representing four-part harmony and preserve their relationships in a
- smooth way, so the output would contain some reasonable harmony too.
- Naturally, to make the output sound like something by Debussy, you
- would probably take the input from a random number generator. :-)
-
- There is a known bug in this program: If a parameter of 2 is supplied,
- the output may not be very random. Other values work well.
-
- Source for Turbo C 2.0 is included here. Anthony Lovell wants to
- credit the source of this idea thus: He wrote this program after a
- friend, who had seen the algorithm in an old BYTE article, described it
- to him. He has not seen the article himself.
-
- He suggests: "I recommend you try this out on a textfile you know
- well - it's more fun that way."
-
- -- R.D.
- ]
-