This works!
Except that if I run:
chdir("ctests");
$cmd = "../bp -gr.NotReich -d --csoundout > out.sco";
exec($cmd,$o);
for($i=0; $i < count($o); $i++) echo $o[$i]."<br />";
nothing is displayed because the output is entirely stored in "out.sco"
on top of the Csound lines.
This means that we need an option to send the output to a file rather
than redirect the standard output. We do have it, according to the help:
> --csoundout outfile write Csound score to file 'outfile' ('-' for stdout)
So I tried:
$cmd = "../bp -gr.NotReich -d --csoundout out.sco";
but this yielded the following error:
> Unknown action 'out.sco'
> If 'out.sco' is an input file, indicate the file type (eg. -gr out.sco).
Actually it is expecting an input file, not an output file, at this
stage of the command. The problem is the same with --midiout:
$cmd = "../bp -gr.NotReich -d --midiout out.mid";
> Unknown action 'out.mid'
> If 'out.mid' is an input file, indicate the file type (eg. -gr out.mid).
I am confident it can easily be fixed. (No emergency!)
Bernard
Anthony Kozar wrote on 07/07/2020 11:46:
> Aha! Now I understand what the problem is. I divided the output from
> BP console between stderr and stdout. My intention was to separate
> "algorithm output" from other messages, warnings, etc. Perhaps we need
> to rethink that or provide an option to send all output to stdout.
>
> Look at the code in source/BP2/ConsoleMessages.[c/h] to see the current
> behavior. You can easily change all of the elements of the array
> gOutDestinations[] to point to stdout in the function
> ConsoleMessagesInit() so that you can continue your work.
>
> Anthony
|