A bang for the crash, which is this game's first sound
Noise through a low pass that the modulation envelope shuts as the level falls, so the bright part is only at the front of it: a boom rather than a hiss. Noise because every other waveform here has a pitch, and a pitched bang is a note. The instrument is built at startup the way the tiles are, and a crash only says "this channel, this note". That is what the selector and value registers are for - a patch is twenty odd writes and a note is two - and it is the shape every sound after this one should take. CHANNEL THREE. There are four, and effects count down from the top so that music, if it ever arrives, can take nought and count up and the two never have to negotiate. This is also the first program to drive the sound device while also doing something else; the only other customer is the patch editor, whose whole job is the device. ---- A byte of envelope is not seconds ---- It is squared and scaled to four of them, so the decay first written here was 200 - which is two and a half seconds. Over the eight tenths of a second the pieces are in the air that is not a bang fading, it is the FRONT THIRD of one, and it both sounded and measured as a flat wash of noise. Ninety is about half a second and it fades to silence with time to spare. Two checks, each seen to fail on its own break. The first is against SILENCE - a landing in the same conditions makes no sound at all, so it is measuring the crash and not the machine humming - and the second is that it is louder in its first half than its second, which is the difference the decay was getting wrong.
This commit is contained in:
@@ -80,6 +80,7 @@ start:
|
||||
CALL putLander
|
||||
CALL putGauge
|
||||
CALL putOrbital
|
||||
CALL putBoom ; The instrument, once, the way the tiles are.
|
||||
|
||||
INIA 0x01
|
||||
OUTA 0x02 ; Key mode.
|
||||
@@ -2534,7 +2535,9 @@ explode:
|
||||
STA.0 ; Getting on for a second, which is long enough to watch.
|
||||
SETD.0 SparkV
|
||||
CALL startBurst
|
||||
CALL boom
|
||||
CALL runBurst
|
||||
CALL boomOff
|
||||
RET
|
||||
|
||||
; ---- Dust, for a landing that went right ----
|
||||
@@ -2656,6 +2659,119 @@ hideSprite:
|
||||
OUTA 0xE9
|
||||
RET
|
||||
|
||||
; ---- The bang, set up once and played in two writes ----
|
||||
;
|
||||
; A patch is twenty odd writes and a note is two, which is the whole point of the selector and
|
||||
; value registers - so the instrument is built at startup like the tiles are, and a crash only
|
||||
; has to say "this channel, this note".
|
||||
;
|
||||
; ---- Channel three, counting down ----
|
||||
;
|
||||
; Effects take the top channel and work downwards, so music, if it ever arrives, can take
|
||||
; nought and count up and the two never have to negotiate. There are four, and this is the
|
||||
; first program to want any of them while also doing something else.
|
||||
putBoom:
|
||||
INIA 0x03
|
||||
OUTA 0x41 ; Channel three. Every parameter write below lands on it.
|
||||
|
||||
; ---- Noise, which is what an explosion is ----
|
||||
;
|
||||
; Every other waveform here has a pitch, and a pitched bang is a note. Writing a port leaves
|
||||
; A alone, so the three that selected the channel would select parameter three; the wave is
|
||||
; parameter nought and has to be said.
|
||||
RSTA
|
||||
OUTA 0x42
|
||||
INIA 0d5 ; Noise.
|
||||
OUTA 0x43
|
||||
INIA 0x01 ; Oscillator nought, gain.
|
||||
OUTA 0x42
|
||||
INIA 0xFF
|
||||
OUTA 0x43
|
||||
|
||||
; ---- Instant, then a long way down ----
|
||||
;
|
||||
; No attack at all, because a bang that fades in is not a bang. A sustain of nothing does NOT
|
||||
; end the note - a voice holding at nothing is what a held key is - so the gate still has to
|
||||
; be dropped afterwards, which the explosion does once its pieces have gone.
|
||||
INIA 0x20 ; Amplitude envelope, attack.
|
||||
OUTA 0x42
|
||||
RSTA
|
||||
OUTA 0x43
|
||||
INIA 0x21 ; ---- Decay: about half a second ----
|
||||
OUTA 0x42 ;
|
||||
; A byte is not seconds. It is squared and scaled to four of them,
|
||||
; so 200 is two and a half - which over the eight tenths of a
|
||||
; second the pieces are in the air is not a bang fading, it is the
|
||||
; first third of one, and it read as a flat wash of noise.
|
||||
INIA 0d90
|
||||
OUTA 0x43
|
||||
INIA 0x22 ; Sustain: nothing.
|
||||
OUTA 0x42
|
||||
RSTA
|
||||
OUTA 0x43
|
||||
INIA 0x23 ; Release.
|
||||
OUTA 0x42
|
||||
INIA 0d40
|
||||
OUTA 0x43
|
||||
|
||||
; ---- And a filter closing, which is what makes it a boom and not a hiss ----
|
||||
;
|
||||
; Noise on its own is a cymbal. The modulation envelope shuts the low pass over the same
|
||||
; moment the level falls, so the bright part is only at the front of it.
|
||||
INIA 0x40 ; Filter, on.
|
||||
OUTA 0x42
|
||||
INIA 0x01
|
||||
OUTA 0x43
|
||||
INIA 0x41 ; Type: low pass.
|
||||
OUTA 0x42
|
||||
RSTA
|
||||
OUTA 0x43
|
||||
INIA 0x42 ; Cutoff, low, which is where it ends up.
|
||||
OUTA 0x42
|
||||
INIA 0d40
|
||||
OUTA 0x43
|
||||
INIA 0x43 ; A little resonance, so the sweep can be heard.
|
||||
OUTA 0x42
|
||||
INIA 0d120
|
||||
OUTA 0x43
|
||||
INIA 0x44 ; What opens it: the modulation envelope.
|
||||
OUTA 0x42
|
||||
INIA 0d2
|
||||
OUTA 0x43
|
||||
INIA 0x45 ; And how far above where it sits.
|
||||
OUTA 0x42
|
||||
INIA 0d200
|
||||
OUTA 0x43
|
||||
INIA 0x30 ; That envelope: open at once,
|
||||
OUTA 0x42
|
||||
RSTA
|
||||
OUTA 0x43
|
||||
INIA 0x31 ; shut over about a third of a second,
|
||||
OUTA 0x42
|
||||
INIA 0d90
|
||||
OUTA 0x43
|
||||
INIA 0x32 ; and stay shut.
|
||||
OUTA 0x42
|
||||
RSTA
|
||||
OUTA 0x43
|
||||
RET
|
||||
|
||||
; Two writes, which is what a note is meant to cost.
|
||||
boom:
|
||||
INIA 0x03
|
||||
OUTA 0x41
|
||||
INIA 0d24 ; Low: the filter is doing the work and this is only the body.
|
||||
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