hydrogen 1.2.3
Instrument Class Reference

Instrument class. More...

#include <Instrument.h>

Inheritance diagram for Instrument:
Object< Instrument > Base

Public Types

enum  SampleSelectionAlgo { VELOCITY , ROUND_ROBIN , RANDOM }
 

Public Member Functions

 Instrument (const int id=EMPTY_INSTR_ID, const QString &name="Empty Instrument", std::shared_ptr< ADSR > adsr=nullptr)
 constructor
 
 Instrument (std::shared_ptr< Instrument > other)
 copy constructor
 
 ~Instrument ()
 destructor
 
std::shared_ptr< ADSRcopy_adsr () const
 get a copy of the ADSR of the instrument
 
void dequeue ()
 dequeue the instrument
 
void enqueue ()
 enqueue the instrument
 
std::shared_ptr< ADSRget_adsr () const
 get the ADSR of the instrument
 
bool get_apply_velocity () const
 
std::shared_ptr< InstrumentComponentget_component (int DrumkitComponentID)
 
std::vector< std::shared_ptr< InstrumentComponent > > * get_components ()
 
const QString & get_drumkit_name () const
 
QString get_drumkit_path () const
 set the name of the related drumkit
 
float get_filter_cutoff () const
 get the filter cutoff of the instrument
 
float get_filter_resonance () const
 get the filter resonance of the instrument
 
float get_fx_level (int index) const
 get the fx level of the instrument
 
float get_gain () const
 get gain of the instrument
 
int get_higher_cc () const
 set the path of the related drumkit
 
int get_hihat_grp () const
 
int get_id () const
 Returns __id.
 
int get_lower_cc () const
 
int get_midi_out_channel () const
 get the midi out channel of the instrument
 
int get_midi_out_note () const
 get the midi out note of the instrument
 
int get_mute_group () const
 get the mute group of the instrument
 
const QString & get_name () const
 set the id of the instrument
 
float get_peak_l () const
 get the left peak of the instrument
 
float get_peak_r () const
 get the right peak of the instrument
 
float get_pitch_offset () const
 get the pitch offset of the instrument
 
float get_random_pitch_factor () const
 get the random pitch factor of the instrument
 
float get_volume () const
 get the volume of the instrument
 
float getPan () const
 get pan of the instrument
 
float getPanWithRangeFrom0To1 () const
 get pan of the instrument scaling and translating the range from [-1;1] to [0;1]
 
bool has_missing_samples () const
 
bool hasSamples () const
 Whether the instrument contains at least one non-missing sample.
 
bool is_active () const
 get the active status of the instrument
 
bool is_currently_exported () const
 
bool is_filter_active () const
 get the status of the filter of the instrument
 
bool is_metronome_instrument () const
 
bool is_muted () const
 get muted status of the instrument
 
bool is_preview_instrument () const
 
bool is_queued () const
 get the queued status of the instrument
 
bool is_soloed () const
 get the soloed status of the instrument
 
bool is_stop_notes () const
 get the stop notes of the instrument
 
void load_from (const QString &drumkit_path, const QString &instrument_name)
 loads instrument from a given instrument within a given drumkit into a live Instrument object.
 
void load_from (std::shared_ptr< Drumkit > drumkit, std::shared_ptr< Instrument > instrument)
 loads instrument from a given instrument into a live Instrument object.
 
void load_samples (float fBpm=120)
 Calls the InstrumentLayer::load_sample() member function of all layers of each component of the Instrument.
 
SampleSelectionAlgo sample_selection_alg () const
 
void save_to (XMLNode *node, int component_id, bool bRecentVersion=true, bool bFull=false)
 save the instrument within the given XMLNode
 
void set_active (bool active)
 set the active status of the instrument
 
void set_adsr (std::shared_ptr< ADSR > adsr)
 set the ADSR of the instrument
 
void set_apply_velocity (bool apply_velocity)
 
void set_currently_exported (bool isCurrentlyExported)
 
void set_drumkit_name (const QString &sName)
 get the name of the related drumkits
 
void set_drumkit_path (const QString &sPath)
 get the path of the related drumkits
 
void set_filter_active (bool active)
 activate the filter of the instrument
 
void set_filter_cutoff (float val)
 set the filter cutoff of the instrument
 
