Subversion Repositories DIN Is Noise

Rev

Rev 1370 | Rev 1659 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
* modulator.cc
* DIN Is Noise is copyright (c) 2006-2020 Jagannathan Sampath
* For more information, please visit https://dinisnoise.org/
*/


#include "multi_curve.h"
#include "modulator.h"
#include "audio.h"

mod_params::mod_params (multi_curve* c, const std::string& n) {
  bv.name = n;
  bv.crv = c;
  bv.setup (aout.samples_per_channel);
  depth = result = initial = 0;
}

void mod_params::clear (int reset) {
  depth = 0;
  result = 0;
  initial = 0;
  bv.set_bpm (bv.bpm, aout.samples_per_channel);
}

void mod_params::calc () {
  result = depth * bv.sol (bv.now, bv.delta);
}