perlscore.pm is a brief Perl module which is intended to provide the same services to Perl that are given to C with the Cscore library that comes with Csound. It has just been created at the time of the writing of the contents of this file, and so is not very well tested, but has worked well for me up to this point. I have roughly translated the following functions: createv(); create a blank event with n pfields defev("..."); defines an event as per the character string ... copyev($f); make a new copy of event $f getev(); read the next event in the score input file putev($e); write event $e to the score output file putstr("..."); write the character string ... to score output lcreat(); create an empty event list lappev($a, $e); append event $e to list $a lcount($a); count the events now in list $a lcopy($b); copy the list $b (but not the events) lcopyev($b); copy the events of $b, making a new list lget(); read events from score input (to next s or e) lput($a); write the events of list $a to score output lsepf($b); separate the f statements from list $b into list $a lcat($a, $b); concatenate (append) the list $b onto the list $a Many of the above are not really needed in Perl, but I have included them for completeness. One can also use the powerful data structure handling capabilities of Perl to accomplish many of these tasks. These are not finished yet, mainly because I have never used them in a program: lsort(a); sort the list a into chronological order by p[2] lxins(b,"..."); extract notes of instruments ... (no new events) lxtimev(b,from,to); extract notes of time-span, creating new events These don't make sense in Perl. relev(e); release the space of event e lrel(a); release the space of list a (but not events) lrelev(a); release the events of list a, and the list space Cscore programs are quite easily translated into 'perlscore' programs. Here is a comparison of the two syntaxes, where I have tried to permute the Perl side to look like the cscore side: cscore perlscore ------ --------- EVENT *e; my $e; EVLIST *a; my $a; e = defev("i1 0 2 10000 440"); $e = defev("i1 0 2 10000 440"); a = lappev(a, e); $a = lappev($a, $e); a = lappev(a, e); $a = lappev($a, $e); putev( a->e[1] ); putev( $a->[1] ); printf("%g", a->e[1]->p[2]); printf("%g", $a->[1]->[2]); So, in the Perl program, an EVENT is an 'array of scalars', and an EVLIST is an 'array of references to EVENTS', and the functions that deal with EVENTs and EVLISTs take and return references to each as arguments. Perl is an order of magnitude lower on the scale of difficulty and inconvenience than C. For now, one must look at the source for the module, and the cscore documentation for a better look. Toby Shepard toby@rcsreg.com