Hi list,Has anyone ever used [bang~] as an engine to break up long-running control calculations? For example, suppose I analyze the incoming signal and choose the most suitable among 10,000 melodies to play in response. If I search in logical time I'll probably get a dropout. However, if I rewrite the patch to use [bang~] and [5,000(--[until] to do the same calculation, I cut the number of calculations per block in half. As I test the patch I can keep halving that number until I no longer get dropouts. If the resulting time to finish all the calculations is a suitable delay for my melodic response, I'm good. More importantly, I'm deterministically good, as the calculation is guaranteed to complete in the allotted time. (Although I am of course not guaranteed that the audio won't drop out.) Seems clunky, but maybe it's useful for some situations... -Jonathan
On 05/18/2016 07:48 PM, Jonathan Wilkes via Pd-list wrote:
Hi list,Has anyone ever used [bang~] as an engine to break up long-running control calculations?
i've used simple [delay 1] (or other values in the ms range) for these use-cases in the past (though it's been a while....) i don't see any specific advantage in using [bang~] (put the disadvantage that [bang~] requires the audio engine to be turned on)
gmadsr IOhannes
On Wed, 2016-05-18 at 17:48 +0000, Jonathan Wilkes via Pd-list wrote:
Hi list, Has anyone ever used [bang~] as an engine to break up long-running control calculations?
Kind of. I once posted a non-blocking until-like abstraction to the list. The idea is to measure CPU time and delay the next iteration for as long as as it takes to compute one part, so that Pd uses all available CPU time without blocking. You can find it here:
https://github.com/reduzent/netpd/blob/master/includes/netpd-nb-until.pd
Roman