void set_filter_resonance (float val)
 set the filter resonance of the instrument
 
void set_fx_level (float level, int index)
 set the fx level of the instrument
 
void set_gain (float gain)
 set gain of the instrument
 
void set_higher_cc (int message)
 
void set_hihat_grp (int hihat_grp)
 
void set_id (const int id)
 get the id of the instrument
 
void set_is_metronome_instrument (bool isMetronome)
 Mark the instrument as metronome instrument.
 
void set_is_preview_instrument (bool isPreview)
 Mark the instrument as hydrogen's preview instrument.
 
void set_lower_cc (int message)
 
void set_midi_out_channel (int channel)
 set the midi out channel of the instrument
 
void set_midi_out_note (int note)
 set the midi out note of the instrument
 
void set_missing_samples (bool bHasMissingSamples)
 
void set_mute_group (int group)
 set the mute group of the instrument
 
void set_muted (bool muted)
 set muted status of the instrument
 
void set_name (const QString &name)
 get the name of the instrument
 
void set_peak_l (float val)
 set the left peak of the instrument
 
void set_peak_r (float val)
 set the right peak of the instrument
 
void set_pitch_offset (float val)
 set the pitch offset of the instrument
 
void set_random_pitch_factor (float val)
 set the random pitch factor of the instrument
 
void set_sample_selection_alg (SampleSelectionAlgo selected_algo)
 
void set_soloed (bool soloed)
 set the soloed status of the instrument
 
void set_stop_notes (bool stopnotes)
 set the stop notes status of the instrument
 
void set_volume (float volume)
 set the volume of the instrument
 
void setPan (float val)
 set pan of the instrument
 
void setPanWithRangeFrom0To1 (float fVal)
 set pan of the instrument, assuming the input range in [0;1]
 
QString toQString (const QString &sPrefix="", bool bShort=true) const override
 Formatted string version for debugging purposes.
 
void unload_samples ()
 Calls the InstrumentLayer::unload_sample() member function of all layers of each component of the Instrument.
 
