View Single Post
Old 04-18-2012, 02:18 PM   #132
bang
Human being with feelings
 
bang's Avatar
 
Join Date: Jul 2006
Posts: 626
Default

Quote:
Originally Posted by Justin View Post
http://1014.org/shiz/jsfx.dylib has everything up to date, but optimization off.
no luck. still has bogus midi out.

fwiw, i *think* everything is ok up to this code that sends queued midi, just in case anything pops out as suspicious Justin:
Code:
//   send due noteons first to avoid stuck notes
//     also do reset current notes first so new current notes appear
midi_bus= chanbus;
ii= 0; loop ( evcnt,
  evtimes[ii] < samplesblock ?( //event due this @block
    evmsgs[ii] >= 0 && (evmsgs[ii]&$xf0) == $x90 ?(
      midisend(evtimes[ii],evmsgs[ii],evmsg23s[ii]);
    ): evmsgs[ii] == -notes && evmsg23s[ii] < 0 ?( //reset current note hilites
      lastcnt= 0;
    );
  );
  evmsgs[ii] >= 0 && (evmsgs[ii]&$xf0) == $x90 ? foo2+= 1;
  ii+= 1; 
);
ii= 0; loop ( evcnt,
  evtimes[ii] < samplesblock ?( //event due this @block
    evmsgs[ii] < 0 ?( // hilite event
      evmsgs[ii] == -notes ?( //notes hilite
        evmsg23s[ii] >= 0 ?( //add note to hilite lists
          lastnotes[lastcnt]= evmsg23s[ii]; 
          lastcnt+= 1; //remember played notes to hilite
        );
      ): (-evmsgs[ii])[maxmaxsteps]= evmsg23s[ii];
      gdirtx= 1;
    ):( // "real" midi event
      (evmsgs[ii]&$xf0) != $x90 ?(
        midisend(evtimes[ii],evmsgs[ii],evmsg23s[ii]);
      );
    );
    evcnt-= 1; //delete completed event
    evcnt != ii ?(
      evtimes[ii]= evtimes[evcnt];
      evmsgs[ii]= evmsgs[evcnt];
      evmsg23s[ii]= evmsg23s[evcnt];
    );
    evmsgs[evcnt]= 0;
    evmsg23s[evcnt]= 0;
  ):( //not this @block: dec event countdown
    evtimes[ii]-= samplesblock;
    ii+= 1;
  );
);
interesting that the note highlighting logic sems to work. only midi output is garbled. no worries if this is too cryptic. i will look into it tonight.

thanks! /dan
bang is offline   Reply With Quote