@@ -45,7 +45,7 @@ OutputManager::OutputManager( void )
45
45
blit::channels[CHANNEL_LEVEL].volume = 0xffff ;
46
46
blit::channels[CHANNEL_LEVEL].attack_ms = 32 ;
47
47
blit::channels[CHANNEL_LEVEL].decay_ms = 512 ;
48
- blit::channels[CHANNEL_LEVEL].sustain = 256 ;
48
+ blit::channels[CHANNEL_LEVEL].sustain = 0 ;
49
49
blit::channels[CHANNEL_LEVEL].release_ms = 128 ;
50
50
51
51
blit::channels[CHANNEL_FALLING].waveforms = blit::Waveform::SINE;
@@ -66,8 +66,8 @@ OutputManager::OutputManager( void )
66
66
67
67
blit::channels[CHANNEL_BOUNCE].waveforms = blit::Waveform::SAW | blit::Waveform::NOISE;
68
68
blit::channels[CHANNEL_BOUNCE].volume = 0x7fff ;
69
- blit::channels[CHANNEL_BOUNCE].attack_ms = 8 ;
70
- blit::channels[CHANNEL_BOUNCE].decay_ms = 32 ;
69
+ blit::channels[CHANNEL_BOUNCE].attack_ms = 4 ;
70
+ blit::channels[CHANNEL_BOUNCE].decay_ms = 64 ;
71
71
blit::channels[CHANNEL_BOUNCE].sustain = 0 ;
72
72
blit::channels[CHANNEL_BOUNCE].release_ms = 16 ;
73
73
@@ -118,6 +118,7 @@ void OutputManager::enable_sound( bool p_flag )
118
118
blit::write_save ( flags, SAVE_SLOT_OUTPUT );
119
119
120
120
/* And turn off any currently playing sounds. */
121
+ blit::channels[CHANNEL_LEVEL].off ();
121
122
blit::channels[CHANNEL_FALLING].off ();
122
123
blit::channels[CHANNEL_PICKUP].off ();
123
124
blit::channels[CHANNEL_BOUNCE].off ();
@@ -167,6 +168,16 @@ void OutputManager::update( uint32_t p_time )
167
168
blit::vibration = 0 .0f ;
168
169
}
169
170
171
+ /* Check if any channels have hit their sustain phase. */
172
+ if ( blit::channels[CHANNEL_LEVEL].adsr_phase == blit::ADSRPhase::SUSTAIN )
173
+ blit::channels[CHANNEL_LEVEL].trigger_release ();
174
+ if ( blit::channels[CHANNEL_FALLING].adsr_phase == blit::ADSRPhase::SUSTAIN )
175
+ blit::channels[CHANNEL_FALLING].trigger_release ();
176
+ if ( blit::channels[CHANNEL_PICKUP].adsr_phase == blit::ADSRPhase::SUSTAIN )
177
+ blit::channels[CHANNEL_PICKUP].trigger_release ();
178
+ if ( blit::channels[CHANNEL_BOUNCE].adsr_phase == blit::ADSRPhase::SUSTAIN )
179
+ blit::channels[CHANNEL_BOUNCE].trigger_release ();
180
+
170
181
/* All done. */
171
182
return ;
172
183
}
0 commit comments