mirror of
https://github.com/chocolate-doom/research.git
synced 2024-11-10 07:11:34 +00:00
Research data into how Doom behaves when it runs out of voices.
Subversion-branch: /research Subversion-revision: 1655
This commit is contained in:
parent
2f13aee5dd
commit
3c62397360
8 changed files with 3822 additions and 0 deletions
3
opl/novoices/README
Normal file
3
opl/novoices/README
Normal file
|
@ -0,0 +1,3 @@
|
|||
Investigating how Doom decides on a voice to discard when it runs out
|
||||
of OPL voices.
|
||||
|
BIN
opl/novoices/e1m1-cropped.mid
Normal file
BIN
opl/novoices/e1m1-cropped.mid
Normal file
Binary file not shown.
83
opl/novoices/gen-sequence
Executable file
83
opl/novoices/gen-sequence
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
def note_on(delay, channel, note, volume)
|
||||
# note on
|
||||
putc delay
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc volume
|
||||
end
|
||||
|
||||
def note_off(delay, channel, note)
|
||||
# note on
|
||||
putc delay
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc 0x00
|
||||
end
|
||||
|
||||
# Turn on some notes and then turn them off, to boost us
|
||||
# up to the middle of the range of operators.
|
||||
|
||||
note_on(0xf, 8, 0x20, 0x40) # voice 1
|
||||
note_off(0xf, 8, 0x20)
|
||||
note_on(0xf, 8, 0x21, 0x40) # voice 2
|
||||
note_off(0xf, 8, 0x21)
|
||||
note_on(0xf, 8, 0x22, 0x40) # voice 3
|
||||
note_off(0xf, 8, 0x22)
|
||||
|
||||
# Play some notes until we use up all the OPL operators.
|
||||
|
||||
note_on(0xf, 8, 0x20, 0x40) # voice 4
|
||||
note_on(0xf, 1, 0x21, 0x40) # voice 5
|
||||
|
||||
# a quiet note, to check if volume affects it
|
||||
note_on(0xf, 8, 0x22, 0x10) # voice 6
|
||||
|
||||
note_on(0xf, 1, 0x23, 0x40) # voice 7
|
||||
note_on(0xf, 8, 0x24, 0x40) # voice 8
|
||||
note_on(0xf, 1, 0x25, 0x40) # voice 1
|
||||
note_on(0xf, 8, 0x26, 0x40) # voice 2
|
||||
note_on(0xf, 1, 0x27, 0x40) # voice 3
|
||||
|
||||
# Now all voices are in use ...
|
||||
|
||||
note_on(0xf, 8, 0x28, 0x40) # gets v2
|
||||
note_on(0xf, 1, 0x29, 0x40) # gets v2
|
||||
note_on(0xf, 8, 0x2a, 0x40) # gets v8
|
||||
note_on(0xf, 1, 0x2b, 0x40) # gets v8
|
||||
note_on(0xf, 8, 0x2c, 0x40) # gets v6
|
||||
note_on(0xf, 1, 0x2d, 0x40) # gets v6
|
||||
note_on(0xf, 8, 0x2e, 0x40) # gets v4
|
||||
note_on(0xf, 1, 0x2f, 0x40) # gets v4
|
||||
note_on(0xf, 8, 0x30, 0x40) # gets v0
|
||||
note_on(0xf, 1, 0x31, 0x40) # gets v0
|
||||
|
||||
# voices off: 5, 7, 1, 3, 2, 8, 6, 4, 0
|
||||
|
||||
note_off(0xf, 8, 0x20)
|
||||
note_off(0xf, 1, 0x21)
|
||||
note_off(0xf, 8, 0x22)
|
||||
note_off(0xf, 1, 0x23)
|
||||
note_off(0xf, 8, 0x24)
|
||||
note_off(0xf, 1, 0x25)
|
||||
note_off(0xf, 8, 0x26)
|
||||
note_off(0xf, 1, 0x27)
|
||||
note_off(0xf, 8, 0x28)
|
||||
note_off(0xf, 1, 0x29)
|
||||
note_off(0xf, 8, 0x2a)
|
||||
note_off(0xf, 1, 0x2b)
|
||||
note_off(0xf, 8, 0x2c)
|
||||
note_off(0xf, 1, 0x2d)
|
||||
note_off(0xf, 8, 0x2e)
|
||||
note_off(0xf, 1, 0x2f)
|
||||
note_off(0xf, 8, 0x30)
|
||||
note_off(0xf, 1, 0x31)
|
||||
|
||||
# end of track
|
||||
|
||||
putc 0x00
|
||||
putc 0xff
|
||||
putc 0x2f
|
||||
putc 0x00
|
||||
|
84
opl/novoices/gen-sequence2
Executable file
84
opl/novoices/gen-sequence2
Executable file
|
@ -0,0 +1,84 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
def note_on(delay, channel, note, volume)
|
||||
# note on
|
||||
putc delay
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc volume
|
||||
end
|
||||
|
||||
def note_off(delay, channel, note)
|
||||
# note on
|
||||
putc delay
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc 0x00
|
||||
end
|
||||
|
||||
# Turn on some notes and then turn them off, to boost us
|
||||
# up to the middle of the range of operators.
|
||||
|
||||
note_on(0xf, 8, 0x20, 0x40) # voice 1
|
||||
note_off(0xf, 8, 0x20)
|
||||
note_on(0xf, 8, 0x21, 0x40) # voice 2
|
||||
note_off(0xf, 8, 0x21)
|
||||
note_on(0xf, 8, 0x22, 0x40) # voice 3
|
||||
note_off(0xf, 8, 0x22)
|
||||
|
||||
# Play some notes until we use up all the OPL operators.
|
||||
|
||||
note_on(0xf, 8, 0x20, 0x40) # voice 4
|
||||
note_on(0xf, 1, 0x21, 0x40) # voice 5
|
||||
|
||||
# a quiet note, to check if volume affects it
|
||||
note_on(0xf, 8, 0x22, 0x10) # voice 6
|
||||
|
||||
note_on(0xf, 1, 0x23, 0x40) # voice 7
|
||||
note_on(0xf, 8, 0x24, 0x40) # voice 8
|
||||
note_on(0xf, 1, 0x25, 0x40) # voice 1
|
||||
note_on(0xf, 8, 0x26, 0x40) # voice 2
|
||||
note_on(0xf, 1, 0x27, 0x40) # voice 3
|
||||
|
||||
# Now all voices are in use ...
|
||||
|
||||
note_on(0xf, 1, 0x40, 0x40) # gets v2
|
||||
note_on(0xf, 8, 0x28, 0x40) # gets v8
|
||||
note_on(0xf, 1, 0x29, 0x40) # gets v8
|
||||
note_on(0xf, 8, 0x2a, 0x40) # gets v6
|
||||
note_on(0xf, 1, 0x2b, 0x40) # gets v6
|
||||
note_on(0xf, 8, 0x2c, 0x40) # gets v4
|
||||
note_on(0xf, 1, 0x2d, 0x40) # gets v4
|
||||
note_on(0xf, 8, 0x2e, 0x40) # gets v0
|
||||
note_on(0xf, 1, 0x2f, 0x40) # gets v0
|
||||
note_on(0xf, 8, 0x30, 0x40) # gets v0
|
||||
note_on(0xf, 1, 0x31, 0x40) # gets v0
|
||||
|
||||
# voices off: 5, 7, 1, 3, 2, 8, 6, 4, 0
|
||||
|
||||
note_off(0xf, 8, 0x20)
|
||||
note_off(0xf, 1, 0x21)
|
||||
note_off(0xf, 8, 0x22)
|
||||
note_off(0xf, 1, 0x23)
|
||||
note_off(0xf, 8, 0x24)
|
||||
note_off(0xf, 1, 0x25)
|
||||
note_off(0xf, 8, 0x26)
|
||||
note_off(0xf, 1, 0x27)
|
||||
note_off(0xf, 8, 0x28)
|
||||
note_off(0xf, 1, 0x29)
|
||||
note_off(0xf, 8, 0x2a)
|
||||
note_off(0xf, 1, 0x2b)
|
||||
note_off(0xf, 8, 0x2c)
|
||||
note_off(0xf, 1, 0x2d)
|
||||
note_off(0xf, 8, 0x2e)
|
||||
note_off(0xf, 1, 0x2f)
|
||||
note_off(0xf, 8, 0x30)
|
||||
note_off(0xf, 1, 0x31)
|
||||
|
||||
# end of track
|
||||
|
||||
putc 0x00
|
||||
putc 0xff
|
||||
putc 0x2f
|
||||
putc 0x00
|
||||
|
BIN
opl/novoices/novoices.mid
Normal file
BIN
opl/novoices/novoices.mid
Normal file
Binary file not shown.
1864
opl/novoices/novoices.processed.txt
Normal file
1864
opl/novoices/novoices.processed.txt
Normal file
File diff suppressed because it is too large
Load diff
BIN
opl/novoices/novoices2.mid
Normal file
BIN
opl/novoices/novoices2.mid
Normal file
Binary file not shown.
1788
opl/novoices/novoices2.processed.txt
Normal file
1788
opl/novoices/novoices2.processed.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue