|
hydrogen 1.1.1
|
InstrumentLayer is part of an instrument
each layer has it's own :
gain which is the ration between the input sample and the output signal,
pitch which allows you to play the sample at a faster or lower frequency,
start velocity and end velocity which allows you to chose between a layer or another within an instrument by changing the velocity of the played note.
More...
#include <InstrumentLayer.h>
Public Member Functions | |
| InstrumentLayer (std::shared_ptr< Sample > sample) | |
| constructor More... | |
| InstrumentLayer (InstrumentLayer *other) | |
| copy constructor, will be initialized with an empty sample More... | |
| InstrumentLayer (InstrumentLayer *other, std::shared_ptr< Sample > sample) | |
| copy constructor More... | |
| ~InstrumentLayer () | |
| destructor More... | |
| void | set_gain (float gain) |
| set the gain of the layer More... | |
| float | get_gain () const |
| get the gain of the layer More... | |
| void | set_pitch (float pitch) |
| set the pitch of the layer More... | |
| float | get_pitch () const |
| get the pitch of the layer More... | |
| void | set_start_velocity (float start) |
| set the start ivelocity of the layer More... | |
| float | get_start_velocity () const |
| get the start velocity of the layer More... | |
| void | set_end_velocity (float end) |
| set the end velocity of the layer More... | |
| float | get_end_velocity () const |
| get the end velocity of the layer More... | |
| void | set_sample (std::shared_ptr< Sample > sample) |
| set the sample of the layer More... | |
| std::shared_ptr< Sample > | get_sample () const |
| get the sample of the layer More... | |
| void | load_sample () |
| Calls the H2Core::Sample::load() member function of __sample. More... | |
| void | unload_sample () |
| void | save_to (XMLNode *node) |
| save the instrument layer within the given XMLNode More... | |
| QString | toQString (const QString &sPrefix, bool bShort=true) const override |
| Formatted string version for debugging purposes. More... | |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Static Public Member Functions | |
| static InstrumentLayer * | load_from (XMLNode *node, const QString &dk_path) |
| load an instrument layer from an XMLNode More... | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Private Attributes | |
| float | __gain |
| ratio between the input sample and the output signal, 1.0 by default More... | |
| float | __pitch |
| the frequency of the sample, 0.0 by default which means output pitch is the same as input pitch More... | |
| float | __start_velocity |
| the start velocity of the sample, 0.0 by default More... | |
| float | __end_velocity |
| the end velocity of the sample, 1.0 by default More... | |
| std::shared_ptr< Sample > | __sample |
| the underlaying sample More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
InstrumentLayer is part of an instrument
each layer has it's own :
gain which is the ration between the input sample and the output signal,
pitch which allows you to play the sample at a faster or lower frequency,
start velocity and end velocity which allows you to chose between a layer or another within an instrument by changing the velocity of the played note.
so the only layer of an instrument should start at 0.0 and end at 1.0.
| InstrumentLayer | ( | std::shared_ptr< Sample > | sample | ) |
constructor
| sample | the sample to use |
| InstrumentLayer | ( | InstrumentLayer * | other | ) |
copy constructor, will be initialized with an empty sample
| other | the instrument layer to copy from |
| InstrumentLayer | ( | InstrumentLayer * | other, |
| std::shared_ptr< Sample > | sample | ||
| ) |
copy constructor
| other | the instrument layer to copy from |
| sample | the sample to use |
| ~InstrumentLayer | ( | ) |
destructor
|
inline |
get the end velocity of the layer
|
inline |
get the gain of the layer
|
inline |
get the pitch of the layer
|
inline |
get the sample of the layer
|
inline |
get the start velocity of the layer
|
static |
load an instrument layer from an XMLNode
| node | the XMLDode to read from |
| dk_path | the directory holding the drumkit data |
| void load_sample | ( | ) |
Calls the H2Core::Sample::load() member function of __sample.
| void save_to | ( | XMLNode * | node | ) |
|
inline |
set the end velocity of the layer
|
inline |
set the gain of the layer
|
inline |
set the pitch of the layer
| void set_sample | ( | std::shared_ptr< Sample > | sample | ) |
set the sample of the layer
|
inline |
set the start ivelocity of the layer
|
overridevirtual |
Formatted string version for debugging purposes.
| sPrefix | String prefix which will be added in front of every new line |
| bShort | Instead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks. |
Reimplemented from Object.
| void unload_sample | ( | ) |
|
private |
the end velocity of the sample, 1.0 by default
|
private |
ratio between the input sample and the output signal, 1.0 by default
|
private |
the frequency of the sample, 0.0 by default which means output pitch is the same as input pitch
|
private |
the underlaying sample
|
private |
the start velocity of the sample, 0.0 by default