MCPcopy Create free account
hub / github.com/doldecomp/mkdd / updateEffectorParam

Method updateEffectorParam

libs/JSystem/JAudio/System/JASChannel.cpp:183–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void JASChannel::updateEffectorParam(JASDsp::TChannel *channel, u16 *mixerVolume, const JASOscillator::EffectParams &effectParams) {
184 PanVector pan_vector, fxmix_vector, dolby_vector;
185 pan_vector.mSound = mSoundParams.mPan;
186 pan_vector.mChannel = mParams.mPan;
187 pan_vector.mEffect = effectParams.mPan;
188 fxmix_vector.mSound = mSoundParams.mFxMix;
189 fxmix_vector.mChannel = mParams.mFxMix;
190 fxmix_vector.mEffect = effectParams.mFxMix;
191 dolby_vector.mSound = mSoundParams.mDolby;
192 dolby_vector.mChannel = mParams.mDolby;
193 dolby_vector.mEffect = effectParams.mDolby;
194
195 f32 pan = 0.5f;
196 f32 dolby = 0.0f;
197 switch (JASDriver::getOutputMode()) {
198 case 0:
199 break;
200 case 1:
201 pan = calcPan(&pan_vector);
202 break;
203 case 2:
204 pan = calcPan(&pan_vector);
205 dolby = calcEffect(&dolby_vector);
206 break;
207 }
208 f32 fxmix = calcEffect(&fxmix_vector);
209 f32 volume = mVelocity / 127.0f;
210 volume = volume * volume;
211 volume = mSoundParams.mVolume * effectParams.mVolume * mParams.mVolume * (effectParams._18 * mTremolo.getValue() + 1.0f) * volume;
212
213 if (volume < 0.0f) {
214 volume = 0.0f;
215 }
216 pan = JASCalc::clamp01(pan);
217 fxmix = JASCalc::clamp01(fxmix);
218 dolby = JASCalc::clamp01(dolby);
219
220 if (!isDolbyMode()) {
221 updateMixer(volume, pan, fxmix, dolby, mixerVolume);
222 } else {
223 updateAutoMixer(channel, volume, pan, fxmix, dolby);
224 }
225}
226
227s32 JASChannel::dspUpdateCallback(u32 status, JASDsp::TChannel *dspChannel, void *arg) {
228 JASChannel *channel = static_cast<JASChannel*>(arg);

Callers

nothing calls this directly

Calls 3

getOutputModeFunction · 0.85
clamp01Function · 0.85
getValueMethod · 0.45

Tested by

no test coverage detected