~ubuntu-branches/ubuntu/trusty/lmms/trusty

« back to all changes in this revision

Viewing changes to plugins/ladspa_effect/calf/src/modules_dist.cpp

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    is_active = false;
38
38
    srate = 0;
39
39
    meter_drive = 0.f;
 
40
    lp_pre_freq_old = -1;
 
41
    hp_pre_freq_old = -1;
 
42
    lp_post_freq_old = -1;
 
43
    hp_post_freq_old = -1;
 
44
    p_freq_old = -1;
 
45
    p_level_old = -1;
40
46
}
41
47
 
42
48
void saturator_audio_module::activate()
289
295
        }
290
296
        freq_old = *params[param_freq];
291
297
    }
 
298
    // set the params of all filters
 
299
    if(*params[param_ceil] != ceil_old or *params[param_ceil_active] != ceil_active_old) {
 
300
        lp[0][0].set_lp_rbj(*params[param_ceil], 0.707, (float)srate);
 
301
        lp[0][1].copy_coeffs(lp[0][0]);
 
302
        lp[1][0].copy_coeffs(lp[0][0]);
 
303
        lp[1][1].copy_coeffs(lp[0][0]);
 
304
        ceil_old = *params[param_ceil];
 
305
        ceil_active_old = *params[param_ceil_active];
 
306
    }
292
307
    // set distortion
293
308
    dist[0].set_params(*params[param_blend], *params[param_drive]);
294
309
    if(in_count > 1 && out_count > 1)
372
387
 
373
388
                // all post filters in chain
374
389
                proc[i] = hp[i][2].process(hp[i][3].process(proc[i]));
 
390
                
 
391
                if(*params[param_ceil_active] > 0.5f) {
 
392
                    // all H/P post filters in chain
 
393
                    proc[i] = lp[i][0].process(lp[i][1].process(proc[i]));
 
394
                    
 
395
                }
375
396
            }
376
397
            maxDrive = dist[0].get_distortion_level() * *params[param_amount];
377
398
            
463
484
        }
464
485
        freq_old = *params[param_freq];
465
486
    }
 
487
    // set the params of all filters
 
488
    if(*params[param_floor] != floor_old or *params[param_floor_active] != floor_active_old) {
 
489
        hp[0][0].set_hp_rbj(*params[param_floor], 0.707, (float)srate);
 
490
        hp[0][1].copy_coeffs(hp[0][0]);
 
491
        hp[1][0].copy_coeffs(hp[0][0]);
 
492
        hp[1][1].copy_coeffs(hp[0][0]);
 
493
        floor_old = *params[param_floor];
 
494
        floor_active_old = *params[param_floor_active];
 
495
    }
466
496
    // set distortion
467
497
    dist[0].set_params(*params[param_blend], *params[param_drive]);
468
498
    if(in_count > 1 && out_count > 1)
543
573
 
544
574
                // all post filters in chain
545
575
                proc[i] = lp[i][2].process(lp[i][3].process(proc[i]));
 
576
                
 
577
                if(*params[param_floor_active] > 0.5f) {
 
578
                    // all H/P post filters in chain
 
579
                    proc[i] = hp[i][0].process(hp[i][1].process(proc[i]));
 
580
                    
 
581
                }
546
582
            }
547
583
            
548
584
            if(in_count > 1 && out_count > 1) {