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

Method getParam

libs/JSystem/JAudio/System/JASBasicInst.cpp:32–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30void JASBasicInst::searchKeymap(int) const { }
31
32bool JASBasicInst::getParam(int key, int key2, JASInstParam *instParam) const {
33 instParam->_14 = 0;
34 instParam->_24 = 0;
35 instParam->_1c = (JASOscillator::Data **)&mOsc;
36 instParam->_20 = 2;
37 instParam->mVolume = mVolume;
38 instParam->mPitch = mPitch;
39
40 for (int i = 0; i < EFFECT_MAX; i++) {
41 JASInstEffect *effect = mEffect[i];
42 if (effect)
43 effect->effect(key, key2, instParam);
44 }
45
46 const TKeymap *keyMap = NULL;
47 for (u32 i = 0; i < mKeyRegionCount; i++) {
48 if (key <= mKeymap[i].mHighKey) {
49 keyMap = &mKeymap[i];
50 break;
51 }
52 }
53
54 if (!keyMap) {
55 return false;
56 }
57
58 for (u32 j = 0; j < keyMap->mVeloRegionCount; j++) {
59 JASVelo *velo = keyMap->getVeloRegion(j);
60 if (key2 <= velo->_0) {
61 instParam->mVolume *= velo->_8;
62 instParam->mPitch *= velo->_c;
63 instParam->_18 = velo->_4;
64 return true;
65 }
66 }
67
68 return false;
69}
70
71void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap *pHeap) {
72 delete[] mKeymap;

Callers

nothing calls this directly

Calls 2

effectMethod · 0.45
getVeloRegionMethod · 0.45

Tested by

no test coverage detected