Thanks for your thoughts! Nice to have someone with some experience in this area "aboard"
? Yes, Concerto dynamically allocates PSG voices as needed, and I plan to do something similar with the FM voices. The idea is to simply add one (optional) FM voice to the PSG oscillators. So the user can either use PSG oscillators, the FM voice, or both together. I think that combining FM and PSG can give some very juicy results.
I am not so much worried (yet) as to whether the timing will work. Sure, writing values to the PSG registers doesn't require a lot of cycles. But computing the values that are written to the registers does take a lot of cycles. For example, in each tick, the volume envelope value is multiplied with the oscillator's volume knob and the voice's volume (a voice here referring to a voice of a timbre that can contain multiple oscillators). On top of that, the oscillator's frequencies are computed in every tick, which also involves a multiplication. And then add all the optional modulation routings. And all this has turned out to work just fine.
@m00dawg and I haven't encountered a situation where we got Concerto to freeze due to overwhelming the CPU.
Thus, I am not so much worried about, say, 1000-2000 cycles necessary to initialize an FM voice.
Does that reasoning make sense?
15 hours ago, ZeroByte said:
Loading patches into the YM takes "considerable" time compared to the PSG, especially since you have to delay some 20-odd cycles per write to the YM
That is interesting! How did you get this number of 20-odd cycles?
If we can somehow accurately estimate how much we'd have to wait after each write, we can put some code in between the writes in order to make use of the waiting time. I am imagining, since some bytes on the YM2151 contain multiple parameters, one could use the time to stitch those values together from their bare pieces (e.g. FL and CON). I intend to keep those values separate in memory for easier editing.