Hello, besides assigning each chip instance to its own thread, is there a way to multithread vgm rendering? I'm thinking we split the song into N chunks, divided by samples, then render each chunk in parallel, but in order to do that, there needs to be preprocessing of the command stream for that chip, to determine its state at the beginning of each chunk. The preprocessing might not be multi-threadable, but we can probably have some decently fast(?) mode for the chip, where it just takes commands and updates its internal state, and then we can somehow get the state from it at a given sample, so we can instantiate it once for each thread, and for each instance, make it load the internal state at sample N. This preprocessing would also be useful for really fast seeking, which would be useful for an interactive VGM file editor. But it would require that each chip core have the ability to take commands and update its internal state without rendering, and be able to save and load state. I know some of the chips simply have registers that can be updated, but there might also be a phase issue, when putting the chunks back together, so there probably needs to be some phase information, ie, some processing of wait samples. hmmmm
_________________ vampi.tech
|