| 16 | } |
| 17 | |
| 18 | bool JASDrumSet::getParam(int key, int veloKey, JASInstParam *param) const { |
| 19 | #line 29 |
| 20 | JUT_ASSERT(key >= 0); |
| 21 | |
| 22 | if (key >= sPercCount) { |
| 23 | JUT_WARNING_F2("JASDrumSet: key %d >= sPercCount %d\n", key, sPercCount); |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | TPerc *perc = mPercArray[key]; |
| 28 | if (perc == NULL) { |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | param->_14 = 0; |
| 33 | param->_24 = 1; |
| 34 | param->mVolume = perc->mVolume; |
| 35 | param->mPitch = perc->mPitch; |
| 36 | param->mPan = perc->mPan; |
| 37 | param->_26 = perc->mRelease; |
| 38 | |
| 39 | static JASOscillator::Data osc; |
| 40 | |
| 41 | osc.mTarget = 0; |
| 42 | osc._04 = 1.0f; |
| 43 | osc.mTable = NULL; |
| 44 | osc.rel_table = NULL; |
| 45 | osc.mScale = 1.0f; |
| 46 | osc._14 = 0.0f; |
| 47 | |
| 48 | static JASOscillator::Data *oscp = &osc; |
| 49 | |
| 50 | param->_1c = &oscp; |
| 51 | param->_20 = 1; |
| 52 | |
| 53 | for (int i = 0; i < 4; i++) { |
| 54 | JASInstEffect *effect = perc->mEffects[i]; |
| 55 | if (effect) |
| 56 | effect->effect(key, veloKey, param); |
| 57 | } |
| 58 | |
| 59 | for (u32 i = 0; i < perc->mVelomapCount; i++) { |
| 60 | JASVelo *velo = &perc->mVelomap[i]; |
| 61 | if (veloKey <= velo->_0) { |
| 62 | param->mVolume *= velo->_8; |
| 63 | param->mPitch *= velo->_c; |
| 64 | param->_18 = velo->_4; |
| 65 | return true; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | void JASDrumSet::setPerc(int index, JASDrumSet::TPerc *pperc) { |
| 73 | #line 87 |
no test coverage detected