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.
 
 

62 lines
1.5 KiB

#include "instr_zosc.hh"
#include "daisysp.h"
#include "osp_utils.hh"
namespace Heck::OSP {
namespace Instrument {
ZOsc::ZOsc()
{
init();
}
void ZOsc::init()
{
zosc.Init(Constants::AUDIO_SAMPLERATE);
zosc.SetFreq(40.f);
zosc.SetShape(1.);
zosc.SetFormantFreq(200);
}
void ZOsc::trigger() {}
void ZOsc::ctl(unsigned int ctl_nr, float val)
{
switch (ctl_nr) {
case 0: {
zosc.SetFreq(dz::scalen_min_max(val, 40, 180));
} break;
case 1: {
// zosc.SetDecay( dz::scalen_min_max(val,0,1));
} break;
case 2: {
zosc.SetFormantFreq(dz::scalen_min_max(val, 200, 800));
} break;
case 3: {
zosc.SetShape(1. - dz::scalen_min_max(val, 0, 1));
} break;
}
}
void ZOsc::switch_algo(unsigned int pos)
{
mode1 = pos;
zosc.SetMode(((float)pos) / 3.);
ld::DaisySeed::PrintLine("");
}
void ZOsc::switch_mode(unsigned int pos)
{
mode2 = pos;
ld::DaisySeed::PrintLine("ZOSC MODE2: %i", mode2);
}
float ZOsc::nextsample()
{
float out{};
out = zosc.Process();
return out;
}
} // namespace Instrument
} // namespace Heck