mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-02 07:25:45 -04:00
genmidi: Add option for note offset.
This commit is contained in:
parent
de596007d8
commit
e10f006a71
2 changed files with 12 additions and 1 deletions
|
@ -45,6 +45,15 @@
|
||||||
#
|
#
|
||||||
# Instrument("file1.sbi", "file2.sbi")
|
# Instrument("file1.sbi", "file2.sbi")
|
||||||
#
|
#
|
||||||
|
# To tune the instruments, it's possible to apply an offset to the notes
|
||||||
|
# that are played. For example, to force all notes down by one octave:
|
||||||
|
#
|
||||||
|
# Instrument("file1.sbi", off1=-12)
|
||||||
|
#
|
||||||
|
# This can be controlled individually for double-voice instruments, eg.
|
||||||
|
#
|
||||||
|
# Instrument("file1.sbi", "file2.sbi", off1=-12, off2=+6)
|
||||||
|
#
|
||||||
# When an instrument is played, the note usually comes from the MIDI
|
# When an instrument is played, the note usually comes from the MIDI
|
||||||
# event. Some instruments (especially percussion) always play the same
|
# event. Some instruments (especially percussion) always play the same
|
||||||
# note. To specify a fixed note, do this:
|
# note. To specify a fixed note, do this:
|
||||||
|
|
|
@ -72,7 +72,7 @@ def load_instrument(filename):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class Instrument:
|
class Instrument:
|
||||||
def __init__(self, file1, file2=None, note=None):
|
def __init__(self, file1, file2=None, off1=0, off2=0, note=None):
|
||||||
self.instr1 = load_instrument(file1)
|
self.instr1 = load_instrument(file1)
|
||||||
|
|
||||||
if file2 is not None:
|
if file2 is not None:
|
||||||
|
@ -81,6 +81,8 @@ class Instrument:
|
||||||
self.instr2 = None
|
self.instr2 = None
|
||||||
|
|
||||||
self.fixed_note = note
|
self.fixed_note = note
|
||||||
|
self.offset1 = off1
|
||||||
|
self.offset2 = off2
|
||||||
|
|
||||||
NullInstrument = Instrument("dummy.sbi")
|
NullInstrument = Instrument("dummy.sbi")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue