Re: imports/exports and multiple instances

From: Eric Scheirer (eds@media.mit.edu)
Date: Thu Feb 11 1999 - 12:56:07 EST


Hi Giorgio,

I think you can do this just by keeping a global
counter to keep track of how many notes have turned
on.

You can't control what order are executed in, but the
k-rate passes are executed sequentially, not in parallel.
The exports to the global ksig don't happen "all at once",
they each happen when the instance completes its k-cycle.

So this:

global {
  ksig notes[10], count;
}

instr foo(pitch) {
  imports exports ksig notes[10], count;

  if (!itime) {
     if (!found(notes,count,pitch)) {
       notes[count] = pitch;
       count = count + 1;
     }
     else { turnoff; }
  }
  
}

kopcode found(array,len,x) {
  // return 1 iff x in array[0..len-1]
  ...
}

should work, I think. Have you tried something like this?
Is this what you're asking for? Is there text in the
standard that contradicts what I argued above?

Best,

 -- Eric



This archive was generated by hypermail 2b29 : Mon Jan 28 2002 - 11:46:33 EST