mirror of
https://github.com/chocolate-doom/research.git
synced 2024-11-25 05:21:15 +00:00
122074db7b
Subversion-branch: /research Subversion-revision: 1667
30 lines
1.6 KiB
Text
30 lines
1.6 KiB
Text
Investigating how Doom decides on a voice to discard when it runs out
|
|
of OPL voices.
|
|
|
|
Findings so far:
|
|
|
|
* The instrument affects the voice that is released (different instruments
|
|
give different results). It is the instrument data that is significant,
|
|
not the instrument number (identical instruments behave the same - 87/88)
|
|
* Sometimes notes are not turned off when they should be. Sometimes notes
|
|
are turned off when they should not be (bug?)
|
|
* DMX maintains a linked list of the most recently-allocated voices. These
|
|
are searched backwards when finding a voice to free, so the most recently
|
|
allocated voices are the first to be freed.
|
|
* Different MIDI channels have different "priorities", somehow affected
|
|
by the instrument in use on that channel.
|
|
* When no voices are available, the will search back through the allocated
|
|
voices list and discard the most recently used voice from a channel of
|
|
a lower priority to the channel for the new note.
|
|
* If no lower-priority voices are available, a voice from the same
|
|
channel will be discarded.
|
|
* If no voices from lower priority channels are available, and none from
|
|
the same channel, the first voice in the list is discarded, ignoring
|
|
priority.
|
|
* Priority seems to be determined by MIDI instrument number - lower
|
|
instruments have a higher priority than higher instruments, so instrument
|
|
0 defeats 1, 1 defeats 2, etc.
|
|
* If a double voice instrument is played, and there are no free voices,
|
|
a voice will be sacrificed to play the first voice of the instrument,
|
|
but the second voice will not be played.
|
|
|