The OSP is a hackable, open source drum machine that accidentally got very, very close to the erica perkons hd-01, which is real beauty of instrument design that i truly love, except for its unhackable closed source nature. So, we new need gnu one.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
1.4 KiB

#include "instr_bd2.hh"
#include "daisysp.h"
#include "utils.hh"
namespace Heck {
namespace Instrument {
BD2::BD2()
{
init();
}
void BD2::init()
{
bd2.Init(Constants::AUDIO_SAMPLERATE);
bd2.SetDecay(1.);
bd2.SetTone(0.4);
bd2.SetAccent(1.);
bd2.SetSustain(true);
bd2.SetDirtiness(1.);
}
void BD2::trigger()
{
bd2.Trig();
}
void BD2::ctl(unsigned int ctl_nr, float val)
{
switch (ctl_nr) {
case 0: {
bd2.SetFreq(scalen_min_max(val, 40, 180));
} break;
case 1: {
bd2.SetDecay(scalen_min_max(val,0,1));
} break;
case 2: {
bd2.SetFmEnvelopeAmount(scalen_min_max(val,0,1));
} break;
case 3: {
bd2.SetFmEnvelopeDecay(scalen_min_max(val,0,1));
} break;
}
}
void BD2::switch_algo(unsigned int pos)
{
mode1 = pos;
}
void BD2::switch_mode(unsigned int pos)
{
mode2 = pos;
}
float BD2::nextsample()
{
float out{};
out = bd2.Process();
return out;
}
} // namespace Instrument
} // namespace Heck