Taud tracker: explicit nop and key-off behaviour

This commit is contained in:
minjaesong
2026-04-17 16:42:17 +09:00
parent 8702104bfe
commit 7f0ff3e653
2 changed files with 23 additions and 12 deletions

View File

@@ -2012,10 +2012,16 @@ Instrument bin: Registry for 256 instruments, formatted as:
Play Data: play data are series of tracker-like instructions, visualised as: Play Data: play data are series of tracker-like instructions, visualised as:
rr||NOTE|Ins|E.Vol|E.Pan|EE.ff| rr||NOTE|Ins|E.Vol|E.Pan|EE.ff|
63||FFFF|255|3+ 64|3+ 64|16 FF| (8 bytes per line, 512 bytes per pattern, 256 patterns on 128 kB block) 63||FFFF|255|3 63|3 63|FF FFFF| (8 bytes per line, 512 bytes per pattern, 256 patterns on 128 kB block)
notes are tuned as 4096 Tone-Equal Temperament. Tuning is set per-sample using their Sampling rate value. notes are tuned as 4096 Tone-Equal Temperament. Tuning is set per-sample using their Sampling rate value.
Special values:
note 0xFFFF: no-op
note 0xFFFE: note cut
note 0x0000: key-off
Sound Adapter MMIO Sound Adapter MMIO

View File

@@ -1156,7 +1156,11 @@ class AudioAdapter(val vm: VM) : PeriBase(VM.PERITYPE_SOUND) {
0xEC -> voice.cutAtTick = row.effectArg and 0xFF 0xEC -> voice.cutAtTick = row.effectArg and 0xFF
} }
if (row.note != 0xFFFF) { when (row.note) {
0xFFFF -> {} // no-op: continue current note unchanged
0x0000 -> voice.active = false // key-off (TODO: trigger envelope release phase)
0xFFFE -> voice.active = false // note cut: immediate silence
else -> {
val inst = instruments[row.instrment] val inst = instruments[row.instrment]
voice.instrumentId = row.instrment voice.instrumentId = row.instrment
voice.samplePos = inst.samplePlayStart.toDouble() voice.samplePos = inst.samplePlayStart.toDouble()
@@ -1170,6 +1174,7 @@ class AudioAdapter(val vm: VM) : PeriBase(VM.PERITYPE_SOUND) {
} }
} }
} }
}
private fun applyTrackerTick(ts: TrackerState, playhead: Playhead) { private fun applyTrackerTick(ts: TrackerState, playhead: Playhead) {
val tickSec = 2.5 / playhead.bpm val tickSec = 2.5 / playhead.bpm