hydrogen 1.2.6
Song Class Reference

Song class. More...

#include <Song.h>

Inheritance diagram for Song:
Object< Song > Base

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< DrumkitComponentgetComponent (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< InstrumentListgetInstrumentList () 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 LicensegetLicense () 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.
 
PatternListgetPatternList () 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< TimelinegetTimeline () const
 
AutomationPathgetVelocityAutomationPath () 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< SonggetEmptySong ()
 
static std::shared_ptr< Songload (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 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
 

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< SongloadFrom (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< InstrumentListm_pInstrumentList
 list of drumkit component
 
std::vector< PatternList * > * m_pPatternGroupSequence
 Instrument list.
 
PatternListm_pPatternList
 Sequence of pattern groups.
 
std::shared_ptr< Timelinem_pTimeline
 
AutomationPathm_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
 

Detailed Description

Song class.

Definition at line 60 of file Song.h.

Member Enumeration Documentation

◆ ActionMode

enum class ActionMode
strong

Defines the type of user interaction experienced in the SongEditor.

Enumerator
selectMode 

Holding a pressed left mouse key will draw a rectangle to select a group of Notes.

drawMode 

Holding a pressed left mouse key will draw/delete patterns in all grid cells encountered.

None 

Used in case no song is set and both pattern and song editor are not ready to operate yet.

Definition at line 74 of file Song.h.

◆ LoopMode

enum class LoopMode
strong
Enumerator
Disabled 
Enabled 
Finishing 

Transport is still in loop mode (frames and ticks larger than song size are allowed) but playback ends the next time the end of the song is reached.

Definition at line 86 of file Song.h.

◆ Mode

enum class Mode
strong
Enumerator
Pattern 
Song 
None 

Used in case no song is set and both pattern and song editor are not ready to operate yet.

Definition at line 64 of file Song.h.

◆ PatternMode

enum class PatternMode
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.

Definition at line 101 of file Song.h.

◆ PlaybackTrack

enum class PlaybackTrack
strong

Determines the state of the Playback track with respect to audio processing.

Enumerator
Unavailable 

No proper playback track file set yet.

Muted 

Valid file set but the playback track is muted via the GUI.

Enabled 

Valid file set and ready for playback.

None 

Null element used to indicate that either no song is present.

Definition at line 115 of file Song.h.

Constructor & Destructor Documentation

◆ Song()

Song ( const QString & sName,
const QString & sAuthor,
float fBpm,
float fVolume )

Definition at line 67 of file Song.cpp.

◆ ~Song()

~Song ( )

Definition at line 109 of file Song.cpp.

Member Function Documentation

◆ clearMissingSamples()

void clearMissingSamples ( )

Definition at line 1095 of file Song.cpp.

◆ copyInstrumentLineToString()

QString copyInstrumentLineToString ( int selectedInstrument)

Definition at line 1129 of file Song.cpp.

◆ findExistingComponent()

int findExistingComponent ( const QString & sComponentName) const

Checks whether a component of name sComponentName exists in m_pComponents.

Returns
Component ID on success and -1 on failure.

Definition at line 1460 of file Song.cpp.

◆ findFreeComponentID()

int findFreeComponentID ( int nStartingID = 0) const

Definition at line 1469 of file Song.cpp.

◆ getActionMode()

Song::ActionMode getActionMode ( ) const
inline

Definition at line 723 of file Song.h.

◆ getAllNotes()

std::vector< std::shared_ptr< Note > > getAllNotes ( ) const

Definition at line 1416 of file Song.cpp.

◆ getAuthor()

const QString & getAuthor ( ) const
inline

Definition at line 584 of file Song.h.

◆ getBpm()

float getBpm ( ) const
inline

Definition at line 485 of file Song.h.

◆ getComponent()

std::shared_ptr< DrumkitComponent > getComponent ( int nID) const

Definition at line 1037 of file Song.cpp.

◆ getComponents()

std::shared_ptr< std::vector< std::shared_ptr< DrumkitComponent > > > getComponents ( ) const
inline

Definition at line 658 of file Song.h.

◆ getEmptySong()

std::shared_ptr< Song > getEmptySong ( )
static

Definition at line 964 of file Song.cpp.

◆ getFilename()

const QString & getFilename ( ) const
inline

Definition at line 589 of file Song.h.

◆ getHumanizeTimeValue()

float getHumanizeTimeValue ( ) const
inline

Definition at line 623 of file Song.h.

◆ getHumanizeVelocityValue()

float getHumanizeVelocityValue ( ) const
inline

Definition at line 633 of file Song.h.

◆ getInstrumentList()

std::shared_ptr< InstrumentList > getInstrumentList ( ) const
inline

Definition at line 525 of file Song.h.

◆ getIsModified()

bool getIsModified ( ) const
inline

Definition at line 520 of file Song.h.

◆ getIsMuted()

bool getIsMuted ( ) const
inline

Definition at line 465 of file Song.h.

◆ getIsPatternEditorLocked()

bool getIsPatternEditorLocked ( ) const
inline

Definition at line 452 of file Song.h.

◆ getIsTimelineActivated()

bool getIsTimelineActivated ( ) const
inline

Definition at line 446 of file Song.h.

◆ getLastLoadedDrumkitName()

const QString & getLastLoadedDrumkitName ( ) const
inline

Definition at line 739 of file Song.h.

◆ getLastLoadedDrumkitPath()

QString getLastLoadedDrumkitPath ( ) const

Definition at line 1497 of file Song.cpp.

◆ getLatestRoundRobin()

int getLatestRoundRobin ( float fStartVelocity)
inline

Definition at line 668 of file Song.h.

◆ getLicense()

const License & getLicense ( ) const
inline

Definition at line 574 of file Song.h.

◆ getLoopMode()

Song::LoopMode getLoopMode ( ) const
inline

Definition at line 605 of file Song.h.

◆ getMetronomeVolume()

float getMetronomeVolume ( ) const
inline

Definition at line 510 of file Song.h.

◆ getMode()

Song::Mode getMode ( ) const
inline

Definition at line 648 of file Song.h.

◆ getName()

const QString & getName ( ) const
inline

Definition at line 495 of file Song.h.

◆ getNotes()

const QString & getNotes ( ) const
inline

Definition at line 564 of file Song.h.

◆ getPanLawKNorm()

float getPanLawKNorm ( ) const
inline

Definition at line 735 of file Song.h.

◆ getPanLawType()

int getPanLawType ( ) const
inline

Definition at line 731 of file Song.h.

◆ getPatternGroupVector() [1/2]

std::vector< PatternList * > * getPatternGroupVector ( )
inline

Return a pointer to a vector storing all Pattern present in the Song.

Returns
m_pPatternGroupSequence

Definition at line 545 of file Song.h.

◆ getPatternGroupVector() [2/2]

const std::vector< PatternList * > * getPatternGroupVector ( ) const
inline

Return a pointer to a vector storing all Pattern present in the Song.

Returns
m_pPatternGroupSequence

Definition at line 549 of file Song.h.

◆ getPatternList()

PatternList * getPatternList ( ) const
inline

Definition at line 535 of file Song.h.

◆ getPatternMode()

Song::PatternMode getPatternMode ( ) const
inline

Definition at line 614 of file Song.h.

◆ getPlaybackTrackEnabled()

bool getPlaybackTrackEnabled ( ) const
inline
Returns
m_bPlaybackTrackEnabled

Definition at line 692 of file Song.h.

◆ getPlaybackTrackFilename()

const QString & getPlaybackTrackFilename ( ) const
inline
Returns
m_sPlaybackTrackFilename

Definition at line 682 of file Song.h.

◆ getPlaybackTrackState()

Song::PlaybackTrack getPlaybackTrackState ( ) const
inline

Definition at line 711 of file Song.h.

◆ getPlaybackTrackVolume()

float getPlaybackTrackVolume ( ) const
inline
Returns
m_fPlaybackTrackVolume

Definition at line 702 of file Song.h.

◆ getResolution()

unsigned getResolution ( ) const
inline

Definition at line 475 of file Song.h.

◆ getSwingFactor()

float getSwingFactor ( ) const
inline

Definition at line 643 of file Song.h.

◆ getTimeline()

std::shared_ptr< Timeline > getTimeline ( ) const
inline

Definition at line 458 of file Song.h.

◆ getVelocityAutomationPath()

AutomationPath * getVelocityAutomationPath ( ) const
inline

Definition at line 663 of file Song.h.

◆ getVolume()

float getVolume ( ) const
inline

Definition at line 500 of file Song.h.

◆ hasMissingSamples()

bool hasMissingSamples ( ) const

Song was incompletely loaded from file (missing samples)

Definition at line 1084 of file Song.cpp.

◆ isLoopEnabled()

bool isLoopEnabled ( ) const
inline

Definition at line 599 of file Song.h.

◆ isPatternActive()

bool isPatternActive ( int nColumn,
int nRow ) const

Definition at line 170 of file Song.cpp.

◆ lengthInTicks()

long lengthInTicks ( ) const

get the length of the song, in tick units

Definition at line 154 of file Song.cpp.

◆ load()

std::shared_ptr< Song > load ( const QString & sFilename,
bool bSilent = false )
static

Load a song from file.

Definition at line 191 of file Song.cpp.

◆ loadFrom()

std::shared_ptr< Song > loadFrom ( XMLNode * pNode,
const QString & sFilename,
bool bSilent = false )
staticprivate

Definition at line 233 of file Song.cpp.

◆ loadPatternGroupVectorFrom()

void loadPatternGroupVectorFrom ( XMLNode * pNode,
bool bSilent = false )
private

Definition at line 707 of file Song.cpp.

◆ loadVirtualPatternsFrom()

void loadVirtualPatternsFrom ( XMLNode * pNode,
bool bSilent = false )
private

Definition at line 655 of file Song.cpp.

◆ makeComponentNameUnique()

QString makeComponentNameUnique ( const QString & sComponentName) const

Ensures sComponentName is not used by any other component loaded into the song yet.

Definition at line 1488 of file Song.cpp.

◆ pasteInstrumentLineFromString()

bool pasteInstrumentLineFromString ( const QString & sSerialized,
int nSelectedInstrument,
std::list< Pattern * > & patterns )

Definition at line 1150 of file Song.cpp.

◆ readTempPatternList()

void readTempPatternList ( const QString & sFilename)

Definition at line 1102 of file Song.cpp.

◆ removeInstrument()

void removeInstrument ( int nInstrumentNumber,
bool bConditional )

Definition at line 1366 of file Song.cpp.

◆ save()

bool save ( const QString & sFilename,
bool bSilent = false )

Save a song to file.

Definition at line 611 of file Song.cpp.

◆ setActionMode()

void setActionMode ( const ActionMode actionMode)

Definition at line 150 of file Song.cpp.

◆ setAuthor()

void setAuthor ( const QString & sAuthor)
inline

Definition at line 579 of file Song.h.

◆ setBpm()

void setBpm ( float fBpm)

Definition at line 132 of file Song.cpp.

◆ setDrumkit()

void setDrumkit ( std::shared_ptr< Drumkit > pDrumkit,
bool bConditional )

Definition at line 1263 of file Song.cpp.

◆ setFilename()

void setFilename ( const QString & sFilename)
inline

Definition at line 594 of file Song.h.

◆ setHumanizeTimeValue()

void setHumanizeTimeValue ( float fValue)
inline

Definition at line 628 of file Song.h.

◆ setHumanizeVelocityValue()

void setHumanizeVelocityValue ( float fValue)
inline

Definition at line 638 of file Song.h.

◆ setInstrumentList()

void setInstrumentList ( std::shared_ptr< InstrumentList > pList)
inline

Definition at line 530 of file Song.h.

◆ setIsModified()

void setIsModified ( bool bIsModified)

Definition at line 1060 of file Song.cpp.

◆ setIsMuted()

void setIsMuted ( bool bIsMuted)
inline

Definition at line 470 of file Song.h.

◆ setIsPatternEditorLocked()

void setIsPatternEditorLocked ( bool bIsPatternEditorLocked)
inline

Definition at line 455 of file Song.h.

◆ setIsTimelineActivated()

void setIsTimelineActivated ( bool bIsTimelineActivated)
inline

Definition at line 449 of file Song.h.

◆ setLastLoadedDrumkitName()

void setLastLoadedDrumkitName ( const QString & sName)
inline

Definition at line 743 of file Song.h.

◆ setLastLoadedDrumkitPath()

void setLastLoadedDrumkitPath ( const QString & sPath)
inline

Definition at line 747 of file Song.h.

◆ setLatestRoundRobin()

void setLatestRoundRobin ( float fStartVelocity,
int nLatestRoundRobin )
inline

Definition at line 677 of file Song.h.

◆ setLicense()

void setLicense ( const License & license)
inline

Definition at line 569 of file Song.h.

◆ setLoopMode()

void setLoopMode ( Song::LoopMode loopMode)
inline

Definition at line 609 of file Song.h.

◆ setMetronomeVolume()

void setMetronomeVolume ( float fVolume)
inline

Definition at line 515 of file Song.h.

◆ setMode()

void setMode ( Song::Mode mode)
inline

Definition at line 653 of file Song.h.

◆ setName()

void setName ( const QString & sName)
inline

Definition at line 490 of file Song.h.

◆ setNotes()

void setNotes ( const QString & sNotes)
inline

Definition at line 559 of file Song.h.

◆ setPanLawKNorm()

void setPanLawKNorm ( float fKNorm)

Definition at line 1254 of file Song.cpp.

◆ setPanLawType()

void setPanLawType ( int nPanLawType)
inline

Definition at line 727 of file Song.h.

◆ setPatternGroupVector()

void setPatternGroupVector ( std::vector< PatternList * > * pGroupVect)
inline

Sets the vector storing all Pattern present in the Song m_pPatternGroupSequence.

Parameters
pGroupVectPointer to a vector containing all Pattern of the Song.

Definition at line 554 of file Song.h.

◆ setPatternList()

void setPatternList ( PatternList * pList)
inline

Definition at line 540 of file Song.h.

◆ setPatternMode()

void setPatternMode ( Song::PatternMode patternMode)
inline

Definition at line 618 of file Song.h.

◆ setPlaybackTrackEnabled()

void setPlaybackTrackEnabled ( const bool bEnabled)
inline

Specifies whether a playback track should be used.

Parameters
bEnabledSets m_bPlaybackTrackEnabled.

Definition at line 697 of file Song.h.

◆ setPlaybackTrackFilename()

void setPlaybackTrackFilename ( const QString sFilename)
inline
Parameters
sFilenameSets m_sPlaybackTrackFilename.

Definition at line 687 of file Song.h.

◆ setPlaybackTrackVolume()

void setPlaybackTrackVolume ( const float fVolume)
inline
Parameters
fVolumeSets m_fPlaybackTrackVolume.

Definition at line 707 of file Song.h.

◆ setResolution()

void setResolution ( unsigned resolution)
inline

Definition at line 480 of file Song.h.

◆ setSwingFactor()

void setSwingFactor ( float fFactor)

Definition at line 1049 of file Song.cpp.

◆ setTimeline()

void setTimeline ( std::shared_ptr< Timeline > pTimeline)
inlineprivate

Definition at line 461 of file Song.h.

◆ setVolume()

void setVolume ( float fVolume)
inline

Definition at line 505 of file Song.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 1502 of file Song.cpp.

◆ writePatternGroupVectorTo()

void writePatternGroupVectorTo ( XMLNode * pNode,
bool bSilent = false )
private

Definition at line 776 of file Song.cpp.

◆ writeTempPatternList()

bool writeTempPatternList ( const QString & sFilename)

Definition at line 1118 of file Song.cpp.

◆ writeTo()

void writeTo ( XMLNode * pNode,
bool bSilent = false )
private

Definition at line 791 of file Song.cpp.

◆ writeVirtualPatternsTo()

void writeVirtualPatternsTo ( XMLNode * pNode,
bool bSilent = false )
private

Definition at line 762 of file Song.cpp.

Field Documentation

◆ m_actionMode

ActionMode m_actionMode
private

Stores the type of interaction with the SongEditor.

Definition at line 405 of file Song.h.

◆ m_bIsModified

bool m_bIsModified
private

Definition at line 369 of file Song.h.

◆ m_bIsMuted

bool m_bIsMuted
private

Resolution of the song (number of ticks per quarter)

Definition at line 315 of file Song.h.

◆ m_bIsPatternEditorLocked

bool m_bIsPatternEditorLocked
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.

Definition at line 416 of file Song.h.

◆ m_bIsTimelineActivated

bool m_bIsTimelineActivated
private

Whether the Timeline button was pressed in the GUI or it was activated via an OSC command.

Definition at line 313 of file Song.h.

◆ m_bPlaybackTrackEnabled

bool m_bPlaybackTrackEnabled
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().

Definition at line 390 of file Song.h.

◆ m_fBpm

float m_fBpm
private

Current speed in beats per minutes.

See TransportPosition::m_fBpm for how the handling of the different tempo instances work. song name

Definition at line 324 of file Song.h.

◆ m_fHumanizeTimeValue

float m_fHumanizeTimeValue
private

Factor to scale the random contribution when humanizing timing between 0 and AudioEngine::fHumanizeTimingSD.

Supported range [0,1].

Definition at line 360 of file Song.h.

◆ m_fHumanizeVelocityValue

float m_fHumanizeVelocityValue
private

Factor to scale the random contribution when humanizing velocity between 0 and AudioEngine::fHumanizeVelocitySD.

Supported range [0,1].

Definition at line 367 of file Song.h.

◆ m_fMetronomeVolume

float m_fMetronomeVolume
private

Definition at line 334 of file Song.h.

◆ m_fPanLawKNorm

float m_fPanLawKNorm
private

Definition at line 420 of file Song.h.

◆ m_fPlaybackTrackVolume

float m_fPlaybackTrackVolume
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().

Definition at line 399 of file Song.h.

◆ m_fSwingFactor

float m_fSwingFactor
private

Definition at line 368 of file Song.h.

◆ m_fVolume

float m_fVolume
private

Metronome volume.

Definition at line 332 of file Song.h.

◆ m_latestRoundRobins

std::map< float, int> m_latestRoundRobins
private

Definition at line 370 of file Song.h.

◆ m_license

License m_license
private

Definition at line 402 of file Song.h.

◆ m_loopMode

LoopMode m_loopMode
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.

Definition at line 352 of file Song.h.

◆ m_mode

Mode m_mode
private

Definition at line 371 of file Song.h.

◆ m_nPanLawType

int m_nPanLawType
private

Definition at line 418 of file Song.h.

◆ m_patternMode

PatternMode m_patternMode
private

Definition at line 353 of file Song.h.

◆ m_pComponents

std::shared_ptr<std::vector<std::shared_ptr<DrumkitComponent> > > m_pComponents
private

Definition at line 343 of file Song.h.

◆ m_pInstrumentList

std::shared_ptr<InstrumentList> m_pInstrumentList
private

list of drumkit component

Definition at line 341 of file Song.h.

◆ m_pPatternGroupSequence

std::vector<PatternList*>* m_pPatternGroupSequence
private

Instrument list.

Definition at line 339 of file Song.h.

◆ m_pPatternList

PatternList* m_pPatternList
private

Sequence of pattern groups.

Definition at line 337 of file Song.h.

◆ m_pTimeline

std::shared_ptr<Timeline> m_pTimeline
private

Definition at line 423 of file Song.h.

◆ m_pVelocityAutomationPath

AutomationPath* m_pVelocityAutomationPath
private

license of the song

Definition at line 400 of file Song.h.

◆ m_resolution

unsigned m_resolution
private

Definition at line 317 of file Song.h.

◆ m_sAuthor

QString m_sAuthor
private

volume of the song (0.0..1.0)

Definition at line 329 of file Song.h.

◆ m_sFilename

QString m_sFilename
private

Definition at line 344 of file Song.h.

◆ m_sLastLoadedDrumkitName

QString m_sLastLoadedDrumkitName
private

Convenience variable holding the name of the drumkit last loaded.

Definition at line 442 of file Song.h.

◆ m_sLastLoadedDrumkitPath

QString m_sLastLoadedDrumkitPath
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.

Definition at line 439 of file Song.h.

◆ m_sName

QString m_sName
private

author of the song

Definition at line 327 of file Song.h.

◆ m_sNotes

QString m_sNotes
private

Pattern list.

Definition at line 335 of file Song.h.

◆ m_sPlaybackTrackFilename

QString m_sPlaybackTrackFilename
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().

Definition at line 381 of file Song.h.

◆ nDefaultResolution

int nDefaultResolution = 48
staticconstexpr

Definition at line 135 of file Song.h.