mirror of
https://github.com/chocolate-doom/research.git
synced 2024-11-21 20:01:46 +00:00
Fine tuning field research.
Subversion-branch: /research Subversion-revision: 1663
This commit is contained in:
parent
fdbaf07ec0
commit
6d81e82c4b
12 changed files with 11241 additions and 0 deletions
14
opl/finetune/README
Normal file
14
opl/finetune/README
Normal file
|
@ -0,0 +1,14 @@
|
|||
Investigations into how the fine tuning field affects OPL register writes.
|
||||
|
||||
Findings:
|
||||
|
||||
* Fine tuning only affects double voice instruments. It is only applied to
|
||||
the second voice and not the first.
|
||||
|
||||
* The fine tuning value adjusts the index into Doom's frequency table. The
|
||||
offset is divided by two before being applied, so a fine tuning value of
|
||||
10 causes an offset of 5.
|
||||
|
||||
* Due to integer rounding, odd numbered negative offsets are rounded down
|
||||
(away from zero), so a tuning of -3 gives an offset of -2.
|
||||
|
BIN
opl/finetune/e1m1-cropped.mid
Normal file
BIN
opl/finetune/e1m1-cropped.mid
Normal file
Binary file not shown.
BIN
opl/finetune/finetune.mid
Normal file
BIN
opl/finetune/finetune.mid
Normal file
Binary file not shown.
1700
opl/finetune/finetune.processed.txt
Normal file
1700
opl/finetune/finetune.processed.txt
Normal file
File diff suppressed because it is too large
Load diff
2579
opl/finetune/finetune.txt
Normal file
2579
opl/finetune/finetune.txt
Normal file
File diff suppressed because it is too large
Load diff
BIN
opl/finetune/finetune2.mid
Normal file
BIN
opl/finetune/finetune2.mid
Normal file
Binary file not shown.
2718
opl/finetune/finetune2.processed.txt
Normal file
2718
opl/finetune/finetune2.processed.txt
Normal file
File diff suppressed because it is too large
Load diff
4088
opl/finetune/finetune2.txt
Normal file
4088
opl/finetune/finetune2.txt
Normal file
File diff suppressed because it is too large
Load diff
51
opl/finetune/gen-sequence
Executable file
51
opl/finetune/gen-sequence
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
def note_on(delay, channel, note, volume)
|
||||
# note on
|
||||
putc delay * 6
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc volume
|
||||
end
|
||||
|
||||
def note_off(delay, channel, note)
|
||||
# note on
|
||||
putc delay * 6
|
||||
putc 0x80 + channel
|
||||
putc note
|
||||
putc 0x00
|
||||
end
|
||||
|
||||
def program_change(delay, channel, instrument)
|
||||
putc delay * 6
|
||||
putc 0xc0 + channel
|
||||
putc instrument
|
||||
end
|
||||
|
||||
def end_of_track
|
||||
|
||||
putc 0x00
|
||||
putc 0xff
|
||||
putc 0x2f
|
||||
putc 0x00
|
||||
|
||||
end
|
||||
|
||||
# Instrument 17 has normal tuning, instrument 18 is +10
|
||||
|
||||
program_change(0x1, 1, 17)
|
||||
program_change(0x1, 2, 18)
|
||||
|
||||
# Play through some notes, making the same note on each of the two channels.
|
||||
|
||||
for i in 10..64
|
||||
note_on(10, 1, i, 100)
|
||||
note_on(10, 2, i, 100)
|
||||
note_off(10, 1, i)
|
||||
note_off(0, 2, i)
|
||||
end
|
||||
|
||||
# end of track
|
||||
|
||||
end_of_track
|
||||
|
51
opl/finetune/gen-sequence2
Executable file
51
opl/finetune/gen-sequence2
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
def note_on(delay, channel, note, volume)
|
||||
# note on
|
||||
putc delay * 6
|
||||
putc 0x90 + channel
|
||||
putc note
|
||||
putc volume
|
||||
end
|
||||
|
||||
def note_off(delay, channel, note)
|
||||
# note on
|
||||
putc delay * 6
|
||||
putc 0x80 + channel
|
||||
putc note
|
||||
putc 0x00
|
||||
end
|
||||
|
||||
def program_change(delay, channel, instrument)
|
||||
putc delay * 6
|
||||
putc 0xc0 + channel
|
||||
putc instrument
|
||||
end
|
||||
|
||||
def end_of_track
|
||||
|
||||
putc 0x00
|
||||
putc 0xff
|
||||
putc 0x2f
|
||||
putc 0x00
|
||||
|
||||
end
|
||||
|
||||
# Instrument 20 has normal tuning, instrument 21 is -3
|
||||
|
||||
program_change(0x1, 1, 20)
|
||||
program_change(0x1, 2, 21)
|
||||
|
||||
# Play through some notes, making the same note on each of the two channels.
|
||||
|
||||
for i in 10..64
|
||||
note_on(10, 1, i, 100)
|
||||
note_on(10, 2, i, 100)
|
||||
note_off(10, 1, i)
|
||||
note_off(0, 2, i)
|
||||
end
|
||||
|
||||
# end of track
|
||||
|
||||
end_of_track
|
||||
|
20
opl/finetune/results.txt
Normal file
20
opl/finetune/results.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
note chan 1 chan 2 index 1 index 2
|
||||
|
||||
10 0x266 0x266, 0x26c 32*10 32*10, 32*10+5
|
||||
11 0x28b 0x28b, 0x290 32*11 32*11, 32*11+5
|
||||
12 0x158 0x158, 0x2b7 32*0 32*0, 32*12+5
|
||||
13 0x16d 0x16d, 0x2e1 32*1 32*1, 32*13+5
|
||||
14 0x183 0x183, 0x30d 32*2 32*2, 32*14+5
|
||||
15 0x19a 0x19a, 0x33b 32*3 32*3, 32*15+5
|
||||
16 0x1b2 0x1b2, 0x36c 32*4 32*4, 32*16+5
|
||||
17 0x1cc 0x1cc, 0x3a1 32*5 32*5, 32*17+5
|
||||
18 0x1e7 0x1e7, 0x3d8 32*6 32*6, 32*18+5
|
||||
19 0x204 0x204, 1/0x209 32*7 32*7, 32*19+5
|
||||
20 0x223 0x223, 1/0x228 32*8 32*8, 32*20+5
|
||||
21 0x244 0x244, 1/0x249 32*9 32*9, 32*21+5
|
||||
22 0x266 0x266, 1/0x26c 32*10 32*10, 32*22+5
|
||||
23 0x28b 0x28b, 1/0x290 32*11 32*11, 32*23+5
|
||||
24 0x2b1 0x2b1, 1/0x2b7 32*12 32*12, 32*24+5
|
||||
25 0x2da 0x2da, 1/0x2e1 32*13 32*13, 32*25+5
|
||||
26 0x306 0x306, 1/0x30d 32*14 32*14, 32*26+5
|
||||
|
20
opl/finetune/results2.txt
Normal file
20
opl/finetune/results2.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
note chan 1 chan 2 index 1 index 2
|
||||
|
||||
10 0x266 0x266, 0x264 32*10 32*10, 32*10-2
|
||||
11 0x28b 0x28b, 0x288 32*11 32*11, 32*11-2
|
||||
12 0x2b1 0x2b1, 0x2af 32*0 32*0, 32*12-2
|
||||
13 0x2da 0x2da, 0x2d8 32*1 32*1, 32*13-2
|
||||
14 0x306 0x306, 0x303 32*2 32*2, 32*14-2
|
||||
15 0x334 0x334, 0x331 32*3 32*3, 32*15-2
|
||||
16 0x365 0x365, 0x361 32*4 32*4, 32*16-2
|
||||
17 0x398 0x398, 0x395 32*5 32*5, 32*17-2
|
||||
18 0x3cf 0x3cf, 0x3cb 32*6 32*6, 32*18-2
|
||||
19 0x204 0x204, 1/0x202 32*7 32*7, 32*19-2
|
||||
20 0x223 0x223, 1/0x221 32*8 32*8, 32*20-2
|
||||
21 0x244 0x244, 1/0x241 32*9 32*9, 32*21-2
|
||||
22 0x266 0x266, 1/0x264 32*10 32*10, 32*22-2
|
||||
23 0x28b 0x28b, 1/0x288 32*11 32*11, 32*23-2
|
||||
24 0x2b1 0x2b1, 1/0x2af 32*12 32*12, 32*24-2
|
||||
25 0x2da 0x2da, 1/0x2d8 32*13 32*13, 32*25-2
|
||||
26 0x306 0x306, 1/0x303 32*14 32*14, 32*26-2
|
||||
|
Loading…
Reference in a new issue