|
hydrogen 1.2.6
|
#include <Song.h>
Public Types | |
| enum class | ActionMode { selectMode = 0 , drawMode = 1 , None = 2 } |
| Defines the type of user interaction experienced in the SongEditor. More... | |
| enum class | LoopMode { Disabled = 0 , Enabled = 1 , Finishing = 2 } |
| enum class | Mode { Pattern = 0 , Song = 1 , None = 2 } |
| enum class | PatternMode { Stacked = 0 , Selected = 1 , None = 2 } |
| Determines how patterns will be added to AudioEngine::m_pPlayingPatterns if transport is in Song::Mode::Pattern. More... | |
| enum class | PlaybackTrack { Unavailable = 0 , Muted = 1 , Enabled = 2 , None = 3 } |
| Determines the state of the Playback track with respect to audio processing. More... | |
Public Member Functions | |
| Song (const QString &sName, const QString &sAuthor, float fBpm, float fVolume) | |
| ~Song () | |
| void | clearMissingSamples () |
| QString | copyInstrumentLineToString (int selectedInstrument) |
| int | findExistingComponent (const QString &sComponentName) const |
| Checks whether a component of name sComponentName exists in m_pComponents. | |
| int | findFreeComponentID (int nStartingID=0) const |
| ActionMode | getActionMode () const |
| std::vector< std::shared_ptr< Note > > | getAllNotes () const |
| const QString & | getAuthor () const |
| float | getBpm () const |
| std::shared_ptr< DrumkitComponent > | getComponent (int nID) const |
| std::shared_ptr< std::vector< std::shared_ptr< DrumkitComponent > > > | getComponents () const |
| const QString & | getFilename () const |
| float | getHumanizeTimeValue () const |
| float | getHumanizeVelocityValue () const |
| std::shared_ptr< InstrumentList > | getInstrumentList () const |
| bool | getIsModified () const |
| bool | getIsMuted () const |
| bool | getIsPatternEditorLocked () const |
| bool | getIsTimelineActivated () const |
| const QString & | getLastLoadedDrumkitName () const |
| QString | getLastLoadedDrumkitPath () const |
| int | getLatestRoundRobin (float fStartVelocity) |
| const License & | getLicense () const |
| LoopMode | getLoopMode () const |
| float | getMetronomeVolume () const |
| Mode | getMode () const |
| const QString & | getName () const |
| const QString & | getNotes () const |
| float | getPanLawKNorm () const |
| int | getPanLawType () const |
| std::vector< PatternList * > * | getPatternGroupVector () |
| Return a pointer to a vector storing all Pattern present in the Song. | |
| const std::vector< PatternList * > * | getPatternGroupVector () const |
| Return a pointer to a vector storing all Pattern present in the Song. | |
| PatternList * | getPatternList () const |
| PatternMode | getPatternMode () const |
| bool | getPlaybackTrackEnabled () const |
| const QString & | getPlaybackTrackFilename () const |
| PlaybackTrack | getPlaybackTrackState () const |
| float | getPlaybackTrackVolume () const |
| unsigned | getResolution () const |
| float | getSwingFactor () const |
| std::shared_ptr< Timeline > | getTimeline () const |
| AutomationPath * | getVelocityAutomationPath () const |
| float | getVolume () const |
| bool | hasMissingSamples () const |
| Song was incompletely loaded from file (missing samples) | |
| bool | isLoopEnabled () const |
| bool | isPatternActive (int nColumn, int nRow) const |
| long | lengthInTicks () const |
| get the length of the song, in tick units | |
| QString | makeComponentNameUnique (const QString &sComponentName) const |
| Ensures sComponentName is not used by any other component loaded into the song yet. | |
| bool | pasteInstrumentLineFromString (const QString &sSerialized, int nSelectedInstrument, std::list< Pattern * > &patterns) |
| void | readTempPatternList (const QString &sFilename) |
| void | removeInstrument (int nInstrumentNumber, bool bConditional) |
| bool | save (const QString &sFilename, bool bSilent=false) |
| Save a song to file. | |
| void | setActionMode (const ActionMode actionMode) |
| void | setAuthor (const QString &sAuthor) |
| void | setBpm (float fBpm) |
| void | setDrumkit (std::shared_ptr< Drumkit > pDrumkit, bool bConditional) |
| void | setFilename (const QString &sFilename) |
| void | setHumanizeTimeValue (float fValue) |
| void | setHumanizeVelocityValue (float fValue) |
| void | setInstrumentList (std::shared_ptr< InstrumentList > pList) |
| void | setIsModified (bool bIsModified) |
| void | setIsMuted (bool bIsMuted) |
| void | setIsPatternEditorLocked (bool bIsPatternEditorLocked) |
| void | setIsTimelineActivated (bool bIsTimelineActivated) |
| void | setLastLoadedDrumkitName (const QString &sName) |
| void | setLastLoadedDrumkitPath (const QString &sPath) |
| void | setLatestRoundRobin (float fStartVelocity, int nLatestRoundRobin) |
| void | setLicense (const License &license) |
| void | setLoopMode (LoopMode loopMode) |
| void | setMetronomeVolume (float fVolume) |
| void | setMode (Mode mode) |
| void | setName (const QString &sName) |
| void | setNotes (const QString &sNotes) |
| void | setPanLawKNorm (float fKNorm) |
| void | setPanLawType (int nPanLawType) |
| void | setPatternGroupVector (std::vector< PatternList * > *pGroupVect) |
| Sets the vector storing all Pattern present in the Song m_pPatternGroupSequence. | |
| void | setPatternList (PatternList *pList) |
| void | setPatternMode (PatternMode patternMode) |
| void | setPlaybackTrackEnabled (const bool bEnabled) |
| Specifies whether a playback track should be used. | |
| void | setPlaybackTrackFilename (const QString sFilename) |
| void | setPlaybackTrackVolume (const float fVolume) |
| void | setResolution (unsigned resolution) |
| void | setSwingFactor (float fFactor) |
| void | setVolume (float fVolume) |
| QString | toQString (const QString &sPrefix="", bool bShort=true) const override |
| Formatted string version for debugging purposes. | |
| bool | writeTempPatternList (const QString &sFilename) |
Public Member Functions inherited from Object< Song > | |
| Object () | |
| Object (const Object< Song > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | logBacktrace () const |
| Print the current stack at point into the debug log. | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
Static Public Member Functions | |
| static std::shared_ptr< Song > | getEmptySong () |
| static std::shared_ptr< Song > | load (const QString &sFilename, bool bSilent=false) |
| Load a song from file. | |
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 Logger * | logger () |
| 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 | |
Static Public Attributes | |
| static constexpr int | nDefaultResolution = 48 |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Private Member Functions | |
| void | loadPatternGroupVectorFrom (XMLNode *pNode, bool bSilent=false) |
| void | loadVirtualPatternsFrom (XMLNode *pNode, bool bSilent=false) |
| void | setTimeline (std::shared_ptr< Timeline > pTimeline) |
| void | writePatternGroupVectorTo (XMLNode *pNode, bool bSilent=false) |
| void | writeTo (XMLNode *pNode, bool bSilent=false) |
| void | writeVirtualPatternsTo (XMLNode *pNode, bool bSilent=false) |
Static Private Member Functions | |
| static std::shared_ptr< Song > | loadFrom (XMLNode *pNode, const QString &sFilename, bool bSilent=false) |
Private Attributes | |
| ActionMode | m_actionMode |
| Stores the type of interaction with the SongEditor. | |
| bool | m_bIsModified |
| bool | m_bIsMuted |
| Resolution of the song (number of ticks per quarter) | |
| bool | m_bIsPatternEditorLocked |
| If set to true, the user won't be able to select a pattern via the SongEditor. | |
| bool | m_bIsTimelineActivated |
| Whether the Timeline button was pressed in the GUI or it was activated via an OSC command. | |
| bool | m_bPlaybackTrackEnabled |
| Whether the playback track should be used at all. | |
| float | m_fBpm |
| Current speed in beats per minutes. | |
| float | m_fHumanizeTimeValue |
| Factor to scale the random contribution when humanizing timing between 0 and AudioEngine::fHumanizeTimingSD. | |
| float | m_fHumanizeVelocityValue |
| Factor to scale the random contribution when humanizing velocity between 0 and AudioEngine::fHumanizeVelocitySD. | |
| float | m_fMetronomeVolume |
| float | m_fPanLawKNorm |
| float | m_fPlaybackTrackVolume |
| Volume of the playback track. | |
| float | m_fSwingFactor |
| float | m_fVolume |
| Metronome volume. | |
| std::map< float, int > | m_latestRoundRobins |
| License | m_license |
| LoopMode | m_loopMode |
| The three states of this enum is just a way to handle the playback within Hydrogen. | |
| Mode | m_mode |
| int | m_nPanLawType |
| PatternMode | m_patternMode |
| std::shared_ptr< std::vector< std::shared_ptr< DrumkitComponent > > > | m_pComponents |
| std::shared_ptr< InstrumentList > | m_pInstrumentList |
| list of drumkit component | |
| std::vector< PatternList * > * | m_pPatternGroupSequence |
| Instrument list. | |
| PatternList * | m_pPatternList |
| Sequence of pattern groups. | |
| std::shared_ptr< Timeline > | m_pTimeline |
| AutomationPath * | m_pVelocityAutomationPath |
| license of the song | |
| unsigned | m_resolution |
| QString | m_sAuthor |
| volume of the song (0.0..1.0) | |
| QString | m_sFilename |
| QString | m_sLastLoadedDrumkitName |
| Convenience variable holding the name of the drumkit last loaded. | |
| QString | m_sLastLoadedDrumkitPath |
| Unique identifier of the drumkit last loaded. | |
| QString | m_sName |
| author of the song | |
| QString | m_sNotes |
| Pattern list. | |
| QString | m_sPlaybackTrackFilename |
| Name of the file to be loaded as playback track. | |
Additional Inherited Members | |
Protected Member Functions inherited from Object< Song > | |
| ~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 |
| static bool | bLogColors = true |
|
strong |
Defines the type of user interaction experienced in the SongEditor.
|
strong |
|
strong |
|
strong |
Determines how patterns will be added to AudioEngine::m_pPlayingPatterns if transport is in Song::Mode::Pattern.
| Enumerator | |
|---|---|
| Stacked | An arbitrary number of pattern can be played. |
| Selected | Only one pattern - the one currently selected in the GUI - will be played back. |
| None | Null element used to indicate that either no song is present or Song::Mode::Song was selected. |
|
strong |
Determines the state of the Playback track with respect to audio processing.
| Song | ( | const QString & | sName, |
| const QString & | sAuthor, | ||
| float | fBpm, | ||
| float | fVolume ) |
| QString copyInstrumentLineToString | ( | int | selectedInstrument | ) |
| int findExistingComponent | ( | const QString & | sComponentName | ) | const |
Checks whether a component of name sComponentName exists in m_pComponents.
|
inline |
| std::vector< std::shared_ptr< Note > > getAllNotes | ( | ) | const |
| std::shared_ptr< DrumkitComponent > getComponent | ( | int | nID | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return a pointer to a vector storing all Pattern present in the Song.
|
inline |
Return a pointer to a vector storing all Pattern present in the Song.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool hasMissingSamples | ( | ) | const |
| long lengthInTicks | ( | ) | const |
|
static |
|
private |
|
private |
| QString makeComponentNameUnique | ( | const QString & | sComponentName | ) | const |
| bool pasteInstrumentLineFromString | ( | const QString & | sSerialized, |
| int | nSelectedInstrument, | ||
| std::list< Pattern * > & | patterns ) |
| void removeInstrument | ( | int | nInstrumentNumber, |
| bool | bConditional ) |
| bool save | ( | const QString & | sFilename, |
| bool | bSilent = false ) |
| void setActionMode | ( | const ActionMode | actionMode | ) |
| void setDrumkit | ( | std::shared_ptr< Drumkit > | pDrumkit, |
| bool | bConditional ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Specifies whether a playback track should be used.
| bEnabled | Sets m_bPlaybackTrackEnabled. |
|
inline |
| sFilename | Sets m_sPlaybackTrackFilename. |
|
inline |
| fVolume | Sets m_fPlaybackTrackVolume. |
|
inlineprivate |
|
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 Base.
|
private |
|
private |
|
private |
|
private |
Stores the type of interaction with the SongEditor.
|
private |
|
private |
If set to true, the user won't be able to select a pattern via the SongEditor.
Instead, the pattern recorded note would be inserted into is displayed. In single pattern/selected pattern mode this is the one pattern being played back and in stacked pattern mode this is the bottom-most one.
This mode is only supported in Song mode.
|
private |
|
private |
Whether the playback track should be used at all.
It is set by setPlaybackTrackEnabled() and queried by getPlaybackTrackEnabled().
The playback track itself is loaded in Sampler::reinitialize_playback_track().
|
private |
Current speed in beats per minutes.
See TransportPosition::m_fBpm for how the handling of the different tempo instances work. song name
|
private |
Factor to scale the random contribution when humanizing timing between 0 and AudioEngine::fHumanizeTimingSD.
Supported range [0,1].
|
private |
Factor to scale the random contribution when humanizing velocity between 0 and AudioEngine::fHumanizeVelocitySD.
Supported range [0,1].
|
private |
Volume of the playback track.
It is set by setPlaybackTrackVolume() and queried by getPlaybackTrackVolume().
The playback track itself is loaded in Sampler::reinitialize_playback_track().
|
private |
The three states of this enum is just a way to handle the playback within Hydrogen.
Not its content but the output of isLoopEnabled(), whether enabled or disabled, will be written to disk.
|
private |
|
private |
|
private |
|
private |
Instrument list.
|
private |
|
private |
|
private |
|
private |
Unique identifier of the drumkit last loaded.
As the instruments and corresponding samples use their own drumkits stored within them, this variable only serves for references when storing patterns, highlighting in the GUI, and other helper purposes.
It's only semi-useful to associate the last loaded drumkit with a song as the user is free to remove instruments and add an arbitrary number of instruments from other drumkits. But the most common use case of Hydrogen is probably with a stack or custom drumkit loaded and not altering the associated instrument list.
|
private |
Name of the file to be loaded as playback track.
It is set by setPlaybackTrackFilename() and queried by getPlaybackTrackFilename().
The playback track itself is loaded in Sampler::reinitialize_playback_track().