Merge remote-tracking branch 'origin/stable-1.1'
Conflicts: data/locale/de.qm data/locale/de.ts
This commit is contained in:
@@ -240,7 +240,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (aliasDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)aliasDescriptor->PortDescriptors);
|
||||
free((char **)aliasDescriptor->PortNames);
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (allpass_nDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)allpass_nDescriptor->PortDescriptors);
|
||||
free((char **)allpass_nDescriptor->PortNames);
|
||||
|
||||
@@ -455,7 +455,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (amPitchshiftDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)amPitchshiftDescriptor->PortDescriptors);
|
||||
free((char **)amPitchshiftDescriptor->PortNames);
|
||||
|
||||
@@ -233,7 +233,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (ampDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)ampDescriptor->PortDescriptors);
|
||||
free((char **)ampDescriptor->PortNames);
|
||||
|
||||
@@ -277,7 +277,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (bandpass_a_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)bandpass_a_iirDescriptor->PortDescriptors);
|
||||
free((char **)bandpass_a_iirDescriptor->PortNames);
|
||||
|
||||
@@ -343,7 +343,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (bandpass_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)bandpass_iirDescriptor->PortDescriptors);
|
||||
free((char **)bandpass_iirDescriptor->PortNames);
|
||||
|
||||
@@ -458,7 +458,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (bodeShifterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)bodeShifterDescriptor->PortDescriptors);
|
||||
free((char **)bodeShifterDescriptor->PortNames);
|
||||
|
||||
@@ -523,7 +523,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (bodeShifterCVDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)bodeShifterCVDescriptor->PortDescriptors);
|
||||
free((char **)bodeShifterCVDescriptor->PortNames);
|
||||
|
||||
@@ -741,7 +741,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (bwxover_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)bwxover_iirDescriptor->PortDescriptors);
|
||||
free((char **)bwxover_iirDescriptor->PortNames);
|
||||
|
||||
@@ -399,7 +399,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (chebstortionDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)chebstortionDescriptor->PortDescriptors);
|
||||
free((char **)chebstortionDescriptor->PortNames);
|
||||
|
||||
@@ -340,7 +340,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (combDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)combDescriptor->PortDescriptors);
|
||||
free((char **)combDescriptor->PortNames);
|
||||
|
||||
@@ -1352,7 +1352,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (comb_nDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)comb_nDescriptor->PortDescriptors);
|
||||
free((char **)comb_nDescriptor->PortNames);
|
||||
|
||||
@@ -341,7 +341,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (combSplitterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)combSplitterDescriptor->PortDescriptors);
|
||||
free((char **)combSplitterDescriptor->PortNames);
|
||||
|
||||
@@ -250,7 +250,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (constDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)constDescriptor->PortDescriptors);
|
||||
free((char **)constDescriptor->PortNames);
|
||||
|
||||
@@ -276,7 +276,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (crossoverDistDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)crossoverDistDescriptor->PortDescriptors);
|
||||
free((char **)crossoverDistDescriptor->PortNames);
|
||||
|
||||
@@ -235,7 +235,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (dcRemoveDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)dcRemoveDescriptor->PortDescriptors);
|
||||
free((char **)dcRemoveDescriptor->PortNames);
|
||||
|
||||
@@ -325,7 +325,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (decayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)decayDescriptor->PortDescriptors);
|
||||
free((char **)decayDescriptor->PortNames);
|
||||
|
||||
@@ -335,7 +335,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (decimatorDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)decimatorDescriptor->PortDescriptors);
|
||||
free((char **)decimatorDescriptor->PortNames);
|
||||
|
||||
@@ -235,7 +235,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (declipDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)declipDescriptor->PortDescriptors);
|
||||
free((char **)declipDescriptor->PortNames);
|
||||
|
||||
@@ -1093,7 +1093,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (delay_nDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)delay_nDescriptor->PortDescriptors);
|
||||
free((char **)delay_nDescriptor->PortNames);
|
||||
|
||||
@@ -847,7 +847,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (delayoramaDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)delayoramaDescriptor->PortDescriptors);
|
||||
free((char **)delayoramaDescriptor->PortNames);
|
||||
|
||||
@@ -264,7 +264,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (diodeDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)diodeDescriptor->PortDescriptors);
|
||||
free((char **)diodeDescriptor->PortNames);
|
||||
|
||||
@@ -331,7 +331,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (dividerDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)dividerDescriptor->PortDescriptors);
|
||||
free((char **)dividerDescriptor->PortNames);
|
||||
|
||||
@@ -674,7 +674,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (dj_eq_monoDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)dj_eq_monoDescriptor->PortDescriptors);
|
||||
free((char **)dj_eq_monoDescriptor->PortNames);
|
||||
|
||||
@@ -472,7 +472,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (djFlangerDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)djFlangerDescriptor->PortDescriptors);
|
||||
free((char **)djFlangerDescriptor->PortNames);
|
||||
|
||||
@@ -885,7 +885,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (dysonCompressDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)dysonCompressDescriptor->PortDescriptors);
|
||||
free((char **)dysonCompressDescriptor->PortNames);
|
||||
|
||||
@@ -388,7 +388,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (fadDelayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)fadDelayDescriptor->PortDescriptors);
|
||||
free((char **)fadDelayDescriptor->PortNames);
|
||||
|
||||
@@ -703,7 +703,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (fastLookaheadLimiterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)fastLookaheadLimiterDescriptor->PortDescriptors);
|
||||
free((char **)fastLookaheadLimiterDescriptor->PortNames);
|
||||
|
||||
@@ -544,7 +544,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (flangerDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)flangerDescriptor->PortDescriptors);
|
||||
free((char **)flangerDescriptor->PortNames);
|
||||
|
||||
@@ -255,7 +255,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (foldoverDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)foldoverDescriptor->PortDescriptors);
|
||||
free((char **)foldoverDescriptor->PortNames);
|
||||
|
||||
@@ -234,7 +234,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (foverdriveDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)foverdriveDescriptor->PortDescriptors);
|
||||
free((char **)foverdriveDescriptor->PortNames);
|
||||
|
||||
@@ -319,7 +319,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (freqTrackerDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)freqTrackerDescriptor->PortDescriptors);
|
||||
free((char **)freqTrackerDescriptor->PortNames);
|
||||
|
||||
@@ -582,7 +582,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (gateDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)gateDescriptor->PortDescriptors);
|
||||
free((char **)gateDescriptor->PortNames);
|
||||
|
||||
@@ -637,7 +637,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (giantFlangeDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)giantFlangeDescriptor->PortDescriptors);
|
||||
free((char **)giantFlangeDescriptor->PortNames);
|
||||
|
||||
@@ -947,7 +947,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (gongDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)gongDescriptor->PortDescriptors);
|
||||
free((char **)gongDescriptor->PortNames);
|
||||
|
||||
@@ -400,7 +400,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (gongBeaterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)gongBeaterDescriptor->PortDescriptors);
|
||||
free((char **)gongBeaterDescriptor->PortNames);
|
||||
|
||||
@@ -493,7 +493,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (gsmDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)gsmDescriptor->PortDescriptors);
|
||||
free((char **)gsmDescriptor->PortNames);
|
||||
|
||||
@@ -429,7 +429,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (gverbDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)gverbDescriptor->PortDescriptors);
|
||||
free((char **)gverbDescriptor->PortNames);
|
||||
|
||||
@@ -286,7 +286,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (hardLimiterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)hardLimiterDescriptor->PortDescriptors);
|
||||
free((char **)hardLimiterDescriptor->PortNames);
|
||||
|
||||
@@ -542,7 +542,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (harmonicGenDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)harmonicGenDescriptor->PortDescriptors);
|
||||
free((char **)harmonicGenDescriptor->PortNames);
|
||||
|
||||
@@ -1998,7 +1998,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (hermesFilterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)hermesFilterDescriptor->PortDescriptors);
|
||||
free((char **)hermesFilterDescriptor->PortNames);
|
||||
|
||||
@@ -278,7 +278,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (highpass_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)highpass_iirDescriptor->PortDescriptors);
|
||||
free((char **)highpass_iirDescriptor->PortNames);
|
||||
|
||||
@@ -316,7 +316,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (hilbertDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)hilbertDescriptor->PortDescriptors);
|
||||
free((char **)hilbertDescriptor->PortNames);
|
||||
|
||||
@@ -628,7 +628,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (impDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)impDescriptor->PortDescriptors);
|
||||
free((char **)impDescriptor->PortNames);
|
||||
|
||||
@@ -257,7 +257,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (impulse_fcDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)impulse_fcDescriptor->PortDescriptors);
|
||||
free((char **)impulse_fcDescriptor->PortNames);
|
||||
|
||||
@@ -207,7 +207,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (invDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)invDescriptor->PortDescriptors);
|
||||
free((char **)invDescriptor->PortNames);
|
||||
|
||||
@@ -274,7 +274,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (karaokeDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)karaokeDescriptor->PortDescriptors);
|
||||
free((char **)karaokeDescriptor->PortNames);
|
||||
|
||||
@@ -259,7 +259,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (artificialLatencyDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)artificialLatencyDescriptor->PortDescriptors);
|
||||
free((char **)artificialLatencyDescriptor->PortNames);
|
||||
|
||||
@@ -733,7 +733,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (lcrDelayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)lcrDelayDescriptor->PortDescriptors);
|
||||
free((char **)lcrDelayDescriptor->PortNames);
|
||||
|
||||
@@ -280,7 +280,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (lowpass_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)lowpass_iirDescriptor->PortDescriptors);
|
||||
free((char **)lowpass_iirDescriptor->PortNames);
|
||||
|
||||
@@ -308,7 +308,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (lsFilterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)lsFilterDescriptor->PortDescriptors);
|
||||
free((char **)lsFilterDescriptor->PortNames);
|
||||
|
||||
@@ -266,7 +266,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (matrixMSStDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)matrixMSStDescriptor->PortDescriptors);
|
||||
free((char **)matrixMSStDescriptor->PortNames);
|
||||
|
||||
@@ -424,7 +424,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (matrixSpatialiserDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)matrixSpatialiserDescriptor->PortDescriptors);
|
||||
free((char **)matrixSpatialiserDescriptor->PortNames);
|
||||
|
||||
@@ -245,7 +245,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (matrixStMSDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)matrixStMSDescriptor->PortDescriptors);
|
||||
free((char **)matrixStMSDescriptor->PortNames);
|
||||
|
||||
@@ -885,7 +885,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (mbeqDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)mbeqDescriptor->PortDescriptors);
|
||||
free((char **)mbeqDescriptor->PortNames);
|
||||
|
||||
@@ -318,7 +318,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (modDelayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)modDelayDescriptor->PortDescriptors);
|
||||
free((char **)modDelayDescriptor->PortNames);
|
||||
|
||||
@@ -656,7 +656,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (multivoiceChorusDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)multivoiceChorusDescriptor->PortDescriptors);
|
||||
free((char **)multivoiceChorusDescriptor->PortNames);
|
||||
|
||||
@@ -343,7 +343,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (notch_iirDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)notch_iirDescriptor->PortDescriptors);
|
||||
free((char **)notch_iirDescriptor->PortNames);
|
||||
|
||||
@@ -1377,7 +1377,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (lfoPhaserDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)lfoPhaserDescriptor->PortDescriptors);
|
||||
free((char **)lfoPhaserDescriptor->PortNames);
|
||||
|
||||
@@ -327,7 +327,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (pitchScaleDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)pitchScaleDescriptor->PortDescriptors);
|
||||
free((char **)pitchScaleDescriptor->PortNames);
|
||||
|
||||
@@ -311,7 +311,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (pitchScaleHQDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)pitchScaleHQDescriptor->PortDescriptors);
|
||||
free((char **)pitchScaleHQDescriptor->PortNames);
|
||||
|
||||
@@ -401,7 +401,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (plateDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)plateDescriptor->PortDescriptors);
|
||||
free((char **)plateDescriptor->PortNames);
|
||||
|
||||
@@ -310,7 +310,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (pointerCastDistortionDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)pointerCastDistortionDescriptor->PortDescriptors);
|
||||
free((char **)pointerCastDistortionDescriptor->PortNames);
|
||||
|
||||
@@ -314,7 +314,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (rateShifterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)rateShifterDescriptor->PortDescriptors);
|
||||
free((char **)rateShifterDescriptor->PortNames);
|
||||
|
||||
@@ -581,7 +581,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (retroFlangeDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)retroFlangeDescriptor->PortDescriptors);
|
||||
free((char **)retroFlangeDescriptor->PortNames);
|
||||
|
||||
@@ -540,7 +540,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (revdelayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)revdelayDescriptor->PortDescriptors);
|
||||
free((char **)revdelayDescriptor->PortNames);
|
||||
|
||||
@@ -632,7 +632,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (ringmod_2i1oDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)ringmod_2i1oDescriptor->PortDescriptors);
|
||||
free((char **)ringmod_2i1oDescriptor->PortNames);
|
||||
|
||||
@@ -344,7 +344,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (satanMaximiserDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)satanMaximiserDescriptor->PortDescriptors);
|
||||
free((char **)satanMaximiserDescriptor->PortNames);
|
||||
|
||||
@@ -473,7 +473,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sc1Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)sc1Descriptor->PortDescriptors);
|
||||
free((char **)sc1Descriptor->PortNames);
|
||||
|
||||
@@ -491,7 +491,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sc2Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)sc2Descriptor->PortDescriptors);
|
||||
free((char **)sc2Descriptor->PortNames);
|
||||
|
||||
@@ -562,7 +562,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sc3Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)sc3Descriptor->PortDescriptors);
|
||||
free((char **)sc3Descriptor->PortNames);
|
||||
|
||||
@@ -618,7 +618,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sc4Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)sc4Descriptor->PortDescriptors);
|
||||
free((char **)sc4Descriptor->PortNames);
|
||||
|
||||
@@ -568,7 +568,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sc4mDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)sc4mDescriptor->PortDescriptors);
|
||||
free((char **)sc4mDescriptor->PortNames);
|
||||
|
||||
@@ -614,7 +614,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (se4Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)se4Descriptor->PortDescriptors);
|
||||
free((char **)se4Descriptor->PortNames);
|
||||
|
||||
@@ -260,7 +260,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (shaperDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)shaperDescriptor->PortDescriptors);
|
||||
free((char **)shaperDescriptor->PortNames);
|
||||
|
||||
@@ -438,7 +438,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sifterDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)sifterDescriptor->PortDescriptors);
|
||||
free((char **)sifterDescriptor->PortNames);
|
||||
|
||||
@@ -296,7 +296,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sinCosDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)sinCosDescriptor->PortDescriptors);
|
||||
free((char **)sinCosDescriptor->PortNames);
|
||||
|
||||
@@ -312,7 +312,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (singleParaDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)singleParaDescriptor->PortDescriptors);
|
||||
free((char **)singleParaDescriptor->PortNames);
|
||||
|
||||
@@ -244,7 +244,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (sinusWavewrapperDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)sinusWavewrapperDescriptor->PortDescriptors);
|
||||
free((char **)sinusWavewrapperDescriptor->PortNames);
|
||||
|
||||
@@ -329,7 +329,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (smoothDecimateDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)smoothDecimateDescriptor->PortDescriptors);
|
||||
free((char **)smoothDecimateDescriptor->PortNames);
|
||||
|
||||
@@ -240,7 +240,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (splitDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)splitDescriptor->PortDescriptors);
|
||||
free((char **)splitDescriptor->PortNames);
|
||||
|
||||
@@ -532,7 +532,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (stepMuxerDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)stepMuxerDescriptor->PortDescriptors);
|
||||
free((char **)stepMuxerDescriptor->PortNames);
|
||||
|
||||
@@ -414,7 +414,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (surroundEncoderDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)surroundEncoderDescriptor->PortDescriptors);
|
||||
free((char **)surroundEncoderDescriptor->PortNames);
|
||||
|
||||
@@ -408,7 +408,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (svfDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)svfDescriptor->PortDescriptors);
|
||||
free((char **)svfDescriptor->PortNames);
|
||||
|
||||
@@ -645,7 +645,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (tapeDelayDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)tapeDelayDescriptor->PortDescriptors);
|
||||
free((char **)tapeDelayDescriptor->PortNames);
|
||||
|
||||
@@ -465,7 +465,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (transientDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)transientDescriptor->PortDescriptors);
|
||||
free((char **)transientDescriptor->PortNames);
|
||||
|
||||
@@ -593,7 +593,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (tripleParaDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)tripleParaDescriptor->PortDescriptors);
|
||||
free((char **)tripleParaDescriptor->PortNames);
|
||||
|
||||
@@ -332,7 +332,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (valveDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)valveDescriptor->PortDescriptors);
|
||||
free((char **)valveDescriptor->PortNames);
|
||||
|
||||
@@ -401,7 +401,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (valveRectDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)valveRectDescriptor->PortDescriptors);
|
||||
free((char **)valveRectDescriptor->PortNames);
|
||||
|
||||
@@ -420,9 +420,9 @@ void __attribute__((constructor)) swh_init() {
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* _fini() is called automatically when the library is unloaded. */
|
||||
/* __attribute__((destructor)) swh_fini() is called automatically when the library is unloaded. */
|
||||
void
|
||||
_fini() {
|
||||
__attribute__((destructor)) swh_fini() {
|
||||
long lIndex;
|
||||
if (g_psDescriptor) {
|
||||
free((char *)g_psDescriptor->Label);
|
||||
|
||||
@@ -712,7 +712,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (vynilDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)vynilDescriptor->PortDescriptors);
|
||||
free((char **)vynilDescriptor->PortNames);
|
||||
|
||||
@@ -231,7 +231,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (waveTerrainDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)waveTerrainDescriptor->PortDescriptors);
|
||||
free((char **)waveTerrainDescriptor->PortNames);
|
||||
|
||||
@@ -598,7 +598,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (xfadeDescriptor) {
|
||||
free((LADSPA_PortDescriptor *)xfadeDescriptor->PortDescriptors);
|
||||
free((char **)xfadeDescriptor->PortNames);
|
||||
|
||||
@@ -232,7 +232,7 @@ void __attribute__((constructor)) swh_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void _fini() {
|
||||
void __attribute__((destructor)) swh_fini() {
|
||||
if (zm1Descriptor) {
|
||||
free((LADSPA_PortDescriptor *)zm1Descriptor->PortDescriptors);
|
||||
free((char **)zm1Descriptor->PortNames);
|
||||
|
||||
@@ -108,6 +108,8 @@ void kickerInstrument::saveSettings( QDomDocument & _doc,
|
||||
|
||||
void kickerInstrument::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_versionModel.loadSettings( _this, "version" );
|
||||
|
||||
m_startFreqModel.loadSettings( _this, "startfreq" );
|
||||
m_endFreqModel.loadSettings( _this, "endfreq" );
|
||||
m_decayModel.loadSettings( _this, "decay" );
|
||||
@@ -126,18 +128,22 @@ void kickerInstrument::loadSettings( const QDomElement & _this )
|
||||
m_clickModel.loadSettings( _this, "click" );
|
||||
m_slopeModel.loadSettings( _this, "slope" );
|
||||
m_startNoteModel.loadSettings( _this, "startnote" );
|
||||
if( m_versionModel.value() < 1 )
|
||||
{
|
||||
m_startNoteModel.setValue( false );
|
||||
}
|
||||
m_endNoteModel.loadSettings( _this, "endnote" );
|
||||
m_versionModel.loadSettings( _this, "version" );
|
||||
|
||||
// Try to maintain backwards compatibility
|
||||
if( !_this.hasAttribute( "version" ) )
|
||||
{
|
||||
|
||||
m_decayModel.setValue( m_decayModel.value() * 1.33f );
|
||||
m_envModel.setValue( 1.0f );
|
||||
m_slopeModel.setValue( 1.0f );
|
||||
m_clickModel.setValue( 0.0f );
|
||||
m_versionModel.setValue( KICKER_PRESET_VERSION );
|
||||
}
|
||||
m_versionModel.setValue( KICKER_PRESET_VERSION );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* lb302.cpp - implementation of class lb302 which is a bass synth attempting
|
||||
* lb302.cpp - implementation of class lb302 which is a bass synth attempting
|
||||
* to emulate the Roland TB303 bass synth
|
||||
*
|
||||
* Copyright (c) 2006-2008 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* lb302FilterIIR2 is based on the gsyn filter code by Andy Sloane.
|
||||
*
|
||||
* lb302Filter3Pole is based on the TB303 instrument written by
|
||||
*
|
||||
* lb302Filter3Pole is based on the TB303 instrument written by
|
||||
* Josep M Comajuncosas for the CSounds library
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "pixmap_button.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
#include "BandLimitedWave.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "moc_lb302.cxx"
|
||||
@@ -49,10 +50,10 @@
|
||||
//
|
||||
// New config
|
||||
//
|
||||
#define LB_24_IGNORE_ENVELOPE
|
||||
#define LB_FILTERED
|
||||
#define LB_24_IGNORE_ENVELOPE
|
||||
#define LB_FILTERED
|
||||
//#define LB_DECAY
|
||||
//#define LB_24_RES_TRICK
|
||||
//#define LB_24_RES_TRICK
|
||||
|
||||
#define LB_DIST_RATIO 4.0
|
||||
#define LB_24_VOL_ADJUST 3.0
|
||||
@@ -143,7 +144,7 @@ lb302FilterIIR2::lb302FilterIIR2(lb302FilterKnobState* p_fs) :
|
||||
{
|
||||
|
||||
m_dist = new DspEffectLibrary::Distortion( 1.0, 1.0f);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -183,7 +184,7 @@ float lb302FilterIIR2::process(const float& samp)
|
||||
vcf_d2 = vcf_d1;
|
||||
vcf_d1 = ret;
|
||||
|
||||
if(fs->dist > 0)
|
||||
if(fs->dist > 0)
|
||||
ret=m_dist->nextSample(ret);
|
||||
|
||||
// output = IIR2 + dry
|
||||
@@ -200,7 +201,7 @@ lb302Filter3Pole::lb302Filter3Pole(lb302FilterKnobState *p_fs) :
|
||||
ay1(0),
|
||||
ay2(0),
|
||||
aout(0),
|
||||
lastin(0)
|
||||
lastin(0)
|
||||
{
|
||||
};
|
||||
|
||||
@@ -225,7 +226,7 @@ void lb302Filter3Pole::envRecalc()
|
||||
w = vcf_e0 + vcf_c0;
|
||||
k = (fs->cutoff > 0.975)?0.975:fs->cutoff;
|
||||
kfco = 50.f + (k)*((2300.f-1600.f*(fs->envmod))+(w) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(700.f+1500.f*(k)+(1500.f+(k)*(engine::mixer()->processingSampleRate()/2.f-6000.f)) *
|
||||
(fs->envmod)) );
|
||||
//+iacc*(.3+.7*kfco*kenvmod)*kaccent*kaccurve*2000
|
||||
|
||||
@@ -249,7 +250,7 @@ void lb302Filter3Pole::envRecalc()
|
||||
}
|
||||
|
||||
|
||||
float lb302Filter3Pole::process(const float& samp)
|
||||
float lb302Filter3Pole::process(const float& samp)
|
||||
{
|
||||
float ax1 = lastin;
|
||||
float ay11 = ay1;
|
||||
@@ -274,12 +275,12 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
vcf_mod_knob( 0.1f, 0.0f, 1.0f, 0.005f, this, tr( "VCF Envelope Mod" ) ),
|
||||
vcf_dec_knob( 0.1f, 0.0f, 1.0f, 0.005f, this, tr( "VCF Envelope Decay" ) ),
|
||||
dist_knob( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Distortion" ) ),
|
||||
wave_shape( 0.0f, 0.0f, 7.0f, this, tr( "Waveform" ) ),
|
||||
wave_shape( 8.0f, 0.0f, 11.0f, this, tr( "Waveform" ) ),
|
||||
slide_dec_knob( 0.6f, 0.0f, 1.0f, 0.005f, this, tr( "Slide Decay" ) ),
|
||||
slideToggle( false, this, tr( "Slide" ) ),
|
||||
accentToggle( false, this, tr( "Accent" ) ),
|
||||
deadToggle( false, this, tr( "Dead" ) ),
|
||||
db24Toggle( false, this, tr( "24dB/oct Filter" ) )
|
||||
db24Toggle( false, this, tr( "24dB/oct Filter" ) )
|
||||
|
||||
{
|
||||
|
||||
@@ -330,7 +331,7 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
vca_attack = 1.0 - 0.96406088;
|
||||
vca_decay = 0.99897516;
|
||||
|
||||
vco_shape = SAWTOOTH;
|
||||
vco_shape = BL_SAWTOOTH;
|
||||
|
||||
// Experimenting with a0 between original (0.5) and 1.0
|
||||
vca_a0 = 0.5;
|
||||
@@ -342,15 +343,13 @@ lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) :
|
||||
db24Toggled();
|
||||
|
||||
sample_cnt = 0;
|
||||
release_frame = 1<<24;
|
||||
release_frame = 0;
|
||||
catch_frame = 0;
|
||||
catch_decay = 0;
|
||||
|
||||
last_offset = 0;
|
||||
|
||||
new_freq = -1;
|
||||
current_freq = -1;
|
||||
delete_freq = -1;
|
||||
new_freq = false;
|
||||
|
||||
filterChanged();
|
||||
|
||||
@@ -425,7 +424,7 @@ void lb302Synth::filterChanged()
|
||||
void lb302Synth::db24Toggled()
|
||||
{
|
||||
vcf = vcfs[db24Toggle.value()];
|
||||
// These recalcFilter calls might suck
|
||||
// These recalcFilter calls might suck
|
||||
recalcFilter();
|
||||
}
|
||||
|
||||
@@ -465,41 +464,41 @@ inline float GET_INC(float freq) {
|
||||
|
||||
int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
{
|
||||
const float sampleRatio = 44100.f / engine::mixer()->processingSampleRate();
|
||||
float w;
|
||||
float samp;
|
||||
|
||||
// Hold on to the current VCF, and use it throughout this period
|
||||
lb302Filter *filter = vcf;
|
||||
|
||||
if( delete_freq == current_freq ) {
|
||||
// Normal release
|
||||
delete_freq = -1;
|
||||
if( release_frame == 0 || ! m_playingNote )
|
||||
{
|
||||
vca_mode = 1;
|
||||
}
|
||||
|
||||
if( new_freq > 0.0f ) {
|
||||
if( new_freq )
|
||||
{
|
||||
//printf(" playing new note..\n");
|
||||
lb302Note note;
|
||||
note.vco_inc = GET_INC( true_freq );
|
||||
//printf("GET_INC %f %f %d\n", note.vco_inc, new_freq, vca_mode );
|
||||
///**vco_detune*//engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
//printf("VCO_INC = %f\n", note.vco_inc);
|
||||
note.dead = deadToggle.value();
|
||||
initNote(¬e);
|
||||
//printf("%f %f, ", vco_inc, vco_c);
|
||||
|
||||
current_freq = new_freq;
|
||||
|
||||
new_freq = -1.0f;
|
||||
//printf("GOT_INC %f %f %d\n\n", note.vco_inc, new_freq, vca_mode );
|
||||
}
|
||||
new_freq = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: NORMAL RELEASE
|
||||
// vca_mode = 1;
|
||||
|
||||
for(int i=0;i<size;i++) {
|
||||
for( int i=0; i<size; i++ )
|
||||
{
|
||||
// start decay if we're past release
|
||||
if( i >= release_frame )
|
||||
{
|
||||
vca_mode = 1;
|
||||
}
|
||||
|
||||
// update vcf
|
||||
if(vcf_envpos >= ENVINC) {
|
||||
@@ -508,9 +507,9 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
vcf_envpos = 0;
|
||||
|
||||
if (vco_slide) {
|
||||
vco_inc=vco_slidebase-vco_slide;
|
||||
vco_inc = vco_slidebase - vco_slide;
|
||||
// Calculate coeff from dec_knob on knob change.
|
||||
vco_slide*= 0.9+(slide_dec_knob.value()*0.0999); // TODO: Adjust for Hz and ENVINC
|
||||
vco_slide -= vco_slide * ( 0.1f - slide_dec_knob.value() * 0.0999f ) * sampleRatio; // TODO: Adjust for ENVINC
|
||||
|
||||
}
|
||||
}
|
||||
@@ -523,17 +522,10 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
|
||||
// update vco
|
||||
vco_c += vco_inc;
|
||||
|
||||
|
||||
if(vco_c > 0.5)
|
||||
vco_c -= 1.0;
|
||||
|
||||
/*LB303
|
||||
if (catch_decay > 0) {
|
||||
if (catch_decay < decay_frames) {
|
||||
catch_decay++;
|
||||
}
|
||||
}*/
|
||||
|
||||
switch(int(rint(wave_shape.value()))) {
|
||||
case 0: vco_shape = SAWTOOTH; break;
|
||||
case 1: vco_shape = TRIANGLE; break;
|
||||
@@ -543,6 +535,10 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
case 5: vco_shape = SINE; break;
|
||||
case 6: vco_shape = EXPONENTIAL; break;
|
||||
case 7: vco_shape = WHITE_NOISE; break;
|
||||
case 8: vco_shape = BL_SAWTOOTH; break;
|
||||
case 9: vco_shape = BL_SQUARE; break;
|
||||
case 10: vco_shape = BL_TRIANGLE; break;
|
||||
case 11: vco_shape = BL_MOOG; break;
|
||||
default: vco_shape = SAWTOOTH; break;
|
||||
}
|
||||
|
||||
@@ -568,7 +564,7 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
break;
|
||||
|
||||
case MOOG: // Maybe the fall should be exponential/sinsoidal instead of quadric.
|
||||
// [-0.5, 0]: Rise, [0,0.25]: Slope down, [0.25,0.5]: Low
|
||||
// [-0.5, 0]: Rise, [0,0.25]: Slope down, [0.25,0.5]: Low
|
||||
vco_k = (vco_c*2.0)+0.5;
|
||||
if (vco_k>1.0) {
|
||||
vco_k = -0.5 ;
|
||||
@@ -577,7 +573,7 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
w = 2.0*(vco_k-0.5)-1.0;
|
||||
vco_k = 0.5 - sqrtf(1.0-(w*w));
|
||||
}
|
||||
vco_k *= 2.0; // MOOG wave gets filtered away
|
||||
vco_k *= 2.0; // MOOG wave gets filtered away
|
||||
break;
|
||||
|
||||
case SINE:
|
||||
@@ -592,6 +588,22 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
case WHITE_NOISE:
|
||||
vco_k = 0.5 * Oscillator::noiseSample( vco_c );
|
||||
break;
|
||||
|
||||
case BL_SAWTOOTH:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLSaw ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_SQUARE:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLSquare ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_TRIANGLE:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLTriangle ) * 0.5f;
|
||||
break;
|
||||
|
||||
case BL_MOOG:
|
||||
vco_k = BandLimitedWave::oscillate( vco_c + 0.5f, BandLimitedWave::pdToLen( vco_inc ), BandLimitedWave::BLMoog );
|
||||
break;
|
||||
}
|
||||
|
||||
//vca_a = 0.5;
|
||||
@@ -600,8 +612,8 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
//samp = vcf->process(vco_k)*2.0*vca_a;
|
||||
//samp = vcf->process(vco_k)*2.0;
|
||||
samp = filter->process(vco_k) * vca_a;
|
||||
//printf("%f %d\n", vco_c, sample_cnt);
|
||||
|
||||
//printf("%f %d\n", vco_c, sample_cnt);
|
||||
|
||||
|
||||
//samp = vco_k * vca_a;
|
||||
|
||||
@@ -609,7 +621,7 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
{
|
||||
// vca_a = 0;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
//samp = vco_k*vca_a;
|
||||
#endif
|
||||
@@ -619,21 +631,15 @@ int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
*/
|
||||
//LB302 samp *= (float)(decay_frames - catch_decay)/(float)decay_frames;
|
||||
|
||||
for(int c=0; c<DEFAULT_CHANNELS; c++) {
|
||||
outbuf[i][c]=samp;
|
||||
for( int c = 0; c < DEFAULT_CHANNELS; c++ )
|
||||
{
|
||||
outbuf[i][c] = samp;
|
||||
}
|
||||
|
||||
|
||||
/*LB303
|
||||
if((int)i>=release_frame) {
|
||||
vca_mode=1;
|
||||
}
|
||||
*/
|
||||
|
||||
// Handle Envelope
|
||||
if(vca_mode==0) {
|
||||
vca_a+=(vca_a0-vca_a)*vca_attack;
|
||||
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
|
||||
if(sample_cnt>=0.5*engine::mixer()->processingSampleRate())
|
||||
vca_mode = 2;
|
||||
}
|
||||
else if(vca_mode == 1) {
|
||||
@@ -661,7 +667,7 @@ void lb302Synth::initNote( lb302Note *n)
|
||||
catch_decay = 0;
|
||||
|
||||
vco_inc = n->vco_inc;
|
||||
|
||||
|
||||
// Always reset vca on non-dead notes, and
|
||||
// Only reset vca on decaying(decayed) and never-played
|
||||
if(n->dead == 0 || (vca_mode==1 || vca_mode==3)) {
|
||||
@@ -675,8 +681,32 @@ void lb302Synth::initNote( lb302Note *n)
|
||||
vca_mode = 2;
|
||||
}
|
||||
|
||||
initSlide();
|
||||
|
||||
// Slide-from note, save inc for next note
|
||||
if (slideToggle.value()) {
|
||||
vco_slideinc = vco_inc; // May need to equal vco_slidebase+vco_slide if last note slid
|
||||
}
|
||||
|
||||
|
||||
recalcFilter();
|
||||
|
||||
if(n->dead ==0){
|
||||
// Swap next two blocks??
|
||||
vcf->playNote();
|
||||
// Ensure envelope is recalculated
|
||||
vcf_envpos = ENVINC;
|
||||
|
||||
// Double Check
|
||||
//vca_mode = 0;
|
||||
//vca_a = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lb302Synth::initSlide()
|
||||
{
|
||||
// Initiate Slide
|
||||
// TODO: Break out into function, should be called again on detuneChanged
|
||||
if (vco_slideinc) {
|
||||
//printf(" sliding\n");
|
||||
vco_slide = vco_inc-vco_slideinc; // Slide amount
|
||||
@@ -686,71 +716,55 @@ void lb302Synth::initNote( lb302Note *n)
|
||||
else {
|
||||
vco_slide = 0;
|
||||
}
|
||||
// End break-out
|
||||
|
||||
// Slide-from note, save inc for next note
|
||||
if (slideToggle.value()) {
|
||||
vco_slideinc = vco_inc; // May need to equal vco_slidebase+vco_slide if last note slid
|
||||
}
|
||||
|
||||
|
||||
recalcFilter();
|
||||
|
||||
if(n->dead ==0){
|
||||
// Swap next two blocks??
|
||||
vcf->playNote();
|
||||
// Ensure envelope is recalculated
|
||||
vcf_envpos = ENVINC;
|
||||
|
||||
// Double Check
|
||||
//vca_mode = 0;
|
||||
//vca_a = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lb302Synth::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
{
|
||||
//fpp_t framesPerPeriod = engine::mixer()->framesPerPeriod();
|
||||
|
||||
if( _n->isMasterNote() )
|
||||
if( _n->isMasterNote() || ( _n->hasParent() && _n->isReleased() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Currently have release/decay disabled
|
||||
// Start the release decay if this is the first release period.
|
||||
//if (_n->released() && catch_decay == 0)
|
||||
// catch_decay = 1;
|
||||
|
||||
bool decay_note = false;
|
||||
|
||||
release_frame = _n->framesLeft() - desiredReleaseFrames();
|
||||
// sort notes: new notes to the end
|
||||
m_notesMutex.lock();
|
||||
if( _n->totalFramesPlayed() == 0 )
|
||||
{
|
||||
m_notes.append( _n );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_notes.prepend( _n );
|
||||
}
|
||||
m_notesMutex.unlock();
|
||||
|
||||
release_frame = qMax( release_frame, _n->framesLeft() + _n->offset() );
|
||||
}
|
||||
|
||||
|
||||
//LB303 if ( _n->totalFramesPlayed() <= 0 ) {
|
||||
// This code is obsolete, hence the "if false"
|
||||
|
||||
// Existing note. Allow it to decay.
|
||||
if(deadToggle.value() == 0 && decay_note) {
|
||||
|
||||
/* lb302Note note;
|
||||
note.vco_inc = _n->frequency()*vco_detune/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
note.dead = deadToggle.value();
|
||||
initNote(¬e);
|
||||
vca_mode=0;
|
||||
*/
|
||||
|
||||
}
|
||||
void lb302Synth::processNote( NotePlayHandle * _n )
|
||||
{
|
||||
/// Start a new note.
|
||||
else if( _n->totalFramesPlayed() == 0 ) {
|
||||
new_freq = _n->unpitchedFrequency();
|
||||
true_freq = _n->frequency();
|
||||
if( _n->m_pluginData != this )
|
||||
{
|
||||
m_playingNote = _n;
|
||||
new_freq = true;
|
||||
_n->m_pluginData = this;
|
||||
}
|
||||
|
||||
if( ! m_playingNote && ! _n->isReleased() && release_frame > 0 )
|
||||
{
|
||||
m_playingNote = _n;
|
||||
if ( slideToggle.value() )
|
||||
{
|
||||
vco_slideinc = GET_INC( _n->frequency() );
|
||||
}
|
||||
}
|
||||
|
||||
// Check for slide
|
||||
if( _n->unpitchedFrequency() == current_freq ) {
|
||||
if( m_playingNote == _n )
|
||||
{
|
||||
true_freq = _n->frequency();
|
||||
|
||||
if( slideToggle.value() ) {
|
||||
@@ -760,22 +774,22 @@ void lb302Synth::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
vco_inc = GET_INC( true_freq );
|
||||
}
|
||||
}
|
||||
|
||||
//LB303 }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void lb302Synth::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
//printf(".");
|
||||
while( ! m_notes.isEmpty() )
|
||||
{
|
||||
processNote( m_notes.takeFirst() );
|
||||
};
|
||||
|
||||
const fpp_t frames = engine::mixer()->framesPerPeriod();
|
||||
|
||||
process( _working_buffer, frames);
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frames,
|
||||
NULL );
|
||||
process( _working_buffer, frames );
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );
|
||||
release_frame = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -783,9 +797,9 @@ void lb302Synth::play( sampleFrame * _working_buffer )
|
||||
void lb302Synth::deleteNotePluginData( NotePlayHandle * _n )
|
||||
{
|
||||
//printf("GONE\n");
|
||||
if( _n->unpitchedFrequency() == current_freq )
|
||||
if( m_playingNote == _n )
|
||||
{
|
||||
delete_freq = current_freq;
|
||||
m_playingNote = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,7 +845,7 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
m_deadToggle->move( 10, 220 );
|
||||
|
||||
m_db24Toggle = new ledCheckBox( "", this );
|
||||
m_db24Toggle->setWhatsThis(
|
||||
m_db24Toggle->setWhatsThis(
|
||||
tr( "303-es-que, 24dB/octave, 3 pole filter" ) );
|
||||
m_db24Toggle->move( 10, 150);
|
||||
|
||||
@@ -888,8 +902,8 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
"round_square_wave_inactive" ) );
|
||||
toolTip::add( roundSqrWaveBtn,
|
||||
tr( "Click here for a square-wave with a rounded end." ) );
|
||||
|
||||
pixmapButton * moogWaveBtn =
|
||||
|
||||
pixmapButton * moogWaveBtn =
|
||||
new pixmapButton( this, tr( "Moog wave" ) );
|
||||
moogWaveBtn->move( waveBtnX+(16*4), waveBtnY );
|
||||
moogWaveBtn->setActiveGraphic(
|
||||
@@ -929,6 +943,47 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
toolTip::add( whiteNoiseWaveBtn,
|
||||
tr( "Click here for white-noise." ) );
|
||||
|
||||
pixmapButton * blSawWaveBtn =
|
||||
new pixmapButton( this, tr( "Bandlimited saw wave" ) );
|
||||
blSawWaveBtn->move( waveBtnX+(16*9)-8, waveBtnY );
|
||||
blSawWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "saw_wave_active" ) );
|
||||
blSawWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "saw_wave_inactive" ) );
|
||||
toolTip::add( blSawWaveBtn,
|
||||
tr( "Click here for bandlimited saw wave." ) );
|
||||
|
||||
pixmapButton * blSquareWaveBtn =
|
||||
new pixmapButton( this, tr( "Bandlimited square wave" ) );
|
||||
blSquareWaveBtn->move( waveBtnX+(16*10)-8, waveBtnY );
|
||||
blSquareWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "square_wave_active" ) );
|
||||
blSquareWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "square_wave_inactive" ) );
|
||||
toolTip::add( blSquareWaveBtn,
|
||||
tr( "Click here for bandlimited square wave." ) );
|
||||
|
||||
pixmapButton * blTriangleWaveBtn =
|
||||
new pixmapButton( this, tr( "Bandlimited triangle wave" ) );
|
||||
blTriangleWaveBtn->move( waveBtnX+(16*11)-8, waveBtnY );
|
||||
blTriangleWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "triangle_wave_active" ) );
|
||||
blTriangleWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "triangle_wave_inactive" ) );
|
||||
toolTip::add( blTriangleWaveBtn,
|
||||
tr( "Click here for bandlimited triangle wave." ) );
|
||||
|
||||
pixmapButton * blMoogWaveBtn =
|
||||
new pixmapButton( this, tr( "Bandlimited moog saw wave" ) );
|
||||
blMoogWaveBtn->move( waveBtnX+(16*12)-8, waveBtnY );
|
||||
blMoogWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "moog_saw_wave_active" ) );
|
||||
blMoogWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "moog_saw_wave_inactive" ) );
|
||||
toolTip::add( blMoogWaveBtn,
|
||||
tr( "Click here for bandlimited moog saw wave." ) );
|
||||
|
||||
|
||||
m_waveBtnGrp = new automatableButtonGroup( this );
|
||||
m_waveBtnGrp->addButton( sawWaveBtn );
|
||||
m_waveBtnGrp->addButton( triangleWaveBtn );
|
||||
@@ -938,6 +993,10 @@ lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) :
|
||||
m_waveBtnGrp->addButton( sinWaveBtn );
|
||||
m_waveBtnGrp->addButton( exponentialWaveBtn );
|
||||
m_waveBtnGrp->addButton( whiteNoiseWaveBtn );
|
||||
m_waveBtnGrp->addButton( blSawWaveBtn );
|
||||
m_waveBtnGrp->addButton( blSquareWaveBtn );
|
||||
m_waveBtnGrp->addButton( blTriangleWaveBtn );
|
||||
m_waveBtnGrp->addButton( blMoogWaveBtn );
|
||||
|
||||
setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
@@ -955,7 +1014,7 @@ lb302SynthView::~lb302SynthView()
|
||||
void lb302SynthView::modelChanged()
|
||||
{
|
||||
lb302Synth * syn = castModel<lb302Synth>();
|
||||
|
||||
|
||||
m_vcfCutKnob->setModel( &syn->vcf_cut_knob );
|
||||
m_vcfResKnob->setModel( &syn->vcf_res_knob );
|
||||
m_vcfDecKnob->setModel( &syn->vcf_dec_knob );
|
||||
@@ -964,7 +1023,7 @@ void lb302SynthView::modelChanged()
|
||||
|
||||
m_distKnob->setModel( &syn->dist_knob );
|
||||
m_waveBtnGrp->setModel( &syn->wave_shape );
|
||||
|
||||
|
||||
m_slideToggle->setModel( &syn->slideToggle );
|
||||
m_accentToggle->setModel( &syn->accentToggle );
|
||||
m_deadToggle->setModel( &syn->deadToggle );
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* emulate the Roland TB303 bass synth
|
||||
*
|
||||
* Copyright (c) 2006-2008 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* lb302FilterIIR2 is based on the gsyn filter code by Andy Sloane.
|
||||
*
|
||||
* lb302Filter3Pole is based on the TB303 instrument written by
|
||||
*
|
||||
* lb302Filter3Pole is based on the TB303 instrument written by
|
||||
* Josep M Comajuncosas for the CSounds library
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LB302_H_
|
||||
#define _LB302_H_
|
||||
#ifndef LB302_H_
|
||||
#define LB302_H_
|
||||
|
||||
#include "DspEffectLibrary.h"
|
||||
#include "Instrument.h"
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "led_checkbox.h"
|
||||
#include "knob.h"
|
||||
#include "Mixer.h"
|
||||
#include "NotePlayHandle.h"
|
||||
#include <QMutex>
|
||||
|
||||
static const int NUM_FILTERS = 2;
|
||||
|
||||
@@ -67,12 +69,12 @@ class lb302Filter
|
||||
virtual void playNote();
|
||||
|
||||
protected:
|
||||
lb302FilterKnobState *fs;
|
||||
lb302FilterKnobState *fs;
|
||||
|
||||
// Filter Decay
|
||||
float vcf_c0; // c0=e1 on retrigger; c0*=ed every sample; cutoff=e0+c0
|
||||
float vcf_e0, // e0 and e1 for interpolation
|
||||
vcf_e1;
|
||||
vcf_e1;
|
||||
float vcf_rescoeff; // Resonance coefficient [0.30,9.54]
|
||||
};
|
||||
|
||||
@@ -87,13 +89,13 @@ class lb302FilterIIR2 : public lb302Filter
|
||||
virtual float process(const float& samp);
|
||||
|
||||
protected:
|
||||
float vcf_d1, // d1 and d2 are added back into the sample with
|
||||
float vcf_d1, // d1 and d2 are added back into the sample with
|
||||
vcf_d2; // vcf_a and b as coefficients. IIR2 resonance
|
||||
// loop.
|
||||
|
||||
// IIR2 Coefficients for mixing dry and delay.
|
||||
float vcf_a, // Mixing coefficients for the final sound.
|
||||
vcf_b, //
|
||||
float vcf_a, // Mixing coefficients for the final sound.
|
||||
vcf_b, //
|
||||
vcf_c;
|
||||
|
||||
DspEffectLibrary::Distortion * m_dist;
|
||||
@@ -111,15 +113,15 @@ class lb302Filter3Pole : public lb302Filter
|
||||
virtual float process(const float& samp);
|
||||
|
||||
protected:
|
||||
float kfcn,
|
||||
kp,
|
||||
kp1,
|
||||
kp1h,
|
||||
float kfcn,
|
||||
kp,
|
||||
kp1,
|
||||
kp1h,
|
||||
kres;
|
||||
float ay1,
|
||||
ay2,
|
||||
aout,
|
||||
lastin,
|
||||
float ay1,
|
||||
ay2,
|
||||
aout,
|
||||
lastin,
|
||||
value;
|
||||
};
|
||||
|
||||
@@ -164,9 +166,10 @@ public:
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
private:
|
||||
void processNote( NotePlayHandle * n );
|
||||
|
||||
void initNote(lb302Note *note);
|
||||
|
||||
void initSlide();
|
||||
|
||||
private:
|
||||
FloatModel vcf_cut_knob;
|
||||
@@ -179,7 +182,7 @@ private:
|
||||
FloatModel dist_knob;
|
||||
IntModel wave_shape;
|
||||
FloatModel slide_dec_knob;
|
||||
|
||||
|
||||
BoolModel slideToggle;
|
||||
BoolModel accentToggle;
|
||||
BoolModel deadToggle;
|
||||
@@ -200,7 +203,8 @@ private:
|
||||
vco_slideinc, //* Slide base to use in next node. Nonzero=slide next note
|
||||
vco_slidebase; //* The base vco_inc while sliding.
|
||||
|
||||
enum vco_shape_t { SAWTOOTH, SQUARE, TRIANGLE, MOOG, ROUND_SQUARE, SINE, EXPONENTIAL, WHITE_NOISE };
|
||||
enum vco_shape_t { SAWTOOTH, SQUARE, TRIANGLE, MOOG, ROUND_SQUARE, SINE, EXPONENTIAL, WHITE_NOISE,
|
||||
BL_SAWTOOTH, BL_SQUARE, BL_TRIANGLE, BL_MOOG };
|
||||
vco_shape_t vco_shape;
|
||||
|
||||
// Filters (just keep both loaded and switch)
|
||||
@@ -215,9 +219,9 @@ private:
|
||||
// More States
|
||||
int vcf_envpos; // Update counter. Updates when >= ENVINC
|
||||
|
||||
float vca_attack, // Amp attack
|
||||
float vca_attack, // Amp attack
|
||||
vca_decay, // Amp decay
|
||||
vca_a0, // Initial amplifier coefficient
|
||||
vca_a0, // Initial amplifier coefficient
|
||||
vca_a; // Amplifier coefficient.
|
||||
|
||||
// Envelope State
|
||||
@@ -231,9 +235,7 @@ private:
|
||||
int catch_frame;
|
||||
int catch_decay;
|
||||
|
||||
float new_freq;
|
||||
float current_freq;
|
||||
float delete_freq;
|
||||
bool new_freq;
|
||||
float true_freq;
|
||||
|
||||
void recalcFilter();
|
||||
@@ -242,6 +244,9 @@ private:
|
||||
|
||||
friend class lb302SynthView;
|
||||
|
||||
NotePlayHandle * m_playingNote;
|
||||
NotePlayHandleList m_notes;
|
||||
QMutex m_notesMutex;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -254,7 +259,7 @@ public:
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
|
||||
|
||||
knob * m_vcfCutKnob;
|
||||
knob * m_vcfResKnob;
|
||||
knob * m_vcfDecKnob;
|
||||
@@ -263,7 +268,7 @@ private:
|
||||
knob * m_distKnob;
|
||||
knob * m_slideDecKnob;
|
||||
automatableButtonGroup * m_waveBtnGrp;
|
||||
|
||||
|
||||
ledCheckBox * m_slideToggle;
|
||||
ledCheckBox * m_accentToggle;
|
||||
ledCheckBox * m_deadToggle;
|
||||
|
||||
@@ -89,7 +89,7 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph,
|
||||
|
||||
m_lfo1_phase = 0.0f;
|
||||
m_lfo2_phase = 0.0f;
|
||||
|
||||
|
||||
m_lfo1_s = Oscillator::noiseSample( 0.0f );
|
||||
m_lfo2_s = Oscillator::noiseSample( 0.0f );
|
||||
|
||||
@@ -103,15 +103,16 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph,
|
||||
m_invert2r = false;
|
||||
m_invert3l = false;
|
||||
m_invert3r = false;
|
||||
|
||||
|
||||
m_integrator = 0.5f - ( 0.5f - INTEGRATOR ) * 44100.0f / m_samplerate;
|
||||
|
||||
|
||||
m_counter2l = 0;
|
||||
m_counter2r = 0;
|
||||
m_counter3l = 0;
|
||||
m_counter3r = 0;
|
||||
m_counterMax = ( m_samplerate * 10 ) / 44100;
|
||||
|
||||
|
||||
m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,32 +128,36 @@ MonstroSynth::~MonstroSynth()
|
||||
|
||||
void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
{
|
||||
float modtmp; // temp variable for freq modulation
|
||||
// macros for modulating with env/lfos
|
||||
#define modulatefreq( car, mod ) \
|
||||
if( mod##_e1 != 0.0f ) car = qBound( MIN_FREQ, car * powf( 2.0f, m_env1_buf[f] * mod##_e1 * 2.0f ), MAX_FREQ ); \
|
||||
if( mod##_e2 != 0.0f ) car = qBound( MIN_FREQ, car * powf( 2.0f, m_env2_buf[f] * mod##_e2 * 2.0f ), MAX_FREQ ); \
|
||||
if( mod##_l1 != 0.0f ) car = qBound( MIN_FREQ, car * powf( 2.0f, m_lfo1_buf[f] * mod##_l1 ), MAX_FREQ ); \
|
||||
if( mod##_l2 != 0.0f ) car = qBound( MIN_FREQ, car * powf( 2.0f, m_lfo2_buf[f] * mod##_l2 ), MAX_FREQ );
|
||||
modtmp = 0.0f; \
|
||||
if( mod##_e1 != 0.0f ) modtmp += m_env1_buf[f] * mod##_e1; \
|
||||
if( mod##_e2 != 0.0f ) modtmp += m_env2_buf[f] * mod##_e2; \
|
||||
if( mod##_l1 != 0.0f ) modtmp += m_lfo1_buf[f] * mod##_l1; \
|
||||
if( mod##_l2 != 0.0f ) modtmp += m_lfo2_buf[f] * mod##_l2; \
|
||||
car = qBound( MIN_FREQ, car * powf( 2.0f, modtmp ), MAX_FREQ );
|
||||
|
||||
#define modulateabs( car, mod ) \
|
||||
if( mod##_e1 != 0.0f ) car = qBound( 0.0f, car + mod##_e1 * m_env1_buf[f], 1.0f ); \
|
||||
if( mod##_e2 != 0.0f ) car = qBound( 0.0f, car + mod##_e2 * m_env2_buf[f], 1.0f ); \
|
||||
if( mod##_l1 != 0.0f ) car = qBound( 0.0f, car + mod##_l1 * 0.5f * m_lfo1_buf[f], 1.0f ); \
|
||||
if( mod##_l2 != 0.0f ) car = qBound( 0.0f, car + mod##_l2 * 0.5f * m_lfo2_buf[f], 1.0f );
|
||||
if( mod##_e1 != 0.0f ) car += m_env1_buf[f] * mod##_e1; \
|
||||
if( mod##_e2 != 0.0f ) car += m_env2_buf[f] * mod##_e2; \
|
||||
if( mod##_l1 != 0.0f ) car += m_lfo1_buf[f] * mod##_l1; \
|
||||
if( mod##_l2 != 0.0f ) car += m_lfo2_buf[f] * mod##_l2;
|
||||
|
||||
#define modulatephs( car, mod ) \
|
||||
if( mod##_e1 != 0.0f ) car += qBound( -1.0f, ( mod##_e1 * m_env1_buf[f] ), 1.0f ); \
|
||||
if( mod##_e2 != 0.0f ) car += qBound( -1.0f, ( mod##_e2 * m_env2_buf[f] ), 1.0f ); \
|
||||
if( mod##_l1 != 0.0f ) car += ( mod##_l1 * 0.5f * m_lfo1_buf[f] ); \
|
||||
if( mod##_l2 != 0.0f ) car += ( mod##_l2 * 0.5f * m_lfo2_buf[f] );
|
||||
if( mod##_e1 != 0.0f ) car += m_env1_buf[f] * mod##_e1; \
|
||||
if( mod##_e2 != 0.0f ) car += m_env2_buf[f] * mod##_e2; \
|
||||
if( mod##_l1 != 0.0f ) car += m_lfo1_buf[f] * mod##_l1; \
|
||||
if( mod##_l2 != 0.0f ) car += m_lfo2_buf[f] * mod##_l2;
|
||||
|
||||
#define modulatevol( car, mod ) \
|
||||
if( mod##_e1 > 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f - mod##_e1 + mod##_e1 * m_env1_buf[f] ), MODCLIP ); \
|
||||
if( mod##_e1 < 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_e1 * m_env1_buf[f] ), MODCLIP ); \
|
||||
if( mod##_e2 > 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f - mod##_e2 + mod##_e2 * m_env2_buf[f] ), MODCLIP ); \
|
||||
if( mod##_e2 < 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_e2 * m_env2_buf[f] ), MODCLIP ); \
|
||||
if( mod##_l1 != 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_l1 * m_lfo1_buf[f] ), MODCLIP ); \
|
||||
if( mod##_l2 != 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_l2 * m_lfo2_buf[f] ), MODCLIP );
|
||||
if( mod##_e1 > 0.0f ) car *= ( 1.0f - mod##_e1 + mod##_e1 * m_env1_buf[f] ); \
|
||||
if( mod##_e1 < 0.0f ) car *= ( 1.0f + mod##_e1 * m_env1_buf[f] ); \
|
||||
if( mod##_e2 > 0.0f ) car *= ( 1.0f - mod##_e2 + mod##_e2 * m_env2_buf[f] ); \
|
||||
if( mod##_e2 < 0.0f ) car *= ( 1.0f + mod##_e2 * m_env2_buf[f] ); \
|
||||
if( mod##_l1 != 0.0f ) car *= ( 1.0f + mod##_l1 * m_lfo1_buf[f] ); \
|
||||
if( mod##_l2 != 0.0f ) car *= ( 1.0f + mod##_l2 * m_lfo2_buf[f] ); \
|
||||
car = qBound( -MODCLIP, car, MODCLIP );
|
||||
|
||||
// pre-render env's and lfo's
|
||||
renderModulators( _frames );
|
||||
@@ -162,24 +167,27 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
const float pw = ( m_parent->m_osc1Pw.value() / 100.0f );
|
||||
const float o1pw_e1 = ( m_parent->m_pw1env1.value() );
|
||||
const float o1pw_e2 = ( m_parent->m_pw1env2.value() );
|
||||
const float o1pw_l1 = ( m_parent->m_pw1lfo1.value() );
|
||||
const float o1pw_l2 = ( m_parent->m_pw1lfo2.value() );
|
||||
const float o1pw_l1 = ( m_parent->m_pw1lfo1.value() * 0.5f );
|
||||
const float o1pw_l2 = ( m_parent->m_pw1lfo2.value() * 0.5f );
|
||||
const bool o1pw_mod = o1pw_e1 != 0.0f || o1pw_e2 != 0.0f || o1pw_l1 != 0.0f || o1pw_l2 != 0.0f;
|
||||
|
||||
// get phases
|
||||
const float o1lpo = m_parent->m_osc1l_po;
|
||||
const float o1rpo = m_parent->m_osc1r_po;
|
||||
const float o1p_e1 = ( m_parent->m_phs1env1.value() );
|
||||
const float o1p_e2 = ( m_parent->m_phs1env2.value() );
|
||||
const float o1p_l1 = ( m_parent->m_phs1lfo1.value() );
|
||||
const float o1p_l2 = ( m_parent->m_phs1lfo2.value() );
|
||||
const float o1p_l1 = ( m_parent->m_phs1lfo1.value() * 0.5f );
|
||||
const float o1p_l2 = ( m_parent->m_phs1lfo2.value() * 0.5f );
|
||||
const bool o1p_mod = o1p_e1 != 0.0f || o1p_e2 != 0.0f || o1p_l1 != 0.0f || o1p_l2 != 0.0f;
|
||||
|
||||
// get pitch
|
||||
const float o1lfb = ( m_parent->m_osc1l_freq * m_nph->frequency() );
|
||||
const float o1rfb = ( m_parent->m_osc1r_freq * m_nph->frequency() );
|
||||
const float o1f_e1 = ( m_parent->m_pit1env1.value() );
|
||||
const float o1f_e2 = ( m_parent->m_pit1env2.value() );
|
||||
const float o1f_e1 = ( m_parent->m_pit1env1.value() * 2.0f );
|
||||
const float o1f_e2 = ( m_parent->m_pit1env2.value() * 2.0f );
|
||||
const float o1f_l1 = ( m_parent->m_pit1lfo1.value() );
|
||||
const float o1f_l2 = ( m_parent->m_pit1lfo2.value() );
|
||||
const bool o1f_mod = o1f_e1 != 0.0f || o1f_e2 != 0.0f || o1f_l1 != 0.0f || o1f_l2 != 0.0f;
|
||||
|
||||
// get volumes
|
||||
const float o1lv = m_parent->m_osc1l_vol;
|
||||
@@ -188,6 +196,7 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
const float o1v_e2 = ( m_parent->m_vol1env2.value() );
|
||||
const float o1v_l1 = ( m_parent->m_vol1lfo1.value() );
|
||||
const float o1v_l2 = ( m_parent->m_vol1lfo2.value() );
|
||||
const bool o1v_mod = o1v_e1 != 0.0f || o1v_e2 != 0.0f || o1v_l1 != 0.0f || o1v_l2 != 0.0f;
|
||||
|
||||
// update osc2
|
||||
// get waveform
|
||||
@@ -198,25 +207,27 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
const float o2rpo = m_parent->m_osc2r_po;
|
||||
const float o2p_e1 = ( m_parent->m_phs2env1.value() );
|
||||
const float o2p_e2 = ( m_parent->m_phs2env2.value() );
|
||||
const float o2p_l1 = ( m_parent->m_phs2lfo1.value() );
|
||||
const float o2p_l2 = ( m_parent->m_phs2lfo2.value() );
|
||||
const float o2p_l1 = ( m_parent->m_phs2lfo1.value() * 0.5f );
|
||||
const float o2p_l2 = ( m_parent->m_phs2lfo2.value() * 0.5f );
|
||||
const bool o2p_mod = o2p_e1 != 0.0f || o2p_e2 != 0.0f || o2p_l1 != 0.0f || o2p_l2 != 0.0f;
|
||||
|
||||
// get pitch
|
||||
const float o2lfb = ( m_parent->m_osc2l_freq * m_nph->frequency() );
|
||||
const float o2rfb = ( m_parent->m_osc2r_freq * m_nph->frequency() );
|
||||
const float o2f_e1 = ( m_parent->m_pit2env1.value() );
|
||||
const float o2f_e2 = ( m_parent->m_pit2env2.value() );
|
||||
const float o2f_e1 = ( m_parent->m_pit2env1.value() * 2.0f );
|
||||
const float o2f_e2 = ( m_parent->m_pit2env2.value() * 2.0f );
|
||||
const float o2f_l1 = ( m_parent->m_pit2lfo1.value() );
|
||||
const float o2f_l2 = ( m_parent->m_pit2lfo2.value() );
|
||||
const bool o2f_mod = o2f_e1 != 0.0f || o2f_e2 != 0.0f || o2f_l1 != 0.0f || o2f_l2 != 0.0f;
|
||||
|
||||
// get volumes
|
||||
const float o2lv = m_parent->m_osc2l_vol;
|
||||
const float o2rv = m_parent->m_osc2r_vol;
|
||||
const float o2v_e1 = ( m_parent->m_vol2env1.value() );
|
||||
const float o2v_e2 = ( m_parent->m_vol2env2.value() );
|
||||
const float o2v_l1 = ( m_parent->m_vol2lfo2.value() );
|
||||
const float o2v_l1 = ( m_parent->m_vol2lfo1.value() );
|
||||
const float o2v_l2 = ( m_parent->m_vol2lfo2.value() );
|
||||
|
||||
const bool o2v_mod = o2v_e1 != 0.0f || o2v_e2 != 0.0f || o2v_l1 != 0.0f || o2v_l2 != 0.0f;
|
||||
|
||||
|
||||
// update osc3
|
||||
@@ -229,15 +240,17 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
const float o3rpo = m_parent->m_osc3r_po;
|
||||
const float o3p_e1 = ( m_parent->m_phs3env1.value() );
|
||||
const float o3p_e2 = ( m_parent->m_phs3env2.value() );
|
||||
const float o3p_l1 = ( m_parent->m_phs3lfo1.value() );
|
||||
const float o3p_l2 = ( m_parent->m_phs3lfo2.value() );
|
||||
const float o3p_l1 = ( m_parent->m_phs3lfo1.value() * 0.5f );
|
||||
const float o3p_l2 = ( m_parent->m_phs3lfo2.value() * 0.5f );
|
||||
const bool o3p_mod = o3p_e1 != 0.0f || o3p_e2 != 0.0f || o3p_l1 != 0.0f || o3p_l2 != 0.0f;
|
||||
|
||||
// get pitch modulators
|
||||
const float o3fb = ( m_parent->m_osc3_freq * m_nph->frequency() );
|
||||
const float o3f_e1 = ( m_parent->m_pit3env1.value() );
|
||||
const float o3f_e2 = ( m_parent->m_pit3env2.value() );
|
||||
const float o3f_e1 = ( m_parent->m_pit3env1.value() * 2.0f );
|
||||
const float o3f_e2 = ( m_parent->m_pit3env2.value() * 2.0f );
|
||||
const float o3f_l1 = ( m_parent->m_pit3lfo1.value() );
|
||||
const float o3f_l2 = ( m_parent->m_pit3lfo2.value() );
|
||||
const bool o3f_mod = o3f_e1 != 0.0f || o3f_e2 != 0.0f || o3f_l1 != 0.0f || o3f_l2 != 0.0f;
|
||||
|
||||
// get volumes
|
||||
const float o3lv = m_parent->m_osc3l_vol;
|
||||
@@ -246,13 +259,15 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
const float o3v_e2 = ( m_parent->m_vol3env2.value() );
|
||||
const float o3v_l1 = ( m_parent->m_vol3lfo1.value() );
|
||||
const float o3v_l2 = ( m_parent->m_vol3lfo2.value() );
|
||||
const bool o3v_mod = o3v_e1 != 0.0f || o3v_e2 != 0.0f || o3v_l1 != 0.0f || o3v_l2 != 0.0f;
|
||||
|
||||
// get sub
|
||||
const float o3sub = ( m_parent->m_osc3Sub.value() + 100.0f ) / 200.0f;
|
||||
const float o3s_e1 = ( m_parent->m_sub3env1.value() );
|
||||
const float o3s_e2 = ( m_parent->m_sub3env2.value() );
|
||||
const float o3s_l1 = ( m_parent->m_sub3lfo1.value() );
|
||||
const float o3s_l2 = ( m_parent->m_sub3lfo2.value() );
|
||||
const float o3s_l1 = ( m_parent->m_sub3lfo1.value() * 0.5f );
|
||||
const float o3s_l2 = ( m_parent->m_sub3lfo2.value() * 0.5f );
|
||||
const bool o3s_mod = o3s_e1 != 0.0f || o3s_e2 != 0.0f || o3s_l1 != 0.0f || o3s_l2 != 0.0f;
|
||||
|
||||
|
||||
//o2-o3 modulation
|
||||
@@ -274,7 +289,6 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// //
|
||||
///////////////////////////
|
||||
|
||||
|
||||
// declare working variables for for loop
|
||||
|
||||
// phase manipulation vars - these can be reused by all oscs
|
||||
@@ -284,12 +298,12 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
float pd_r;
|
||||
float len_l;
|
||||
float len_r;
|
||||
|
||||
|
||||
// osc1 vars
|
||||
float o1l_f;
|
||||
float o1r_f;
|
||||
float o1l_p = m_osc1l_phase + o1lpo; // we add phase offset here so we don't have to do it every frame
|
||||
float o1r_p = m_osc1r_phase + o1rpo; // then substract it again after loop...
|
||||
float o1r_p = m_osc1r_phase + o1rpo; // then substract it again after loop...
|
||||
float o1_pw;
|
||||
|
||||
// osc2 vars
|
||||
@@ -327,18 +341,27 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// calc and mod frequencies
|
||||
o1l_f = o1lfb;
|
||||
o1r_f = o1rfb;
|
||||
modulatefreq( o1l_f, o1f )
|
||||
modulatefreq( o1r_f, o1f )
|
||||
|
||||
if( o1f_mod )
|
||||
{
|
||||
modulatefreq( o1l_f, o1f )
|
||||
modulatefreq( o1r_f, o1f )
|
||||
}
|
||||
// calc and modulate pulse
|
||||
o1_pw = pw;
|
||||
modulateabs( o1_pw, o1pw )
|
||||
if( o1pw_mod )
|
||||
{
|
||||
modulateabs( o1_pw, o1pw )
|
||||
o1_pw = qBound( PW_MIN, o1_pw, PW_MAX );
|
||||
}
|
||||
|
||||
// calc and modulate phase
|
||||
leftph = o1l_p;
|
||||
rightph = o1r_p;
|
||||
modulatephs( leftph, o1p )
|
||||
modulatephs( rightph, o1p )
|
||||
rightph = o1r_p;
|
||||
if( o1p_mod )
|
||||
{
|
||||
modulatephs( leftph, o1p )
|
||||
modulatephs( rightph, o1p )
|
||||
}
|
||||
|
||||
// pulse wave osc
|
||||
sample_t O1L = ( absFraction( leftph ) < o1_pw ) ? 1.0f : -1.0f;
|
||||
@@ -395,7 +418,7 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
{
|
||||
if( O1L < m_osc1l_last ) { m_invert3l = !m_invert3l; m_counter3l = m_counterMax; }
|
||||
if( O1R < m_osc1r_last ) { m_invert3r = !m_invert3r; m_counter3r = m_counterMax; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update last before signal is touched
|
||||
@@ -412,8 +435,11 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// modulate volume
|
||||
O1L *= o1lv;
|
||||
O1R *= o1rv;
|
||||
modulatevol( O1L, o1v )
|
||||
modulatevol( O1R, o1v )
|
||||
if( o1v_mod )
|
||||
{
|
||||
modulatevol( O1L, o1v )
|
||||
modulatevol( O1R, o1v )
|
||||
}
|
||||
|
||||
// update osc1 phase working variable
|
||||
o1l_p += 1.0f / ( static_cast<float>( m_samplerate ) / o1l_f );
|
||||
@@ -428,14 +454,20 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// calc and mod frequencies
|
||||
o2l_f = o2lfb;
|
||||
o2r_f = o2rfb;
|
||||
modulatefreq( o2l_f, o2f )
|
||||
modulatefreq( o2r_f, o2f )
|
||||
if( o2f_mod )
|
||||
{
|
||||
modulatefreq( o2l_f, o2f )
|
||||
modulatefreq( o2r_f, o2f )
|
||||
}
|
||||
|
||||
// calc and modulate phase
|
||||
leftph = o2l_p;
|
||||
rightph = o2r_p;
|
||||
modulatephs( leftph, o2p )
|
||||
modulatephs( rightph, o2p )
|
||||
rightph = o2r_p;
|
||||
if( o2p_mod )
|
||||
{
|
||||
modulatephs( leftph, o2p )
|
||||
modulatephs( rightph, o2p )
|
||||
}
|
||||
leftph = absFraction( leftph );
|
||||
rightph = absFraction( rightph );
|
||||
|
||||
@@ -456,8 +488,11 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// modulate volume
|
||||
O2L *= o2lv;
|
||||
O2R *= o2rv;
|
||||
modulatevol( O2L, o2v )
|
||||
modulatevol( O2R, o2v )
|
||||
if( o2v_mod )
|
||||
{
|
||||
modulatevol( O2L, o2v )
|
||||
modulatevol( O2R, o2v )
|
||||
}
|
||||
|
||||
// reverse sync - invert waveforms when needed
|
||||
if( m_invert2l ) O2L *= -1.0;
|
||||
@@ -478,26 +513,25 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// calc and mod frequencies
|
||||
o3l_f = o3fb;
|
||||
o3r_f = o3fb;
|
||||
modulatefreq( o3l_f, o3f )
|
||||
modulatefreq( o3r_f, o3f )
|
||||
// o2 modulation?
|
||||
if( omod == MOD_FM )
|
||||
if( o3f_mod )
|
||||
{
|
||||
o3l_f = qBound( MIN_FREQ, o3l_f * powf( 2.0f, O2L ), MAX_FREQ );
|
||||
o3r_f = qBound( MIN_FREQ, o3r_f * powf( 2.0f, O2R ), MAX_FREQ );
|
||||
modulatefreq( o3l_f, o3f )
|
||||
modulatefreq( o3r_f, o3f )
|
||||
}
|
||||
|
||||
// calc and modulate phase
|
||||
leftph = o3l_p;
|
||||
rightph = o3r_p;
|
||||
modulatephs( leftph, o3p )
|
||||
modulatephs( rightph, o3p )
|
||||
|
||||
rightph = o3r_p;
|
||||
if( o3p_mod )
|
||||
{
|
||||
modulatephs( leftph, o3p )
|
||||
modulatephs( rightph, o3p )
|
||||
}
|
||||
|
||||
// o2 modulation?
|
||||
if( omod == MOD_PM )
|
||||
{
|
||||
leftph += O2L/2;
|
||||
rightph += O2R/2;
|
||||
leftph += O2L * 0.5f;
|
||||
rightph += O2R * 0.5f;
|
||||
}
|
||||
leftph = absFraction( leftph );
|
||||
rightph = absFraction( rightph );
|
||||
@@ -523,7 +557,11 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
|
||||
// calc and modulate sub
|
||||
sub = o3sub;
|
||||
modulateabs( sub, o3s )
|
||||
if( o3s_mod )
|
||||
{
|
||||
modulateabs( sub, o3s )
|
||||
sub = qBound( 0.0f, sub, 1.0f );
|
||||
}
|
||||
|
||||
sample_t O3L = linearInterpolate( O3AL, O3BL, sub );
|
||||
sample_t O3R = linearInterpolate( O3AR, O3BR, sub );
|
||||
@@ -531,8 +569,11 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// modulate volume
|
||||
O3L *= o3lv;
|
||||
O3R *= o3rv;
|
||||
modulatevol( O3L, o3v )
|
||||
modulatevol( O3R, o3v )
|
||||
if( o3v_mod )
|
||||
{
|
||||
modulatevol( O3L, o3v )
|
||||
modulatevol( O3R, o3v )
|
||||
}
|
||||
// o2 modulation?
|
||||
if( omod == MOD_AM )
|
||||
{
|
||||
@@ -547,8 +588,16 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
// update osc3 phases
|
||||
m_ph3l_last = leftph;
|
||||
m_ph3r_last = rightph;
|
||||
o3l_p += 1.0f / ( static_cast<float>( m_samplerate ) / o3l_f );
|
||||
o3r_p += 1.0f / ( static_cast<float>( m_samplerate ) / o3r_f );
|
||||
len_l = 1.0f / ( static_cast<float>( m_samplerate ) / o3l_f );
|
||||
len_r = 1.0f / ( static_cast<float>( m_samplerate ) / o3r_f );
|
||||
// handle FM as PM
|
||||
if( omod == MOD_FM )
|
||||
{
|
||||
len_l += O2L * m_fmCorrection;
|
||||
len_r += O2R * m_fmCorrection;
|
||||
}
|
||||
o3l_p += len_l;
|
||||
o3r_p += len_r;
|
||||
|
||||
// integrator - very simple filter
|
||||
sample_t L = O1L + O3L + ( omod == MOD_MIX ? O2L : 0.0f );
|
||||
@@ -560,7 +609,7 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
m_l_last = L;
|
||||
m_r_last = R;
|
||||
}
|
||||
|
||||
|
||||
// update phases
|
||||
m_osc1l_phase = absFraction( o1l_p - o1lpo );
|
||||
m_osc1r_phase = absFraction( o1r_p - o1rpo );
|
||||
@@ -568,7 +617,7 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf )
|
||||
m_osc2r_phase = absFraction( o2r_p - o2rpo );
|
||||
m_osc3l_phase = absFraction( o3l_p - o3lpo );
|
||||
m_osc3r_phase = absFraction( o3r_p - o3rpo );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -712,7 +761,7 @@ void MonstroSynth::renderModulators( fpp_t _frames )
|
||||
const f_cnt_t tm = t % static_cast<int>( lfo1_r );
|
||||
const float p = static_cast<float>( tm ) / lfo1_r;
|
||||
if( tm == 0 )
|
||||
{
|
||||
{
|
||||
m_lfo1_last = m_lfo1_s;
|
||||
m_lfo1_s = Oscillator::noiseSample( 0.0f );
|
||||
}
|
||||
@@ -845,7 +894,7 @@ void MonstroSynth::renderModulators( fpp_t _frames )
|
||||
const f_cnt_t tm = t % static_cast<int>( lfo2_r );
|
||||
const float p = static_cast<float>( tm ) / lfo2_r;
|
||||
if( tm == 0 )
|
||||
{
|
||||
{
|
||||
m_lfo2_last = m_lfo2_s;
|
||||
m_lfo2_s = Oscillator::noiseSample( 0.0f );
|
||||
}
|
||||
@@ -959,7 +1008,7 @@ void MonstroSynth::renderModulators( fpp_t _frames )
|
||||
{
|
||||
m_env2_buf[f] = s;
|
||||
m_env2_phase = qMin( 4.0f - env2_sus, m_env2_phase + m_parent->m_env2_dec );
|
||||
if( m_env1_phase == 4.0f ) m_env1_phase = 5.0f; // jump over release if sustain is zero - fix for clicking
|
||||
if( m_env2_phase == 4.0f ) m_env2_phase = 5.0f; // jump over release if sustain is zero - fix for clicking
|
||||
}
|
||||
}
|
||||
else if( m_env2_phase < 5.0f ) // release phase
|
||||
@@ -998,7 +1047,7 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) :
|
||||
m_osc1Ftl( 0.0, -100.0, 100.0, 1.0, this, tr( "Osc 1 Fine detune left" ) ),
|
||||
m_osc1Ftr( 0.0, -100.0, 100.0, 1.0, this, tr( "Osc 1 Fine detune right" ) ),
|
||||
m_osc1Spo( 0.0, -180.0, 180.0, 0.1, this, tr( "Osc 1 Stereo phase offset" ) ),
|
||||
m_osc1Pw( 50.0, 0.0, 100.0, 0.01, this, tr( "Osc 1 Pulse width" ) ),
|
||||
m_osc1Pw( 50.0, PW_MIN, PW_MAX, 0.01, this, tr( "Osc 1 Pulse width" ) ),
|
||||
m_osc1SSR( false, this, tr( "Osc 1 Sync send on rise" ) ),
|
||||
m_osc1SSF( false, this, tr( "Osc 1 Sync send on fall" ) ),
|
||||
|
||||
@@ -1161,7 +1210,7 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) :
|
||||
connect( &m_env2Dec, SIGNAL( dataChanged() ), this, SLOT( updateEnvelope2() ) );
|
||||
connect( &m_env2Rel, SIGNAL( dataChanged() ), this, SLOT( updateEnvelope2() ) );
|
||||
connect( &m_env2Slope, SIGNAL( dataChanged() ), this, SLOT( updateSlope2() ) );
|
||||
|
||||
|
||||
// updateLFOAtts
|
||||
|
||||
connect( &m_lfo1Att, SIGNAL( dataChanged() ), this, SLOT( updateLFOAtts() ) );
|
||||
@@ -1183,6 +1232,8 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) :
|
||||
updatePO1();
|
||||
updatePO2();
|
||||
updatePO3();
|
||||
updateSlope1();
|
||||
updateSlope2();
|
||||
}
|
||||
|
||||
|
||||
@@ -1206,7 +1257,7 @@ void MonstroInstrument::playNote( NotePlayHandle * _n,
|
||||
|
||||
ms->renderOutput( frames, _working_buffer );
|
||||
|
||||
applyRelease( _working_buffer, _n );
|
||||
//applyRelease( _working_buffer, _n ); // we have our own release
|
||||
|
||||
instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n );
|
||||
}
|
||||
@@ -1461,7 +1512,7 @@ QString MonstroInstrument::nodeName() const
|
||||
|
||||
f_cnt_t MonstroInstrument::desiredReleaseFrames() const
|
||||
{
|
||||
return 64;
|
||||
return qMax( 64, qMax( m_env1_relF, m_env2_relF ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1590,14 +1641,14 @@ void MonstroInstrument::updateSamplerate()
|
||||
void MonstroInstrument::updateSlope1()
|
||||
{
|
||||
const float slope = m_env1Slope.value();
|
||||
m_slope1 = powf( 10.0f, slope * -1.0f );
|
||||
m_slope1 = powf( 10.0f, slope * -1.0f );
|
||||
}
|
||||
|
||||
|
||||
void MonstroInstrument::updateSlope2()
|
||||
{
|
||||
const float slope = m_env2Slope.value();
|
||||
m_slope2 = powf( 10.0f, slope * -1.0f );
|
||||
m_slope2 = powf( 10.0f, slope * -1.0f );
|
||||
}
|
||||
|
||||
|
||||
@@ -1842,7 +1893,7 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent )
|
||||
|
||||
maketinyled( m_osc3SyncHButton, 212, O3ROW - 3, "Hard sync oscillator 3" )
|
||||
maketinyled( m_osc3SyncRButton, 191, O3ROW - 3, "Reverse sync oscillator 3" )
|
||||
|
||||
|
||||
m_lfo1WaveBox = new comboBox( view );
|
||||
m_lfo1WaveBox -> setGeometry( 2, LFOROW + 7, 42, 22 );
|
||||
m_lfo1WaveBox->setFont( pointSize<8>( m_lfo1WaveBox->font() ) );
|
||||
|
||||
@@ -178,6 +178,11 @@ const float MAX_FREQ = 48000.0f;
|
||||
|
||||
const float INTEGRATOR = 3.0f / 7.0f;
|
||||
|
||||
const float FM_AMOUNT = 0.25f;
|
||||
|
||||
const float PW_MIN = 0.25f;
|
||||
const float PW_MAX = 100.0f - PW_MIN;
|
||||
|
||||
class MonstroInstrument;
|
||||
class MonstroView;
|
||||
|
||||
@@ -338,6 +343,8 @@ private:
|
||||
int m_counter3l;
|
||||
int m_counter3r;
|
||||
int m_counterMax;
|
||||
|
||||
float m_fmCorrection;
|
||||
};
|
||||
|
||||
class MonstroInstrument : public Instrument
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 64 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user