Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:4223] Score extraction broken in 4.23fxx

Date2004-03-02 20:13
FromAnthony Kozar
Subject[CSOUND-DEV:4223] Score extraction broken in 4.23fxx
Score extraction seems to have been broken since 4.23f01 on all platforms.
Whenever the -x option is used, no matter the contents of the extraction
settings file, I get an empty score.

I tracked the problem down to the introduction of the sread_init() function
in sread.c.  This function has been called since 4.23f01 to perform
initialization that used to be done inside of sread().  sread_init() is
called from scsort():

    void scsort(FILE *scin, FILE *scout)
    {
        [...]
        sread_init();
        do {
        if ((n = sread()) > 0) {
          sort();
          if (!POLL_EVENTS()) break; /* on Mac/Win, system events */
          twarp();
          swrite();
        }
        } while (POLL_EVENTS() && n > 1);

but not in similar code in scxtract():

    int scxtract(FILE *scin, FILE * scout, FILE *xfile)
    {  
        int n;
    
        readxfil(xfile);
        SCOREIN = scin;
        SCOREOUT = scout;
    
        sectcnt = 0;
        do {
        if ((n = sread()) > 0) {
          /*  allout();   */
          /*  textout();  */
          extract();
          swrite();
        }
        } while (n > 1);


A call to sread_init() just before the do-while loop in scxtract() seems to
fix the problem.

Anthony Kozar
anthony.kozar@utoledo.edu