Printing to file using >>> "file" & control structures
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg430] Printing to file using >>> "file" & control structures
- From: clefort at unix1.sncc.lsu.edu (Clinton R Lefort)
- Date: Wed, 25 Jan 1995 14:39:27 -0600
Hello,
I am currently writing a routine that is connecting Macintosh Common Lisp with Mathematica , and using the data in Mathematica to generate a score file for use in Csound, a music synthesis program,developedat MIT.
I am having difficulty havng Mathematica print theresults in Tableformatted form to another file...this is my algorithm...
OpenWrite[".sco1"]]
Inst[x_] := x+1
Start[x_] := x
Dur[x_] := x * .314
Amp[x_] := If[x>44000, x/2,x*.314]
Freq[x_] := x * .314
OutputFormTableForm[{{Inst[0],Start[0], Dur[1],Amp[200],Freq[1000]},
{Inst[1],Start[1], Dur[3],Amp[400],Freq[4000]},
{Inst[4],Start[4], Dur[5],Amp[600],Freq[7000]},
{Inst[3],Start[3], Dur[7],Amp[800],Freq[4000]},
{Inst[11]Start[20],Dur[9],Amp[250],Freq[1000]}},
TableHeadings ->{Automatic,{"I","S","D","A","F"}}]
I would also like to have this algorithmgeneratea control loop in which at the end of each # of iterations it would print to another file, start overagain, iterate a certain number of times and themn append to the previous file ...
isthis kind of control structure possible in MAthematica..any ideas will be appreciated...
Thanks
CRL