|
hydrogen 1.1.1
|
A note plays an associated instrument with a velocity left and right pan. More...
#include <Note.h>
Public Types | |
| enum | Key { C =KEY_MIN , Cs , D , Ef , E , F , Fs , G , Af , A , Bf , B } |
| possible keys More... | |
| enum | Octave { P8Z =-3 , P8Y =-2 , P8X =-1 , P8 =OCTAVE_DEFAULT , P8A =1 , P8B =2 , P8C =3 } |
| possible octaves More... | |
Public Member Functions | |
| Note (Instrument *instrument, int position, float velocity, float pan_l, float pan_r, int length, float pitch) | |
| constructor More... | |
| Note (Note *other, Instrument *instrument=nullptr) | |
| copy constructor with an optional parameter More... | |
| ~Note () | |
| destructor More... | |
| void | save_to (XMLNode *node) |
| void | dump () |
| output details through logger with DEBUG severity More... | |
| void | map_instrument (InstrumentList *instruments) |
| find the corresponding instrument and point to it, or an empty instrument More... | |
| Instrument * | get_instrument () |
| __instrument accessor More... | |
| bool | has_instrument () const |
| return true if __instrument is set More... | |
| void | set_instrument_id (int value) |
| __instrument_id setter More... | |
| int | get_instrument_id () const |
| __instrument_id accessor More... | |
| void | set_specific_compo_id (int value) |
| __specific_compo_id setter More... | |
| int | get_specific_compo_id () const |
| __specific_compo_id accessor More... | |
| void | set_position (int value) |
| __position setter More... | |
| int | get_position () const |
| __position accessor More... | |
| void | set_velocity (float value) |
| __velocity setter More... | |
| float | get_velocity () const |
| __velocity accessor More... | |
| void | set_pan_l (float value) |
| __pan_l setter More... | |
| float | get_pan_l () const |
| __pan_l accessor More... | |
| void | set_pan_r (float value) |
| __pan_r setter More... | |
| float | get_pan_r () const |
| __pan_r accessor More... | |
| void | set_lead_lag (float value) |
| __lead_lag setter More... | |
| float | get_lead_lag () const |
| __lead_lag accessor More... | |
| void | set_length (int value) |
| __length setter More... | |
| int | get_length () const |
| __length accessor More... | |
| void | set_pitch (float value) |
| __pitch setter More... | |
| float | get_pitch () const |
| __pitch accessor More... | |
| void | set_note_off (bool value) |
| __note_off setter More... | |
| bool | get_note_off () const |
| __note_off accessor More... | |
| int | get_midi_msg () const |
| __midi_msg accessor More... | |
| void | set_pattern_idx (int value) |
| __pattern_idx setter More... | |
| int | get_pattern_idx () const |
| __pattern_idx accessor More... | |
| void | set_just_recorded (bool value) |
| __just_recorded setter More... | |
| bool | get_just_recorded () const |
| __just_recorded accessor More... | |
| SelectedLayerInfo * | get_layer_selected (int CompoID) |
| void | set_probability (float value) |
| float | get_probability () const |
| void | set_humanize_delay (int value) |
| __humanize_delay setter More... | |
| int | get_humanize_delay () const |
| __humanize_delay accessor More... | |
| float | get_cut_off () const |
| __cut_off accessor More... | |
| float | get_resonance () const |
| __resonance accessor More... | |
| float | get_bpfb_l () const |
| __bpfb_l accessor More... | |
| float | get_bpfb_r () const |
| __bpfb_r accessor More... | |
| float | get_lpfb_l () const |
| __lpfb_l accessor More... | |
| float | get_lpfb_r () const |
| __lpfb_r accessor More... | |
| bool | filter_sustain () const |
| Filter output is sustaining note. More... | |
| Key | get_key () |
| __key accessor More... | |
| Octave | get_octave () |
| __octave accessor More... | |
| int | get_midi_key () const |
| return scaled key for midi output, !!! DO NOT CHECK IF INSTRUMENT IS SET !!! More... | |
| int | get_midi_velocity () const |
| midi velocity accessor More... | |
| float | get_notekey_pitch () const |
| note key pitch accessor More... | |
| float | get_total_pitch () const |
| returns More... | |
| QString | key_to_string () |
| return a string representation of key-octave More... | |
| void | set_key_octave (const QString &str) |
| parse str and set __key and __octave More... | |
| void | set_key_octave (Key key, Octave octave) |
| set __key and __octave only if within acceptable range More... | |
| void | set_midi_info (Key key, Octave octave, int msg) |
| set __key, __octave and __midi_msg only if within acceptable range More... | |
| ADSR * | get_adsr () const |
| get the ADSR of the note More... | |
| bool | match (Instrument *instrument, Key key, Octave octave) const |
| call release on adsr More... | |
| bool | match (const Note *pNote) const |
| Return true if two notes match in instrument, key and octave. More... | |
| void | compute_lr_values (float *val_l, float *val_r) |
| compute left and right output based on filters 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 Note * | load_from (XMLNode *node, InstrumentList *instruments) |
| load a note from an XMLNode More... | |
| static double | pitchToFrequency (double fPitch) |
| Convert a logarithmic pitch-space value in semitones to a frequency-domain value. 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 | |
| Instrument * | __instrument |
| the instrument to be played by this note More... | |
| int | __instrument_id |
| the id of the instrument played by this note More... | |
| int | __specific_compo_id |
| play a specific component, -1 if playing all More... | |
| int | __position |
| note position inside the pattern More... | |
| float | __velocity |
| velocity (intensity) of the note [0;1] More... | |
| float | __pan_l |
| pan of the note (left volume) [0;0.5] More... | |
| float | __pan_r |
| pan of the note (right volume) [0;0.5] More... | |
| int | __length |
| the length of the note More... | |
| float | __pitch |
| the frequency of the note More... | |
| Key | __key |
| the key, [0;11]==[C;B] More... | |
| Octave | __octave |
| the octave [-3;3] More... | |
| ADSR * | __adsr |
| attack decay sustain release More... | |
| float | __lead_lag |
| lead or lag offset of the note More... | |
| float | __cut_off |
| filter cutoff [0;1] More... | |
| float | __resonance |
| filter resonant frequency [0;1] More... | |
| int | __humanize_delay |
| used in "humanize" function More... | |
| std::map< int, SelectedLayerInfo * > | __layers_selected |
| float | __bpfb_l |
| left band pass filter buffer More... | |
| float | __bpfb_r |
| right band pass filter buffer More... | |
| float | __lpfb_l |
| left low pass filter buffer More... | |
| float | __lpfb_r |
| right low pass filter buffer More... | |
| int | __pattern_idx |
| index of the pattern holding this note for undo actions More... | |
| int | __midi_msg |
| TODO. More... | |
| bool | __note_off |
| note type on|off More... | |
| bool | __just_recorded |
| used in record+delete More... | |
| float | __probability |
| note probability More... | |
Static Private Attributes | |
| static const char * | __key_str [] = { "C", "Cs", "D", "Ef", "E", "F", "Fs", "G", "Af", "A", "Bf", "B" } |
| used to build QString from __key an __octave 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... | |
A note plays an associated instrument with a velocity left and right pan.
| enum Key |
| enum Octave |
| Note | ( | Instrument * | instrument, |
| int | position, | ||
| float | velocity, | ||
| float | pan_l, | ||
| float | pan_r, | ||
| int | length, | ||
| float | pitch | ||
| ) |
constructor
| instrument | the instrument played by this note |
| position | the position of the note within the pattern |
| velocity | it's velocity |
| pan_l | left pan |
| pan_r | right pan |
| length | it's length |
| pitch | it's pitch |
| Note | ( | Note * | other, |
| Instrument * | instrument = nullptr |
||
| ) |
copy constructor with an optional parameter
| other | |
| instrument | if set will be used as note instrument |
| ~Note | ( | ) |
destructor
|
inline |
compute left and right output based on filters
| val_l | the left channel value |
| val_r | the right channel value |
| void dump | ( | ) |
output details through logger with DEBUG severity
|
inline |
Filter output is sustaining note.
|
inline |
__bpfb_l accessor
|
inline |
__bpfb_r accessor
|
inline |
__cut_off accessor
|
inline |
__humanize_delay accessor
|
inline |
__instrument accessor
|
inline |
__instrument_id accessor
|
inline |
__just_recorded accessor
|
inline |
|
inline |
__lead_lag accessor
|
inline |
__length accessor
|
inline |
__lpfb_l accessor
|
inline |
__lpfb_r accessor
|
inline |
return scaled key for midi output, !!! DO NOT CHECK IF INSTRUMENT IS SET !!!
|
inline |
__midi_msg accessor
|
inline |
midi velocity accessor
|
inline |
__note_off accessor
|
inline |
note key pitch accessor
|
inline |
__octave accessor
|
inline |
__pan_l accessor
|
inline |
__pan_r accessor
|
inline |
__pattern_idx accessor
|
inline |
__pitch accessor
|
inline |
__position accessor
|
inline |
|
inline |
__resonance accessor
|
inline |
__specific_compo_id accessor
|
inline |
returns
|
inline |
__velocity accessor
|
inline |
return true if __instrument is set
| QString key_to_string | ( | ) |
return a string representation of key-octave
|
static |
| void map_instrument | ( | InstrumentList * | instruments | ) |
find the corresponding instrument and point to it, or an empty instrument
| instruments | the list of instrument to look into |
|
inline |
Return true if two notes match in instrument, key and octave.
|
inline |
call release on adsr
call get value on adsr return true if instrument, key and octave matches with internal
| instrument | the instrument to match with __instrument |
| key | the key to match with __key |
| octave | the octave to match with __octave |
|
inlinestatic |
Convert a logarithmic pitch-space value in semitones to a frequency-domain value.
| void save_to | ( | XMLNode * | node | ) |
|
inline |
__humanize_delay setter
| value | the new value |
|
inline |
__instrument_id setter
| value | the new value |
|
inline |
__just_recorded setter
| value | the new value |
| void set_key_octave | ( | const QString & | str | ) |
| void set_lead_lag | ( | float | value | ) |
__lead_lag setter
| value | the new value |
|
inline |
__length setter
| value | the new value |
set __key, __octave and __midi_msg only if within acceptable range
| key | the key to set |
| octave | the octave to be set |
| msg |
|
inline |
__note_off setter
| value | the new value |
| void set_pan_l | ( | float | value | ) |
__pan_l setter
| value | the new value |
| void set_pan_r | ( | float | value | ) |
__pan_r setter
| value | the new value |
|
inline |
__pattern_idx setter
| value | the new value |
|
inline |
__pitch setter
| value | the new value |
|
inline |
__position setter
| value | the new value |
|
inline |
|
inline |
__specific_compo_id setter
| value | the new value |
| void set_velocity | ( | float | value | ) |
__velocity setter
| value | the new value |
|
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.
|
private |
attack decay sustain release
|
private |
left band pass filter buffer
|
private |
right band pass filter buffer
|
private |
filter cutoff [0;1]
|
private |
used in "humanize" function
|
private |
the instrument to be played by this note
|
private |
the id of the instrument played by this note
|
private |
used in record+delete
|
private |
the key, [0;11]==[C;B]
|
private |
|
private |
lead or lag offset of the note
|
private |
the length of the note
|
private |
left low pass filter buffer
|
private |
right low pass filter buffer
|
private |
TODO.
|
private |
note type on|off
|
private |
the octave [-3;3]
|
private |
pan of the note (left volume) [0;0.5]
|
private |
pan of the note (right volume) [0;0.5]
|
private |
index of the pattern holding this note for undo actions
|
private |
the frequency of the note
|
private |
note position inside the pattern
|
private |
note probability
|
private |
filter resonant frequency [0;1]
|
private |
play a specific component, -1 if playing all
|
private |
velocity (intensity) of the note [0;1]