Of course but I have a bad English, not proper for a man page. In general, we can use every command with the syntax command infile outfile where the outfile is a score file for csound. Feel free to use the example everywhere tito On Mon, Mar 12, 2012 at 12:49:10PM +0100, joachim heintz wrote: > hi tito - > very cool example. i never knew about the feature, > though it's really great for extending csound's score language to the > own needs. i just looked at > http://www.csounds.com/manual/html/CommandUnifile.html but can't find > anything about it. > is it in any way documentated? if not, it would be great to add a note, > and perhaps your example, too. > best - > joachim > > Am 10.03.2012 18:38, schrieb Tito Latini: > > I have written a simple `perl' filter usable in > > You can set the seed in a comment, for example > > > > ;; SEED 123 > > > > and the random number with > > > > rand() > > rand(NUM) > > > > anywhere in the score. > > > > # cs_sco_rand.pl > > my ($in, $out) = @ARGV; > > open(EXT, "<", $in); > > open(SCO, ">", $out); > > > > while () { > > s/SEED\s+(\d+)/srand($1);$&/e; > > s/rand\(\d*\)/eval $&/ge; > > print SCO; > > } > > > > > > Here is a csd file for the test > > > > ;; score_random.csd > > > > > > > > instr 1 > > prints "amp = %f, freq = %f\n", p4, p5; > > endin > > > > > > > > > > i1 0 .01 rand() [200 + rand(30)] > > i1 + . rand() [400 + rand(80)] > > i1 + . rand() [600 + rand(160)] > > ;; SEED 123 > > i1 + . rand() [750 + rand(200)] > > i1 + . rand() [210 + rand(20)] > > e > > > > > > > > > > > > csound score_random.csd > > ... > > amp = 0.825471, freq = 217.856199 > > ... > > amp = 0.628137, freq = 463.863331 > > ... > > amp = 0.790931, freq = 638.330751 > > ... > > amp = 0.279512, freq = 832.905816 > > ... > > amp = 0.925176, freq = 212.590480 > > ... > > > > > > PS Only the git version of csound removes all the temp files on *nix OS > > > > tito > > > > > > Send bugs reports to the Sourceforge bug tracker > > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > > Discussions of bugs and features can be posted here > > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > > > > > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"