| @@ -850,7 +850,7 @@ float tADSR3_tick(tADSR3* const adsrenv) · 849 unmodified lines |
| 850 | 850 | // use this if the size of the big ADSR tables is too much. |
| 851 | 851 | void tADSR4_init (tADSR4* const adsrenv, float attack, float decay, float sustain, float release, float* expBuffer, int bufferSize) |
| 852 | 852 | { |
| 853 | | − tADSR4_initToPool (adsrenv, attack, decay, sustain, release, expBuffer, bufferSize, &leaf.mempool); |
| 853 | + tADSR4_initToPool (adsrenv, attack, decay, sustain, release, expBuffer, bufferSize, &leaf.mempool); |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | void tADSR4_free(tADSR4* const adsrenv) |
| @@ -887,11 +887,7 @@ void tADSR4_initToPool (tADSR4* const adsrenv, float attack, float decay, · 30 unmodified lines |
| 887 | 887 | |
| 888 | 888 | adsr->next = 0.0f; |
| 889 | 889 | |
| 890 | | − adsr->inRamp = OFALSE; |
| 891 | | − adsr->inAttack = OFALSE; |
| 892 | | − adsr->inDecay = OFALSE; |
| 893 | | − adsr->inSustain = OFALSE; |
| 894 | | − adsr->inRelease = OFALSE; |
| 890 | + adsr->whichStage = env_idle; |
| 895 | 891 | |
| 896 | 892 | adsr->sustain = sustain; |
| 897 | 893 | |
| @@ -916,7 +912,7 @@ void tADSR4_setAttack(tADSR4* const adsrenv, float attack) · 18 unmodified lines |
| 916 | 912 | |
| 917 | 913 | if (attack < 0.0f) |
| 918 | 914 | { |
| 919 | | − attack = 0.0f; |
| 915 | + attack = 0.0f; |
| 920 | 916 | } |
| 921 | 917 | |
| 922 | 918 | adsr->attackInc = adsr->bufferSizeDividedBySampleRateInMs / attack; |
| @@ -928,7 +924,7 @@ void tADSR4_setDecay(tADSR4* const adsrenv, float decay) · 5 unmodified lines |
| 928 | 924 | |
| 929 | 925 | if (decay < 0.0f) |
| 930 | 926 | { |
| 931 | | − decay = 0.0f; |
| 927 | + decay = 0.0f; |
| 932 | 928 | } |
| 933 | 929 | adsr->decayInc = adsr->bufferSizeDividedBySampleRateInMs / decay; |
| 934 | 930 | } |
| @@ -948,7 +944,7 @@ void tADSR4_setRelease(tADSR4* const adsrenv, float release) · 13 unmodified lines |
| 948 | 944 | |
| 949 | 945 | if (release < 0.0f) |
| 950 | 946 | { |
| 951 | | − release = 0.0f; |
| 947 | + release = 0.0f; |
| 952 | 948 | } |
| 953 | 949 | adsr->releaseInc = adsr->bufferSizeDividedBySampleRateInMs / release; |
| 954 | 950 | } |
| @@ -966,23 +962,20 @@ void tADSR4_on(tADSR4* const adsrenv, float velocity) · 11 unmodified lines |
| 966 | 962 | { |
| 967 | 963 | _tADSR4* adsr = *adsrenv; |
| 968 | 964 | |
| 969 | | − if ((adsr->inAttack || adsr->inDecay) || (adsr->inSustain || adsr->inRelease)) // In case ADSR retriggered while it is still happening. |
| 965 | + if (adsr->whichStage != env_idle) // In case ADSR retriggered while it is still happening. |
| 970 | 966 | { |
| 971 | 967 | adsr->rampPhase = 0; |
| 972 | | − adsr->inRamp = OTRUE; |
| 968 | + adsr->whichStage = env_ramp; |
| 973 | 969 | adsr->rampPeak = adsr->next; |
| 974 | 970 | } |
| 975 | 971 | else // Normal start. |
| 976 | 972 | { |
| 977 | | − adsr->inAttack = OTRUE; |
| 973 | + adsr->whichStage = env_attack; |
| 978 | 974 | } |
| 979 | 975 | |
| 980 | 976 | adsr->attackPhase = 0; |
| 981 | 977 | adsr->decayPhase = 0; |
| 982 | 978 | adsr->releasePhase = 0; |
| 983 | | − adsr->inDecay = OFALSE; |
| 984 | | − adsr->inSustain = OFALSE; |
| 985 | | − adsr->inRelease = OFALSE; |
| 986 | 979 | adsr->gain = velocity; |
| 987 | 980 | } |
| 988 | 981 | |
| @@ -990,146 +983,139 @@ void tADSR4_off(tADSR4* const adsrenv) · 1 unmodified line |
| 990 | 983 | { |
| 991 | 984 | _tADSR4* adsr = *adsrenv; |
| 992 | 985 | |
| 993 | | − if (adsr->inRelease) return; |
| 994 | | − |
| 995 | | − adsr->inAttack = OFALSE; |
| 996 | | − adsr->inDecay = OFALSE; |
| 997 | | − adsr->inSustain = OFALSE; |
| 998 | | − adsr->inRelease = OTRUE; |
| 999 | | − |
| 1000 | | − adsr->releasePeak = adsr->next; |
| 986 | + if (adsr->whichStage == env_idle) |
| 987 | + { |
| 988 | + return; |
| 989 | + } |
| 990 | + else |
| 991 | + { |
| 992 | + adsr->whichStage = env_release; |
| 993 | + adsr->releasePeak = adsr->next; |
| 994 | + } |
| 1001 | 995 | } |
| 1002 | 996 | |
| 1003 | 997 | float tADSR4_tick(tADSR4* const adsrenv) |
| 1004 | 998 | { |
| 1005 | 999 | _tADSR4* adsr = *adsrenv; |
| 1006 | 1000 | |
| 1007 | | − |
| 1008 | | − if (adsr->inRamp) |
| 1001 | + switch (adsr->whichStage) |
| 1009 | 1002 | { |
| 1010 | | − if (adsr->rampPhase > adsr->buff_sizeMinusOne) |
| 1011 | | − { |
| 1012 | | − adsr->inRamp = OFALSE; |
| 1013 | | − adsr->inAttack = OTRUE; |
| 1014 | | − adsr->next = 0.0f; |
| 1015 | | − } |
| 1016 | | − else |
| 1017 | | − { |
| 1018 | | − uint32_t intPart = (uint32_t)adsr->rampPhase; |
| 1019 | | − float floatPart = adsr->rampPhase - intPart; |
| 1020 | | − float secondValue; |
| 1021 | | − if (adsr->rampPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1022 | | − { |
| 1023 | | − secondValue = 0.0f; |
| 1024 | | − } |
| 1025 | | − else |
| 1026 | | − { |
| 1027 | | − secondValue = adsr->exp_buff[(uint32_t)((adsr->rampPhase)+1)]; |
| 1028 | | − } |
| 1029 | | − adsr->next = adsr->rampPeak * LEAF_interpolation_linear(adsr->exp_buff[(uint32_t)(adsr->rampPhase)], secondValue, floatPart); |
| 1030 | | − } |
| 1003 | + case env_ramp: |
| 1004 | + if (adsr->rampPhase > adsr->buff_sizeMinusOne) |
| 1005 | + { |
| 1006 | + adsr->whichStage = env_attack; |
| 1007 | + adsr->next = 0.0f; |
| 1008 | + } |
| 1009 | + else |
| 1010 | + { |
| 1011 | + uint32_t intPart = (uint32_t)adsr->rampPhase; |
| 1012 | + float floatPart = adsr->rampPhase - intPart; |
| 1013 | + float secondValue; |
| 1014 | + if (adsr->rampPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1015 | + { |
| 1016 | + secondValue = 0.0f; |
| 1017 | + } |
| 1018 | + else |
| 1019 | + { |
| 1020 | + secondValue = adsr->exp_buff[(uint32_t)((adsr->rampPhase)+1)]; |
| 1021 | + } |
| 1022 | + adsr->next = adsr->rampPeak * LEAF_interpolation_linear(adsr->exp_buff[intPart], secondValue, floatPart); |
| 1023 | + } |
| 1031 | 1024 | |
| 1032 | | − adsr->rampPhase += adsr->rampInc; |
| 1033 | | − } |
| 1025 | + adsr->rampPhase += adsr->rampInc; |
| 1026 | + break; |
| 1034 | 1027 | |
| 1035 | | − if (adsr->inAttack) |
| 1036 | | − { |
| 1037 | 1028 | |
| 1038 | | − // If attack done, time to turn around. |
| 1039 | | − if (adsr->attackPhase > adsr->buff_sizeMinusOne) |
| 1040 | | − { |
| 1041 | | − adsr->inDecay = OTRUE; |
| 1042 | | − adsr->inAttack = OFALSE; |
| 1043 | | − adsr->next = adsr->gain; |
| 1044 | | − } |
| 1045 | | − else |
| 1046 | | − { |
| 1047 | | − // do interpolation ! |
| 1048 | | − uint32_t intPart = (uint32_t)adsr->attackPhase; |
| 1049 | | − float floatPart = adsr->attackPhase - intPart; |
| 1050 | | − float secondValue; |
| 1051 | | − if (adsr->attackPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1052 | | − { |
| 1053 | | − secondValue = 0.0f; |
| 1054 | | − } |
| 1055 | | − else |
| 1056 | | − { |
| 1057 | | − secondValue = adsr->exp_buff[(uint32_t)((adsr->attackPhase)+1)]; |
| 1058 | | − } |
| 1059 | | − |
| 1060 | | − adsr->next = adsr->gain * (1.0f - LEAF_interpolation_linear(adsr->exp_buff[(uint32_t)(adsr->attackPhase)], secondValue, floatPart)); // inverted and backwards to get proper rising exponential shape/perception |
| 1061 | | − } |
| 1029 | + case env_attack: |
| 1062 | 1030 | |
| 1063 | | − // Increment ADSR attack. |
| 1064 | | − adsr->attackPhase += adsr->attackInc; |
| 1031 | + // If attack done, time to turn around. |
| 1032 | + if (adsr->attackPhase > adsr->buff_sizeMinusOne) |
| 1033 | + { |
| 1034 | + adsr->whichStage = env_decay; |
| 1035 | + adsr->next = adsr->gain; |
| 1036 | + } |
| 1037 | + else |
| 1038 | + { |
| 1039 | + // do interpolation ! |
| 1040 | + uint32_t intPart = (uint32_t)adsr->attackPhase; |
| 1041 | + float floatPart = adsr->attackPhase - intPart; |
| 1042 | + float secondValue; |
| 1043 | + if (adsr->attackPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1044 | + { |
| 1045 | + secondValue = 0.0f; |
| 1046 | + } |
| 1047 | + else |
| 1048 | + { |
| 1049 | + secondValue = adsr->exp_buff[(uint32_t)((adsr->attackPhase)+1)]; |
| 1050 | + } |
| 1051 | + |
| 1052 | + adsr->next = adsr->gain * (1.0f - LEAF_interpolation_linear(adsr->exp_buff[intPart], secondValue, floatPart)); // inverted and backwards to get proper rising exponential shape/perception |
| 1053 | + } |
| 1065 | 1054 | |
| 1066 | | − } |
| 1055 | + // Increment ADSR attack. |
| 1056 | + adsr->attackPhase += adsr->attackInc; |
| 1057 | + break; |
| 1067 | 1058 | |
| 1068 | | − if (adsr->inDecay) |
| 1069 | | − { |
| 1059 | + case env_decay: |
| 1070 | 1060 | |
| 1071 | | − // If decay done, sustain. |
| 1072 | | − if (adsr->decayPhase > adsr->buff_sizeMinusOne) |
| 1073 | | − { |
| 1074 | | − adsr->inDecay = OFALSE; |
| 1075 | | − adsr->inSustain = OTRUE; |
| 1076 | | − adsr->next = adsr->gain * adsr->sustain; |
| 1077 | | − } |
| 1061 | + // If decay done, sustain. |
| 1062 | + if (adsr->decayPhase > adsr->buff_sizeMinusOne) |
| 1063 | + { |
| 1064 | + adsr->whichStage = env_sustain; |
| 1065 | + adsr->next = adsr->gain * adsr->sustain; |
| 1066 | + } |
| 1078 | 1067 | |
| 1079 | | − else |
| 1080 | | − { |
| 1081 | | − uint32_t intPart = (uint32_t)adsr->decayPhase; |
| 1082 | | − float floatPart = adsr->decayPhase - intPart; |
| 1083 | | − float secondValue; |
| 1084 | | − if (adsr->decayPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1085 | | − { |
| 1086 | | − secondValue = 0.0f; |
| 1087 | | − } |
| 1088 | | − else |
| 1089 | | − { |
| 1090 | | − secondValue = adsr->exp_buff[(uint32_t)((adsr->decayPhase)+1)]; |
| 1091 | | − } |
| 1092 | | − float interpValue = (LEAF_interpolation_linear(adsr->exp_buff[(uint32_t)(adsr->decayPhase)], secondValue, floatPart)); |
| 1093 | | − adsr->next = (adsr->gain * (adsr->sustain + (interpValue * (1.0f - adsr->sustain)))) * adsr->leakFactor; // do interpolation ! |
| 1094 | | − } |
| 1068 | + else |
| 1069 | + { |
| 1070 | + uint32_t intPart = (uint32_t)adsr->decayPhase; |
| 1071 | + float floatPart = adsr->decayPhase - intPart; |
| 1072 | + float secondValue; |
| 1073 | + if (adsr->decayPhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1074 | + { |
| 1075 | + secondValue = 0.0f; |
| 1076 | + } |
| 1077 | + else |
| 1078 | + { |
| 1079 | + secondValue = adsr->exp_buff[(uint32_t)((adsr->decayPhase)+1)]; |
| 1080 | + } |
| 1081 | + float interpValue = (LEAF_interpolation_linear(adsr->exp_buff[intPart], secondValue, floatPart)); |
| 1082 | + adsr->next = (adsr->gain * (adsr->sustain + (interpValue * (1.0f - adsr->sustain)))) * adsr->leakFactor; // do interpolation ! |
| 1083 | + } |
| 1095 | 1084 | |
| 1096 | | − // Increment ADSR decay. |
| 1097 | | − adsr->decayPhase += adsr->decayInc; |
| 1098 | | − } |
| 1085 | + // Increment ADSR decay. |
| 1086 | + adsr->decayPhase += adsr->decayInc; |
| 1087 | + break; |
| 1099 | 1088 | |
| 1100 | | − if (adsr->inSustain) |
| 1101 | | − { |
| 1102 | | − adsr->next = adsr->next * adsr->leakFactor; |
| 1103 | | − } |
| 1089 | + case env_sustain: |
| 1090 | + adsr->next = adsr->next * adsr->leakFactor; |
| 1091 | + break; |
| 1104 | 1092 | |
| 1105 | | − if (adsr->inRelease) |
| 1106 | | − { |
| 1107 | | − // If release done, finish. |
| 1108 | | − if (adsr->releasePhase > adsr->buff_sizeMinusOne) |
| 1109 | | − { |
| 1110 | | − adsr->inRelease = OFALSE; |
| 1111 | | − adsr->next = 0.0f; |
| 1112 | | − } |
| 1113 | | − else { |
| 1114 | | − uint32_t intPart = (uint32_t)adsr->releasePhase; |
| 1115 | | − float floatPart = adsr->releasePhase - intPart; |
| 1116 | | − float secondValue; |
| 1117 | | − if (adsr->releasePhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1118 | | − { |
| 1119 | | − secondValue = 0.0f; |
| 1120 | | − } |
| 1121 | | − else |
| 1122 | | − { |
| 1123 | | − secondValue = adsr->exp_buff[(uint32_t)((adsr->releasePhase)+1)]; |
| 1124 | | − } |
| 1125 | | − adsr->next = adsr->releasePeak * (LEAF_interpolation_linear(adsr->exp_buff[(uint32_t)(adsr->releasePhase)], secondValue, floatPart)); // do interpolation ! |
| 1126 | | − } |
| 1093 | + case env_release: |
| 1094 | + // If release done, finish. |
| 1095 | + if (adsr->releasePhase > adsr->buff_sizeMinusOne) |
| 1096 | + { |
| 1097 | + adsr->whichStage = env_idle; |
| 1098 | + adsr->next = 0.0f; |
| 1099 | + } |
| 1100 | + else { |
| 1101 | + uint32_t intPart = (uint32_t)adsr->releasePhase; |
| 1102 | + float floatPart = adsr->releasePhase - intPart; |
| 1103 | + float secondValue; |
| 1104 | + if (adsr->releasePhase + 1.0f > adsr->buff_sizeMinusOne) |
| 1105 | + { |
| 1106 | + secondValue = 0.0f; |
| 1107 | + } |
| 1108 | + else |
| 1109 | + { |
| 1110 | + secondValue = adsr->exp_buff[(uint32_t)((adsr->releasePhase)+1)]; |
| 1111 | + } |
| 1112 | + adsr->next = adsr->releasePeak * (LEAF_interpolation_linear(adsr->exp_buff[intPart], secondValue, floatPart)); // do interpolation ! |
| 1113 | + } |
| 1127 | 1114 | |
| 1128 | | − // Increment envelope release; |
| 1129 | | − adsr->releasePhase += adsr->releaseInc; |
| 1115 | + // Increment envelope release; |
| 1116 | + adsr->releasePhase += adsr->releaseInc; |
| 1117 | + break; |
| 1130 | 1118 | } |
| 1131 | | − |
| 1132 | | − |
| 1133 | 1119 | return adsr->next; |
| 1134 | 1120 | } |
| 1135 | 1121 | |
| @@ -1137,87 +1123,77 @@ float tADSR4_tickNoInterp(tADSR4* const adsrenv) · 1 unmodified line |
| 1137 | 1123 | { |
| 1138 | 1124 | _tADSR4* adsr = *adsrenv; |
| 1139 | 1125 | |
| 1140 | | − |
| 1141 | | − if (adsr->inRamp) |
| 1126 | + switch (adsr->whichStage) |
| 1142 | 1127 | { |
| 1143 | | − if (adsr->rampPhase > adsr->buff_sizeMinusOne) |
| 1144 | | − { |
| 1145 | | − adsr->inRamp = OFALSE; |
| 1146 | | − adsr->inAttack = OTRUE; |
| 1147 | | − adsr->next = 0.0f; |
| 1148 | | − } |
| 1149 | | − else |
| 1150 | | − { |
| 1151 | | − adsr->next = adsr->rampPeak * adsr->exp_buff[(uint32_t)(adsr->rampPhase)]; |
| 1152 | | − } |
| 1153 | | − |
| 1154 | | − adsr->rampPhase += adsr->rampInc; |
| 1155 | | − } |
| 1128 | + case env_ramp: |
| 1129 | + if (adsr->rampPhase > adsr->buff_sizeMinusOne) |
| 1130 | + { |
| 1131 | + adsr->whichStage = env_attack; |
| 1132 | + adsr->next = 0.0f; |
| 1133 | + } |
| 1134 | + else |
| 1135 | + { |
| 1136 | + adsr->next = adsr->rampPeak * adsr->exp_buff[(uint32_t)adsr->rampPhase]; |
| 1137 | + } |
| 1156 | 1138 | |
| 1157 | | − if (adsr->inAttack) |
| 1158 | | − { |
| 1139 | + adsr->rampPhase += adsr->rampInc; |
| 1140 | + break; |
| 1159 | 1141 | |
| 1160 | | − // If attack done, time to turn around. |
| 1161 | | − if (adsr->attackPhase > adsr->buff_sizeMinusOne) |
| 1162 | | − { |
| 1163 | | − adsr->inDecay = OTRUE; |
| 1164 | | − adsr->inAttack = OFALSE; |
| 1165 | | − adsr->next = adsr->gain; |
| 1166 | | − } |
| 1167 | | − else |
| 1168 | | − { |
| 1169 | | − // do interpolation ! |
| 1170 | | − adsr->next = adsr->gain * (1.0f - adsr->exp_buff[(uint32_t)(adsr->attackPhase)]); // inverted and backwards to get proper rising exponential shape/perception |
| 1171 | | − } |
| 1172 | 1142 | |
| 1173 | | − // Increment ADSR attack. |
| 1174 | | − adsr->attackPhase += adsr->attackInc; |
| 1143 | + case env_attack: |
| 1175 | 1144 | |
| 1176 | | − } |
| 1145 | + // If attack done, time to turn around. |
| 1146 | + if (adsr->attackPhase > adsr->buff_sizeMinusOne) |
| 1147 | + { |
| 1148 | + adsr->whichStage = env_decay; |
| 1149 | + adsr->next = adsr->gain; |
| 1150 | + } |
| 1151 | + else |
| 1152 | + { |
| 1153 | + adsr->next = adsr->gain * (1.0f - adsr->exp_buff[(uint32_t)adsr->attackPhase]); // inverted and backwards to get proper rising exponential shape/perception |
| 1154 | + } |
| 1177 | 1155 | |
| 1178 | | − if (adsr->inDecay) |
| 1179 | | − { |
| 1156 | + // Increment ADSR attack. |
| 1157 | + adsr->attackPhase += adsr->attackInc; |
| 1158 | + break; |
| 1180 | 1159 | |
| 1181 | | − // If decay done, sustain. |
| 1182 | | − if (adsr->decayPhase > adsr->buff_sizeMinusOne) |
| 1183 | | − { |
| 1184 | | − adsr->inDecay = OFALSE; |
| 1185 | | − adsr->inSustain = OTRUE; |
| 1186 | | − adsr->next = adsr->gain * adsr->sustain; |
| 1187 | | − } |
| 1160 | + case env_decay: |
| 1188 | 1161 | |
| 1189 | | − else |
| 1190 | | − { |
| 1191 | | − adsr->next = (adsr->gain * (adsr->sustain + ((adsr->exp_buff[(uint32_t)(adsr->decayPhase)]) * (1.0f - adsr->sustain)))) * adsr->leakFactor; // do interpolation ! |
| 1192 | | − } |
| 1162 | + // If decay done, sustain. |
| 1163 | + if (adsr->decayPhase > adsr->buff_sizeMinusOne) |
| 1164 | + { |
| 1165 | + adsr->whichStage = env_sustain; |
| 1166 | + adsr->next = adsr->gain * adsr->sustain; |
| 1167 | + } |
| 1193 | 1168 | |
| 1194 | | − // Increment ADSR decay. |
| 1195 | | − adsr->decayPhase += adsr->decayInc; |
| 1196 | | − } |
| 1169 | + else |
| 1170 | + { |
| 1171 | + adsr->next = (adsr->gain * (adsr->sustain + (adsr->exp_buff[(uint32_t)adsr->decayPhase] * (1.0f - adsr->sustain)))) * adsr->leakFactor; |
| 1172 | + } |
| 1197 | 1173 | |
| 1198 | | − if (adsr->inSustain) |
| 1199 | | − { |
| 1200 | | − adsr->next = adsr->next * adsr->leakFactor; |
| 1201 | | − } |
| 1174 | + // Increment ADSR decay. |
| 1175 | + adsr->decayPhase += adsr->decayInc; |
| 1176 | + break; |
| 1202 | 1177 | |
| 1203 | | − if (adsr->inRelease) |
| 1204 | | − { |
| 1205 | | − // If release done, finish. |
| 1206 | | − if (adsr->releasePhase > adsr->buff_sizeMinusOne) |
| 1207 | | − { |
| 1208 | | − adsr->inRelease = OFALSE; |
| 1209 | | − adsr->next = 0.0f; |
| 1210 | | − } |
| 1211 | | − else { |
| 1178 | + case env_sustain: |
| 1179 | + adsr->next = adsr->next * adsr->leakFactor; |
| 1180 | + break; |
| 1212 | 1181 | |
| 1213 | | − adsr->next = adsr->releasePeak * (adsr->exp_buff[(uint32_t)(adsr->releasePhase)]); // do interpolation ! |
| 1214 | | − } |
| 1182 | + case env_release: |
| 1183 | + // If release done, finish. |
| 1184 | + if (adsr->releasePhase > adsr->buff_sizeMinusOne) |
| 1185 | + { |
| 1186 | + adsr->whichStage = env_idle; |
| 1187 | + adsr->next = 0.0f; |
| 1188 | + } |
| 1189 | + else { |
| 1190 | + adsr->next = adsr->releasePeak * adsr->exp_buff[(uint32_t)adsr->releasePhase]; |
| 1191 | + } |
| 1215 | 1192 | |
| 1216 | | − // Increment envelope release; |
| 1217 | | − adsr->releasePhase += adsr->releaseInc; |
| 1193 | + // Increment envelope release; |
| 1194 | + adsr->releasePhase += adsr->releaseInc; |
| 1195 | + break; |
| 1218 | 1196 | } |
| 1219 | | − |
| 1220 | | − |
| 1221 | 1197 | return adsr->next; |
| 1222 | 1198 | } |
| 1223 | 1199 | |