Re: Mathematica to MIDI?
- To: mathgroup at smc.vnet.net
- Subject: [mg27858] Re: Mathematica to MIDI?
- From: "marcos" <marcos at centrifuge.org>
- Date: Thu, 22 Mar 2001 04:30:01 -0500 (EST)
- References: <98viob$946@smc.vnet.net> <994af7$5jc@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
MIDI does not contain sound information directly, it contains control information that drives sound producing devices. The advantage of this is twofold: first, it is very compact; and, second, it permits one to concentrate on an overall composition at a structural and symbolic level. Mathematica is a wonderful tool, but when it comes to creating soundof any but the shortest duration, it can easily get overwhelmed. This is a pity, because there are many musical ideas that it could be brought to bear upon. Having Mathematica produce MIDI files is one way of getting around this limitation. The MIDI files can then be converted to sound files with other programs, such as Csound (this, of course, begs the question: why not just work directly with Csound?). See www.csound.org for more information on Csound. You might also be interested in a Lisp-based program called Symbolic Composer: http://www-ks.rus.uni-stuttgart.de/people/schulz/fmusic/symbolic/mainpage.ht ml The easiest way to do what you want is with MAX/MSP: see www.cycling74.com: this would allow you to write your Mathematica data to an ordinary text file, in a format of your own invention, and read it with MAX. Once inside MAX, the rest would be trivial, and you could have the choice of staying with MIDI, or working with sound directly( with MSP). In any case, a MIDI file is simply a series of bytes that follow the MIDI specification (www.midi.org). Mathematica is certainly capable of producing such files. You would need to refer to the MIDI spec, or to a source such as "MIDI Programmers Handbook" (De Furia and Scaccaiferro) for the details. If you have a list of pitches and durations, you've probably already done the hard part; the rest should be relatively straightforward. Good luck! M "Paul Lutus" <nospam at nosite.com> wrote in message news:994af7$5jc at smc.vnet.net... > "Alan" <kd7cyb at mac.com> wrote in message news:98viob$946 at smc.vnet.net... > > I know what MIDI is and what I am trying to do is convert, for example, > > a list of values containing a frequency to play on the synthesizer and > > the duration for how long to play it. Is there a Mathematica package to > > do so? > > > > The list may look like: > > {{note,duration},{note,duration},{note,duration}...} > > Why not export the information as a supported file type (aiff,au,snd,wav) > and convert it externally? There are many ways, some free, to convert from a > common file type like WAV to another format like MIDI. > > But if your purpose is simply to export and play a sound file, why not this > (example for Windows): > > s = Play[Sin[2 Pi 440 t],{t,0,1},DisplayFunction->Identity]; > > Export["test.wav",s]; > > "test.wav" >> "!command.com" > > -- > Paul Lutus > www.arachnoid.com