virtual channels

Started by bass, March 11, 2016, 21:27:23

Previous topic - Next topic

bass

Hi, my hobby project developing a mod player is still going on, when I have some time  :)
I saw the NNAs of the IT format and I wonder if I should use a new virtual channel every time when a new note is played whether there is a nna or not.
is this clever?  ???
What about sliding notes or other effects which need the old note values then? Copy the current channel data to the new channel data every time?
I could use these virtual channels for declicking also when I fade them fast out, right?
I just need some thoughts about this. Does this make things too complicated again?

Saga Musix

Well, you certainly need to keep a channel structure for the past channels just like for regular channels. OpenMPT just has a huge (well, 256 entries) array of channel structures, the first N channels are always for regular channels, and if a channel needs to go virtual, a free channel from the remaining 256 - N channel structs is selected and the original data is copied over.
OpenMPT essentially uses virtual channels for anti-click as you describe it, but anything like that is probably not the best solution because, well, the channel keeps playing for longer than it should, which can lead to bleeding notes.
Keep in mind that your channel structures should always be pre-allocated (so you need a maximum number of allowed virtual channels), because allocating memory during mix time is always a bad idea if you want realtime playback.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

bass

OK, thank you. I want to try a solution with a virtual channel manager and a virtual channel for each note. Of course, I would allocate all virtual channels frst. It's a just for fun project 8)