mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-06 13:38:30 +09:00
Taud tracker: explicit nop and key-off behaviour
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -1156,17 +1156,22 @@ 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) {
|
||||||
val inst = instruments[row.instrment]
|
0xFFFF -> {} // no-op: continue current note unchanged
|
||||||
voice.instrumentId = row.instrment
|
0x0000 -> voice.active = false // key-off (TODO: trigger envelope release phase)
|
||||||
voice.samplePos = inst.samplePlayStart.toDouble()
|
0xFFFE -> voice.active = false // note cut: immediate silence
|
||||||
voice.forward = true
|
else -> {
|
||||||
voice.active = true
|
val inst = instruments[row.instrment]
|
||||||
voice.envIndex = 0
|
voice.instrumentId = row.instrment
|
||||||
voice.envTimeSec = 0.0
|
voice.samplePos = inst.samplePlayStart.toDouble()
|
||||||
voice.envVolume = inst.envelopes[0].volume / 255.0
|
voice.forward = true
|
||||||
voice.noteVal = row.note
|
voice.active = true
|
||||||
voice.playbackRate = computePlaybackRate(inst, row.note)
|
voice.envIndex = 0
|
||||||
|
voice.envTimeSec = 0.0
|
||||||
|
voice.envVolume = inst.envelopes[0].volume / 255.0
|
||||||
|
voice.noteVal = row.note
|
||||||
|
voice.playbackRate = computePlaybackRate(inst, row.note)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user