This question is probably more general, with the answer varying from sound engine to sound engine.
In the typical scenario where we have four sound channels, lets suppose that we had music playing which used the noise channel for drums. We also had a certain sound effect that used the noise channel; it has priority over the music.
We know that if we triggered the sound effect while the music is playing, the sound engine will mute the music on channel 3 to play the sound. From the info I gathered, I think I understand what's going on from engine's point of view.
Basically, the sound engine iterates through several "streams" each which, typically, contain different parts or waveforms of a piece of music; i.e. stream 0 might contain the lead square of a piece, stream 1 might contain the backup square, etc.
If a sound needs to be triggered that needs to use a channel that's already in use by the music, then if the sound has priority over the music, the engine will stop writing the note data for that stream to the APU. At the same time, the engine will start writing the note data for the sound effect to the APU. However the all of the music counters are still updated.
So when stream borrowing happens, basically, engine stops writing one stream and starts writing another. When the sound is done playing, the engine stops writing that data and resumes the other stream.
Is this about right?
In the typical scenario where we have four sound channels, lets suppose that we had music playing which used the noise channel for drums. We also had a certain sound effect that used the noise channel; it has priority over the music.
We know that if we triggered the sound effect while the music is playing, the sound engine will mute the music on channel 3 to play the sound. From the info I gathered, I think I understand what's going on from engine's point of view.
Basically, the sound engine iterates through several "streams" each which, typically, contain different parts or waveforms of a piece of music; i.e. stream 0 might contain the lead square of a piece, stream 1 might contain the backup square, etc.
If a sound needs to be triggered that needs to use a channel that's already in use by the music, then if the sound has priority over the music, the engine will stop writing the note data for that stream to the APU. At the same time, the engine will start writing the note data for the sound effect to the APU. However the all of the music counters are still updated.
So when stream borrowing happens, basically, engine stops writing one stream and starts writing another. When the sound is done playing, the engine stops writing that data and resumes the other stream.
Is this about right?