Anthony Kozar wrote on 06/07/2020 22:43:
> My web hosting service provides all of the standard Linux dev tools we
> need (GCC, git, PHP, MySQL, and Apache). If it would be helpful, I
> can set up a sandbox environment for developing a BP web app and give
> you access to it, Bernard. The web front end would have to be
> password-protected though since I don't think we can trust BP to not
> be exploitable at this point.
This might be a very good option. Thus, PHP files created for various
tests/demos could be shared by authorized contributors, and some of them
arranged on a Wordpress site. I guess we would access this environment
via FTP?
> Hmmm... strange that can't run a macOS binary on macOS just because it
> is called from PHP. I see that your script uses "./bp". Are the PHP
> script and bp in the same directory? You might try using a full
> pathname to bp. Alternatively, try copying the bp binary to somewhere
> on your path (or the web server's CGI bin folder?) and removing the
> "./". Also, "-v" is not a valid option for BP console. I think you
> want "--version".
In fact I can compile and run a simple "hello.c" program using the call
"./hello".
Compiling "hello.c" created a warning in apache_error.log, claiming that
since "stdio.h" is missing 'printf' will be interpreted implicitly. This
gave me the idea of adding #include <stdio.h> to PrefixANSIDebug.h and
run Makefile again. Yet BP remained silent when called by PHP.
Strangely, $cmd = "./bp --version" yieds no output, nor does $cmd =
"./bp --version > try.txt" create a non-empty "try.txt" file. However
they both generate apache errors which are the actual expected output.
For instance apache error when calling "./bp --version" is:
Bol Processor console app
Version 2.9.8 (Jul 7 2020)
In other words, the output of apache error is actually the output
expected from BP. In reality BP runs properly. For instance this PHP
sequence:
chdir("ctests");
$cmd = "../bp -gr.NotReich -d --csoundout > out.sco";
exec($cmd,$o);
print_r($o);
creates the correct out.sco file while it sends the "console" output to
apache_error.log:
Bol Processor console app
Version 2.9.8 (Jul 7 2020)
This is a beta version for evaluation...
Reading grammar file -gr.NotReich...
BP2 Console completed initialization.
seed 1 = 1594103353
seed 2 = 10475
Err. GetTextChar(). pos out of range
TextInsert(Trace):
Compiling alphabetÉ
Err. GetTextChar(). pos out of range
Looking for time patternsÉ
Err. GetTextChar(). pos out of range
Err. GetTextChar(). pos out of range
Compiling subgrammar #1É
Compiling subgrammar #2É
Err. GetTextChar(). pos out of range
Errors: 0
Producing item(s)É
Computing itemÉ
Subgrammar 1/2
Subgrammar 2/2
Buffer limit expanded to 1500
Buffer limit expanded to 2250
Buffer limit expanded to 3375
Buffer limit expanded to 5062
Interpreting structureÉ
etc.
In sum, the problem is not running BP but rather retrieving its "console
output" somewhere else than apache_error.log. Unlike "hello.c" calling
printf for the output:
#include <stdio.h>
int main() {
printf("Hello! This is a test");
return 0;
}
When running PHP:
$cmd = "./hello";
exec($cmd,$o);
print_r($o);
The output is:
Array ( [0] => Hello! This is a test )
> Yes, the fact that it compiled on an ARM platform makes me think we
> won't have much trouble compiling for Android either. Imagine being
> able to play with BP on your tablet or smartphone! :)
(Joke) I hardly use anything else than telephone, SMS, WhatsApp and the
torch on my iPhone! ;-)
Nevertheless I can figure out extensions.
I am particularly keen to work with "sound-objects" (typically
-gr.koto3). In reality, BP handles "time-objects", the current ones
containing either MIDI instructions, lines of Csound score or both.
These time-objects have topological properties putting constraints on
their actual time-setting. For instance, a certain object should not
have its beginning mixed with other objects, so the algorithm may delay
it if its is relocatable, otherwise move ahead the preceding object etc.
These time-objects could contain video sequences, bits of stories in a
scenario. Producing object structures via grammars, polymetric
representation and time-constraint solving would amount to fabricating
"stories" mixing different sorts of material instead of just sounds.
Another great usage would be speech synthesis because the polymetric
representation is probably the best tool for structuring prosodic units,
thereby synthesizing speech at different speeds and taking care of
co-articulation in fast speech.
As you guess there is still a very wide scope for development/research
and this will be open to practice thanks to the command-line "engine"! I
am certain that more developers will join once we have small demos of
working with different sorts of time-objects. Imagine a grammar that
creates variations of a scenario for a series including their clips,
image sequences, music and synthetic background speech!
> I suspect the speedup is mostly due to the fact that BP console
> doesn't have to poll for events like the Mac Classic & Carbon versions
> did. Every time BP2 calls GetNextEvent(waitTime) creates a delay.
Indeed! For the time being we drop real-time interactions — e.g.
controling improvisational processes via MIDI events.
> The low memory usage could be an advantage on mobile and embedded
> devices though. (One can imagine that, someday, someone might create
> an interactive multimedia installation using BP on a Raspberry Pi or
> even Arduino-like device).
This is an instance of the dream I described above. ;-)
> Well, on to far less interesting tasks for now. ;-)
No hurry! A few small steps at a time. :-)
Bernard
|