Yet Another Synthesizer Engine
 
Loading...
Searching...
No Matches
yase::Impulse Class Reference

#include <impulse.hh>

+ Inheritance diagram for yase::Impulse:
+ Collaboration diagram for yase::Impulse:

Detailed Description

An impulse.

Outputs a non-zero signal for k time steps when triggered. The default value for k is 1. The output is either square or random depending on whether set_type("square") or set_type("random") has been called. The default is square.

Parameters
[out]signalThe output.

Public Member Functions

void trigger ()
 Trigger the impulse.
 
void release ()
 
void set (int k)
 
void init ()
 
void update ()
 
void set_type (std::string)
 
- Public Member Functions inherited from yase::Triggerable
void init ()
 
void update ()
 
virtual void trigger ()=0
 
virtual void release ()=0
 
- Public Member Functions inherited from yase::Module
virtual void init ()=0
 
virtual void update ()=0
 
int add_input (string name)
 
int add_output (string name)
 
int get_input_index (string name) const
 
string get_input_name (int index) const
 
string get_output_name (int index) const
 
int get_output_index (string name) const
 
void set_input (string name, double value)
 
void set_input (int index, double value)
 
double get_input (int index) const
 
double get_input (string name) const
 
double get_output (string name) const
 
double get_output (int index) const
 
void set_output (int index, double value)
 
void copy_inputs (const Module &source)
 
void copy_outputs (Module &destination) const
 
void configure (std::vector< std::tuple< string, double > > assignments)
 
int num_inputs () const
 
int num_outputs () const
 
void emit (Event e)
 
void set_ts (double s)
 
double get_ts ()
 

Member Function Documentation

◆ init()

void yase::Impulse::init ( )
virtual

This method should be overridden by derived classes. It will usually be called once, after all modules and connections objects have been added to a synthesizer, but before the synthesizer starts running.

Implements yase::Module.

◆ release()

void yase::Impulse::release ( )
inlinevirtual

Implements yase::Triggerable.

◆ set()

void yase::Impulse::set ( int  k)

Set the number of time steps for the impulse to be non-zero. Each time step is 1 / SAMPLE_RATE seconds long.

Parameters
kThe number of time steps

◆ set_type()

void yase::Impulse::set_type ( std::string  type)

Set the type of the impulse.

Parameters
typeEither "square" or "random"

◆ trigger()

void yase::Impulse::trigger ( )
virtual

Trigger the impulse.

Implements yase::Triggerable.

◆ update()

void yase::Impulse::update ( )
virtual

This method should be overridden by derived classes. It will be called repeatedly by a synthesizer at a frequency determined by SAMPLE_RATE.

Implements yase::Module.


The documentation for this class was generated from the following files: