[comp.sys.mac] Musical output from numerical simulations

hsg@romeo.cs.duke.edu (Henry Greenside) (10/27/88)

For a demo as part of a nonlinear dynamics course, I
would like to write a LSC application that would
integrate ordinary differential equations that have
chaotic behavior (e.g., the 3-variable Lorenz
equations) and present the output (value of x(t), y(t),
z(t)) as musical tones. The integration of o.d.e.s is
easy, the translation into sound is not.

Alternatively, you can imagine having time series
consisting of floating point numbers at equal intervals
of time. One would like to map the range of the time
series into the range of audible frequencies and
"listen" to the output, with possibly multiple voices
(several time series played at once).

As a complete beginner with little understanding of the
Macintosh interface, I was wondering if anyone out
there in netland has done something like this and could
send me some source code to imitate? Any pointers or
tricks to watch out for?

	Henry Greenside

mystone@caen.engin.umich.edu (Dean Yu) (10/27/88)

In article <12689@duke.cs.duke.edu>, hsg@romeo.cs.duke.edu (Henry Greenside) writes:
> For a demo as part of a nonlinear dynamics course, I
> would like to write a LSC application that would
> integrate ordinary differential equations that have
> chaotic behavior (e.g., the 3-variable Lorenz
> equations) and present the output (value of x(t), y(t),
> z(t)) as musical tones. The integration of o.d.e.s is
> easy, the translation into sound is not.
> 
> Alternatively, you can imagine having time series
> consisting of floating point numbers at equal intervals
> of time. One would like to map the range of the time
> series into the range of audible frequencies and
> "listen" to the output, with possibly multiple voices
> (several time series played at once).
> 
> As a complete beginner with little understanding of the
> Macintosh interface, I was wondering if anyone out
> there in netland has done something like this and could
> send me some source code to imitate? Any pointers or
> tricks to watch out for?
> 
  Gee, this sounds like Anthem Richard MacDuff of Wayforward Technologies... ;)
  

thisted@galton.uchicago.edu (Ronald A. Thisted) (10/28/88)

In article <12689@duke.cs.duke.edu> hsg@romeo.cs.duke.edu (Henry Greenside)
writes [edited for NetNews]:
=>For a demo, I would like to write a LSC application that would
=>present output as musical tones. The integration of o.d.e.s is
=>easy, the translation into sound is not.
=>
=>Alternatively, you can imagine having time series
=>consisting of floating point numbers at equal intervals
=>of time. One would like to map the range of the time
=>series into the range of audible frequencies and
=>"listen" to the output, with possibly multiple voices
=>(several time series played at once).
=>
=>I was wondering if anyone out
=>there in netland has done something like this and could
=>send me some source code to imitate?
=>
=>	Henry Greenside

In 1981 I gave a paper at the 13th Computer Science and Statistics
interface conference entitled, "The effect of personal computers on
statistical practice."  (The proceedings of the conference were
published by Springer).  I discussed exactly the idea that you raise
here, and I played a tape of some time series with different
characteristics.  For that work, I wrote a program for the old Apple ][
(remember, it WAS 1981) in Apple Pascal, which had a few sound
primitives built into it.

The Mac, of course, is a much better sound engine.  For the neophyte,
MS BASIC (version 2 or better) is very easy to use to get something up
and running that uses special features of the Mac (such as windows,
graphics, buttons, and sound) because it has builtin primitives for
doing so.  It also comes with demo programs for music (and other stuff).

/** flame retardent **/
Yes, I know about why BASIC is an abhorrent language.  But MS Basic
isn't nearly as bad as BASIC, per se, and incorporates many (but not
all) of the things one would want in a serious language.  I do a lot of
c programming, both in UNIX and Mac environments.  But MS BASIC is
really great for some things, and I have found it invaluable for
prototyping.  In any event, send flames to me by email if you must;
comp.sys.mac is too crowded anyway.
/** end flame retardent **/

If you email me your usps address, I can send you a copy of my paper.
I'm not sure that I can still lay my hands on the Pascal code, though.


Ron Thisted
Department of Statistics/The University of Chicago
thisted@galton.uchicago.edu

andrew@comp.vuw.ac.nz (Andrew Vignaux) (10/31/88)

This is a completely unhelpful reply -- but it confirms that nature sometimes
mimics fiction.

In article <12689@duke.cs.duke.edu> hsg@romeo.cs.duke.edu (Henry Greenside) writes:
>For a demo as part of a nonlinear dynamics course, I would like to write a
>LSC application that would integrate ordinary differential equations that
>have chaotic behavior (e.g., the 3-variable Lorenz equations) and present
>the output (value of x(t), y(t), z(t)) as musical tones. The integration of
>o.d.e.s is easy, the translation into sound is not.

There is a character in Douglas Adams' book "Dirk Gently's Holistic
Detective Agency" whose current project is to write an all-singing,
all-dancing Macintosh spreadsheet program

"... And being of a slightly whimsical turn of mind I took him literally."

"... So I sat down and wrote a program that'll take those numbers and do
 what you like with them.  If you want a bar graph it'll do them as a bar
 graph, if you want a pie chart or scatter graph it'll do them as a pie
 chart or scatter graph.  If you want dancing girls jumping out of the pie
 chart in order to distract attention from the figures the pie chart
 actually represents, then the program will do that as well.  Or you can
 turn your figures into, for instance, a flock of seagulls, and the
 formation they fly in and the way in which the wings of each gull beat will
 be determined by the performance of each division of your company.  Great
 for producing animated corporate logos that actually *mean* something."

"But the silliest feature of all was that if you wanted you company
 accounts represented as a piece of music, it could do that as well.  Well,
 I thought it was silly.  The corporate world went bananas over it."

"... Not so much here.  The yearly accounts of most British companies
 emerged sounding like the Dead March from Saul, but in Japan they went for
 it like a pack of rats.  It produced lots of cheery company anthems that
 started well, but if you were going to criticise you'd probably say that
 they tended to get a bit loud and squeaky at the end."

This has nothing to do with the rest of the book (which is described on the
cover as a Ghost-Horror-Detective-Whodunit-Time-Travel-Romantic-Musical-Comedy
Epic), but I am waiting for such a product to actually be released [perhaps
on the NeXT box ?] :-)

[Quotations from "Dirk Gently's Holistic Detective Agency" by Douglas Adams
(re: Hitchhiker's Guide to the Galaxy), Heinemann. ISBN 0-434-00900-8]

Andrew
--
Domain address: andrew@comp.vuw.ac.nz   Path address: ...!uunet!vuwcomp!andrew