Fold soundThing's changes back down, and expose the two new switches
The three changes that went up came back as part of soundThing, along with two more that they made possible. The engine here is now b73e5c0 character for character, except that em-dashes and arrows in comments are written as ASCII because this tree is ASCII only - a local rule, not an improvement, and not sent up. So synth.h's "what was changed" list is gone. There is nothing to list: what has to be kept current is only that if either copy changes, the other one has to be told. ---- What came back ---- A VOICE CAN END ITSELF. Naming the level's source said what shapes a voice; nothing said what ends one, so the only thing that could ever finish one was a key coming up. A game is nearly all one-shots and not one of them wants its length decided by how long a note was held. Exposed as parameter 0x51: 0 gated, 1 triggered. AND A ONE-SHOT IS THE SAME ONE-SHOT TWICE. A triggered voice re-arms its oscillators, and an LFO can be told to start over with each voice - parameter 3 of either LFO. Both halves are needed and the check proves it: with the LFO left free, two triggered hits still differ. Their note warned that whatever applies a patch to a channel has to set these or they hold synthInit's defaults. Checked: Voyager never calls synthSyncVoices, so their 0001 is a no-op here as they predicted, and nothing reaches into an LFO's phase, so the struct split is safe. ---- What it is for ---- Lander's crash is a triggered voice now, so boomOff is gone. Nothing has to remember to end a bang. SoundPatch learnt voice_levelSource, voice_gate and lfo<N>_mode, which the new soundThing writes - without that it would have refused every patch saved from it, since an unknown field stops the tool on purpose. A patch from before those fields still converts, and says in its own comments that it predates the level routing. Three checks, each seen to fail on its own break: a gated voice still sounding with nothing holding it, a triggered one down to nothing with no gate ever dropped, and two hits identical sample for sample. One test bug worth keeping: the first version of the repeatability check struck the second note while the first was still ringing, so what it found and compared as "the second hit" was a point in the middle of the first one's tail. It now looks for sound after SILENCE rather than sound after an offset.
This commit is contained in:
@@ -2537,7 +2537,6 @@ explode:
|
||||
CALL startBurst
|
||||
CALL boom
|
||||
CALL runBurst
|
||||
CALL boomOff
|
||||
RET
|
||||
|
||||
; ---- Dust, for a landing that went right ----
|
||||
@@ -2683,6 +2682,20 @@ putBoom:
|
||||
OUTA 0x41 ; Channel three. Every parameter write below lands on it.
|
||||
SETD.0 BoomPatch
|
||||
CALL playPatch
|
||||
|
||||
; ---- Struck, not held ----
|
||||
;
|
||||
; A gated voice lasts as long as something keeps hold of it, and the gate coming up is what
|
||||
; starts its release - which is what a keyboard is. A crash is not a keyboard. It is struck
|
||||
; once and then plays its own length, and nothing should have to remember to end it.
|
||||
;
|
||||
; Said here rather than left to the patch because it is the PROGRAM that knows this is a
|
||||
; one-shot: the patch decides what the bang sounds like, and this decides that it is a bang.
|
||||
; A patch designed in soundThing carries a gate of its own, and this overrides it on purpose.
|
||||
INIA 0x51
|
||||
OUTA 0x42
|
||||
INIA 0x01 ; Triggered.
|
||||
OUTA 0x43
|
||||
RET
|
||||
|
||||
; ---- A whole patch, out of a table ----
|
||||
@@ -2716,14 +2729,6 @@ boom:
|
||||
OUTA 0x44 ; Writing the note is what starts it.
|
||||
RET
|
||||
|
||||
; And letting go of it, once there is nothing left to watch.
|
||||
boomOff:
|
||||
INIA 0x03
|
||||
OUTA 0x41
|
||||
RSTA
|
||||
OUTA 0x45 ; Dropping the gate is the only thing that ends a note.
|
||||
RET
|
||||
|
||||
; ---- A key, or a button ----
|
||||
;
|
||||
; Somebody flying on a controller should not have to reach for the keyboard to say "yes, I
|
||||
|
||||
Reference in New Issue
Block a user