127 Song(
const QString& sName,
const QString& sAuthor,
float fBpm,
float fVolume );
132 static std::shared_ptr<Song>
load(
const QString& sFilename,
bool bSilent =
false );
133 bool save(
const QString& sFilename,
bool bSilent =
false );
149 void setBpm(
float fBpm );
151 const QString&
getName()
const;
152 void setName(
const QString& sName );
184 void setNotes(
const QString& sNotes );
190 void setAuthor(
const QString& sAuthor );
218 std::shared_ptr<std::vector<std::shared_ptr<DrumkitComponent>>>
getComponents()
const;
222 std::shared_ptr<DrumkitComponent>
getComponent(
int nID )
const;
269 void setDrumkit( std::shared_ptr<Drumkit> pDrumkit,
bool bConditional );
272 std::vector<std::shared_ptr<Note>>
getAllNotes()
const;
299 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const override;
303 static std::shared_ptr<Song>
loadFrom(
XMLNode* pNode,
const QString& sFilename,
bool bSilent =
false );
343 std::shared_ptr<std::vector<std::shared_ptr<DrumkitComponent>>>
m_pComponents;
422 void setTimeline( std::shared_ptr<Timeline> pTimeline );
Attack Decay Sustain Release envelope.
InstrumentList is a collection of instruments used within a song, a drumkit, ...
Wrapper class to help Hydrogen deal with the license information specified in a drumkit.
A note plays an associated instrument with a velocity left and right pan.
PatternList is a collection of patterns.
Pattern class is a Note container.
void setPatternMode(PatternMode patternMode)
std::vector< PatternList * > * getPatternGroupVector()
Return a pointer to a vector storing all Pattern present in the Song.
bool m_bIsTimelineActivated
Whether the Timeline button was pressed in the GUI or it was activated via an OSC command.
void setPanLawKNorm(float fKNorm)
bool getIsTimelineActivated() const
std::shared_ptr< Timeline > m_pTimeline
void loadVirtualPatternsFrom(XMLNode *pNode, bool bSilent=false)
std::shared_ptr< InstrumentList > getInstrumentList() const
PatternList * getPatternList() const
const QString & getNotes() const
void setPlaybackTrackVolume(const float fVolume)
QString m_sName
author of the song
bool getIsPatternEditorLocked() const
float getPlaybackTrackVolume() const
bool save(const QString &sFilename, bool bSilent=false)
Save a song to file.
Song(const QString &sName, const QString &sAuthor, float fBpm, float fVolume)
bool isLoopEnabled() const
void setPatternList(PatternList *pList)
const QString & getLastLoadedDrumkitName() const
void setDrumkit(std::shared_ptr< Drumkit > pDrumkit, bool bConditional)
ActionMode m_actionMode
Stores the type of interaction with the SongEditor.
PatternList * m_pPatternList
Sequence of pattern groups.
const QString & getName() const
static constexpr int nDefaultResolution
std::map< float, int > m_latestRoundRobins
void setIsTimelineActivated(bool bIsTimelineActivated)
float m_fVolume
Metronome volume.
@ None
Used in case no song is set and both pattern and song editor are not ready to operate yet.
QString getLastLoadedDrumkitPath() const
void setPlaybackTrackFilename(const QString sFilename)
bool writeTempPatternList(const QString &sFilename)
QString m_sAuthor
volume of the song (0.0..1.0)
void setMetronomeVolume(float fVolume)
float getHumanizeVelocityValue() const
unsigned getResolution() const
ActionMode getActionMode() const
void readTempPatternList(const QString &sFilename)
static std::shared_ptr< Song > load(const QString &sFilename, bool bSilent=false)
Load a song from file.
PlaybackTrack getPlaybackTrackState() const
void setIsPatternEditorLocked(bool bIsPatternEditorLocked)
bool hasMissingSamples() const
Song was incompletely loaded from file (missing samples)
void setResolution(unsigned resolution)
std::shared_ptr< std::vector< std::shared_ptr< DrumkitComponent > > > getComponents() const
long lengthInTicks() const
get the length of the song, in tick units
LoopMode m_loopMode
The three states of this enum is just a way to handle the playback within Hydrogen.
ActionMode
Defines the type of user interaction experienced in the SongEditor.
@ 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.
@ Finishing
Transport is still in loop mode (frames and ticks larger than song size are allowed) but playback end...
float m_fBpm
Current speed in beats per minutes.
bool pasteInstrumentLineFromString(const QString &sSerialized, int nSelectedInstrument, std::list< Pattern * > &patterns)
void setHumanizeTimeValue(float fValue)
void setLoopMode(LoopMode loopMode)
const QString & getFilename() const
PlaybackTrack
Determines the state of the Playback track with respect to audio processing.
@ Enabled
Valid file set and ready for playback.
@ Unavailable
No proper playback track file set yet.
@ Muted
Valid file set but the playback track is muted via the GUI.
bool isPatternActive(int nColumn, int nRow) const
std::shared_ptr< Timeline > getTimeline() const
std::shared_ptr< DrumkitComponent > getComponent(int nID) const
void clearMissingSamples()
void setVolume(float fVolume)
QString makeComponentNameUnique(const QString &sComponentName) const
Ensures sComponentName is not used by any other component loaded into the song yet.
const QString & getAuthor() const
std::shared_ptr< InstrumentList > m_pInstrumentList
list of drumkit component
void writeTo(XMLNode *pNode, bool bSilent=false)
void writePatternGroupVectorTo(XMLNode *pNode, bool bSilent=false)
void removeInstrument(int nInstrumentNumber, bool bConditional)
PatternMode getPatternMode() const
void setActionMode(const ActionMode actionMode)
AutomationPath * m_pVelocityAutomationPath
license of the song
float getPanLawKNorm() const
void loadPatternGroupVectorFrom(XMLNode *pNode, bool bSilent=false)
QString m_sNotes
Pattern list.
float getHumanizeTimeValue() const
int findFreeComponentID(int nStartingID=0) const
float getMetronomeVolume() const
void setFilename(const QString &sFilename)
void setLastLoadedDrumkitPath(const QString &sPath)
void setSwingFactor(float fFactor)
LoopMode getLoopMode() const
float m_fPlaybackTrackVolume
Volume of the playback track.
std::shared_ptr< std::vector< std::shared_ptr< DrumkitComponent > > > m_pComponents
void setPanLawType(int nPanLawType)
std::vector< PatternList * > * m_pPatternGroupSequence
Instrument list.
static std::shared_ptr< Song > getEmptySong()
void setLicense(const License &license)
void setNotes(const QString &sNotes)
void setLastLoadedDrumkitName(const QString &sName)
PatternMode m_patternMode
void setIsModified(bool bIsModified)
bool m_bIsMuted
Resolution of the song (number of ticks per quarter)
bool getPlaybackTrackEnabled() const
int getLatestRoundRobin(float fStartVelocity)
void setTimeline(std::shared_ptr< Timeline > pTimeline)
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
void setInstrumentList(std::shared_ptr< InstrumentList > pList)
bool m_bIsPatternEditorLocked
If set to true, the user won't be able to select a pattern via the SongEditor.
void setName(const QString &sName)
PatternMode
Determines how patterns will be added to AudioEngine::m_pPlayingPatterns if transport is in Song::Mod...
@ Stacked
An arbitrary number of pattern can be played.
@ Selected
Only one pattern - the one currently selected in the GUI - will be played back.
const License & getLicense() const
float m_fHumanizeVelocityValue
Factor to scale the random contribution when humanizing velocity between 0 and AudioEngine::fHumanize...
void setAuthor(const QString &sAuthor)
AutomationPath * getVelocityAutomationPath() const
float m_fHumanizeTimeValue
Factor to scale the random contribution when humanizing timing between 0 and AudioEngine::fHumanizeTi...
void setPlaybackTrackEnabled(const bool bEnabled)
Specifies whether a playback track should be used.
QString copyInstrumentLineToString(int selectedInstrument)
QString m_sLastLoadedDrumkitName
Convenience variable holding the name of the drumkit last loaded.
void setLatestRoundRobin(float fStartVelocity, int nLatestRoundRobin)
bool getIsModified() const
std::vector< std::shared_ptr< Note > > getAllNotes() const
void writeVirtualPatternsTo(XMLNode *pNode, bool bSilent=false)
int getPanLawType() const
int findExistingComponent(const QString &sComponentName) const
Checks whether a component of name sComponentName exists in m_pComponents.
static std::shared_ptr< Song > loadFrom(XMLNode *pNode, const QString &sFilename, bool bSilent=false)
QString m_sPlaybackTrackFilename
Name of the file to be loaded as playback track.
bool m_bPlaybackTrackEnabled
Whether the playback track should be used at all.
void setIsMuted(bool bIsMuted)
float getSwingFactor() const
void setHumanizeVelocityValue(float fValue)
void setPatternGroupVector(std::vector< PatternList * > *pGroupVect)
Sets the vector storing all Pattern present in the Song m_pPatternGroupSequence.
QString m_sLastLoadedDrumkitPath
Unique identifier of the drumkit last loaded.
const QString & getPlaybackTrackFilename() const
Timeline class storing and handling all TempoMarkers and Tags.
XMLNode is a subclass of QDomNode with read and write values methods.