mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-06 05:28:31 +09:00
S3M/MON converters using NOTE_CUT for note-off because of fadeout semantics
This commit is contained in:
@@ -132,7 +132,7 @@ def mon_note_to_taud(mon_note: int) -> int:
|
||||
if mon_note == 0:
|
||||
return NOTE_NOP
|
||||
if mon_note == 0x7F:
|
||||
return NOTE_KEYOFF
|
||||
return NOTE_CUT
|
||||
val = TAUD_C4 + round((mon_note - MON_NOTE_C4) * 4096.0 / 12.0)
|
||||
return max(1, min(0xFFFD, val))
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ def encode_note(s3m_note: int) -> int:
|
||||
if s3m_note == S3M_NOTE_EMPTY:
|
||||
return NOTE_NOP
|
||||
if s3m_note == S3M_NOTE_OFF:
|
||||
return NOTE_KEYOFF
|
||||
return NOTE_CUT
|
||||
octave = (s3m_note >> 4) & 0xF
|
||||
pitch = s3m_note & 0xF
|
||||
if pitch > 11:
|
||||
|
||||
Reference in New Issue
Block a user