home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky bit.listserv.frac-l:1375 comp.music:6403 sci.fractals:644
- Path: sparky!uunet!ulowell!m2c!nic.umass.edu!hamp.hampshire.edu!aalpern
- From: aalpern@hamp.hampshire.edu
- Newsgroups: bit.listserv.frac-l,comp.music,sci.fractals
- Subject: Chaos C code(Was:Re:chaotic modelling)
- Message-ID: <1993Jan27.101724.1@hamp.hampshire.edu>
- Date: 27 Jan 93 14:17:24 GMT
- Distribution: inet
- Organization: Hampshire College
- Lines: 54
- NNTP-Posting-Host: hamp.hampshire.edu
-
-
- Here's those code snippets I promised. Apologies for the delay, but all the
- computing facilities here at Hampshire were closed yesterday.
- The algorithms presented here were taken from Rick Bidlack's
- paper entitled "Chaotic Systems as Simple (But Complex)
- Compositional Algorithms. Computer Music Journal Vol. 16
- No. 3, Fall 1992, MIT Press
-
- Here's a C code snippet for iterating the Henon system.
- ITERATIONS is the number of iterations you desire. After about
- 80 iterations or so the transients filter out and the system
- assumes a chaotic behavior.
-
- float new_iota, new_theta,
- A = 1.43, B = 0.3;
- /* A and B are parameters which determine the orbit */
-
- for(counter = 0; counter < ITERATIONS; counter++) {
- output(iota,theta) /* produce sound, graphics, or whatever */
-
- new_iota = theta + 1.0 - (A*(iota*iota));
- new_theta = B * iota * P;
-
- iota = new_iota;
- theta = new_theta;
- }
-
- This is a loop for iterating the Standard Map.
-
- float new_iota, new_theta, K = 1.1;
- /* K is the controlling parameter in this system */
- for(counter = 0; counter < length; counter++) {
- output(iota,theta);
- new_iota = iota + (K * sin(theta));
- new_theta = theta + new_iota;
-
- iota = new_iota;
- theta = new_theta;
- }
-
- Here are some parameter values that will produce a Chaotic
- orbit. For Henon:
- with B = 0.3, use A = 1.076, 1.4, 1.43
- For the Standard Map:
- K = 1,1.02,1.1,2.6. Values for K above 1 will usually produce
- a chaotic orbit, but there are "windows" of periodicity to
- be found too.
-
- In order to produce music from these, one has to figure out a way to
- interpret the results. You could map the results directly to frequency and
- delta-time, or mess with them to get something like a scale index.
-
- -Adam
- aalpern@hamp.hamsphire.edu
-