In later versions, you may have different rates in different parts of the network.
One example might be if you expand it to transfer data to or from disk. Another example would be that small data rate control variables, such as a single control echo delay, may later become part of your network. You probably do not want to process control variables at the same frequency as for processing audio packets, but they are still βreal timeβ and part of the functional network. They may, for example, need smoothing to avoid sudden transitions.
As long as you call all of your functions at the same speed, and all the functions are mostly performed continuously, your data pull approach will work fine. There will be little to choose between pulling data and clicking. Pulling is somewhat more natural for reproducing sound, pressing is more natural for recording, but it either works or ends with the same call to the basic functions of sound processing.
For a spectrometer , you have a multiple absorber problem for data, but that is not a problem. Enter a fictitious link to it from the real shell. A dummy link may cause a request for data that is not an honor. As long as the dummy link knows this dummy and does not care about the lack of data, everything will be OK. This is a standard technique for reducing multiple receivers or sources to one.
In such a network, you do not want to do the same calculation twice in one full update. For example, if you mix a high-frequency and a low-profile version of a signal, you do not want to evaluate the original signal twice. You should do something like write a timer value with each buffer and stop spreading the excerpts when you see the current checkmark value. The same mechanism will also protect you from feedback loops in the evaluation.
So, these two issues that concern you are easily resolved within your current structure.
Matching speeds , where there are different packet rates in different parts of the network, problems with the current approach will occur. If you write audio to disc, then for efficiency you want to write large chunks infrequently. You do not want to block the maintenance of more frequent small input and output data processing packets during these write operations. A single pulling or pushing strategy will not be enough.
Just admit that at some point you may need a more sophisticated upgrade method than a single speed network. When this happens, you will need threads for different bets to be launched, or you will write your own simple scheduler, perhaps as simple as calling less frequently performed functions once in n, so that the bets match. You do not need to plan this in advance. Your audio functions will almost certainly already delegate responsibility for making their input buffers ready for other functions, and these will be only those other functions that need to be changed, and not the audio functions themselves.
The only thing I would like to advise at this stage is to be careful to centralize the sound buffer , noting that the buffers are like fence fences. They do not belong to the audio function, they lie between the audio functions. Centralizing the distribution of the buffer makes it easy to retrospectively modify the update strategy for different speeds in different parts of the network.
James crook
source share