- Public Member Functions inherited from Object< Instrument >
 Object ()
 
 Object (const Object< Instrument > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 

Static Public Member Functions

static std::shared_ptr< Instrumentload_from (XMLNode *pNode, const QString &sDrumkitPath="", const QString &sDrumkitName="", const License &license=License(), bool bSilent=false)
 load an instrument from an XMLNode
 
static std::shared_ptr< Instrumentload_instrument (const QString &drumkit_path, const QString &instrument_name)
 creates a new Instrument, loads samples from a given instrument within a given drumkit
 
- Static Public Member Functions inherited from Base
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 

Private Attributes

bool __active
 is the instrument active?
 
std::shared_ptr< ADSR__adsr
 attack delay sustain release instance
 
bool __apply_velocity
 change the sample gain based on velocity
 
std::vector< std::shared_ptr< InstrumentComponent > > * __components
 InstrumentLayer array.
 
bool __current_instr_for_export
 is the instrument currently being exported?
 
QString __drumkit_name
 Name of the #Drumkit found at __drumkit_path.
 
QString __drumkit_path
 Path of the #Drumkit this Instrument belongs to.
 
bool __filter_active
 is filter active?
 
float __filter_cutoff
 filter cutoff (0..1)
 
float __filter_resonance
 filter resonant frequency (0..1)
 
float __fx_level [MAX_FX]
 Ladspa FX level array.
 
float __gain
 gain of the instrument
 
int __higher_cc
 higher cc level
 
int __hihat_grp
 the instrument is part of a hihat
 
int __id
 Identifier of an instrument, which should be unique.
 
bool __is_metronome_instrument
 is the instrument an metronome instrument?
 
bool __is_preview_instrument
 is the instrument an hydrogen preview instrument?
 
int __lower_cc
 lower cc level
 
int __midi_out_channel
 midi out channel
 
int __midi_out_note
 midi out note
 
int __mute_group
 mute group of the instrument
 
bool __muted
 is the instrument muted?
 
QString __name
 Name of the Instrument.
 
float __peak_l
 left current peak value
 
float __peak_r
 right current peak value
 
float __pitch_offset
 instrument main pitch offset
 
int __queued
 count the number of notes queued within Sampler::__playing_notes_queue or std::priority_queue m_songNoteQueue
 
float __random_pitch_factor
 Factor to scale the random contribution when humanizing pitch between 0 and AudioEngine::fHumanizePitchSD.
 
SampleSelectionAlgo __sample_selection_alg
 how Hydrogen will chose the sample to use
 
bool __soloed
 is the instrument in solo mode?
 
bool __stop_notes
 will the note automatically generate a note off after being on
 
float __volume
 volume of the instrument
 
bool m_bHasMissingSamples
 does the instrument have missing sample files?
 
float m_fPan
 pan of the instrument, [-1;1] from left to right, as requested by Sampler PanLaws
 

Additional Inherited Members

- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 
- Protected Member Functions inherited from Object< Instrument >
 ~Object ()
 
- Protected Member Functions inherited from Base
 ~Base ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
- Static Protected Attributes inherited from Base
static bool __count = false
 should we count class instances
 
static timeval __last_clock = { 0, 0 }
 
static Logger__logger = nullptr
 

Detailed Description

Instrument class.

Definition at line 54 of file Instrument.h.

Member Enumeration Documentation

◆ SampleSelectionAlgo

Enumerator
VELOCITY 
ROUND_ROBIN 
RANDOM 

Definition at line 58 of file Instrument.h.

Constructor & Destructor Documentation

◆ Instrument() [1/2]

Instrument ( const int id = EMPTY_INSTR_ID,
const QString & name = "Empty Instrument",
std::shared_ptr< ADSR > adsr = nullptr )

constructor

Parameters
idthe id of this instrument
namethe name of the instrument
adsrattack decay sustain release instance

Definition at line 45 of file Instrument.cpp.

◆ Instrument() [2/2]

Instrument ( std::shared_ptr< Instrument > other)

copy constructor

Definition at line 96 of file Instrument.cpp.

◆ ~Instrument()

~Instrument ( )

destructor

Definition at line 141 of file Instrument.cpp.

Member Function Documentation

◆ copy_adsr()

std::shared_ptr< ADSR > copy_adsr ( ) const
inline

get a copy of the ADSR of the instrument

Definition at line 417 of file Instrument.h.

◆ dequeue()

void dequeue ( )
inline

dequeue the instrument

Definition at line 615 of file Instrument.h.

◆ enqueue()

void enqueue ( )
inline

enqueue the instrument

Definition at line 610 of file Instrument.h.

◆ get_adsr()

std::shared_ptr< ADSR > get_adsr ( ) const
inline

get the ADSR of the instrument

Definition at line 412 of file Instrument.h.

◆ get_apply_velocity()

bool get_apply_velocity ( ) const
inline

Definition at line 721 of file Instrument.h.

◆ get_component()

std::shared_ptr< InstrumentComponent > get_component ( int DrumkitComponentID)

Definition at line 653 of file Instrument.cpp.

◆ get_components()

std::vector< std::shared_ptr< InstrumentComponent > > * get_components ( )
inline

Definition at line 711 of file Instrument.h.

◆ get_drumkit_name()

const QString & get_drumkit_name ( ) const
inline

Definition at line 686 of file Instrument.h.

◆ get_drumkit_path()

QString get_drumkit_path ( ) const

set the name of the related drumkit

Definition at line 664 of file Instrument.cpp.

◆ get_filter_cutoff()

float get_filter_cutoff ( ) const
inline

get the filter cutoff of the instrument

Definition at line 535 of file Instrument.h.

◆ get_filter_resonance()

float get_filter_resonance ( ) const
inline

get the filter resonance of the instrument

Definition at line 525 of file Instrument.h.

◆ get_fx_level()

float get_fx_level ( int index) const
inline

get the fx level of the instrument

Definition at line 565 of file Instrument.h.

◆ get_gain()

float get_gain ( ) const
inline

get gain of the instrument

Definition at line 495 of file Instrument.h.

◆ get_higher_cc()

int get_higher_cc ( ) const
inline

set the path of the related drumkit

Definition at line 671 of file Instrument.h.

◆ get_hihat_grp()

int get_hihat_grp ( ) const
inline

Definition at line 651 of file Instrument.h.

◆ get_id()

int get_id ( ) const
inline

Returns __id.

Returns
__id.

Definition at line 407 of file Instrument.h.

◆ get_lower_cc()

int get_lower_cc ( ) const
inline

Definition at line 661 of file Instrument.h.

◆ get_midi_out_channel()

int get_midi_out_channel ( ) const
inline

get the midi out channel of the instrument

Definition at line 432 of file Instrument.h.

◆ get_midi_out_note()

int get_midi_out_note ( ) const
inline

get the midi out note of the instrument

Definition at line 450 of file Instrument.h.

◆ get_mute_group()

int get_mute_group ( ) const
inline

get the mute group of the instrument

Definition at line 427 of file Instrument.h.

◆ get_name()

const QString & get_name ( ) const
inline

set the id of the instrument

Access the name of the Instrument.

Returns
__name

Definition at line 395 of file Instrument.h.

◆ get_peak_l()

float get_peak_l ( ) const
inline

get the left peak of the instrument

Definition at line 545 of file Instrument.h.

◆ get_peak_r()

float get_peak_r ( ) const
inline

get the right peak of the instrument

Definition at line 555 of file Instrument.h.

◆ get_pitch_offset()

float get_pitch_offset ( ) const
inline

get the pitch offset of the instrument

Definition at line 585 of file Instrument.h.

◆ get_random_pitch_factor()

float get_random_pitch_factor ( ) const
inline

get the random pitch factor of the instrument

Definition at line 580 of file Instrument.h.

◆ get_volume()

float get_volume ( ) const
inline

get the volume of the instrument

Definition at line 505 of file Instrument.h.

◆ getPan()

float getPan ( ) const
inline

get pan of the instrument

Definition at line 485 of file Instrument.h.

◆ getPanWithRangeFrom0To1()

float getPanWithRangeFrom0To1 ( ) const
inline

get pan of the instrument scaling and translating the range from [-1;1] to [0;1]

Definition at line 195 of file Instrument.h.

◆ has_missing_samples()

bool has_missing_samples ( ) const
inline

Definition at line 308 of file Instrument.h.

◆ hasSamples()

bool hasSamples ( ) const

Whether the instrument contains at least one non-missing sample.

Definition at line 669 of file Instrument.cpp.

◆ is_active()

bool is_active ( ) const
inline

get the active status of the instrument

Definition at line 595 of file Instrument.h.

◆ is_currently_exported()

bool is_currently_exported ( ) const
inline

Definition at line 726 of file Instrument.h.

◆ is_filter_active()

bool is_filter_active ( ) const
inline

get the status of the filter of the instrument

Definition at line 515 of file Instrument.h.

◆ is_metronome_instrument()

bool is_metronome_instrument ( ) const
inline

Definition at line 701 of file Instrument.h.

◆ is_muted()

bool is_muted ( ) const
inline

get muted status of the instrument

Definition at line 469 of file Instrument.h.

◆ is_preview_instrument()

bool is_preview_instrument ( ) const
inline

Definition at line 691 of file Instrument.h.

◆ is_queued()

bool is_queued ( ) const
inline

get the queued status of the instrument

Definition at line 621 of file Instrument.h.

◆ is_soloed()

bool is_soloed ( ) const
inline

get the soloed status of the instrument

Definition at line 605 of file Instrument.h.

◆ is_stop_notes()

bool is_stop_notes ( ) const
inline

get the stop notes of the instrument

Definition at line 631 of file Instrument.h.

◆ load_from() [1/3]

void load_from ( const QString & drumkit_path,
const QString & instrument_name )

loads instrument from a given instrument within a given drumkit into a live Instrument object.

Parameters
drumkit_paththe drumkit to search the instrument in
instrument_namethe instrument within the drumkit to load samples from for the drumkit.

Definition at line 234 of file Instrument.cpp.

◆ load_from() [2/3]

void load_from ( std::shared_ptr< Drumkit > drumkit,
std::shared_ptr< Instrument > instrument )

loads instrument from a given instrument into a live Instrument object.

Parameters
drumkitthe drumkit the instrument belongs to
instrumentto load samples and members from
lookupWhere to search (system/user folder or both) for the drumkit.

Definition at line 153 of file Instrument.cpp.

◆ load_from() [3/3]

std::shared_ptr< Instrument > load_from ( XMLNode * pNode,
const QString & sDrumkitPath = "",
const QString & sDrumkitName = "",
const License & license = License(),
bool bSilent = false )
static

load an instrument from an XMLNode

Parameters
pNodethe XMLDode to read from
sDrumkitPaththe directory holding the drumkit data. If empty, it will be read from pNode.
sDrumkitNameName of the drumkit found in sDrumkitPath.
licenseLicense assigned to all Samples that will be loaded. If empty, the license will be read from sDrumkitPath.
bSilentif set to true, all log messages except of errors and warnings are suppressed.
Returns
a new Instrument instance set the name of the instrument

Definition at line 261 of file Instrument.cpp.

◆ load_instrument()

std::shared_ptr< Instrument > load_instrument ( const QString & drumkit_path,
const QString & instrument_name )
static

creates a new Instrument, loads samples from a given instrument within a given drumkit

Parameters
drumkit_namethe drumkit to search the instrument in
instrument_namethe instrument within the drumkit to load samples from
Returns
a new Instrument instance

Definition at line 146 of file Instrument.cpp.

◆ load_samples()

void load_samples ( float fBpm = 120)

Calls the InstrumentLayer::load_sample() member function of all layers of each component of the Instrument.

Definition at line 551 of file Instrument.cpp.

◆ sample_selection_alg()

Instrument::SampleSelectionAlgo sample_selection_alg ( ) const
inline

Definition at line 641 of file Instrument.h.

◆ save_to()

void save_to ( XMLNode * node,
int component_id,
bool bRecentVersion = true,
bool bFull = false )

save the instrument within the given XMLNode

Parameters
nodethe XMLNode to feed
component_idIdentifier of the corresponding component.
bRecentVersionWhether the drumkit format should be supported by Hydrogen 0.9.7 or higher (whether it should be composed of DrumkitComponents).
bFullWhether to write all parameters of the contained #Sample as well. This will be done when storing an Instrument as part of a #Song but not when storing as part of a #Drumkit.

Definition at line 575 of file Instrument.cpp.

◆ set_active()

void set_active ( bool active)
inline

set the active status of the instrument

Definition at line 590 of file Instrument.h.

◆ set_adsr()

void set_adsr ( std::shared_ptr< ADSR > adsr)

set the ADSR of the instrument

Definition at line 648 of file Instrument.cpp.

◆ set_apply_velocity()

void set_apply_velocity ( bool apply_velocity)
inline

Definition at line 716 of file Instrument.h.

◆ set_currently_exported()

void set_currently_exported ( bool isCurrentlyExported)
inline

Definition at line 731 of file Instrument.h.

◆ set_drumkit_name()

void set_drumkit_name ( const QString & sName)
inline

get the name of the related drumkits

Definition at line 681 of file Instrument.h.

◆ set_drumkit_path()

void set_drumkit_path ( const QString & sPath)
inline

get the path of the related drumkits

Definition at line 676 of file Instrument.h.

◆ set_filter_active()

void set_filter_active ( bool active)
inline

activate the filter of the instrument

Definition at line 510 of file Instrument.h.

◆ set_filter_cutoff()

void set_filter_cutoff ( float val)
inline

set the filter cutoff of the instrument

Definition at line 530 of file Instrument.h.

◆ set_filter_resonance()

void set_filter_resonance ( float val)
inline

set the filter resonance of the instrument

Definition at line 520 of file Instrument.h.

◆ set_fx_level()

void set_fx_level ( float level,
int index )
inline

set the fx level of the instrument

Definition at line 560 of file Instrument.h.

◆ set_gain()

void set_gain ( float gain)
inline

set gain of the instrument

Definition at line 490 of file Instrument.h.

◆ set_higher_cc()

void set_higher_cc ( int message)
inline

Definition at line 666 of file Instrument.h.

◆ set_hihat_grp()

void set_hihat_grp ( int hihat_grp)
inline

Definition at line 646 of file Instrument.h.

◆ set_id()

void set_id ( const int id)
inline

get the id of the instrument

Sets __id to id.

Parameters
idUnique identifier of the instrument.

Definition at line 401 of file Instrument.h.

◆ set_is_metronome_instrument()

void set_is_metronome_instrument ( bool isMetronome)
inline

Mark the instrument as metronome instrument.

Definition at line 706 of file Instrument.h.

◆ set_is_preview_instrument()

void set_is_preview_instrument ( bool isPreview)
inline

Mark the instrument as hydrogen's preview instrument.

Definition at line 696 of file Instrument.h.

◆ set_lower_cc()

void set_lower_cc ( int message)
inline

Definition at line 656 of file Instrument.h.

◆ set_midi_out_channel()

void set_midi_out_channel ( int channel)
inline

set the midi out channel of the instrument

Definition at line 437 of file Instrument.h.

◆ set_midi_out_note()

void set_midi_out_note ( int note)
inline

set the midi out note of the instrument

Definition at line 455 of file Instrument.h.

◆ set_missing_samples()

void set_missing_samples ( bool bHasMissingSamples)
inline

Definition at line 309 of file Instrument.h.

◆ set_mute_group()

void set_mute_group ( int group)
inline

set the mute group of the instrument

Definition at line 422 of file Instrument.h.

◆ set_muted()

void set_muted ( bool muted)
inline

set muted status of the instrument

Definition at line 464 of file Instrument.h.

◆ set_name()

void set_name ( const QString & name)
inline

get the name of the instrument

Sets the name of the Instrument __name.

Parameters
nameNew name.

Definition at line 389 of file Instrument.h.

◆ set_peak_l()

void set_peak_l ( float val)
inline

set the left peak of the instrument

Definition at line 540 of file Instrument.h.

◆ set_peak_r()

void set_peak_r ( float val)
inline

set the right peak of the instrument

Definition at line 550 of file Instrument.h.

◆ set_pitch_offset()

void set_pitch_offset ( float val)
inline

set the pitch offset of the instrument

Definition at line 575 of file Instrument.h.

◆ set_random_pitch_factor()

void set_random_pitch_factor ( float val)
inline

set the random pitch factor of the instrument

Definition at line 570 of file Instrument.h.

◆ set_sample_selection_alg()

void set_sample_selection_alg ( SampleSelectionAlgo selected_algo)
inline

Definition at line 636 of file Instrument.h.

◆ set_soloed()

void set_soloed ( bool soloed)
inline

set the soloed status of the instrument

Definition at line 600 of file Instrument.h.

◆ set_stop_notes()

void set_stop_notes ( bool stopnotes)
inline

set the stop notes status of the instrument

Definition at line 626 of file Instrument.h.

◆ set_volume()

void set_volume ( float volume)
inline

set the volume of the instrument

Definition at line 500 of file Instrument.h.

◆ setPan()

void setPan ( float val)
inline

set pan of the instrument

Definition at line 474 of file Instrument.h.

◆ setPanWithRangeFrom0To1()

void setPanWithRangeFrom0To1 ( float fVal)
inline

set pan of the instrument, assuming the input range in [0;1]

Definition at line 189 of file Instrument.h.

◆ toQString()

QString toQString ( const QString & sPrefix = "",
bool bShort = true ) const
overridevirtual

Formatted string version for debugging purposes.

Parameters
sPrefixString prefix which will be added in front of every new line
bShortInstead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks.
Returns
String presentation of current object.

Reimplemented from Base.

Definition at line 685 of file Instrument.cpp.

◆ unload_samples()

void unload_samples ( )

Calls the InstrumentLayer::unload_sample() member function of all layers of each component of the Instrument.

Definition at line 563 of file Instrument.cpp.

Field Documentation

◆ __active

bool __active
private

is the instrument active?

Definition at line 369 of file Instrument.h.

◆ __adsr

std::shared_ptr<ADSR> __adsr
private

attack delay sustain release instance

Definition at line 353 of file Instrument.h.

◆ __apply_velocity

bool __apply_velocity
private

change the sample gain based on velocity

Definition at line 381 of file Instrument.h.

◆ __components

std::vector<std::shared_ptr<InstrumentComponent> >* __components
private

InstrumentLayer array.

Definition at line 380 of file Instrument.h.

◆ __current_instr_for_export

bool __current_instr_for_export
private

is the instrument currently being exported?

Definition at line 382 of file Instrument.h.

◆ __drumkit_name

QString __drumkit_name
private

Name of the #Drumkit found at __drumkit_path.

This helper variable should only be used during Instrument loading. It ensures portability of songs as absolute paths only serve for unique identifiers locally and also ensures backward compatibility.

Definition at line 347 of file Instrument.h.

◆ __drumkit_path

QString __drumkit_path
private

Path of the #Drumkit this Instrument belongs to.

An instrument belonging to a #Drumkit uses relative paths for its #Sample. Therefore we have to take care of mapping them to absolute paths ourselves in case instruments of several drumkits are mixed in one #Song.

Definition at line 339 of file Instrument.h.

◆ __filter_active

bool __filter_active
private

is filter active?

Definition at line 354 of file Instrument.h.

◆ __filter_cutoff

float __filter_cutoff
private

filter cutoff (0..1)

Definition at line 355 of file Instrument.h.

◆ __filter_resonance

float __filter_resonance
private

filter resonant frequency (0..1)

Definition at line 356 of file Instrument.h.

◆ __fx_level

float __fx_level[MAX_FX]
private

Ladspa FX level array.

Definition at line 374 of file Instrument.h.

◆ __gain

float __gain
private

gain of the instrument

Definition at line 348 of file Instrument.h.

◆ __higher_cc

int __higher_cc
private

higher cc level

Definition at line 377 of file Instrument.h.

◆ __hihat_grp

int __hihat_grp
private

the instrument is part of a hihat

Definition at line 375 of file Instrument.h.

◆ __id

int __id
private

Identifier of an instrument, which should be unique.

It is set by set_id() and accessed via get_id().

Definition at line 328 of file Instrument.h.

◆ __is_metronome_instrument

bool __is_metronome_instrument
private

is the instrument an metronome instrument?

Definition at line 379 of file Instrument.h.

◆ __is_preview_instrument

bool __is_preview_instrument
private

is the instrument an hydrogen preview instrument?

Definition at line 378 of file Instrument.h.

◆ __lower_cc

int __lower_cc
private

lower cc level

Definition at line 376 of file Instrument.h.

◆ __midi_out_channel

int __midi_out_channel
private

midi out channel

Definition at line 366 of file Instrument.h.

◆ __midi_out_note

int __midi_out_note
private

midi out note

Definition at line 365 of file Instrument.h.

◆ __mute_group

int __mute_group
private

mute group of the instrument

Definition at line 372 of file Instrument.h.

◆ __muted

bool __muted
private

is the instrument muted?

Definition at line 371 of file Instrument.h.

◆ __name

QString __name
private

Name of the Instrument.

It is set by set_name() and accessed via get_name().

Definition at line 331 of file Instrument.h.

◆ __peak_l

float __peak_l
private

left current peak value

Definition at line 351 of file Instrument.h.

◆ __peak_r

float __peak_r
private

right current peak value

Definition at line 352 of file Instrument.h.

◆ __pitch_offset

float __pitch_offset
private

instrument main pitch offset

Definition at line 364 of file Instrument.h.

◆ __queued

int __queued
private

count the number of notes queued within Sampler::__playing_notes_queue or std::priority_queue m_songNoteQueue

Definition at line 373 of file Instrument.h.

◆ __random_pitch_factor

float __random_pitch_factor
private

Factor to scale the random contribution when humanizing pitch between 0 and AudioEngine::fHumanizePitchSD.

Supported range [0,1].

Definition at line 363 of file Instrument.h.

◆ __sample_selection_alg

SampleSelectionAlgo __sample_selection_alg
private

how Hydrogen will chose the sample to use

Definition at line 368 of file Instrument.h.

◆ __soloed

bool __soloed
private

is the instrument in solo mode?

Definition at line 370 of file Instrument.h.

◆ __stop_notes

bool __stop_notes
private

will the note automatically generate a note off after being on

Definition at line 367 of file Instrument.h.

◆ __volume

float __volume
private

volume of the instrument

Definition at line 349 of file Instrument.h.

◆ m_bHasMissingSamples

bool m_bHasMissingSamples
private

does the instrument have missing sample files?

Definition at line 383 of file Instrument.h.

◆ m_fPan

float m_fPan
private

pan of the instrument, [-1;1] from left to right, as requested by Sampler PanLaws

Definition at line 350 of file Instrument.h.