hydrogen 1.1.1
LilyPond Class Reference

A class to convert a Hydrogen song to LilyPond format. More...

#include <Lilypond.h>

Public Member Functions

 LilyPond ()
 
void extractData (const Song &song)
 
void write (const QString &sFilename) const
 

Private Types

typedef std::vector< std::vector< std::pair< int, float > > > notes_t
 

Private Member Functions

void writeMeasures (std::ofstream &stream) const
 Write measures in LilyPond format to stream. More...
 
void writeUpper (std::ofstream &stream, unsigned nMeasure) const
 Write upper voice of given measure to stream. More...
 
void writeLower (std::ofstream &stream, unsigned nMeasure) const
 Write lower voice of given measure to stream. More...
 
void writeVoice (std::ofstream &stream, unsigned nMeasure, const std::vector< int > &whiteList) const
 

Static Private Member Functions

static void addPatternList (const PatternList &list, notes_t &notes)
 
static void addPattern (const Pattern &pattern, notes_t &notes)
 

Private Attributes

std::vector< notes_tm_Measures
 Representation of the song. More...
 
QString m_sName
 Name of the song. More...
 
QString m_sAuthor
 Author of the song. More...
 
float m_fBPM
 BPM of the song. More...
 

Detailed Description

A class to convert a Hydrogen song to LilyPond format.

Member Typedef Documentation

◆ notes_t

typedef std::vector<std::vector<std::pair<int, float> > > notes_t
private

Constructor & Destructor Documentation

◆ LilyPond()

LilyPond ( )

Member Function Documentation

◆ addPattern()

void addPattern ( const Pattern pattern,
notes_t notes 
)
staticprivate

◆ addPatternList()

void addPatternList ( const PatternList list,
notes_t notes 
)
staticprivate

◆ extractData()

void extractData ( const Song song)

◆ write()

void write ( const QString &  sFilename) const

◆ writeLower()

void writeLower ( std::ofstream &  stream,
unsigned  nMeasure 
) const
private

Write lower voice of given measure to stream.

Mapping of GM-kit instrument to LilyPond names.

◆ writeMeasures()

void writeMeasures ( std::ofstream &  stream) const
private

Write measures in LilyPond format to stream.

◆ writeUpper()

void writeUpper ( std::ofstream &  stream,
unsigned  nMeasure 
) const
private

Write upper voice of given measure to stream.

◆ writeVoice()

void writeVoice ( std::ofstream &  stream,
unsigned  nMeasure,
const std::vector< int > &  whiteList 
) const
private

Field Documentation

◆ m_fBPM

float m_fBPM
private

BPM of the song.

◆ m_Measures

std::vector<notes_t> m_Measures
private

Representation of the song.

◆ m_sAuthor

QString m_sAuthor
private

Author of the song.

◆ m_sName

QString m_sName
private

Name of the song.