mirror of
https://github.com/chocolate-doom/research.git
synced 2025-02-16 09:01:58 +00:00
Add pitch bend research data.
Subversion-branch: /research Subversion-revision: 1656
This commit is contained in:
parent
3c62397360
commit
fdbaf07ec0
9 changed files with 13470 additions and 0 deletions
17
opl/pitchbend/README
Normal file
17
opl/pitchbend/README
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
Constructed MIDI to test pitch bend effects.
|
||||
|
||||
Findings:
|
||||
|
||||
* Doom ignores the least significant bit of pitch bend events
|
||||
|
||||
* The "range" of the pitch bend extends over the nearest two notes,
|
||||
ie. when bent down to the minimum, notes sound two semitones lower
|
||||
than normal, when bent up to maximum, notes sound two semitones
|
||||
higher than normal.
|
||||
|
||||
* The full pitch table is in doom2.exe starting at 0x0008864c
|
||||
|
||||
* When bent up at the highest note, the MIDI code overflows the pitch
|
||||
table slightly and uses the next value in memory (0x36c)
|
||||
|
BIN
opl/pitchbend/bend.mid
Normal file
BIN
opl/pitchbend/bend.mid
Normal file
Binary file not shown.
6198
opl/pitchbend/bend.processed.txt
Normal file
6198
opl/pitchbend/bend.processed.txt
Normal file
File diff suppressed because it is too large
Load diff
6667
opl/pitchbend/bend.txt
Normal file
6667
opl/pitchbend/bend.txt
Normal file
File diff suppressed because it is too large
Load diff
BIN
opl/pitchbend/e1m1-cropped.mid
Normal file
BIN
opl/pitchbend/e1m1-cropped.mid
Normal file
Binary file not shown.
26
opl/pitchbend/freqs-to-csv
Executable file
26
opl/pitchbend/freqs-to-csv
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "scanf"
|
||||
|
||||
index = 0
|
||||
|
||||
$stdin.each_line do |s|
|
||||
|
||||
if s !~ /Key on.*octave (\d+), freq 0x([0-9a-f]+)/
|
||||
next
|
||||
end
|
||||
|
||||
octave = $1.to_i
|
||||
freq = $2.scanf("%x")
|
||||
|
||||
if index > 0
|
||||
puts "#{index},#{octave},#{freq}"
|
||||
end
|
||||
|
||||
index += 1
|
||||
|
||||
if index >= 512
|
||||
break
|
||||
end
|
||||
end
|
||||
|
511
opl/pitchbend/freqs2.csv
Normal file
511
opl/pitchbend/freqs2.csv
Normal file
|
@ -0,0 +1,511 @@
|
|||
1,1,975
|
||||
2,1,869
|
||||
3,1,869
|
||||
4,1,869
|
||||
5,1,870
|
||||
6,1,870
|
||||
7,1,870
|
||||
8,1,870
|
||||
9,1,872
|
||||
10,1,872
|
||||
11,1,872
|
||||
12,1,872
|
||||
13,1,873
|
||||
14,1,873
|
||||
15,1,873
|
||||
16,1,873
|
||||
17,1,875
|
||||
18,1,875
|
||||
19,1,875
|
||||
20,1,875
|
||||
21,1,876
|
||||
22,1,876
|
||||
23,1,876
|
||||
24,1,876
|
||||
25,1,878
|
||||
26,1,878
|
||||
27,1,878
|
||||
28,1,878
|
||||
29,1,880
|
||||
30,1,880
|
||||
31,1,880
|
||||
32,1,880
|
||||
33,1,881
|
||||
34,1,881
|
||||
35,1,881
|
||||
36,1,881
|
||||
37,1,883
|
||||
38,1,883
|
||||
39,1,883
|
||||
40,1,883
|
||||
41,1,884
|
||||
42,1,884
|
||||
43,1,884
|
||||
44,1,884
|
||||
45,1,886
|
||||
46,1,886
|
||||
47,1,886
|
||||
48,1,886
|
||||
49,1,888
|
||||
50,1,888
|
||||
51,1,888
|
||||
52,1,888
|
||||
53,1,889
|
||||
54,1,889
|
||||
55,1,889
|
||||
56,1,889
|
||||
57,1,891
|
||||
58,1,891
|
||||
59,1,891
|
||||
60,1,891
|
||||
61,1,892
|
||||
62,1,892
|
||||
63,1,892
|
||||
64,1,892
|
||||
65,1,894
|
||||
66,1,894
|
||||
67,1,894
|
||||
68,1,894
|
||||
69,1,896
|
||||
70,1,896
|
||||
71,1,896
|
||||
72,1,896
|
||||
73,1,897
|
||||
74,1,897
|
||||
75,1,897
|
||||
76,1,897
|
||||
77,1,899
|
||||
78,1,899
|
||||
79,1,899
|
||||
80,1,899
|
||||
81,1,900
|
||||
82,1,900
|
||||
83,1,900
|
||||
84,1,900
|
||||
85,1,902
|
||||
86,1,902
|
||||
87,1,902
|
||||
88,1,902
|
||||
89,1,904
|
||||
90,1,904
|
||||
91,1,904
|
||||
92,1,904
|
||||
93,1,905
|
||||
94,1,905
|
||||
95,1,905
|
||||
96,1,905
|
||||
97,1,907
|
||||
98,1,907
|
||||
99,1,907
|
||||
100,1,907
|
||||
101,1,909
|
||||
102,1,909
|
||||
103,1,909
|
||||
104,1,909
|
||||
105,1,910
|
||||
106,1,910
|
||||
107,1,910
|
||||
108,1,910
|
||||
109,1,912
|
||||
110,1,912
|
||||
111,1,912
|
||||
112,1,912
|
||||
113,1,914
|
||||
114,1,914
|
||||
115,1,914
|
||||
116,1,914
|
||||
117,1,915
|
||||
118,1,915
|
||||
119,1,915
|
||||
120,1,915
|
||||
121,1,917
|
||||
122,1,917
|
||||
123,1,917
|
||||
124,1,917
|
||||
125,1,919
|
||||
126,1,919
|
||||
127,1,919
|
||||
128,1,919
|
||||
129,1,920
|
||||
130,1,920
|
||||
131,1,920
|
||||
132,1,920
|
||||
133,1,922
|
||||
134,1,922
|
||||
135,1,922
|
||||
136,1,922
|
||||
137,1,924
|
||||
138,1,924
|
||||
139,1,924
|
||||
140,1,924
|
||||
141,1,925
|
||||
142,1,925
|
||||
143,1,925
|
||||
144,1,925
|
||||
145,1,927
|
||||
146,1,927
|
||||
147,1,927
|
||||
148,1,927
|
||||
149,1,929
|
||||
150,1,929
|
||||
151,1,929
|
||||
152,1,929
|
||||
153,1,930
|
||||
154,1,930
|
||||
155,1,930
|
||||
156,1,930
|
||||
157,1,932
|
||||
158,1,932
|
||||
159,1,932
|
||||
160,1,932
|
||||
161,1,934
|
||||
162,1,934
|
||||
163,1,934
|
||||
164,1,934
|
||||
165,1,935
|
||||
166,1,935
|
||||
167,1,935
|
||||
168,1,935
|
||||
169,1,937
|
||||
170,1,937
|
||||
171,1,937
|
||||
172,1,937
|
||||
173,1,939
|
||||
174,1,939
|
||||
175,1,939
|
||||
176,1,939
|
||||
177,1,940
|
||||
178,1,940
|
||||
179,1,940
|
||||
180,1,940
|
||||
181,1,942
|
||||
182,1,942
|
||||
183,1,942
|
||||
184,1,942
|
||||
185,1,944
|
||||
186,1,944
|
||||
187,1,944
|
||||
188,1,944
|
||||
189,1,945
|
||||
190,1,945
|
||||
191,1,945
|
||||
192,1,945
|
||||
193,1,947
|
||||
194,1,947
|
||||
195,1,947
|
||||
196,1,947
|
||||
197,1,949
|
||||
198,1,949
|
||||
199,1,949
|
||||
200,1,949
|
||||
201,1,951
|
||||
202,1,951
|
||||
203,1,951
|
||||
204,1,951
|
||||
205,1,952
|
||||
206,1,952
|
||||
207,1,952
|
||||
208,1,952
|
||||
209,1,954
|
||||
210,1,954
|
||||
211,1,954
|
||||
212,1,954
|
||||
213,1,956
|
||||
214,1,956
|
||||
215,1,956
|
||||
216,1,956
|
||||
217,1,957
|
||||
218,1,957
|
||||
219,1,957
|
||||
220,1,957
|
||||
221,1,959
|
||||
222,1,959
|
||||
223,1,959
|
||||
224,1,959
|
||||
225,1,961
|
||||
226,1,961
|
||||
227,1,961
|
||||
228,1,961
|
||||
229,1,963
|
||||
230,1,963
|
||||
231,1,963
|
||||
232,1,963
|
||||
233,1,964
|
||||
234,1,964
|
||||
235,1,964
|
||||
236,1,964
|
||||
237,1,966
|
||||
238,1,966
|
||||
239,1,966
|
||||
240,1,966
|
||||
241,1,968
|
||||
242,1,968
|
||||
243,1,968
|
||||
244,1,968
|
||||
245,1,970
|
||||
246,1,970
|
||||
247,1,970
|
||||
248,1,970
|
||||
249,1,971
|
||||
250,1,971
|
||||
251,1,971
|
||||
252,1,971
|
||||
253,1,973
|
||||
254,1,973
|
||||
255,1,973
|
||||
256,1,973
|
||||
257,1,975
|
||||
258,1,975
|
||||
259,1,975
|
||||
260,1,975
|
||||
261,1,977
|
||||
262,1,977
|
||||
263,1,977
|
||||
264,1,977
|
||||
265,1,978
|
||||
266,1,978
|
||||
267,1,978
|
||||
268,1,978
|
||||
269,1,980
|
||||
270,1,980
|
||||
271,1,980
|
||||
272,1,980
|
||||
273,1,982
|
||||
274,1,982
|
||||
275,1,982
|
||||
276,1,982
|
||||
277,1,984
|
||||
278,1,984
|
||||
279,1,984
|
||||
280,1,984
|
||||
281,1,986
|
||||
282,1,986
|
||||
283,1,986
|
||||
284,1,986
|
||||
285,1,987
|
||||
286,1,987
|
||||
287,1,987
|
||||
288,1,987
|
||||
289,1,989
|
||||
290,1,989
|
||||
291,1,989
|
||||
292,1,989
|
||||
293,1,991
|
||||
294,1,991
|
||||
295,1,991
|
||||
296,1,991
|
||||
297,1,993
|
||||
298,1,993
|
||||
299,1,993
|
||||
300,1,993
|
||||
301,1,995
|
||||
302,1,995
|
||||
303,1,995
|
||||
304,1,995
|
||||
305,1,996
|
||||
306,1,996
|
||||
307,1,996
|
||||
308,1,996
|
||||
309,1,998
|
||||
310,1,998
|
||||
311,1,998
|
||||
312,1,998
|
||||
313,1,1000
|
||||
314,1,1000
|
||||
315,1,1000
|
||||
316,1,1000
|
||||
317,1,1002
|
||||
318,1,1002
|
||||
319,1,1002
|
||||
320,1,1002
|
||||
321,1,1004
|
||||
322,1,1004
|
||||
323,1,1004
|
||||
324,1,1004
|
||||
325,1,1005
|
||||
326,1,1005
|
||||
327,1,1005
|
||||
328,1,1005
|
||||
329,1,1007
|
||||
330,1,1007
|
||||
331,1,1007
|
||||
332,1,1007
|
||||
333,1,1009
|
||||
334,1,1009
|
||||
335,1,1009
|
||||
336,1,1009
|
||||
337,1,1011
|
||||
338,1,1011
|
||||
339,1,1011
|
||||
340,1,1011
|
||||
341,1,1013
|
||||
342,1,1013
|
||||
343,1,1013
|
||||
344,1,1013
|
||||
345,1,1014
|
||||
346,1,1014
|
||||
347,1,1014
|
||||
348,1,1014
|
||||
349,1,1016
|
||||
350,1,1016
|
||||
351,1,1016
|
||||
352,1,1016
|
||||
353,1,1018
|
||||
354,1,1018
|
||||
355,1,1018
|
||||
356,1,1018
|
||||
357,1,1020
|
||||
358,1,1020
|
||||
359,1,1020
|
||||
360,1,1020
|
||||
361,1,1022
|
||||
362,1,1022
|
||||
363,1,1022
|
||||
364,1,1022
|
||||
365,1,876
|
||||
366,1,876
|
||||
367,1,876
|
||||
368,1,876
|
||||
369,2,513
|
||||
370,2,513
|
||||
371,2,513
|
||||
372,2,513
|
||||
373,2,513
|
||||
374,2,513
|
||||
375,2,513
|
||||
376,2,513
|
||||
377,2,514
|
||||
378,2,514
|
||||
379,2,514
|
||||
380,2,514
|
||||
381,2,515
|
||||
382,2,515
|
||||
383,2,515
|
||||
384,2,515
|
||||
385,2,516
|
||||
386,2,516
|
||||
387,2,516
|
||||
388,2,516
|
||||
389,2,517
|
||||
390,2,517
|
||||
391,2,517
|
||||
392,2,517
|
||||
393,2,518
|
||||
394,2,518
|
||||
395,2,518
|
||||
396,2,518
|
||||
397,2,519
|
||||
398,2,519
|
||||
399,2,519
|
||||
400,2,519
|
||||
401,2,520
|
||||
402,2,520
|
||||
403,2,520
|
||||
404,2,520
|
||||
405,2,521
|
||||
406,2,521
|
||||
407,2,521
|
||||
408,2,521
|
||||
409,2,522
|
||||
410,2,522
|
||||
411,2,522
|
||||
412,2,522
|
||||
413,2,523
|
||||
414,2,523
|
||||
415,2,523
|
||||
416,2,523
|
||||
417,2,524
|
||||
418,2,524
|
||||
419,2,524
|
||||
420,2,524
|
||||
421,2,525
|
||||
422,2,525
|
||||
423,2,525
|
||||
424,2,525
|
||||
425,2,526
|
||||
426,2,526
|
||||
427,2,526
|
||||
428,2,526
|
||||
429,2,527
|
||||
430,2,527
|
||||
431,2,527
|
||||
432,2,527
|
||||
433,2,528
|
||||
434,2,528
|
||||
435,2,528
|
||||
436,2,528
|
||||
437,2,528
|
||||
438,2,528
|
||||
439,2,528
|
||||
440,2,528
|
||||
441,2,529
|
||||
442,2,529
|
||||
443,2,529
|
||||
444,2,529
|
||||
445,2,530
|
||||
446,2,530
|
||||
447,2,530
|
||||
448,2,530
|
||||
449,2,531
|
||||
450,2,531
|
||||
451,2,531
|
||||
452,2,531
|
||||
453,2,532
|
||||
454,2,532
|
||||
455,2,532
|
||||
456,2,532
|
||||
457,2,533
|
||||
458,2,533
|
||||
459,2,533
|
||||
460,2,533
|
||||
461,2,534
|
||||
462,2,534
|
||||
463,2,534
|
||||
464,2,534
|
||||
465,2,535
|
||||
466,2,535
|
||||
467,2,535
|
||||
468,2,535
|
||||
469,2,536
|
||||
470,2,536
|
||||
471,2,536
|
||||
472,2,536
|
||||
473,2,537
|
||||
474,2,537
|
||||
475,2,537
|
||||
476,2,537
|
||||
477,2,538
|
||||
478,2,538
|
||||
479,2,538
|
||||
480,2,538
|
||||
481,2,539
|
||||
482,2,539
|
||||
483,2,539
|
||||
484,2,539
|
||||
485,2,540
|
||||
486,2,540
|
||||
487,2,540
|
||||
488,2,540
|
||||
489,2,541
|
||||
490,2,541
|
||||
491,2,541
|
||||
492,2,541
|
||||
493,2,542
|
||||
494,2,542
|
||||
495,2,542
|
||||
496,2,542
|
||||
497,2,543
|
||||
498,2,543
|
||||
499,2,543
|
||||
500,2,543
|
||||
501,2,544
|
||||
502,2,544
|
||||
503,2,544
|
||||
504,2,544
|
||||
505,2,545
|
||||
506,2,545
|
||||
507,2,545
|
||||
508,2,545
|
||||
509,2,546
|
||||
510,2,546
|
||||
511,2,546
|
|
BIN
opl/pitchbend/freqs2.gnumeric
Normal file
BIN
opl/pitchbend/freqs2.gnumeric
Normal file
Binary file not shown.
51
opl/pitchbend/gen-sequence
Executable file
51
opl/pitchbend/gen-sequence
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/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
|
||||
|
||||
def pitch_bend(delay, channel, bend)
|
||||
putc delay
|
||||
putc 0xe0 + channel
|
||||
putc (bend & 0x7f)
|
||||
putc ((bend >> 7) & 0x7f)
|
||||
end
|
||||
|
||||
def end_of_track
|
||||
|
||||
# end of track
|
||||
|
||||
putc 0x00
|
||||
putc 0xff
|
||||
putc 0x2f
|
||||
putc 0x00
|
||||
end
|
||||
|
||||
# Play the same note pitch bent at various values.
|
||||
# This doesn't check the full 0...16384 range but should
|
||||
# be enough
|
||||
|
||||
for i in 0...512
|
||||
pitch_bend(0x3, 8, (i * 16384) / 512)
|
||||
|
||||
# Turn on a note on channel 8:
|
||||
|
||||
note_on(0x3, 8, 30, 0x40 + (i % 32))
|
||||
|
||||
note_off(0xa, 8, 30)
|
||||
end
|
||||
|
||||
end_of_track
|
||||
|
Loading…
Reference in a new issue