Skip to content

Commit

Permalink
- added control.random node
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Dec 26, 2023
1 parent 7bafc88 commit 4481f51
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions hi_dsp_library/dsp_nodes/CableNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,29 @@ namespace control
ConverterClass obj;
};

template <typename ParameterClass> struct random : public mothernode,
public pimpl::parameter_node_base<ParameterClass>,
public pimpl::no_processing
{
SN_NODE_ID("random");
SN_GET_SELF_AS_OBJECT(random);
SN_DESCRIPTION("creates a random value");

SN_ADD_SET_VALUE(random);

random() :
pimpl::parameter_node_base<ParameterClass>(getStaticId())
{};

void setValue(double)
{
if (this->getParameter().isConnected())
this->getParameter().call(r.nextDouble());
}

Random r;
};

template <typename ParameterClass> struct cable_table : public scriptnode::data::base,
public pimpl::parameter_node_base<ParameterClass>,
public pimpl::no_processing
Expand Down

0 comments on commit 4481f51

Please sign in to comment.