|
hydrogen 1.1.1
|
Instrument class. More...
#include <Instrument.h>
Public Types | |
| enum | SampleSelectionAlgo { VELOCITY , ROUND_ROBIN , RANDOM } |
Public Member Functions | |
| Instrument (const int id=EMPTY_INSTR_ID, const QString &name="Empty Instrument", ADSR *adsr=nullptr) | |
| constructor More... | |
| Instrument (Instrument *other) | |
| copy constructor More... | |
| ~Instrument () | |
| destructor More... | |
| void | load_from (const QString &drumkit_name, const QString &instrument_name, bool is_live=true, Filesystem::Lookup lookup=Filesystem::Lookup::stacked) |
loads instrument from a given instrument within a given drumkit into a live Instrument object. More... | |
| void | load_from (Drumkit *drumkit, Instrument *instrument, bool is_live=true) |
loads instrument from a given instrument into a live Instrument object. More... | |
| void | load_samples () |
| Calls the InstrumentLayer::load_sample() member function of all layers of each component of the Instrument. More... | |
| void | unload_samples () |
| Calls the InstrumentLayer::unload_sample() member function of all layers of each component of the Instrument. More... | |
| void | save_to (XMLNode *node, int component_id) |
| save the instrument within the given XMLNode More... | |
| void | set_name (const QString &name) |
| get the name of the instrument More... | |
| const QString & | get_name () const |
| set the id of the instrument More... | |
| void | set_id (const int id) |
| get the id of the instrument More... | |
| int | get_id () const |
| Returns __id. More... | |
| void | set_adsr (ADSR *adsr) |
| set the ADSR of the instrument More... | |
| ADSR * | get_adsr () const |
| get the ADSR of the instrument More... | |
| ADSR * | copy_adsr () const |
| get a copy of the ADSR of the instrument More... | |
| void | set_mute_group (int group) |
| set the mute group of the instrument More... | |
| int | get_mute_group () const |
| get the mute group of the instrument More... | |
| void | set_midi_out_channel (int channel) |
| set the midi out channel of the instrument More... | |
| int | get_midi_out_channel () const |
| get the midi out channel of the instrument More... | |
| void | set_midi_out_note (int note) |
| set the midi out note of the instrument More... | |
| int | get_midi_out_note () const |
| get the midi out note of the instrument More... | |
| void | set_muted (bool muted) |
| set muted status of the instrument More... | |
| bool | is_muted () const |
| get muted status of the instrument More... | |
| void | set_pan_l (float val) |
| set left pan of the instrument More... | |
| float | get_pan_l () const |
| get left pan of the instrument More... | |
| void | set_pan_r (float val) |
| set right pan of the instrument More... | |
| float | get_pan_r () const |
| get right pan of the instrument More... | |
| void | set_gain (float gain) |
| set gain of the instrument More... | |
| float | get_gain () const |
| get gain of the instrument More... | |
| void | set_volume (float volume) |
| set the volume of the instrument More... | |
| float | get_volume () const |
| get the volume of the instrument More... | |
| void | set_filter_active (bool active) |
| activate the filter of the instrument More... | |
| bool | is_filter_active () const |
| get the status of the filter of the instrument More... | |
| void | set_filter_resonance (float val) |
| set the filter resonance of the instrument More... | |
| float | get_filter_resonance () const |
| get the filter resonance of the instrument More... | |
| void | set_filter_cutoff (float val) |
| set the filter cutoff of the instrument More... | |
| float | get_filter_cutoff () const |
| get the filter cutoff of the instrument More... | |
| void | set_peak_l (float val) |
| set the left peak of the instrument More... | |
| float | get_peak_l () const |
| get the left peak of the instrument More... | |
| void | set_peak_r (float val) |
| set the right peak of the instrument More... | |
| float | get_peak_r () const |
| get the right peak of the instrument More... | |
| void | set_fx_level (float level, int index) |
| set the fx level of the instrument More... | |
| float | get_fx_level (int index) const |
| get the fx level of the instrument More... | |
| void | set_random_pitch_factor (float val) |
| set the random pitch factor of the instrument More... | |
| float | get_random_pitch_factor () const |
| get the random pitch factor of the instrument More... | |
| void | set_pitch_offset (float val) |
| set the pitch offset of the instrument More... | |
| float | get_pitch_offset () const |
| get the pitch offset of the instrument More... | |
| void | set_active (bool active) |
| set the active status of the instrument More... | |
| bool | is_active () const |
| get the active status of the instrument More... | |
| void | set_soloed (bool soloed) |
| set the soloed status of the instrument More... | |
| bool | is_soloed () const |
| get the soloed status of the instrument More... | |
| void | enqueue () |
| enqueue the instrument More... | |
| void | dequeue () |
| dequeue the instrument More... | |
| bool | is_queued () const |
| get the queued status of the instrument More... | |
| void | set_stop_notes (bool stopnotes) |
| set the stop notes status of the instrument More... | |
| bool | is_stop_notes () const |
| get the stop notes of the instrument More... | |
| void | set_sample_selection_alg (SampleSelectionAlgo selected_algo) |
| SampleSelectionAlgo | sample_selection_alg () const |
| void | set_hihat_grp (int hihat_grp) |
| int | get_hihat_grp () const |
| void | set_lower_cc (int message) |
| int | get_lower_cc () const |
| void | set_higher_cc (int message) |
| int | get_higher_cc () const |
| set the name of the related drumkit More... | |
| void | set_drumkit_name (const QString &name) |
| get the name of the related drumkits More... | |
| const QString & | get_drumkit_name () const |
| void | set_is_preview_instrument (bool isPreview) |
| Mark the instrument as hydrogen's preview instrument. More... | |
| bool | is_preview_instrument () const |
| void | set_is_metronome_instrument (bool isMetronome) |
| Mark the instrument as metronome instrument. More... | |
| bool | is_metronome_instrument () const |
| std::vector< InstrumentComponent * > * | get_components () |
| InstrumentComponent * | get_component (int DrumkitComponentID) |
| void | set_apply_velocity (bool apply_velocity) |
| bool | get_apply_velocity () const |
| bool | is_currently_exported () const |
| void | set_currently_exported (bool isCurrentlyExported) |
| bool | has_missing_samples () const |
| void | set_missing_samples (bool bHasMissingSamples) |
| 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 Instrument * | load_instrument (const QString &drumkit_name, const QString &instrument_name, Filesystem::Lookup lookup=Filesystem::Lookup::stacked) |
| creates a new Instrument, loads samples from a given instrument within a given drumkit More... | |
| static Instrument * | load_from (XMLNode *node, const QString &dk_path, const QString &dk_name) |
| load an instrument 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 | |
| int | __id |
| Identifier of an instrument, which should be unique. More... | |
| QString | __name |
| Name of the Instrument. More... | |
| QString | __drumkit_name |
| the name of the drumkit this instrument belongs to More... | |
| float | __gain |
| gain of the instrument More... | |
| float | __volume |
| volume of the instrument More... | |
| float | __pan_l |
| left pan of the instrument More... | |
| float | __pan_r |
| right pan of the instrument More... | |
| float | __peak_l |
| left current peak value More... | |
| float | __peak_r |
| right current peak value More... | |
| ADSR * | __adsr |
| attack delay sustain release instance More... | |
| bool | __filter_active |
| is filter active? More... | |
| float | __filter_cutoff |
| filter cutoff (0..1) More... | |
| float | __filter_resonance |
| filter resonant frequency (0..1) More... | |
| float | __random_pitch_factor |
| random pitch factor More... | |
| float | __pitch_offset |
| instrument main pitch offset More... | |
| int | __midi_out_note |
| midi out note More... | |
| int | __midi_out_channel |
| midi out channel More... | |
| bool | __stop_notes |
| will the note automatically generate a note off after being on More... | |
| SampleSelectionAlgo | __sample_selection_alg |
| how Hydrogen will chose the sample to use More... | |
| bool | __active |
| is the instrument active? More... | |
| bool | __soloed |
| is the instrument in solo mode? More... | |
| bool | __muted |
| is the instrument muted? More... | |
| int | __mute_group |
| mute group of the instrument More... | |
| int | __queued |
| count the number of notes queued within Sampler::__playing_notes_queue or std::priority_queue m_songNoteQueue More... | |
| float | __fx_level [MAX_FX] |
| Ladspa FX level array. More... | |
| int | __hihat_grp |
| the instrument is part of a hihat More... | |
| int | __lower_cc |
| lower cc level More... | |
| int | __higher_cc |
| higher cc level More... | |
| bool | __is_preview_instrument |
| is the instrument an hydrogen preview instrument? More... | |
| bool | __is_metronome_instrument |
| is the instrument an metronome instrument? More... | |
| std::vector< InstrumentComponent * > * | __components |
| InstrumentLayer array. More... | |
| bool | __apply_velocity |
| change the sample gain based on velocity More... | |
| bool | __current_instr_for_export |
| is the instrument currently being exported? More... | |
| bool | m_bHasMissingSamples |
| does the instrument have missing sample files? 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... | |
Instrument class.
| enum SampleSelectionAlgo |
| Instrument | ( | const int | id = EMPTY_INSTR_ID, |
| const QString & | name = "Empty Instrument", |
||
| ADSR * | adsr = nullptr |
||
| ) |
constructor
| id | the id of this instrument |
| name | the name of the instrument |
| adsr | attack decay sustain release instance |
| Instrument | ( | Instrument * | other | ) |
copy constructor
| ~Instrument | ( | ) |
destructor
|
inline |
dequeue the instrument
|
inline |
enqueue the instrument
|
inline |
| InstrumentComponent * get_component | ( | int | DrumkitComponentID | ) |
|
inline |
|
inline |
|
inline |
get the filter cutoff of the instrument
|
inline |
get the filter resonance of the instrument
|
inline |
get the fx level of the instrument
|
inline |
get gain of the instrument
|
inline |
set the name of the related drumkit
|
inline |
|
inline |
|
inline |
get the midi out channel of the instrument
|
inline |
get the midi out note of the instrument
|
inline |
get the mute group of the instrument
|
inline |
|
inline |
get left pan of the instrument
|
inline |
get right pan of the instrument
|
inline |
get the left peak of the instrument
|
inline |
get the right peak of the instrument
|
inline |
get the pitch offset of the instrument
|
inline |
get the random pitch factor of the instrument
|
inline |
get the volume of the instrument
|
inline |
|
inline |
get the active status of the instrument
|
inline |
|
inline |
get the status of the filter of the instrument
|
inline |
|
inline |
get muted status of the instrument
|
inline |
|
inline |
get the queued status of the instrument
|
inline |
get the soloed status of the instrument
|
inline |
get the stop notes of the instrument
| void load_from | ( | const QString & | drumkit_name, |
| const QString & | instrument_name, | ||
| bool | is_live = true, |
||
| Filesystem::Lookup | lookup = Filesystem::Lookup::stacked |
||
| ) |
loads instrument from a given instrument within a given drumkit into a live Instrument object.
| drumkit_name | the drumkit to search the instrument in |
| instrument_name | the instrument within the drumkit to load samples from |
| is_live | is it performed while playing |
| lookup | Where to search (system/user folder or both) for the drumkit. |
| void load_from | ( | Drumkit * | drumkit, |
| Instrument * | instrument, | ||
| bool | is_live = true |
||
| ) |
loads instrument from a given instrument into a live Instrument object.
| drumkit | the drumkit the instrument belongs to |
| instrument | to load samples and members from |
| is_live | is it performed while playing |
|
static |
load an instrument from an XMLNode
| node | the XMLDode to read from |
| dk_path | the directory holding the drumkit data |
| dk_name | the name of the drumkit |
|
static |
creates a new Instrument, loads samples from a given instrument within a given drumkit
| drumkit_name | the drumkit to search the instrument in |
| instrument_name | the instrument within the drumkit to load samples from |
| lookup | Where to search (system/user folder or both) for the drumkit. |
| void load_samples | ( | ) |
Calls the InstrumentLayer::load_sample() member function of all layers of each component of the Instrument.
|
inline |
| void save_to | ( | XMLNode * | node, |
| int | component_id | ||
| ) |
|
inline |
set the active status of the instrument
|
inline |
|
inline |
|
inline |
get the name of the related drumkits
|
inline |
activate the filter of the instrument
|
inline |
set the filter cutoff of the instrument
|
inline |
set the filter resonance of the instrument
|
inline |
set the fx level of the instrument
|
inline |
set gain of the instrument
|
inline |
|
inline |
|
inline |
|
inline |
Mark the instrument as metronome instrument.
|
inline |
Mark the instrument as hydrogen's preview instrument.
|
inline |
|
inline |
set the midi out channel of the instrument
|
inline |
set the midi out note of the instrument
|
inline |
|
inline |
set the mute group of the instrument
|
inline |
set muted status of the instrument
|
inline |
|
inline |
set left pan of the instrument
|
inline |
set right pan of the instrument
|
inline |
set the left peak of the instrument
|
inline |
set the right peak of the instrument
|
inline |
set the pitch offset of the instrument
|
inline |
set the random pitch factor of the instrument
|
inline |
|
inline |
set the soloed status of the instrument
|
inline |
set the stop notes status of the instrument
|
inline |
set the volume of the instrument
|
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_samples | ( | ) |
Calls the InstrumentLayer::unload_sample() member function of all layers of each component of the Instrument.
|
private |
is the instrument active?
|
private |
attack delay sustain release instance
|
private |
change the sample gain based on velocity
|
private |
InstrumentLayer array.
|
private |
is the instrument currently being exported?
|
private |
the name of the drumkit this instrument belongs to
|
private |
is filter active?
|
private |
filter cutoff (0..1)
|
private |
filter resonant frequency (0..1)
|
private |
Ladspa FX level array.
|
private |
gain of the instrument
|
private |
higher cc level
|
private |
the instrument is part of a hihat
|
private |
|
private |
is the instrument an metronome instrument?
|
private |
is the instrument an hydrogen preview instrument?
|
private |
lower cc level
|
private |
midi out channel
|
private |
midi out note
|
private |
mute group of the instrument
|
private |
is the instrument muted?
|
private |
Name of the Instrument.
It is set by set_name() and accessed via get_name().
|
private |
left pan of the instrument
|
private |
right pan of the instrument
|
private |
left current peak value
|
private |
right current peak value
|
private |
instrument main pitch offset
|
private |
count the number of notes queued within Sampler::__playing_notes_queue or std::priority_queue m_songNoteQueue
|
private |
random pitch factor
|
private |
how Hydrogen will chose the sample to use
|
private |
is the instrument in solo mode?
|
private |
will the note automatically generate a note off after being on
|
private |
volume of the instrument
|
private |
does the instrument have missing sample files?