have a look at the [dsp] object/abstraction. it uses [cputime]. you should be able to feed this directly back to your patch. for example, if dsp reaches a certain percentage, then turn off some subpatches or reduce the refresh rate of your vu meters... marius.
matteo sisti sette wrote: > Hi, > > I wish I could estimate "cpu usage" (in terms I will define later) > from within the patch, in order to have some part of the patch adapt > to it and work with higher "resolution" when more "free" cpu power is > available, and less when the cpu load is higher. For instance, I would > like to have some vu-meters to monitor various signal levels, but > vu-meters are expensive and I must avoid audio dropouts, so I'd like > my monitors to be less accurate when I need to save cpu power, and > more accurate when they can. > > So, what do I mean with "cpu usage"... > Suppose I could have a bang when a DSP cycle is started, and a bang > when the same DSP cycle is complete: by sending those bangs to a > [realtime] I could measure the interval and divide it by the teorical > duration of a DSP block (i.e. 64/44100*1000 milliseconds): that would > give me an estimation (however reliable) of the percentage of block > time that is actually spent in computing audio data. This would be > enough for me to start trying out something. > > Any idea of how to do that? I know [bang~] gives a bang at the end of > each DSP cycle, but how to get a bang at the beginning of the cycle? > > Any other suggestion? > > Thanks in advance > m. > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
