Csound Csound-dev Csound-tekno Search About

Possible musmon()/kperf() simplification?

Date1997-02-18 01:06
FromLarry Troxler
SubjectPossible musmon()/kperf() simplification?
Wouldn't it simplify the logic dramatically, to do the following?

1) only perf 1 k-period each time through the main loop 
2) Take the checking for real-time events out of kperf(), and change  kperf
to always perform just perf 1 k-period. Poof! It just got a lot smaller.
3) Change rdscor() to conditionally return an event, only if an event is to
be started at the current value of kcounter.
4) Move the real-time checks up in to musmon().
5) Make a common protocol for *all* sources of events (csound score, score,
ASCII input, real-time MIDI, etc). As an example of such an implementation,
each event source would supply a function that returns either NULL, or an
event, if an event is to be started at the current kcounter. This would make
musmon() a lot easier to understand!

I haven't considered event-offs yet, since I don't quite understand all the
spaghetti-code in musmon().  And maybe there's some other problems I'm not
considering.  And, yes, this would result in a slight performance penalty.

Any comments?

Larry


                  
 --  Larry Troxler  --  lt@westnet.com  --  Patterson, NY  USA   --